Skip to content

devsecops workflow

devsecops workflow #26

Workflow file for this run

name: devsecops
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
inputs:
scan:
type: choice
options:
- gitleaks
- safety
- bandit
- zap
- all
gitleaks-config:
description: 'Path to a gitleaks configuration file'
required: false
type: string
gitleaks-version:
description: 'A particular Gitleaks version to use (e.g. 8.15.3, no v prefix) or use latest to always use the newest available version'
required: false
type: string
safety-args:
description: 'Any additional arguments to pass to Safety'
required: false
default: ''
type: string
bandit-exit-zero:
description: 'Exit with 0 even if issues are found'
required: false
type: boolean
default: true
bandit-path:
description: 'Path to the directory to scan'
required: false
type: string
default: '.'
bandit-level:
description: 'Report only issues of a given severity level or higher'
required: false
type: string
default: 'UNDEFINED'
bandit-confidence:
description: 'Report only issues of a given confidence level or higher'
required: false
type: string
default: 'UNDEFINED'
jobs:
build:
needs: secrets
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: |
ghcr.io/molocohrrr/vampi:ci
secrets:
if: (github.events.choice == 'gitleaks' || github.events.choice == 'all' ) || github.event_name == 'push' || github.event_name == 'pull_request'
uses: ./.github/workflows/gitleaks.yml
with:
gitleaks-config: ${{ github.event.inputs.gitleaks-config }}
gitleaks-version: ${{ github.event.inputs.gitleaks-version }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
sca:
if: (github.events.choice == 'safety' || github.events.choice == 'all' ) || github.event_name == 'push' || github.event_name == 'pull_request'
uses: ./.github/workflows/safety.yml
with:
args: ${{ github.event.inputs.args }}
secrets:
api-key: ${{ secrets.SAFETY_API_KEY }}
sast:
if: (github.events.choice == 'bandit' || github.events.choice == 'all' ) || github.event_name == 'push' || github.event_name == 'pull_request'
uses: ./.github/workflows/bandit.yml
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
with:
bandit-exit-zero: ${{ github.event.inputs.bandit-exit-zero || true }}
bandit-path: ${{ github.event.inputs.bandit-path || '.' }}
bandit-level: ${{ github.event.inputs.bandit-level || 'UNDEFINED' }}
bandit-confidence: ${{ github.event.inputs.bandit-confidence || 'UNDEFINED' }}
dast:
needs: build
uses: ./.github/workflows/zap.yml