Skip to content

Commit

Permalink
Merge branch 'main' into linting
Browse files Browse the repository at this point in the history
  • Loading branch information
bdhave committed Dec 13, 2022
2 parents ca415d1 + ff52b42 commit adcba8c
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 51 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: 'CodeQL'

on:
push:
Expand All @@ -18,7 +18,7 @@ on:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '20 20 * * 5'
- cron: '20 20 * * 5' # see https://crontab.guru/ for more examples

permissions: # added using https://github.com/step-security/secure-workflows
contents: read
Expand All @@ -29,7 +29,7 @@ jobs:
actions: read # for github/codeql-action/init to get workflow details
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/autobuild to send a status report
name: Analyze
name: 'Analyze'
runs-on: ubuntu-latest

strategy:
Expand All @@ -41,7 +41,7 @@ jobs:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Harden Runner
- name: 'Harden Runner'
uses: step-security/harden-runner@0a5820a2ec510d2521c1715d24860fc8cd06400a
with:
disable-sudo: true
Expand All @@ -53,12 +53,12 @@ jobs:
storage.googleapis.com:443
sum.golang.org:443
- name: Checkout repository
uses: actions/checkout@bf085276cecdb0cc76fbbe0687a5a0e786646936
- name: 'Checkout repository'
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@896079047b4bb059ba6f150a5d87d47dde99e6e5
- name: 'Initialize CodeQL'
uses: github/codeql-action/init@899bf9c076bcf8a9b657dd1b6d6a8270f89f356a
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -68,8 +68,8 @@ jobs:

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@896079047b4bb059ba6f150a5d87d47dde99e6e5
- name: 'Autobuild'
uses: github/codeql-action/autobuild@899bf9c076bcf8a9b657dd1b6d6a8270f89f356a

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -82,5 +82,5 @@ jobs:
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@896079047b4bb059ba6f150a5d87d47dde99e6e5
- name: 'Perform CodeQL Analysis'
uses: github/codeql-action/analyze@899bf9c076bcf8a9b657dd1b6d6a8270f89f356a
9 changes: 5 additions & 4 deletions .github/workflows/dependencies-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
- name: 'Harden Runner'
uses: step-security/harden-runner@0a5820a2ec510d2521c1715d24860fc8cd06400a
with:
disable-sudo: true
egress-policy: audit
egress-policy: block
allowed-endpoints: >
api.github.com:443
github.com:443
proxy.golang.org:443
storage.googleapis.com:443
- name: 'Checkout Repository'
uses: actions/checkout@bf085276cecdb0cc76fbbe0687a5a0e786646936
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b

- name: 'Dependency Review'
uses: actions/dependency-review-action@df02ee7d42c1ab6f13c6035e757b83333458e51d
uses: actions/dependency-review-action@29022577bf5deaf5ce4e137a74d591b4c66c8b99
17 changes: 9 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Go
name: 'Go compilation'

on:
push:
Expand All @@ -14,7 +14,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
- name: 'Harden Runner'
uses: step-security/harden-runner@0a5820a2ec510d2521c1715d24860fc8cd06400a
with:
disable-sudo: true
Expand All @@ -25,20 +25,21 @@ jobs:
storage.googleapis.com:443
- name: 'Checkout Repository'
uses: actions/checkout@bf085276cecdb0cc76fbbe0687a5a0e786646936
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b

- name: Set up Go
uses: actions/setup-go@30c39bfe0c7338d0d8e99486938f1066b2f92108
- name: 'Set up Go'
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
with:
go-version: 1.19

- name: Build
- name: 'Build'
run: go build -o vault4summon

- name: Test
- name: 'Test'
run: go test ./...

- uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb
- name: 'Upload binaries'
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb
with:
name: vault4summon linux amd64
path: vault4summon
26 changes: 14 additions & 12 deletions .github/workflows/gosec.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Gosec
name: 'Run Gosec'
on:
push:
branches:
Expand All @@ -7,7 +7,7 @@ on:
branches:
- master
schedule:
- cron: '0 0 * * 0'
- cron: '0 0 * * *' # see https://crontab.guru/ for more examples

