Skip to content
Merged
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
a8eadbf
test vulnerability_scan notification
caroline-ttd Feb 24, 2025
80caef1
Test
caroline-ttd Feb 25, 2025
2816229
test
caroline-ttd Feb 25, 2025
5e81892
test
caroline-ttd Feb 25, 2025
c2e56ca
Test
caroline-ttd Feb 25, 2025
1fa74e7
Test
caroline-ttd Feb 26, 2025
6bd31e7
Remove slack_webhook required
caroline-ttd Feb 26, 2025
a705781
Test
caroline-ttd Feb 26, 2025
6b110e5
Test
caroline-ttd Feb 27, 2025
57f9ff1
test
caroline-ttd Feb 27, 2025
d7f630d
test
caroline-ttd Feb 27, 2025
8d269f7
Test
caroline-ttd Feb 27, 2025
e3f2d68
temporary remove unit test section
caroline-ttd Feb 27, 2025
c065be3
Test
caroline-ttd Feb 27, 2025
82b2970
Test
caroline-ttd Feb 27, 2025
88438f3
Test
caroline-ttd Feb 27, 2025
43c607c
Test
caroline-ttd Feb 27, 2025
b98349d
Test
caroline-ttd Feb 27, 2025
96a1372
Test
caroline-ttd Feb 27, 2025
fcd168c
Test
caroline-ttd Feb 28, 2025
f7217d6
Test
caroline-ttd Feb 28, 2025
7c67c79
Test
caroline-ttd Feb 28, 2025
f4f488e
Test
caroline-ttd Feb 28, 2025
a9b3b28
Test
caroline-ttd Feb 28, 2025
d95d549
Test
caroline-ttd Feb 28, 2025
54ab9a5
Test
caroline-ttd Feb 28, 2025
5b846d0
Test
caroline-ttd Mar 1, 2025
f020ccf
Test
caroline-ttd Mar 1, 2025
98aa1d4
Test
caroline-ttd Mar 1, 2025
0ab9d2e
Test
caroline-ttd Mar 1, 2025
4502a2b
Test
caroline-ttd Mar 1, 2025
0227dc0
Test
caroline-ttd Mar 1, 2025
4e49295
Test
caroline-ttd Mar 1, 2025
abd0ec4
Test
caroline-ttd Mar 1, 2025
7e5e268
Test
caroline-ttd Mar 1, 2025
ec11662
Test
caroline-ttd Mar 1, 2025
383463c
Test
caroline-ttd Mar 1, 2025
29f9ff9
Test
caroline-ttd Mar 3, 2025
b6cf603
Test
caroline-ttd Mar 3, 2025
42eb047
Test
caroline-ttd Mar 3, 2025
2dfc98c
Test
caroline-ttd Mar 3, 2025
0e9c0a3
Test
caroline-ttd Mar 3, 2025
ac36165
Test
caroline-ttd Mar 3, 2025
face50b
Revert changes
caroline-ttd Mar 4, 2025
c80a679
Test
caroline-ttd Mar 4, 2025
e9372cb
Test
caroline-ttd Mar 4, 2025
679dd9f
Test
caroline-ttd Mar 4, 2025
ded61fc
Test
caroline-ttd Mar 4, 2025
811e4dd
Test
caroline-ttd Mar 4, 2025
5ef77c6
Test
caroline-ttd Mar 4, 2025
9dca2c3
Test
caroline-ttd Mar 4, 2025
d87481b
Test
caroline-ttd Mar 4, 2025
f3bb41f
Test
caroline-ttd Mar 4, 2025
46ac416
Test
caroline-ttd Mar 4, 2025
996b81b
Test
caroline-ttd Mar 4, 2025
3bd8741
Test
caroline-ttd Mar 5, 2025
d7fafe1
Test
caroline-ttd Mar 5, 2025
a5a437d
Test
caroline-ttd Mar 5, 2025
39c0d6d
Test
caroline-ttd Mar 5, 2025
68124c6
Test
caroline-ttd Mar 5, 2025
ae6d3a6
Test
caroline-ttd Mar 5, 2025
da18ab5
Test
caroline-ttd Mar 5, 2025
5e0f968
Test
caroline-ttd Mar 5, 2025
7d707c8
Test
caroline-ttd Mar 5, 2025
047e9fc
Test
caroline-ttd Mar 5, 2025
c4d8dc0
Test
caroline-ttd Mar 5, 2025
074ac1d
Test
caroline-ttd Mar 6, 2025
36e15d9
Test
caroline-ttd Mar 6, 2025
e4658f2
Test
caroline-ttd Mar 6, 2025
fc35df4
Test
caroline-ttd Mar 6, 2025
d05bbc0
Test
caroline-ttd Mar 6, 2025
c29f3c6
Test
caroline-ttd Mar 6, 2025
a1d6961
Test
caroline-ttd Mar 6, 2025
67a6803
Test
caroline-ttd Mar 6, 2025
70037ac
Test
caroline-ttd Mar 6, 2025
0dc1ad7
Test
caroline-ttd Mar 6, 2025
728ecf5
Test
caroline-ttd Mar 6, 2025
911c4b3
Test
caroline-ttd Mar 6, 2025
50468f5
Test
caroline-ttd Mar 6, 2025
0e35248
Test
caroline-ttd Mar 6, 2025
e5ab91a
Test
caroline-ttd Mar 6, 2025
4fe1add
Test
caroline-ttd Mar 6, 2025
f9c1bf6
Test
caroline-ttd Mar 6, 2025
414bb49
Test
caroline-ttd Mar 6, 2025
1729ebe
Test
caroline-ttd Mar 6, 2025
c1bd671
Test
caroline-ttd Mar 6, 2025
a23270e
Test
caroline-ttd Mar 6, 2025
25980af
Test
caroline-ttd Mar 6, 2025
4e17877
Test
caroline-ttd Mar 6, 2025
d8495d1
Test
caroline-ttd Mar 6, 2025
d264090
Test
caroline-ttd Mar 6, 2025
f1a4785
Test
caroline-ttd Mar 6, 2025
eecf6e2
Test
caroline-ttd Mar 6, 2025
6aed551
Test
caroline-ttd Mar 6, 2025
567a419
Test
caroline-ttd Mar 6, 2025
c0e4815
Test
caroline-ttd Mar 6, 2025
0639c61
Remove fs scan yaml
caroline-ttd Mar 6, 2025
f718dcd
Change scan_severity
caroline-ttd Mar 7, 2025
c6d49e3
Update slack message
caroline-ttd Mar 10, 2025
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
115 changes: 115 additions & 0 deletions .github/workflows/shared-vulnerability-scan-failure-notify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Vulnerability Scan Failure Notification
on:
workflow_call:
inputs:
java_version:
description: The version of Java to use to compile the JAR. Defaults to 11
type: string
default: '11'
vulnerability_severity:
description: The severity that will cause the action to fail if a vulnerability at that level is detected. UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL
default: CRITICAL,HIGH
type: string
publish_vulnerabilities:
description: If true, will attempt to publish the results to the GitHub security tab
default: 'false'
type: string
scan_type:
description: The scan-type for aquasecurity/trivy-action action. Default to a fs scan.
default: fs
type: string
platform:
description: The OS runner to execute the vulnerability scan (e.g., ubuntu-latest, macos-latest, windows-latest).
default: 'ubuntu-latest'
type: string
skip_tests:
description: If true, will skip tests when packaging JAR. Defaults to false. Set to true for test-only repos.
type: boolean
default: false
working_dir:
description: The path to the pom.xml and Dockerfile.
type: string
default: '.'
secrets:
SLACK_WEBHOOK:
required: false

