Skip to content

Commit 6279f2c

Browse files
kparkinson-ldcwaldren-ldpkaeding
authored
ci: add Gosec github action (#22)
https://launchdarkly.atlassian.net/browse/SEC-2664 As part of our Repository Standards we need to run static analysis on all of our critical repositories. This github action runs gosec against the repository and uploads the results to an S3 bucket. This is intended to be a NON-BLOCKING action. --------- Co-authored-by: Casey Waldren <cwaldren@launchdarkly.com> Co-authored-by: Patrick Kaeding <patrick@kaeding.name>
1 parent 6f6abd7 commit 6279f2c

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/gosec.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Gosec
2+
on:
3+
schedule:
4+
- cron: '0 8 * * *'
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
id-token: write
11+
contents: read
12+
13+
jobs:
14+
tests:
15+
runs-on: ubuntu-latest
16+
env:
17+
GO111MODULE: on
18+
steps:
19+
- name: Get current date
20+
id: date
21+
run: echo "::set-output name=date::$(date +'%Y/%m/%d')"
22+
- name: Checkout Source
23+
uses: actions/checkout@v3
24+
- name: Run Gosec Security Scanner
25+
uses: securego/gosec@2.14.0
26+
timeout-minutes: 5
27+
with:
28+
args: --exclude-generated=true --severity=medium --concurrency=1 --fmt json --out=gosec-results.json --stdout --verbose=text --no-fail ./...
29+
- name: Configure AWS Credentials
30+
uses: aws-actions/configure-aws-credentials@v1
31+
with:
32+
audience: https://github.com/launchdarkly
33+
role-to-assume: ${{ secrets.ORG_SECURITY_GHA_ROLE_ARN }}
34+
aws-region: us-east-1
35+
- name: Upload scan results to S3
36+
run: |
37+
aws s3 cp ./gosec-results.json "s3://launchdarkly-org-security-inventory/scan-results/gosec/${{ steps.date.outputs.date }}/$GITHUB_REPOSITORY.json"

0 commit comments

Comments
 (0)