tfsec
IAC scanning tool
What is TFSec?
Installation
Scanning
Local Scanning
# Partial output of results
Result #1 HIGH Bucket does not encrypt data with a customer managed key.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
s3-cis-req.tf:3-15
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3 β resource "aws_s3_bucket_server_side_encryption_configuration" "s3-encryption-config" {
4 β bucket = aws_s3_bucket.s3-bucket-1.bucket # defines bucket name
5 β
6 β rule {
7 β apply_server_side_encryption_by_default {
8 β sse_algorithm = var.sse-algorithm # defines encryption type
9 β }
10 β }
11 β
..
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ID aws-s3-encryption-customer-key
Impact Using AWS managed keys does not allow for fine grained control
Resolution Enable encryption using customer managed keys
More Information
- https://aquasecurity.github.io/tfsec/v1.28.4/checks/aws/s3/encryption-customer-key/
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket#enable-default-server-side-encryption
[SNIP]
results
ββββββββββββββββββββββββββββββββββββββββββ
passed 9
ignored 0
critical 0
high 7
medium 3
low 1
9 passed, 11 potential problem(s) detected.CI Job
Creating Exceptions
Config File
Overriding the Severity
Excluding a Rule from a Scan
Custom tfsec Rules
JSON Format
YAML Format
Rego Format

Useful Resources
Last updated