-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (78 loc) · 2.22 KB
/
Copy pathcodeql.yml
File metadata and controls
89 lines (78 loc) · 2.22 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CodeQL Security Scanning
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
schedule:
# Run every Monday at 00:00 UTC
- cron: '0 0 * * 1'
jobs:
# ============================================
# CODEQL ANALYSIS - Security Vulnerability Detection
# ============================================
analyze:
name: Analyze (Go)
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ['go']
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: security-and-quality
config: |
paths-ignore:
- '**/vendor/**'
- '**/node_modules/**'
- '**/*.min.js'
- '**/dist/**'
- '**/build/**'
- 'archive/**'
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
cache: true
cache-dependency-path: biometrics-cli/go.sum
- name: Download Dependencies
working-directory: biometrics-cli
run: go mod download
- name: Build (Required for CodeQL)
working-directory: biometrics-cli
run: go build -v ./...
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"
output: sarif-results
upload: true
# ============================================
# TRUFFLEHOG - Secret Detection
# ============================================
secret-scan:
name: Secret Detection (TruffleHog)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run TruffleHog
uses: trufflesecurity/trufflehog@v3.63.0
with:
path: ./
base: ${{ github.event.repository.default_branch }}
head: HEAD
extra_args: --only-verified