Skip to content

Commit 4021a1c

Browse files
authored
Add SAST/SCA scan (#79)
chore: create sast.yml Signed-off-by: Lukas Jokubauskas <[email protected]>
1 parent 42f09e7 commit 4021a1c

File tree

2 files changed

+101
-0
lines changed

2 files changed

+101
-0
lines changed

.github/workflows/sast.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# By default this workflow will be running for PRs and pushes to other branches except main
2+
on:
3+
pull_request_target:
4+
types: [labeled]
5+
push:
6+
branches-ignore:
7+
- 'main'
8+
jobs:
9+
sast:
10+
runs-on: sast
11+
if: |
12+
github.event_name == 'push' ||
13+
(
14+
github.event_name == 'pull_request_target' &&
15+
github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name &&
16+
github.event.label.name == 'security scan'
17+
)
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
21+
# Checking out SAST composite action
22+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
23+
with:
24+
repository: NordSecurity/sast-configs
25+
ref: main
26+
ssh-key: ${{ secrets.SAST_ACTION_KEY }}
27+
path: .github/workflows/sast
28+
# Checking out only SAST action and composite project configuration action
29+
sparse-checkout: |
30+
base/sast-action
31+
actions/storyblok-rich-text-astro-renderer-sast-action
32+
- uses: ./.github/workflows/sast/actions/storyblok-rich-text-astro-renderer-sast-action
33+
with:
34+
SAST_TEAM: ${{ secrets.SAST_TEAM }}
35+
SAST_URL: ${{ secrets.SAST_URL }}
36+
SAST_USERNAME: ${{ secrets.SAST_USERNAME }}
37+
SAST_PASSWORD: ${{ secrets.SAST_PASSWORD }}
38+
SAST_CLIENT_SECRET: ${{ secrets.SAST_CLIENT_SECRET }}
39+

.github/workflows/sca.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# By default this workflow will be running for PRs (rapid scans) and on push to main branch (full scan)
2+
on:
3+
pull_request_target:
4+
types: [labeled]
5+
pull_request:
6+
branches: [main]
7+
push:
8+
branches: [main]
9+
jobs:
10+
sca-full:
11+
runs-on: sca
12+
if: github.event_name == 'push'
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
16+
# Checking out SCA composite action
17+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
18+
with:
19+
repository: NordSecurity/sca-configs
20+
ref: main
21+
ssh-key: ${{ secrets.SCA_ACTION_KEY }}
22+
path: .github/workflows/sca
23+
# Checking out only SCA action and composite project configuration action
24+
sparse-checkout: |
25+
base/sca-action
26+
SCA/nordsecurity-storyblok-rich-text-astro-renderer-sca-action
27+
- uses: ./.github/workflows/sca/SCA/nordsecurity-storyblok-rich-text-astro-renderer-sca-action
28+
with:
29+
SCA_URL: ${{ secrets.SCA_URL }}
30+
SCA_API_TOKEN: ${{ secrets.SCA_API_TOKEN }}
31+
SCA_FULL_SCAN: true
32+
sca-rapid:
33+
runs-on: sca
34+
if: |
35+
(
36+
github.event_name == 'pull_request' &&
37+
github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
38+
) ||
39+
(
40+
github.event_name == 'pull_request_target' &&
41+
github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name &&
42+
github.event.label.name == 'security scan'
43+
)
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
47+
# Checking out SCA composite action
48+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
49+
with:
50+
repository: NordSecurity/sca-configs
51+
ref: main
52+
ssh-key: ${{ secrets.SCA_ACTION_KEY }}
53+
path: .github/workflows/sca
54+
# Checking out only SCA action and composite project configuration action
55+
sparse-checkout: |
56+
base/sca-action
57+
SCA/nordsecurity-storyblok-rich-text-astro-renderer-sca-action
58+
- uses: ./.github/workflows/sca/SCA/nordsecurity-storyblok-rich-text-astro-renderer-sca-action
59+
with:
60+
SCA_URL: ${{ secrets.SCA_URL }}
61+
SCA_API_TOKEN: ${{ secrets.SCA_API_TOKEN }}
62+
SCA_FULL_SCAN: false

0 commit comments

Comments
 (0)