Skip to content

Commit a0aa5bc

Browse files
authored
[CU-86b8rd19x] Add PR validation pipeline with SCA, SAST, and secrets detection (#18)
* [CU-86b8rd19x] Add PR validation pipeline with SCA, SAST, and secrets detection Replace Cloud Build-only CI with GitHub Actions for PR validation: - Build & Test, SAST (SonarQube), SCA (Trivy with SBOM), Secrets Detection (Gitleaks) - Add .gitleaks.toml, .gitleaksignore, .trivyignore.yaml
1 parent ac4d0de commit a0aa5bc

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build, Test & Analyse
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-test-java-app:
11+
name: Build & Test Java App
12+
uses: DNAstack/dnastack-development-tools/.github/workflows/build-test-java-app.yml@945ddc20e0baa715095f63b282d81da7df57dd0b
13+
with:
14+
java-version: 17
15+
secrets:
16+
pat-with-read-packages-permission: ${{ secrets.AUTH_TOKEN }}
17+
18+
sast:
19+
name: SAST (SonarQube)
20+
uses: DNAstack/dnastack-development-tools/.github/workflows/sast.yml@945ddc20e0baa715095f63b282d81da7df57dd0b
21+
with:
22+
with-frontend: false
23+
java-version: 17
24+
secrets:
25+
pat-with-read-packages-permission: ${{ secrets.AUTH_TOKEN }}
26+
sonar-token: ${{ secrets.SONAR_TOKEN }}
27+
sonar-host-url: ${{ secrets.SONAR_HOST_URL }}
28+
29+
sca:
30+
name: SCA (Trivy)
31+
uses: DNAstack/dnastack-development-tools/.github/workflows/sca.yml@945ddc20e0baa715095f63b282d81da7df57dd0b
32+
with:
33+
java-version: 17
34+
secrets:
35+
pat-with-read-packages-permission: ${{ secrets.AUTH_TOKEN }}
36+
37+
secrets-detection:
38+
name: Secrets Detection (Gitleaks)
39+
uses: DNAstack/dnastack-development-tools/.github/workflows/secrets-detection.yml@945ddc20e0baa715095f63b282d81da7df57dd0b
40+
secrets:
41+
gitleaks-license: ${{ secrets.GITLEAKS_LICENSE }}

.gitleaks.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Gitleaks configuration — controls secret scanning behavior.
2+
# See: https://github.com/gitleaks/gitleaks#configuration
3+
4+
# Use the default detection rules.
5+
[extend]
6+
useDefault = true
7+
8+
# Exclude build artifacts and dependency directories from scanning.
9+
[[allowlists]]
10+
description = "exclude build artifacts and dependency directories"
11+
paths = [
12+
'''target/''',
13+
]

.gitleaksignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Gitleaks ignore file — suppresses known/accepted secret findings.
2+
# Each line is a fingerprint from gitleaks output. New secrets in the same
3+
# files will still be caught — only these specific findings are suppressed.
4+
#
5+
# To add a new entry: run `gitleaks detect --source . --no-git -v`,
6+
# copy the Fingerprint line, and add it here with a comment explaining why.

.trivyignore.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Trivy ignore file for known/accepted vulnerabilities.
2+
# See: https://trivy.dev/docs/configuration/filtering/#trivyignoreyaml
3+
#
4+
# Format:
5+
# vulnerabilities:
6+
# - id: CVE-XXXX-XXXXX
7+
# reason: "Why this is acceptable"
8+
# expired_at: 2026-XX-XXT00:00:00Z

0 commit comments

Comments
 (0)