GitHub Action for Orca Shift Left Security
More info can be found in the official Orca Shift Left Security documentation
name: Sample Orca IaC Scan Workflow
on:
# Scan for each push event on your protected branch. If you have a different branch configured, please adjust the configuration accordingly by replacing 'main'.
push:
branches: ["main"]
# NOTE: To enable scanning for pull requests, uncomment the section below.
#pull_request:
#branches: [ "main" ]
# NOTE: To schedule a daily scan at midnight, uncomment the section below.
#schedule:
#- cron: '0 0 * * *'
jobs:
orca-iac_scan:
name: Orca IaC Scan
runs-on: ubuntu-latest
env:
PROJECT_KEY: <project key> # Set the desired project to run the cli scanning with
steps:
# Checkout your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v4
- name: Run Orca IaC Scan
uses: orcasecurity/shiftleft-iac-action@v1
with:
api_token: ${{ secrets.ORCA_SECURITY_API_TOKEN }}
project_key: ${{ env.PROJECT_KEY }}
path:
# scanning directories: ./terraform/ ./sub-dir/ and a file: ./Dockerfile
"terraform,sub-dir,other-sub-dir/Dockerfile"After scanning, the action will add the results as annotations in a pull request:
NOTE: Annotations can be disabled by setting the "show_annotation" input to "false"
If you have GitHub code scanning available you can use Orca Shift Left Security as a scanning tool
NOTE: Code scanning is available for all public repositories. Code scanning is also available in private repositories owned by organizations that use GitHub Enterprise Cloud and have a license for GitHub Advanced Security.
Configuration:
name: Scan and upload SARIF
push:
branches:
- main
jobs:
orca-iac_scan:
name: Orca IaC Scan
runs-on: ubuntu-latest
permissions:
security-events: write
env:
PROJECT_KEY: <project key> # Set the desired project to run the cli scanning with
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Run Orca IaC Scan
id: orcasecurity_iac_scan
uses: orcasecurity/shiftleft-iac-action@v1
with:
api_token: ${{ secrets.ORCA_SECURITY_API_TOKEN }}
project_key: ${{ env.PROJECT_KEY }}
path: <path to scan>
format: "sarif"
output: "results/"
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
if: ${{ always() && steps.orcasecurity_iac_scan.outputs.exit_code != 1 }}
with:
sarif_file: results/iac.sarifThe results list can be found on the security tab of your GitHub project and should look like the following image
An entry should describe the error and in which line it occurred



