Skip to content

Commit

Permalink
ci(.github/action): add checkov-scan github action (#141)
Browse files Browse the repository at this point in the history
* ci(.github/action): add checkov scan github action

* ci(.github/action): delete unnecessary step in the checkov-scan github action

* ci(.github/action): delete unnecessary input in the checkov-scan github action

* ci(.github/action): set SHA of checkov-action in the checkov-scans action
  • Loading branch information
maksym-shynkarenko authored Mar 18, 2024
1 parent bade3ff commit 3111350
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/actions/checkov-scans-v1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# checkov-scans-v1

A GitHub Action to run [Checkov scans](https://github.com/bridgecrewio/checkov-action/tree/v12#readme) and a result will be shown in Prisma Cloud.

## Inputs

| Name | Required | Description | Default |
| ------------------- | -------- | ----------------------- | ------- |
| `prisma-access-key` | Yes | Prisma Cloud access key | NA |
| `prisma-secret-key` | Yes | Prisma Cloud secret key | NA |
| `prisma-api-url` | Yes | Prisma Cloud API URL | NA |

## Example usage

```yaml
name: Checkov

on:
push:
branches:
- release
- main

jobs:
checkov-scan:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: dequelabs/axe-api-team-public/.github/actions/checkov-scans-v1@main
with:
prisma-access-key: ${{ secrets.PRISMA_ACCESS_KEY }}
prisma-secret-key: ${{ secrets.PRISMA_SECRET_KEY }}
prisma-api-url: ${{ secrets.PRISMA_URL }}
```
31 changes: 31 additions & 0 deletions .github/actions/checkov-scans-v1/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: checkov-scans
description: Checkov scans cloud infrastructure configurations to find misconfigurations before they're deployed and sends a result to Prisma Cloud.

inputs:
prisma-access-key:
description: Prisma Cloud access key
required: true
prisma-secret-key:
description: Prisma Cloud secret key
required: true
prisma-api-url:
description: Prisma Cloud API URL
required: true

runs:
using: 'composite'
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so follow-up steps can access it
- uses: actions/checkout@v4
# The checkov scan
- name: Run Prisma Cloud
id: prisma-cloud
uses: bridgecrewio/checkov-action@8b268e1e4d7e52a78ba9d86e2489fb09b8a340c3 # tag=v12.2690.0
with:
api-key: ${{ inputs.prisma-access-key }}::${{ inputs.prisma-secret-key }}
# CLI output to the console and md file
output_format: cli
framework: sca_package,github_actions,dockerfile,secrets
soft_fail_on: LOW
env:
PRISMA_API_URL: ${{ inputs.prisma-api-url }}

0 comments on commit 3111350

Please sign in to comment.