Skip to content

Commit

Permalink
ci: add checkov ci check
Browse files Browse the repository at this point in the history
  • Loading branch information
kylesomers committed Jul 11, 2024
1 parent 917f4df commit d52237f
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 8 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/checkov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Checkov
on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
scan:
permissions:
contents: read

Check failure

Code scanning / checkov

Ensure top-level permissions are not set to write-all Error

Ensure top-level permissions are not set to write-all
security-events: write
actions: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkov GitHub Action
uses: bridgecrewio/checkov-action@v12
with:
output_format: sarif
output_file_path: results.sarif
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
if: success() || failure()
with:
sarif_file: results.sarif
4 changes: 4 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: "CodeQL"
on:
workflow_call:
push:
branches: main
pull_request:
branches: main
permissions:
contents: read
jobs:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# Runs security scans
# This workflow can be used as needed and is triggered manually to consolidate the security scans.

name: Security
on:
push:
branches:
- main
pull_request:
workflow_dispatch:

permissions:
contents: read
Expand All @@ -19,3 +16,6 @@ jobs:
codeql-analysis:
uses: ./.github/workflows/codeql-analysis.yml
secrets: inherit
checkov:
uses: ./.github/workflows/checkov.yml
secrets: inherit
8 changes: 5 additions & 3 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Reusable workflow that scans a repository for vulnerabilities using Trivy and uploads the results to the GitHub Security tab.
# Triggered by a workflow call event from the Security workflow.
name: Trivy Scan
on:
push:
branches:
- main
pull_request:
workflow_call:
jobs:
trivy_scan:
Expand All @@ -18,7 +20,7 @@ jobs:
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL'
severity: 'CRITICAL,HIGH'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
Expand Down

0 comments on commit d52237f

Please sign in to comment.