Terraform AWS Provider support
Support and limitations for the Terraform AWS provider.
Version 4.0.0 of the AWS Terraform Provider introduced changes in how S3 services are defined. With v4.0, the definition of S3 services is now spread across several resource blocks within Terraform. If you defined an instance of an S3 bucket across multiple files, this update is a breaking change and may have negatively impacted your security results from Snyk IaC.
From the Terraform documentation: To help distribute the management of S3 bucket settings via independent resources, various arguments and attributes in the aws_s3_bucket
resource have become read-only. Configurations dependent on these arguments should be updated to use the corresponding aws_s3_bucket_*
resource.
To migrate to Terraform v4.0.0, you must refactor and re-import your S3 service definitions. Depending on how you choose to do this, it may limit your coverage of security findings.
See the Terraform V4 upgrade guide from Hashicorp for more details
Example of Terraform AWS Provider support
Consider the following example of defining an S3 bucket with an ACL using Terraform v3.x.x in a file named s3.tf
The definition of the S3 bucket is in one resource block. If you scanned this file using snyk iac test s3.tf
you would get a security finding for the permissive ACL settings.
With v4.0.0 of the Provider, certain S3 bucket properties are now defined in their own resources. Continuing the previous example, the ACL property has moved to its own resource, so the refactored Terraform looks like this.
If you scan this file using snyk iac test s3.tf
you will get the same results as before for the permissive ACL settings.
Limitations of support for Terraform AWS Provider
You may choose to structure your code differently, for example, by having the S3 bucket definition and its associated properties in separate Terraform files:
If you scan these files, you will either not receive a security issue or receive a false positive for the permissive ACL. This is because Snyk cannot currently link the two resources together.
Snyk is working on adding support for this additional use case to the product.
An interim workaround is to define the resources in a single Terraform file.
Last updated