-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (68 loc) · 2.39 KB
/
snyk_scan_aws_beta.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
71
72
73
74
75
76
77
78
name: Regular Snyk scan of aws-beta
on:
push:
branches:
- main
workflow_dispatch:
schedule: # At 09:00 every Saturday
- cron: '0 9 * * SAT'
env:
KOSLI_HOST_STAGING: ${{ vars.KOSLI_HOST_STAGING }}
KOSLI_HOST_PROD: ${{ vars.KOSLI_HOST }}
KOSLI_ORG: ${{ vars.KOSLI_ORG }} # cyber-dojo
KOSLI_API_TOKEN_STAGING: ${{ secrets.KOSLI_API_TOKEN_STAGING }}
KOSLI_API_TOKEN_PROD: ${{ secrets.KOSLI_API_TOKEN }}
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
AWS_ACCOUNT_ID: ${{ vars.AWS_ACCOUNT_ID_BETA }}
AWS_REGION: ${{ vars.AWS_REGION }}
jobs:
snyk-scan:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 100
- name: Setup Kosli CLI
uses: kosli-dev/setup-cli-action@v2
with:
version: ${{ vars.KOSLI_CLI_VERSION }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/gh_actions_snyk_scans
aws-region: ${{ env.AWS_REGION }}
role-duration-seconds: 2400
role-session-name: ${{ github.event.repository.name }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Setup Snyk
uses: snyk/actions/setup@master
- name: Run Snyk
run: |
# What https://app.kosli.com says is running in aws-prod
./snyk_scan_live_artifacts_and_report_to_kosli.sh \
"${KOSLI_HOST_PROD}" \
"${KOSLI_API_TOKEN_PROD}" \
aws-prod
# # What https://app.kosli.com says is running in aws-beta
# ./snyk_scan_live_artifacts_and_report_to_kosli.sh \
# "${KOSLI_HOST_PROD}" \
# "${KOSLI_API_TOKEN_PROD}" \
# aws-beta
#
# # What https://staging.app.kosli.com says is running in aws-prod
# ./snyk_scan_live_artifacts_and_report_to_kosli.sh \
# "${KOSLI_HOST_STAGING}" \
# "${KOSLI_API_TOKEN_STAGING}" \
# aws-prod
#
# # What https://staging.app.kosli.com says is running in aws-beta
# ./snyk_scan_live_artifacts_and_report_to_kosli.sh \
# "${KOSLI_HOST_STAGING}" \
# "${KOSLI_API_TOKEN_STAGING}" \
# aws-beta