Skip to content

Commit 1ddf1fe

Browse files
authored
Merge pull request #86 from MJSEC-MJU/feat/security
fix: Central Analyzer 끔 → POM 조회 병목 제거
2 parents ed879c8 + 7e72569 commit 1ddf1fe

1 file changed

Lines changed: 19 additions & 11 deletions

File tree

.github/workflows/security-spring.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
run: npm ci --ignore-scripts --no-audit
4545

4646
# ──────────────────────────────
47-
# Semgrep (SAST) — Java/Kotlin + (옵션) JS/React → SARIF
47+
# Semgrep (SAST)
4848
# ──────────────────────────────
4949
- name: Set up Python (for Semgrep CLI)
5050
uses: actions/setup-python@v5
@@ -56,8 +56,6 @@ jobs:
5656
python -m pip install --upgrade pip
5757
pip install semgrep
5858
59-
# 백엔드만 있어도 Java/Kotlin/OWASP 룰은 항상 실행.
60-
# JS/React 룰은 락파일 있을 때만 추가로 돌리도록 나눔.
6159
- name: Run Semgrep (OWASP + Java/Kotlin) → SARIF
6260
run: |
6361
set -euo pipefail
@@ -76,7 +74,6 @@ jobs:
7674
--config p/javascript \
7775
--config p/react \
7876
--sarif -o semgrep-js.sarif || true
79-
# SARIF 병합(간단 append; GitHub는 여러 SARIF 업로드도 지원)
8077
jq -s '.[0].runs += .[1].runs | .[0]' semgrep.sarif semgrep-js.sarif > semgrep-merged.sarif && mv semgrep-merged.sarif semgrep.sarif
8178
8279
- name: Check Semgrep SARIF has results
@@ -96,7 +93,7 @@ jobs:
9693
sarif_file: semgrep.sarif
9794

9895
# ──────────────────────────────
99-
# Node SCA — npm audit (프론트엔드 있을 때만, report-only)
96+
# Node SCA — npm audit (report-only)
10097
# ──────────────────────────────
10198
- name: Node audit (npm)
10299
if: ${{ hashFiles('**/package-lock.json', '**/npm-shrinkwrap.json', '**/pnpm-lock.yaml', '**/yarn.lock') != '' }}
@@ -124,22 +121,26 @@ jobs:
124121
run: ./gradlew build -x test
125122

126123
# ──────────────────────────────
127-
# Dependency-Check (Java SCA) → SARIF (리포트만, 실패 안함)
124+
# Dependency-Check (Java SCA) → SARIF
128125
# ──────────────────────────────
129-
- name: OWASP Dependency-Check → SARIF
126+
- name: OWASP Dependency-Check → SARIF (fast, Java-only)
127+
if: ${{ hashFiles('**/pom.xml', '**/build.gradle*') != '' }}
130128
uses: dependency-check/Dependency-Check_Action@main
131129
env:
132-
JAVA_HOME: /opt/jdk # README 권고
130+
JAVA_HOME: /opt/jdk # action 이미지 요구사항
133131
with:
134132
project: ${{ github.repository }}
135133
path: .
136134
format: 'SARIF'
137135
out: 'dependency-check-report'
138136
args: >
139137
--noupdate
140-
--failOnCVSS 11
138+
--disableCentral
139+
--disableNodeJS --disableNodeAudit --disableYarnAudit --disablePnpmAudit --disableRetireJS
141140
--enableRetired
141+
--failOnCVSS 11
142142
--suppression .github/dependency-check-suppressions.xml
143+
--log dependency-check-report/odc.log
143144
continue-on-error: true
144145

145146
- name: Upload Dependency-Check SARIF
@@ -148,6 +149,13 @@ jobs:
148149
with:
149150
sarif_file: dependency-check-report/dependency-check-report.sarif
150151

152+
- name: Upload Dependency-Check log (always)
153+
if: always()
154+
uses: actions/upload-artifact@v4
155+
with:
156+
name: dependency-check-log
157+
path: dependency-check-report/odc.log
158+
151159
# ──────────────────────────────
152160
# Trivy (filesystem scan) → SARIF
153161
# ──────────────────────────────
@@ -178,7 +186,7 @@ jobs:
178186
sarif_file: trivy-fs.sarif
179187

180188
# ──────────────────────────────
181-
# Hadolint (Dockerfile Lint)
189+
# Hadolint
182190
# ──────────────────────────────
183191
- name: Locate Dockerfile(s)
184192
id: df
@@ -255,7 +263,7 @@ jobs:
255263
sarif_file: trivy-image.sarif
256264

257265
# ──────────────────────────────
258-
# Gitleaks (Secrets) — SARIF
266+
# Gitleaks (Secrets)
259267
# ──────────────────────────────
260268
- name: Run Gitleaks (secrets scan) → SARIF
261269
shell: bash

0 commit comments

Comments
 (0)