Skip to content

Commit

Permalink
Merge pull request #303 from ministryofjustice/fix/secure-code-analysis
Browse files Browse the repository at this point in the history
Address secure code analysis alerts
  • Loading branch information
dms1981 authored Nov 1, 2023
2 parents 38ee7ff + a3df201 commit ffe6c2d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ on:
branches:
- main

permissions: {}

jobs:
docs:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/terraform-static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
scan_type: single
tfsec_exclude: AWS089, AWS099, AWS009, AWS097, AWS018
checkov_exclude: CKV_GIT_1
tflint_exclude: terraform_unused_declarations

terraform-static-analysis-full-scan:
permissions:
Expand All @@ -52,3 +53,4 @@ jobs:
scan_type: full
tfsec_exclude: AWS089, AWS099, AWS009, AWS097, AWS018
checkov_exclude: CKV_GIT_1
tflint_exclude: terraform_unused_declarations
9 changes: 6 additions & 3 deletions test/unit-test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ data "aws_iam_policy_document" "topic" {

}
}

#AWS managed KMS key is fine for unit tests
#tfsec:ignore:aws-sns-topic-encryption-use-cmk
resource "aws_sns_topic" "topic" {
#checkov:skip=CKV_AWS_26: "Encryption not required as topic only available during test run"
name = "s3-event-notification-topic"
policy = data.aws_iam_policy_document.topic.json
name = "s3-event-notification-topic"
kms_master_key_id = "alias/aws/sns"
policy = data.aws_iam_policy_document.topic.json
}

module "s3_with_notification" {
Expand Down
4 changes: 4 additions & 0 deletions test/unit-test/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ terraform {
version = "~> 5.0"
source = "hashicorp/aws"
}
http = {
source = "hashicorp/http"
version = "~> 3.4"
}
}
required_version = ">= 1.0.1"
}

0 comments on commit ffe6c2d

Please sign in to comment.