Skip to content

Warn against secrets in state and promote ephemeral resources and write-only arguments #859

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
aristosvo opened this issue Apr 9, 2025 · 1 comment · May be fixed by #860
Open
2 tasks done

Warn against secrets in state and promote ephemeral resources and write-only arguments #859

aristosvo opened this issue Apr 9, 2025 · 1 comment · May be fixed by #860

Comments

@aristosvo
Copy link

aristosvo commented Apr 9, 2025

It would be nice to have linting rules against secrets in state and promote the usage of ephemeral resources and write only arguments: https://developer.hashicorp.com/terraform/language/resources/ephemeral.

Resources with write-only arguments:

Data sources that have ephemeral equivalents:

Questions to be answered:

  • This is a TF 1.11+ feature, how to document that?
  • This is a security recommendation, should that reside in tflint-ruleset-aws or is trivy a better tool to integrate this in?
@aristosvo aristosvo changed the title Warn against secrets in state and promote ephemeral resources and values Warn against secrets in state and promote ephemeral resources and write-only values Apr 9, 2025
@bendrucker
Copy link
Member

bendrucker commented Apr 9, 2025

This is a TF 1.10+ feature, how to document that?

You can read terraform.version from the module if set, and skip the rule's logic if the allowed versions are <1.10. This involves some semver parsing though.

Otherwise, I'd just mention it in the rule's docs:

https://github.com/terraform-linters/tflint-ruleset-aws/tree/master/docs/rules

This is a security recommendation, should that reside in tflint-ruleset-aws or is aquasecurity/trivy#8713 a better tool to integrate this in?

Security recommendations are fine here! Could make sense in both tools but if you want to add a rule here we'd maintain it.

@aristosvo aristosvo changed the title Warn against secrets in state and promote ephemeral resources and write-only values Warn against secrets in state and promote ephemeral resources and write-only arguments Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants