Skip to content

Commit e5611b8

Browse files
committed
Merge branch 'main' into feature/CCM-13539_dependabot_updates
2 parents f1c4929 + f6d46f4 commit e5611b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2045
-319
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
- [ ] I have added tests to cover my changes
2626
- [ ] I have updated the documentation accordingly
2727
- [ ] This PR is a result of pair or mob programming
28+
- [ ] If I have used the 'skip-trivy-package' label I have done so responsibly and in the knowledge that this is being fixed as part of a separate ticket/PR.
2829

2930
---
3031

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: "Trivy IaC Scan"
2+
description: "Scan Terraform IaC using Trivy"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: "Trivy Terraform IaC Scan"
7+
shell: bash
8+
run: |
9+
components_exit_code=0
10+
modules_exit_code=0
11+
12+
./scripts/terraform/trivy-scan.sh --mode iac ./infrastructure/terraform/components || components_exit_code=$?
13+
./scripts/terraform/trivy-scan.sh --mode iac ./infrastructure/terraform/modules || modules_exit_code=$?
14+
15+
if [ $components_exit_code -ne 0 ] || [ $modules_exit_code -ne 0 ]; then
16+
echo "Trivy misconfigurations detected."
17+
exit 1
18+
fi
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: "Trivy Package Scan"
2+
description: "Scan project packages using Trivy"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: "Trivy Package Scan"
7+
shell: bash
8+
run: |
9+
exit_code=0
10+
11+
./scripts/terraform/trivy-scan.sh --mode package . || exit_code=$?
12+
13+
if [ $exit_code -ne 0 ]; then
14+
echo "Trivy has detected package vulnerablilites. Please refer to https://nhsd-confluence.digital.nhs.uk/spaces/RIS/pages/1257636917/PLAT-KOP-012+-+Trivy+Pipeline+Vulnerability+Scanning+Exemption"
15+
exit 1
16+
fi

.github/actions/trivy/action.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/cicd-1-pull-request.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
is_version_prerelease: ${{ steps.variables.outputs.is_version_prerelease }}
3434
does_pull_request_exist: ${{ steps.pr_exists.outputs.does_pull_request_exist }}
3535
pr_number: ${{ steps.pr_exists.outputs.pr_number }}
36+
skip_trivy_package: ${{ steps.skip_trivy.outputs.skip_trivy_package }}
3637
steps:
3738
- name: "Checkout code"
3839
uses: actions/checkout@v5
@@ -72,7 +73,26 @@ jobs:
7273
echo "does_pull_request_exist=false" >> $GITHUB_OUTPUT
7374
echo "pr_number=" >> $GITHUB_OUTPUT
7475
fi
76+
- name: "Determine if Trivy package scan should be skipped"
77+
id: skip_trivy
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
PR_NUMBER: ${{ steps.pr_exists.outputs.pr_number }}
81+
run: |
82+
if [[ -z "$PR_NUMBER" ]]; then
83+
echo "No pull request detected; Trivy package scan will run."
84+
echo "skip_trivy_package=false" >> $GITHUB_OUTPUT
85+
exit 0
86+
fi
7587
88+
labels=$(gh pr view "$PR_NUMBER" --json labels --jq '.labels[].name')
89+
echo "Labels on PR #$PR_NUMBER: $labels"
90+
91+
if echo "$labels" | grep -Fxq 'skip-trivy-package'; then
92+
echo "skip_trivy_package=true" >> $GITHUB_OUTPUT
93+
else
94+
echo "skip_trivy_package=false" >> $GITHUB_OUTPUT
95+
fi
7696
- name: "List variables"
7797
run: |
7898
export BUILD_DATETIME_LONDON="${{ steps.variables.outputs.build_datetime_london }}"
@@ -96,6 +116,7 @@ jobs:
96116
build_epoch: "${{ needs.metadata.outputs.build_epoch }}"
97117
nodejs_version: "${{ needs.metadata.outputs.nodejs_version }}"
98118
python_version: "${{ needs.metadata.outputs.python_version }}"
119+
skip_trivy_package: ${{ needs.metadata.outputs.skip_trivy_package == 'true' }}
99120
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
100121
version: "${{ needs.metadata.outputs.version }}"
101122
# secrets: inherit

.github/workflows/stage-1-commit.yaml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ on:
2323
description: "Python version, set by the CI/CD pipeline workflow"
2424
required: true
2525
type: string
26+
skip_trivy_package:
27+
description: "Skip Trivy package scan when true"
28+
type: boolean
29+
default: false
2630
terraform_version:
2731
description: "Terraform version, set by the CI/CD pipeline workflow"
2832
required: true
@@ -146,21 +150,39 @@ jobs:
146150
uses: actions/checkout@v5
147151
- name: "Lint Terraform"
148152
uses: ./.github/actions/lint-terraform
149-
trivy:
150-
name: "Trivy Scan"
153+
trivy-iac:
154+
name: "Trivy IaC Scan"
155+
permissions:
156+
contents: read
151157
runs-on: ubuntu-latest
152-
timeout-minutes: 5
158+
timeout-minutes: 10
153159
needs: detect-terraform-changes
154160
if: needs.detect-terraform-changes.outputs.terraform_changed == 'true'
155161
steps:
156162
- name: "Checkout code"
157-
uses: actions/checkout@v5
163+
uses: actions/checkout@v4
158164
- name: "Setup ASDF"
159165
uses: asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47 # v4
160166
- name: "Perform Setup"
161167
uses: ./.github/actions/setup
162-
- name: "Trivy Scan"
163-
uses: ./.github/actions/trivy
168+
- name: "Trivy IaC Scan"
169+
uses: ./.github/actions/trivy-iac
170+
trivy-package:
171+
if: ${{ !inputs.skip_trivy_package }}
172+
name: "Trivy Package Scan"
173+
permissions:
174+
contents: read
175+
runs-on: ubuntu-latest
176+
timeout-minutes: 10
177+
steps:
178+
- name: "Checkout code"
179+
uses: actions/checkout@v4
180+
- name: "Setup ASDF"
181+
uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
182+
- name: "Perform Setup"
183+
uses: ./.github/actions/setup
184+
- name: "Trivy Package Scan"
185+
uses: ./.github/actions/trivy-package
164186
count-lines-of-code:
165187
name: "Count lines of code"
166188
runs-on: ubuntu-latest

.tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ vale 3.6.0
1414
# The section below is reserved for Docker image versions.
1515

1616
# TODO: Move this section - consider using a different file for the repository template dependencies.
17-
# docker/ghcr.io/anchore/grype v0.92.2@sha256:651e558f9ba84f2a790b3449c8a57cbbf4f34e004f7d3f14ae8f8cbeede4cd33 # SEE: https://github.com/anchore/grype/pkgs/container/grype
18-
# docker/ghcr.io/anchore/syft v1.26.0@sha256:de078f51704a213906970b1475edd6006b8af50aa159852e125518237487b8c6 # SEE: https://github.com/anchore/syft/pkgs/container/syft
17+
# docker/ghcr.io/anchore/grype v0.104.3@sha256:d340f4f8b3b7e6e72a6c9c0152f25402ed8a2d7375dba1dfce4e53115242feb6 # SEE: https://github.com/anchore/grype/pkgs/container/grype
18+
# docker/ghcr.io/anchore/syft v1.39.0@sha256:6f13bb010923c33fb197047c8f88888e77071bd32596b3f605d62a133e493ce4 # SEE: https://github.com/anchore/syft/pkgs/container/syft
1919
# docker/ghcr.io/gitleaks/gitleaks:v8.24.0@sha256:b8e9bf46893c2f20e10bfb4b2e783adaef519dea981b01ca6221ac325e836040 # SEE: https://github.com/gitleaks/gitleaks/pkgs/container/gitleaks
2020
# docker/ghcr.io/igorshubovych/markdownlint-cli v0.37.0@sha256:fb3e79946fce78e1cde84d6798c6c2a55f2de11fc16606a40d49411e281d950d # SEE: https://github.com/igorshubovych/markdownlint-cli/pkgs/container/markdownlint-cli
2121
# docker/ghcr.io/make-ops-tools/gocloc latest@sha256:6888e62e9ae693c4ebcfed9f1d86c70fd083868acb8815fe44b561b9a73b5032 # SEE: https://github.com/make-ops-tools/gocloc/pkgs/container/gocloc

.trivyignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Remove after resolution as part of https://nhsd-jira.digital.nhs.uk/browse/CCM-13690
2+
CVE-2021-4279 # https://avd.aquasec.com/nvd/cve-2021-4279 ## latest ajv-cli (5.0.0) installs old version of fast-json-patch
3+
CVE-2024-49761 # https://avd.aquasec.com/nvd/cve-2024-49761 ## latest Jekyll Webpack (0.2.7) installs old version of rexml
4+
CVE-2024-47220 # https://avd.aquasec.com/nvd/cve-2024-47220 ## latest lint_roller (1.1.0) installs old version of rexml
5+
CVE-2024-7254 # https://avd.aquasec.com/nvd/cve-2024-7254 ## latest Jekyll Webpack (0.2.7) installs old version of google-protobuf

docs/adr/assets/ADR-003/examples/golang/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ toolchain go1.24.1
55

66
require (
77
github.com/go-resty/resty/v2 v2.7.0
8-
github.com/golang-jwt/jwt v3.2.2+incompatible
8+
github.com/golang-jwt/jwt v5.3.0+incompatible
99
)
1010

1111
require golang.org/x/net v0.38.0 // indirect

docs/architecture/c4/notifhir/printer/eventsfromprint/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
title: Events from Supplier API
44
parent: Print Supplier Services
5-
nav_order: 9
5+
nav_order: 4
66
has_children: true
77
is_not_draft: false
88
last_modified_date: 2025-12-12

0 commit comments

Comments
 (0)