File tree Expand file tree Collapse file tree 18 files changed +40
-11
lines changed Expand file tree Collapse file tree 18 files changed +40
-11
lines changed Original file line number Diff line number Diff line change 72
72
run : |
73
73
pip install pre-commit
74
74
go install github.com/hashicorp/terraform-config-inspect@latest
75
+ make deps
75
76
76
77
- name : Execute generate-terraform-providers for organizational
77
78
if : ${{ matrix.directory != '.' }}
@@ -128,9 +129,7 @@ jobs:
128
129
- name : Install pre-commit dependencies
129
130
run : |
130
131
pip install pre-commit
131
- go install github.com/terraform-docs/terraform-docs@v0.16.0
132
- go install github.com/hashicorp/terraform-config-inspect@latest
133
- curl -L "$(curl -s https://api.github.com/repos/terraform-linters/tflint/releases/latest | grep -o -E "https://.+?_linux_amd64.zip")" > tflint.zip && unzip tflint.zip && rm tflint.zip && sudo mv tflint /usr/bin/
132
+ make deps
134
133
- name : Clean pre-commit cache
135
134
run : pre-commit clean
136
135
- name : Execute pre-commit max_version
Original file line number Diff line number Diff line change @@ -70,6 +70,10 @@ repos:
70
70
# https://github.com/antonbabenko/pre-commit-terraform#terraform_validate
71
71
- id : terraform_validate
72
72
exclude : (test)|(examples-internal)\/.*$
73
+ - id : terrascan
74
+ exclude : (test)
75
+ args :
76
+ - ' --args=--skip-rules AC_AWS_0369'
73
77
- repo : https://github.com/pre-commit/pre-commit-hooks
74
78
rev : v4.1.0
75
79
hooks :
Original file line number Diff line number Diff line change 5
5
unzip tflint.zip && \
6
6
rm tflint.zip && \
7
7
mv tflint " ` go env GOPATH` /bin"
8
+ curl -L https://github.com/tenable/terrascan/releases/download/v1.9.0/terrascan_1.9.0_Linux_x86_64.tar.gz -o terrascan.tar.gz && \
9
+ tar -xf terrascan.tar.gz terrascan && \
10
+ rm terrascan.tar.gz && \
11
+ install terrascan "`go env GOPATH`/bin" && \
12
+ rm terrascan
8
13
9
14
clean :
10
15
find -name " .terraform" -type d | xargs rm -rf
Original file line number Diff line number Diff line change 1
1
resource "aws_s3_bucket" "cloudtrail" {
2
+ # AC_AWS_0214
3
+ # Why: S3 bucket versioning is disabled
4
+ # ts:skip=AC_AWS_0214 S3 is for testing purpose by the customer. In production S3 it's pretended to be provided by the customer with the logging related decisions taken by them as it has costs.
5
+ # AC_AWS_0497
6
+ # Why: S3 access logging is disabled
7
+ # ts:skip=AC_AWS_0497 S3 is for testing purpose by the customer. In production S3 it's pretended to be provided by the customer with the logging related decisions taken by them as it has costs.
2
8
bucket = " ${ var . name } -${ data . aws_caller_identity . me . account_id } "
3
9
force_destroy = true
4
10
tags = var. tags
Original file line number Diff line number Diff line change 1
1
resource "aws_sns_topic" "cloudtrail" {
2
+ # AC_AWS_0502
3
+ # Why: Encrypt SNS with KMS
4
+ # ts:skip=AC_AWS_0502 Don't encrypt as far as SNS can be provided by customer
2
5
name = var. name
3
6
tags = var. tags
4
7
}
Original file line number Diff line number Diff line change @@ -13,8 +13,10 @@ locals {
13
13
14
14
15
15
resource "aws_sns_topic" "s3_sns" {
16
- name = local. s3_sns_name
17
-
16
+ # AC_AWS_0502
17
+ # Why: Encrypt SNS with KMS
18
+ # ts:skip=AC_AWS_0502 Don't encrypt as far as SNS can be provided by customer
19
+ name = local. s3_sns_name
18
20
policy = << POLICY
19
21
{
20
22
"Version":"2012-10-17",
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ data "aws_availability_zones" "zones" {
3
3
4
4
# https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws/latest
5
5
module "vpc" {
6
+ # AC_AWS_0369
7
+ # ts:skip=AC_AWS_0369 Cannot be ignored on external module
6
8
source = " terraform-aws-modules/vpc/aws"
7
9
version = " >=3.14.0"
8
10
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ resource "aws_iam_user" "this" {
5
5
}
6
6
7
7
resource "aws_iam_access_key" "this" {
8
+ # AC_AWS_0133
9
+ # ts:skip=AC_AWS_0133 Doesn't apply
8
10
user = aws_iam_user. this . name
9
11
lifecycle {
10
12
create_before_destroy = true
Original file line number Diff line number Diff line change 1
1
resource "aws_sqs_queue" "this" {
2
+ # AC_AWS_0366
3
+ # Why: Ensure that your Amazon Simple Queue Service (SQS) queues are protecting the contents of their messages using Server-Side Encryption (SSE).
4
+ # ts:skip=AC_AWS_0366 Doesn't apply as the content of the event is stored on S3 not on the log
2
5
name = var. name
3
6
tags = var. tags
4
7
}
@@ -8,6 +11,7 @@ resource "aws_sns_topic_subscription" "this" {
8
11
protocol = " sqs"
9
12
endpoint = aws_sqs_queue. this . arn
10
13
topic_arn = var. cloudtrail_sns_arn
14
+
11
15
}
12
16
13
17
resource "aws_sqs_queue_policy" "this" {
Original file line number Diff line number Diff line change 2
2
3
3
``` terraform
4
4
module "eks"{
5
- source = "sysdiglabs/secure-for-cloud/aws//modules/infrastructure /eks"
5
+ source = "sysdiglabs/secure-for-cloud/aws//test /eks"
6
6
default_vpc_subnets = ["<SUBNET_1>", "<SUBNET_2>"]
7
7
name = "<IDENTIFYING_NAME>"
8
8
}
You can’t perform that action at this time.
0 commit comments