-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (63 loc) · 2.25 KB
/
Copy pathsecurity.yml
File metadata and controls
73 lines (63 loc) · 2.25 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
name: Security
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
schedule:
- cron: "17 4 * * 1"
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
dependency-review:
name: Dependency Review
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
with:
fail-on-severity: high
fail-on-scopes: runtime, development, unknown
comment-summary-in-pr: never
gitleaks:
name: Gitleaks
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- name: Scan changed commits
if: github.event_name == 'pull_request' || github.event_name == 'push'
env:
BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
HEAD_SHA: ${{ github.sha }}
run: |
set -euo pipefail
if [ -z "$BASE_SHA" ] || printf '%s' "$BASE_SHA" | grep -Eq '^0+$' || ! git cat-file -e "$BASE_SHA^{commit}"; then
LOG_OPTS="--all"
else
LOG_OPTS="$BASE_SHA..$HEAD_SHA"
fi
docker run --rm \
-v "$PWD:/repo" \
-w /repo \
ghcr.io/gitleaks/gitleaks:v8.30.1@sha256:c00b6bd0aeb3071cbcb79009cb16a60dd9e0a7c60e2be9ab65d25e6bc8abbb7f \
git --no-banner --redact --verbose --log-opts="$LOG_OPTS" .
- name: Scan full history
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
run: |
set -euo pipefail
docker run --rm \
-v "$PWD:/repo" \
-w /repo \
ghcr.io/gitleaks/gitleaks:v8.30.1@sha256:c00b6bd0aeb3071cbcb79009cb16a60dd9e0a7c60e2be9ab65d25e6bc8abbb7f \
git --no-banner --redact --verbose --log-opts="--all" .