如何从fluentd配置文件中隐藏S3存储桶和访问密钥凭据

huangapple go评论100阅读模式
英文:

How to hide s3 bucket and access key credentials from fluentd config file

问题

我们正在使用Fluentd将来自本地服务器的日志发送到S3存储桶。以下是我的Fluentd配置文件中的代码配置部分。

所以想知道是否有办法在Fluentd配置文件中隐藏/保护我们的敏感信息,比如aws_key_id、aws_sec_key和s3_bucket?请建议。谢谢!

  1. @type s3
  2. aws_key_id YOUR_AWS_KEY_ID
  3. aws_sec_key YOUR_AWS_SECRET/KEY
  4. s3_bucket YOUR_S3_BUCKET_NAME
  5. path logs/
  6. <buffer>
  7. @type file
  8. path /var/log/td-agent/s3
  9. timekey 3600 # 1 hour
  10. timekey_wait 10m
  11. chunk_limit_size 256m
  12. </buffer>
  13. time_slice_format %Y%m%d%H
  14. </match>```
  15. <details>
  16. <summary>英文:</summary>
  17. We are sending the logs from on-prem servers to the S3 bucket by using Fluentd. The below code configuration is from my Fluentd config file.
  18. So wondering is there a way to mask/hide/secure our sensitive information like aws_key_id, aws_sec_key, and s3_bucket from the Fluentd config file? Please advise. Thanks!
  19. ```&lt;match s3.*.*&gt;
  20. @type s3
  21. aws_key_id YOUR_AWS_KEY_ID
  22. aws_sec_key YOUR_AWS_SECRET/KEY
  23. s3_bucket YOUR_S3_BUCKET_NAME
  24. path logs/
  25. &lt;buffer&gt;
  26. @type file
  27. path /var/log/td-agent/s3
  28. timekey 3600 # 1 hour
  29. timekey_wait 10m
  30. chunk_limit_size 256m
  31. &lt;/buffer&gt;
  32. time_slice_format %Y%m%d%H
  33. &lt;/match&gt;```
  34. </details>
  35. # 答案1
  36. **得分**: 1
  37. 使用共享凭证部分来指定配置文件名称或凭证文件的路径。默认情况下,“default”是配置文件名称,路径指向“#{user.home}/.aws/credentials”。
  38. https://github.com/fluent/fluent-plugin-s3/blob/master/docs/credentials.md
  39. 存储桶名称似乎是必需的
  40. <match *>
  41. @type s3
  42. <shared_credentials>
  43. path 路径
  44. profile_name 配置文件名称
  45. </shared_credentials>
  46. </match>
  47. <details>
  48. <summary>英文:</summary>
  49. Use the shared credentials section to specify the profile name or path to the credentials file. By default &quot;default&quot; is the profile name and the path points to &quot;#{user.home}/.aws/credentials&quot;.
  50. https://github.com/fluent/fluent-plugin-s3/blob/master/docs/credentials.md
  51. The bucket name looks to be mandatory
  52. &lt;match *&gt;
  53. @type s3
  54. &lt;shared_credentials&gt;
  55. path PATH
  56. profile_name PROFILE_NAME
  57. &lt;/shared_credentials&gt;
  58. &lt;/match&gt;
  59. </details>

huangapple
  • 本文由 发表于 2023年6月19日 20:12:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/76506505.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定