permissions: # added using https://github.com/step-security/secure-workflows
contents: read
Expand All @@ -21,35 +21,37 @@ jobs:
env:
GO111MODULE: on
steps:
- name: Harden Runner
- name: 'Harden Runner'
uses: step-security/harden-runner@0a5820a2ec510d2521c1715d24860fc8cd06400a
with:
disable-sudo: true
egress-policy: audit
egress-policy: block
allowed-endpoints: >
github.com:443
api.github.com:443
proxy.golang.org:443
storage.googleapis.com:443
artifactcache.actions.githubusercontent.com:443
- name: Checkout Source
uses: actions/checkout@bf085276cecdb0cc76fbbe0687a5a0e786646936
- name: 'Checkout Source'
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b

- name: Run Gosec Security Scanner
uses: securego/gosec@f79c584dbbec47a01a69adbe3e2e96f54bbe74d6
- name: 'Run Gosec Security Scanner'
uses: securego/gosec@f9a8bf0152af9f9bda93de373ddb3762f0d12f14
with:
# we let the report trigger content trigger a failure using the GitHub Security features.
args: '-no-fail -fmt sarif -out gosec.sarif ./...'

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@896079047b4bb059ba6f150a5d87d47dde99e6e5
- name: 'Upload SARIF file'
uses: github/codeql-action/upload-sarif@899bf9c076bcf8a9b657dd1b6d6a8270f89f356a
with:
# Path to SARIF file relative to the root of the repository
sarif_file: gosec.sarif

- name: "Upload artifact"
- name: 'Upload artifact'
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
with:
name: Gosec SARIF file
path: gosec.sarif
retention-days: 5
retention-days: 7

12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ jobs:
contents: write # for goreleaser/goreleaser-action to create a GitHub release
runs-on: ubuntu-latest
steps:
- name: Harden Runner
- name: 'Harden Runner'
uses: step-security/harden-runner@0a5820a2ec510d2521c1715d24860fc8cd06400a
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
allowed-endpoints: >
github.com:443
- name: Checkout
uses: actions/checkout@bf085276cecdb0cc76fbbe0687a5a0e786646936
- name: 'Checkout'
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b

- name: Set up Go
uses: actions/setup-go@30c39bfe0c7338d0d8e99486938f1066b2f92108
- name: 'Set up Go'
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
with:
go-version: 1.19.x

- name: Run GoReleaser
- name: 'Run GoReleaser'
uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757
with:
distribution: goreleaser
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Scorecards supply-chain security
name: 'Scorecards supply-chain security'
on:
# Only the default branch is supported.
branch_protection_rule:
schedule:
# Weekly on Saturdays.
- cron: '30 1 * * 6'
- cron: '30 1 * * 6' # see https://crontab.guru/ for more examples
push:
branches: [ main, master ]

Expand All @@ -13,7 +13,7 @@ permissions: read-all

jobs:
analysis:
name: Scorecards analysis
name: 'Scorecards analysis'
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
Expand All @@ -24,7 +24,7 @@ jobs:
contents: read

steps:
- name: Harden Runner
- name: 'Harden Runner'
uses: step-security/harden-runner@0a5820a2ec510d2521c1715d24860fc8cd06400a
with:
disable-sudo: true
Expand All @@ -42,7 +42,7 @@ jobs:
- name: "Checkout code"
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
with:
persist-credentials: false

Expand Down Expand Up @@ -74,6 +74,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@896079047b4bb059ba6f150a5d87d47dde99e6e5
uses: github/codeql-action/upload-sarif@899bf9c076bcf8a9b657dd1b6d6a8270f89f356a
with:
sarif_file: scorecards.sarif
11 changes: 11 additions & 0 deletions .run/go build vault4summon.go.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="go build vault4summon.go" type="GoApplicationRunConfiguration" factoryName="Go Application" nameIsGenerated="true">
<module name="vault4summon" />
<working_directory value="$PROJECT_DIR$" />
<parameters value="secret/hello#foo" />
<kind value="FILE" />
<directory value="$PROJECT_DIR$" />
<filePath value="$PROJECT_DIR$/vault4summon.go" />
<method v="2" />
</configuration>
</component>
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit adcba8c

Please sign in to comment.