-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (64 loc) · 2.2 KB
/
custom_regex_scan.yml
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
# Edit the custom regex file and commit it to main branch to have a new customized scan
# The custom regex file can be found at:
# https://github.com/spark1security/n0s1-scheduled-scans/blob/main/.github/workflows/config/my_regex.toml
name: "Custom Regex Secret Scan"
on:
push:
branches:
- main
workflow_dispatch:
jobs:
checkout_regex_file:
permissions: write-all
runs-on: [ubuntu-latest]
steps:
- name: Checkout customized regex file
uses: actions/checkout@v3
with:
ref: main
sparse-checkout: |
.github/workflows/config/my_regex.toml
linear_secret_scanning:
permissions: write-all
runs-on: [ubuntu-latest]
steps:
- name: Scan Linear.app with custom regex
uses: spark1security/n0s1-action@main
env:
LINEAR_TOKEN: ${{ secrets.LINEAR_TOKEN }}
with:
scan-target: 'linear_scan'
report-format: "sarif"
report-file: "report.sarif"
regex-file: ".github/workflows/config/my_regex.toml"
- name: Display SARIF result
run: |
cat jira_secret_report.sarif | jq | head -n 10
cat jira_secret_report.sarif | jq | tail -n 50
- name: Upload scan report to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: "report.sarif"
jira_secret_scanning:
permissions: write-all
runs-on: [ ubuntu-latest ]
steps:
- name: Scan Jira with custom regex
uses: spark1security/n0s1-action@main
env:
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
with:
scan-target: 'jira_scan'
user-email: '[email protected]'
platform-url: 'https://spark1us.atlassian.net'
report-format: "sarif"
report-file: "jira_secret_report.sarif"
regex-file: ".github/workflows/config/my_regex.toml"
- name: Display SARIF result
run: |
cat jira_secret_report.sarif | jq | head -n 10
cat jira_secret_report.sarif | jq | tail -n 50
- name: Upload scan report to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: "jira_secret_report.sarif"