-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
CKV_GIT_4 GitHub "Ensure Secrets are encrypted" is based on a misinterpretation #2374
Comments
@shrink thanks for the detailed explanation. I like both of your suggestions, either to remove the check or limit it to hardcoded values. @schosterbarak any thoughts? |
@gruebel let's limit to hard coded values |
3 tasks
Hi, it seems this false positive hasn't been fixed as it still triggers when using a
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
note: I am not a user of Checkov but I contributed to the GitHub terraform provider so this comment by @ned1313 made me aware or Checkov behaviour which I believe to be incorrect.
Describe the issue
The GitHub Ensure Secrets are encrypted check appears to be based on a misinterpretation of the GitHub functionality and the GitHub terraform provider documentation, because of ambiguity in the argument's naming scheme and the documentation.
Secrets can be provided to GitHub in either a plain text form or an encrypted form. GitHub will encrypt any plain text secrets that arrive, and leave encrypted secrets as is. Regardless of the choice of how to provide the input (plain text or encrypted) it will be stored encrypted by GitHub, then decrypted by GitHub Actions at runtime using the private key.
The choice to use
encrypted_value
overplaintext_value
is made when you have a secret that you are providing as an input to terraform that you do not want to end up in your terraform state in plain text. If a secret has been generated by a different terraform provider (e.g: a cloud provider access token) then it will already exist in the terraform state, so passing it as aplaintext_value
to GitHub doesn't introduce any additional exposure.The full quote here the GitHub documentation is...
Rather than serve to describe the behaviour of
encrypted_value
andplaintext_value
the statement is actually just a generic warning about terraform best practices.Here's an example of what would Checkov currently produces a warning for, despite it being a valid and secure use:
The check could either be removed completely (because
plaintext_value
is appropriate to use in most situations) or, if possible, modified to only warn when the value for theplaintext_value
argument is a string value directly written into the terraform configuration.I hope that's clear, please let me know if I can clarify anything.
The text was updated successfully, but these errors were encountered: