tfsec: bug: unable to ignore aws-rds-enable-deletion-protection
Describe the bug
I am unable to locally ignore aws-rds-enable-deletion-protection
in my modules. None of these work
# tfsec:ignore:aws-rds-enable-deletion-protection
module "rds" {
source = "../../modules/rds"
deletion_protection = false
module "rds" {
source = "../../modules/rds"
deletion_protection = false # tfsec:ignore:aws-rds-enable-deletion-protection
module "rds" {
source = "../../modules/rds"
# tfsec:ignore:aws-rds-enable-deletion-protection
deletion_protection = false
The rule is ignored if I exclude it from the global config.yml file
exclude:
- aws-rds-enable-deletion-protection
Output of your tfsec command with --debug flag
Result #1 MEDIUM Instance does not have Deletion Protection enabled
────────────────────────────────────────────────────────────────────────────────
modules/rds/rds.tf:46
────────────────────────────────────────────────────────────────────────────────
46 deletion_protection = var.deletion_protection
────────────────────────────────────────────────────────────────────────────────
Rego Package builtin.aws.rds.aws0177
Rego Rule deny
────────────────────────────────────────────────────────────────────────────────
It also does not report the rule name, so perhaps aws-rds-enable-deletion-protection
is not correct. Do Rego packages need a different ignore syntax?
System Info
- tfsec version:
v1.28.1
- terraform version:
v1.3.1
- OS:
Linux
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 27
- Comments: 22 (3 by maintainers)
same with
Result #1 MEDIUM Instance does not have IAM Authentication enabled
does not give an ignorable ID, but
We’ve improved the trivyignore capabilities in the latest release of trivy, you can find more details here https://aquasecurity.github.io/trivy/v0.45/docs/configuration/filtering/#trivyignoreyaml
No they don’t. For example, to ignore the RDS deletion protection check, you can refer to it by any of the following IDs:
Same issue here.
This somehow seems to be related to #1936. Whenever I try to test my terraform code that uses the
terraform-aws-modules/rds/aws
module, it fails with the error:If I try to disable the rule, none of the following works:
When I change line
93
in the corresponding file in the.terraform/modules
folder manually to the following, I don’t get the error anymore:Same here! Honestly I was coming to github to make an issue about how there’s only the id
aws0176
instead of the rule name so that I can dotfsec:ignore:iam-auth-blahblah
After struggeling for a couple of hours with this issue, i turned out the simple fix would be to downgrade the
tfsec
version from1.28.1
to1.28.0
. But why tho? thetfsec
version1.28.0
was using the versionv0.76.0
of[defsec](https://github.com/aquasecurity/defsec)
whiletfsec
version1.28.1
is using versionv0.82.2
ofdefsec
. It’s worth mentioning that AWS rego scanning support was addeddefsec
in version[v0.77.0](https://github.com/aquasecurity/defsec/releases/tag/v0.77.0)
. since this change happened,tfsec
version1.28.1
was by default evaluating rego rules includingaws.0177
andaws.0176
Even though i tried ignoring these two rules with what has been mentioned above
It didn’t work. ALSO there is no
tfsec
rule forenable-deletion-protection
sooooo there’s that !@whyman10x tfsec merged into Trivy and it has been being maintained and evolved there https://github.com/aquasecurity/trivy
did you try to downgrade the tfsec version from 1.28.1 to 1.28.0