Your risk management organization requires that new AWS S3 buckets must be private and encrypted at rest. How can Terraform Enterprise automatically and proactively enforce this security control?
A.
With a Sentinel policy, which runs before every apply
B.
By adding variables to each TFE workspace to ensure these settings are always enabled
C.
With an S3 module with proper settings for buckets
D.
Auditing cloud storage buckets with a vulnerability scanning tool
A. With a Sentinel policy, which runs before every apply.
Terraform Enterprise can enforce security controls through the use of Sentinel policies. Sentinel is a policy as code framework that integrates with Terraform Enterprise and can be used to enforce specific security controls. In this case, the Sentinel policy could check that all new S3 buckets are set to be private and encrypted at rest and prevent the Terraform apply from proceeding if the buckets do not meet this requirement. This ensures that the security control is automatically and proactively enforced every time Terraform makes changes to the infrastructure.
import "tfplan"
# Ensure all new S3 buckets are private and encrypted at rest
deny[msg] {
resources := tfplan.module_paths["aws_s3_bucket"]
not all_true([
for r in resources:
r.attributes.acl == "private" and
r.attributes.server_side_encryption_configuration.0.rule.0.apply_server_side_encryption_by_default.0.sse_algorithm == "AES256"
])
msg := "All new S3 buckets must be private and encrypted at rest"
}
Terraform Enterprise provides the ability to enforce security controls through Sentinel policies, which are a form of policy as code. Sentinel policies allow you to define and enforce organizational or regulatory policies by creating a set of rules that run before each Terraform operation.
A.
Reference:
https://docs.hashicorp.com/sentinel/intro/what
https://medium.com/hashicorp-engineering/enforcing-aws-s3-security-best-practice-using-terraform-sentinel-ddcd181ff4b7
upvoted 4 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
camps
Highly Voted 1 year, 7 months agoselvaraj133ece
Most Recent 1 year, 3 months agoRohit000003
1 year, 4 months agoNi33
1 year, 6 months agoPower123
1 year, 7 months agoNunyabiznes
1 year, 8 months agoSilentMilli
1 year, 8 months agoAme2222
1 year, 9 months agoDaro_
1 year, 9 months agoseif1993
1 year, 11 months agoRVivek
2 years, 2 months agobora4motion
2 years, 2 months agoBurakko
2 years, 2 months agomav3r1ck
2 years, 2 months ago