-
Notifications
You must be signed in to change notification settings - Fork 363
75 lines (67 loc) · 2.1 KB
/
global-security.yml
File metadata and controls
75 lines (67 loc) · 2.1 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
name: Global Repository Security & Linting
on:
push:
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
schedule:
- cron: '0 0 * * 0' # Run weekly on Sunday
jobs:
secret-scanning:
name: Secret Scanning
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
# TruffleHog is a free, powerful secret scanner
- name: TruffleHog Secret Scan
uses: trufflesecurity/trufflehog@main
with:
path: ./
extra_args: --debug --only-verified
- name: TruffleHog Pull Request Diff Scan
if: github.event_name == 'pull_request'
uses: trufflesecurity/trufflehog@main
with:
path: ./
base: ${{ github.event.pull_request.base.sha }}
head: ${{ github.event.pull_request.head.sha }}
extra_args: --debug --only-verified
iac-security:
name: IaC Security Scan (Trivy)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# Trivy is free and excellent for IaC and container scanning
- name: Run Trivy vulnerability scanner in fs mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
trivy-config: trivy.yaml
format: 'table'
exit-code: '0' # Set to 1 in later phases to block PRs
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
linting:
name: Super-Linter
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
# Super-linter supports multiple languages and is free
- name: Lint Code Base
uses: github/super-linter@v5
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: "main"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Disable linters that might be too noisy initially
VALIDATE_JSCPD: false
VALIDATE_KUBERNETES_KUBEVAL: false