-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 1.79 KB
/
Copy pathsecurity.yml
File metadata and controls
62 lines (54 loc) · 1.79 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
name: Security
on:
pull_request:
branches: [main]
schedule:
- cron: '0 6 * * 1'
workflow_dispatch:
permissions:
contents: read
pull-requests: read
jobs:
gitleaks:
name: Secret scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Run Gitleaks
shell: bash
run: |
set -euo pipefail
GITLEAKS_VERSION=8.24.2
curl -sSL "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" -o gitleaks.tar.gz
tar -xzf gitleaks.tar.gz gitleaks
chmod +x gitleaks
if [ "${{ github.event_name }}" = "pull_request" ]; then
./gitleaks detect --source . --log-opts="origin/${{ github.base_ref }}..HEAD" --verbose
else
./gitleaks detect --source . --verbose
fi
dependency-audit:
name: Dependency audit
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup .NET
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
with:
global-json-file: global.json
- name: Restore
run: dotnet restore IronTrace.sln
- name: Vulnerable package scan
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$output = dotnet list IronTrace.sln package --vulnerable --include-transitive 2>&1 | Out-String
Write-Host $output
if ($output -match '(?i)\b(Critical|High)\b') {
Write-Error 'High or Critical NuGet vulnerabilities detected.'
exit 1
}