fluent-plugin-anonymizer icon indicating copy to clipboard operation
fluent-plugin-anonymizer copied to clipboard

Add hash_salt_path parameter

Open kou opened this issue 11 years ago • 2 comments

hash_salt_path parameter is for security.

Here is a use cases.

Use case: Don't version control hash salt.

If we version control fluentd.conf, hash salt is also version controlled because we need to write hash salt by hash_salt parameter in fluentd.conf.

We can use random hash salt for each host by hash_salt_path parameter without version controlling hash salt. Because hash_salt_path generates random hash salt key and saves it when the path doesn't exist.

kou avatar Dec 29 '14 05:12 kou

Hi @kou

Thank you very much for contribution this fluentd plugin project! It is very good for splitting configuration to store secret data.

How do you think store hash_salt_key into environment data? On td-agent2, you can use environment values in configuration file. The example implement design is below.

$ less /etc/sysconfig/td-agent
export ANONYMIZE_HASH_SALT='MyHashSaltString'

$ less /etc/td-agent/td-agent.conf
<match hoge.**>
  type anonymizer
  # ...snip...
  hash_salt  #{ENV['ANONYMIZE_HASH_SALT']}
</match>

Storing hash_salt_key in environment vs. in file comparison.

Pros

  • keep a single file as /etc/sysconfig/td-agent (on storing in environment.)
  • controllable file permission (on storing in file)

Cons

  • According to some opinions, It is not safe for storing secret data into environment.

How do you think?

y-ken avatar Jan 02 '15 05:01 y-ken

英語で説明できる気がしないので日本語ですみません。。。

ユーザーとしての意見だと、提案してもらった方法は自分で各ホスト毎のsaltを生成する必要があって面倒だなぁと感じます。

(環境変数を使うと他のプラグインがspawnしたりしたときに別プロセスにも情報が渡ってしまいやすくなるので、この方向で実現(設定ファイルの中にRubyのコードを書いて実現)するときは、私はFile.read("/path/to/salt-file")みたいにすると思います。)

1開発者の意見だと、多少ユーザーが不便になったとしても使用や実装をシンプルに保ちたいというのは理解できるので、このプロジェクトがそういう方針であれば、このpull requestは取り下げます。

という感じです!

kou avatar Jan 03 '15 04:01 kou