-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 2.37 KB
/
Copy pathcodeql.yml
File metadata and controls
61 lines (52 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: CodeQL
# Java/Kotlin SAST (정적 분석). push / PR 마다 + 주간 스케줄로 코드 자체 취약점을 스캔.
on:
workflow_dispatch:
schedule:
# 매주 월요일 03:00 UTC — dependabot 점검과 별개로 코드 자체 취약점도 주기 스캔.
- cron: "0 3 * * 1"
push:
branches: [main]
pull_request:
branches: [main]
# 워크플로 기본은 read-only. 코드 스캔 결과 업로드 권한만 job 에서 올린다.
permissions:
contents: read
# 동일 ref 의 이전 분석은 취소 — PR push 연타 시 러너 낭비 방지.
concurrency:
group: codeql-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
analyze:
name: Analyze (java-kotlin)
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up JDK 21
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: temurin
java-version: "21"
- name: Set up Gradle
uses: gradle/actions/setup-gradle@748248ddd2a24f49513d8f472f81c3a07d4d50e1 # v4.4.4
- name: Initialize CodeQL
uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
with:
languages: java-kotlin
# security-extended — 기본 query 셋에 추가 보안 query 포함.
queries: security-extended
# autobuild 대신 명시 빌드 — 멀티모듈이라 CodeQL 이 전 모듈을 확실히 컴파일하도록.
# 프로덕션 코드는 Kotlin 이므로 compileKotlin 까지 포함해야 SAST 가 본 코드를 분석한다.
# --no-build-cache --rerun-tasks --clean 으로 캐시(FROM-CACHE) 재사용을 막아
# CodeQL 추적기가 실제 컴파일러 실행을 관찰하도록 강제한다. 그렇지 않으면
# "no source code seen during build" 로 분석이 실패한다.
- name: Compile
run: ./gradlew --no-daemon --no-build-cache --rerun-tasks clean compileKotlin compileTestKotlin compileJava compileTestJava
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
with:
category: "/language:java-kotlin"