Skip to content
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
15 changes: 0 additions & 15 deletions .github/workflows/stage-1-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,21 +135,6 @@ jobs:
uses: actions/checkout@v4
- name: "Lint Terraform"
uses: ./.github/actions/lint-terraform
trivy:
name: "Trivy Scan"
runs-on: ubuntu-latest
timeout-minutes: 5
needs: detect-terraform-changes
if: needs.detect-terraform-changes.outputs.terraform_changed == 'true'
steps:
- name: "Checkout code"
uses: actions/checkout@v4
- name: "Setup ASDF"
uses: asdf-vm/actions/setup@v4
- name: "Perform Setup"
uses: ./.github/actions/setup
- name: "Trivy Scan"
uses: ./.github/actions/trivy
count-lines-of-code:
name: "Count lines of code"
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ nodejs 22.11.0
pre-commit 3.6.0
terraform 1.9.2
terraform-docs 0.19.0
trivy 0.61.0
# TODO - Re-visit Trivy usage https://nhsd-jira.digital.nhs.uk/browse/CCM-15549
# trivy 0.61.0
vale 3.6.0
python 3.13.2

Expand Down
11 changes: 4 additions & 7 deletions scripts/terraform/terraform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,10 @@ terraform-shellscript-lint: # Lint all Terraform module shell scripts @Quality
file=$${file} scripts/shellscript-linter.sh
done

terraform-sec: # TFSEC check against Terraform files - optional: terraform_dir|dir=[path to a directory where the command will be executed, relative to the project's top-level directory, default is one of the module variables or the example directory, if not set], terraform_opts|opts=[options to pass to the Terraform fmt command, default is '-recursive'] @Quality
tfsec infrastructure/terraform \
--force-all-dirs \
--exclude-downloaded-modules \
--tfvars-file infrastructure/terraform/etc/global.tfvars \
--tfvars-file infrastructure/terraform/etc/env_eu-west-2_main.tfvars \
--config-file scripts/config/tfsec.yaml
# TODO - Re-visit Trivy usage https://nhsd-jira.digital.nhs.uk/browse/CCM-15549
# terraform-sec: # Run Trivy IaC security scanning on Terraform code @Quality
# # Example: make terraform-sec
# ./scripts/terraform/trivy-scan.sh --mode iac infrastructure/terraform

terraform-docs: # Terraform-docs check against Terraform files - optional: terraform_dir|dir=[path to a directory where the command will be executed, relative to the project's top-level directory, default is one of the module variables or the example directory, if not set], terraform_opts|opts=[options to pass to the Terraform fmt command, default is '-recursive'] @Quality
for dir in ./infrastructure/terraform/components/* ./infrastructure/terraform/modules/*; do \
Expand Down
Loading