generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into PI-1759-dlq
# Conflicts: # .github/workflows/suppress-trivy.yml
- Loading branch information
Showing
18 changed files
with
143 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,116 +0,0 @@ | ||
name: Suppress Trivy alert | ||
|
||
on: | ||
issue_comment: | ||
types: | ||
- created | ||
workflow_dispatch: | ||
inputs: | ||
cve_id: | ||
description: CVE ID | ||
type: string | ||
required: true | ||
project: | ||
description: Project | ||
type: choice | ||
required: true | ||
options: | ||
- approved-premises-and-delius | ||
- approved-premises-and-oasys | ||
- arns-and-delius | ||
- assessment-summary-and-delius | ||
- cas3-and-delius | ||
- court-case-and-delius | ||
- create-and-vary-a-licence-and-delius | ||
- custody-key-dates-and-delius | ||
- domain-events-and-delius | ||
- dps-and-delius | ||
- effective-proposal-framework-and-delius | ||
- external-api-and-delius | ||
- hdc-licences-and-delius | ||
- hmpps-auth-and-delius | ||
- make-recall-decisions-and-delius | ||
- manage-offences-and-delius | ||
- manage-pom-cases-and-delius | ||
- offender-events-and-delius | ||
- opd-and-delius | ||
- pathfinder-and-delius | ||
- person-search-index-from-delius | ||
- pre-sentence-reports-to-delius | ||
- prison-case-notes-to-probation | ||
- prison-custody-status-to-delius | ||
- prison-education-and-delius | ||
- prison-identifier-and-delius | ||
- prisoner-profile-and-delius | ||
- redrive-dead-letter-queues | ||
- refer-and-monitor-and-delius | ||
- resettlement-passport-and-delius | ||
- risk-assessment-scores-to-delius | ||
- sentence-plan-and-delius | ||
- sentence-plan-and-oasys | ||
- soc-and-delius | ||
- tier-to-delius | ||
- unpaid-work-and-delius | ||
- workforce-allocations-to-delius | ||
# ^ add new projects here | ||
# GitHub Actions doesn't support dynamic choices, we must add each project here to enable manual deployments | ||
# See https://github.com/community/community/discussions/11795 | ||
reason: | ||
description: Reason | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
build: | ||
if: github.event_name=='workflow_dispatch' || (startsWith(github.event.comment.body, 'Suppress') && startsWith(github.event.issue.title, 'CVE-')) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
|
||
- name: Set CVE from Issue Title automatically | ||
if: github.event_name=='issue_comment' | ||
run: | | ||
echo "cve_id=$(echo "$TITLE" | sed -E 's/(.*) .*/\1/')" | tee -a "$GITHUB_ENV" # CVE-123 | ||
echo "project=$(echo "$TITLE" | sed -E 's/.* \((.*)\)/\1/')" | tee -a "$GITHUB_ENV" # project-name | ||
echo "reason=$COMMENT" | tee -a "$GITHUB_ENV" | ||
env: | ||
TITLE: ${{ github.event.issue.title }} | ||
COMMENT: ${{ github.event.comment.body }} | ||
REASON: ${{ inputs.reason }} | ||
|
||
- name: Set CVE from manual input | ||
if: github.event_name=='workflow_dispatch' | ||
run: | | ||
echo "cve_id=$CVE_ID" | tee -a "$GITHUB_ENV" | ||
echo "project=$PROJECT" | tee -a "$GITHUB_ENV" | ||
echo "reason=$REASON" | tee -a "$GITHUB_ENV" | ||
env: | ||
CVE_ID: ${{ inputs.cve_id }} | ||
PROJECT: ${{ inputs.project }} | ||
REASON: ${{ inputs.reason }} | ||
|
||
- name: Update trivyignore file and create pull request | ||
run: | | ||
git switch -c "suppress/${CVE_ID}_${PROJECT}" | ||
git push origin "suppress/${CVE_ID}_${PROJECT}" | ||
git pull origin "suppress/${CVE_ID}_${PROJECT}" | ||
git push origin "suppress/${CVE_ID}_${PROJECT}" | ||
echo -e "\n# ${REASON} by ${ACTOR}\n${CVE_ID} exp:$(date -d '+2 weeks' '+%Y-%m-%d')" >> "projects/${PROJECT}/.trivyignore" | ||
gh api --method PUT "/repos/ministryofjustice/hmpps-probation-integration-services/contents/projects/${PROJECT}/.trivyignore" \ | ||
--field message="Suppress ${CVE_ID} in ${PROJECT}" \ | ||
--field content=@<( base64 -i "projects/${PROJECT}/.trivyignore" ) \ | ||
--field branch="suppress/${CVE_ID}_${PROJECT}" \ | ||
--field sha="$( git rev-parse "suppress/${CVE_ID}_${PROJECT}:projects/${PROJECT}/.trivyignore" )" | ||
gh pr create \ | ||
--title "Suppress ${CVE_ID} in ${PROJECT}" \ | ||
--body "Suppressed by ${ACTOR} with reason: ${REASON}" \ | ||
--label 'dependencies,security' | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
CVE_ID: ${{ env.cve_id }} | ||
PROJECT: ${{ env.project }} | ||
REASON: ${{ env.reason }} | ||
ACTOR: ${{ github.actor }} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +0,0 @@ | ||
|
||
# Vulnerability in Logback, which is used by the following dependencies: | ||
# | ||
# * Application Insights Java agent | ||
# Not exploitable in the context of the Application Insights Java agent. | ||
# Reference: https://github.com/microsoft/ApplicationInsights-Java/issues/3414#issuecomment-1833988304 | ||
# * Spring Boot | ||
# Only exploitable if logback receiver component is deployed. This is not the case by default in Spring Boot. | ||
# Reference: https://github.com/spring-projects/spring-boot/issues/38643#issuecomment-1838497420 | ||
CVE-2023-6378 exp:2024-01-12 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.