jobs:
vulnerability_scan:
runs-on: ${{ inputs.platform }}

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Checkout uid2-shared-actions repo
uses: actions/checkout@v4
with:
ref: v3
repository: IABTechLab/uid2-shared-actions
path: uid2-shared-actions

- name: Set up JDK
if: inputs.scan_type == 'image'
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ inputs.java_version }}

- name: Package JAR
if: inputs.scan_type == 'image'
id: package
run: |
pushd ${{ inputs.working_dir }}
if [[ "${{ inputs.skip_tests }}" == "false" ]]; then
mvn -B package -P default
else
mvn -B package -P default -DskipTests
fi
echo "jar_version=$(mvn help:evaluate -Dexpression=project.version | grep -e '^[1-9][^\[]')" >> $GITHUB_OUTPUT
echo "git_commit=$(git show --format="%h" --no-patch)" >> $GITHUB_OUTPUT
popd

- name: Extract metadata for Docker
if: inputs.scan_type == 'image'
id: meta
run: echo "tags=${{ steps.package.outputs.jar_version }}-${{ steps.package.outputs.git_commit }}" >> $GITHUB_OUTPUT

- name: Build Docker image
if: inputs.scan_type == 'image'
uses: docker/build-push-action@v5
with:
context: ${{inputs.working_dir}}
load: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
JAR_VERSION=${{ steps.package.outputs.jar_version }}
IMAGE_VERSION=${{ steps.package.outputs.jar_version }}-${{ steps.package.outputs.git_commit }}

- name: Vulnerability Scan
id: vulnerability-scan
uses: IABTechLab/uid2-shared-actions/actions/vulnerability_scan@v3
with:
scan_severity: ${{ inputs.vulnerability_severity }}
failure_severity: ${{ inputs.vulnerability_severity }}
publish_vulnerabilities: ${{ inputs.publish_vulnerabilities }}
image_ref: ${{ steps.meta.outputs.tags }}
scan_type: ${{ inputs.scan_type }}
continue-on-error: true

- name: Notify Slack on Vulnerability Scan Failure
if: ${{ steps.vulnerability-scan.outcome == 'failure' }}
env:
SLACK_COLOR: danger
SLACK_MESSAGE: ':x: Vulnerability scan failed. Please review details: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}. Check past alerts before acting and log new actions to avoid duplicate efforts.'
SLACK_TITLE: Vulnerability Scan Failure
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: rtCamp/action-slack-notify@v2

- name: Fail Workflow if Vulnerability Scan step Fails
if: ${{ steps.vulnerability-scan.outcome == 'failure' }}
shell: bash
run: |
echo "Failing the workflow due to vulnerability scan failure"
exit 1