Skip to content

Commit 0e66d42

Browse files
authored
Merge pull request #18 from aws-samples/checkov
- fixed checkov to 3.2.0 - added guidance for reports
2 parents 40f3bc7 + 2f45f18 commit 0e66d42

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ module "pipeline" {
6363
...
6464
branch = "main"
6565
mode = "SUPERSEDED"
66-
detect_changes = true
66+
detect_changes = false
6767
kms_key = aws_kms_key.this.arn
6868
access_logging_bucket = aws_s3_bucket.this.id
6969
artifact_retention = 90
@@ -90,7 +90,7 @@ module "pipeline" {
9090

9191
`mode` is [pipeline execution mode](https://docs.aws.amazon.com/codepipeline/latest/userguide/concepts-how-it-works.html#concepts-how-it-works-executions). It defaults to `SUPERSEDED`.
9292

93-
`detect_changes` is used with third-party services, like GitHub. It enables AWS CodeConnections to invoke the pipeline when there is a commit to the repo.
93+
`detect_changes` is used with third-party services, like GitHub. It enables AWS CodeConnections to invoke the pipeline when there is a commit to the repo. It defaults to `false`.
9494

9595
`kms_key` is the arn of an *existing* AWS KMS key. This input will encrypt the Amazon S3 bucket with a AWS KMS key of your choice. Otherwise the bucket will be encrypted using SSE-S3. Your AWS KMS key policy will need to allow codebuild and codepipeline to `kms:GenerateDataKey*` and `kms:Decrypt`.
9696

locals.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ locals {
1313
})
1414

1515
env_var = {
16-
TFLINT_VERSION = var.tflint_version
17-
SAST_REPORT_ARN = aws_codebuild_report_group.sast.arn
1816
CHECKOV_SKIPS = join(",", "${var.checkov_skip}")
17+
CHECKOV_VERSION = var.checkov_version
18+
SAST_REPORT_ARN = aws_codebuild_report_group.sast.arn
1919
TF_VERSION = var.terraform_version
20+
TFLINT_VERSION = var.tflint_version
2021
}
2122
conditional_env_var = merge(local.env_var, {
2223
TAGS = var.tags

modules/codebuild/buildspecs/sast.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ phases:
1010
- yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
1111
- yum install -y terraform-${TF_VERSION}
1212
- python -V
13-
- pip3 install checkov
13+
- pip3 install checkov==${CHECKOV_VERSION}
1414

1515
build:
1616
commands:
@@ -21,6 +21,7 @@ phases:
2121
else
2222
checkov --directory ./ --skip-path ./deploy --skip-check ${CHECKOV_SKIPS} -o junitxml > checkov.xml
2323
fi
24+
- echo "Checkov complete. Report available in CodeBuild project > Reports"
2425
reports:
2526
${SAST_REPORT_ARN}:
2627
files:

variables.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ variable "checkov_skip" {
4444

4545
variable "checkov_version" {
4646
type = string
47-
default = "latest"
47+
default = "3.2.0"
4848
}
4949

5050
variable "codebuild_policy" {
@@ -61,7 +61,7 @@ variable "connection" {
6161

6262
variable "detect_changes" {
6363
description = "allows third-party servicesm like GitHub to invoke the pipeline"
64-
type = string
64+
type = bool
6565
default = false
6666
}
6767

@@ -83,7 +83,6 @@ variable "mode" {
8383
], var.mode)
8484
error_message = "unsupported pipeline mode"
8585
}
86-
8786
}
8887

8988
variable "kms_key" {

0 commit comments

Comments
 (0)