Repository navigation
96 lines (86 loc) · 2.91 KB
/
Copy pathsecurity-process.yml
File metadata and controls
96 lines (86 loc) · 2.91 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
90
91
92
93
94
95
96
name: Security Process
on:
push:
branches: [develop, main, master]
pull_request:
branches: [develop, main, master]
schedule:
- cron: "31 4 * * 1"
workflow_dispatch:
# Least-privilege top-level token; write scopes are granted per-job below.
permissions:
contents: read
jobs:
appguardrail-scan:
runs-on: ubuntu-latest
permissions:
contents: read
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare CodeGraph CLI
env:
CODEGRAPH_PACKAGE: "@colbymchenry/codegraph@0.9.9"
run: |
set -euo pipefail
codegraph_bin="${RUNNER_TEMP}/codegraph-bin"
mkdir -p "$codegraph_bin"
cat >"${codegraph_bin}/codegraph" <<SH
#!/bin/sh
exec npx -y "$CODEGRAPH_PACKAGE" "\$@"
SH
chmod 0755 "${codegraph_bin}/codegraph"
echo "$codegraph_bin" >>"$GITHUB_PATH"
- name: Run AppGuardrail deploy gate
run: |
set -euo pipefail
python3 scanner/cli/appguardrail.py scan --codegraph . | tee appguardrail-scan.txt
- name: Upload AppGuardrail scan output
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: appguardrail-scan
path: appguardrail-scan.txt
if-no-files-found: error
retention-days: 7
trivy-fs:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Run Trivy FS scan
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
scan-type: fs
scan-ref: .
scanners: vuln,secret,misconfig
severity: CRITICAL,HIGH
ignore-unfixed: true
format: sarif
output: trivy-results.sarif
exit-code: "1"
- name: Upload Trivy SARIF to code scanning
if: >-
always()
&& hashFiles('trivy-results.sarif') != ''
&& (github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name == github.repository)
uses: github/codeql-action/upload-sarif@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6
with:
sarif_file: trivy-results.sarif
- name: Upload Trivy SARIF artifact
if: always() && hashFiles('trivy-results.sarif') != ''
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: trivy-results
path: trivy-results.sarif
if-no-files-found: error
retention-days: 7