Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address secure code analysis alerts #303

Merged
merged 3 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}