Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/seckit-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# SecKit security scan - portable drop-in for any repo.
#
# Runs the full SecKit flow in CI: `seckit install` to provision the scanners,
# then `seckit scan` over the checked-out code, and publishes the markdown
# report as a build artifact.
#
# Copy this file into any repo's .github/workflows/. It clones SecKit at run
# time, so the only thing the target repo needs is this one file. Inside the
# SecKit repo itself you can drop the "Get SecKit" step and call ./seckit.sh.
#
# Notes:
# - GitHub-hosted ubuntu runners ship Homebrew, which `seckit install` uses.
# The install step is the slow one (a few minutes); cache or pin if it bites.
# - gitleaks needs full git history, hence fetch-depth: 0.
# - The scan is soft-fail by default (findings -> warning + artifact, not a
# red build). Flip the "Gate" step to `exit 1` to block merges on findings.
# - socket is skipped (it needs `socket login`); drop --skip=socket to include.
name: seckit-scan

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

env:
SECKIT_REPORT_DIR: ${{ github.workspace }}/seckit-reports

jobs:
seckit:
name: seckit install + scan
runs-on: ubuntu-latest
steps:
- name: Checkout (full history for gitleaks)
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
fetch-depth: 0

- name: Get SecKit
run: git clone --depth 1 https://github.com/segraef/sec-kit.git "$RUNNER_TEMP/sec-kit"
Comment on lines +42 to +43

- name: Install scanners (seckit install)
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" 2>/dev/null || true
bash "$RUNNER_TEMP/sec-kit/seckit.sh" install --all -y
Comment on lines +46 to +48

- name: Scan (seckit scan)
id: scan
continue-on-error: true
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" 2>/dev/null || true
bash "$RUNNER_TEMP/sec-kit/seckit.sh" scan "$GITHUB_WORKSPACE" --skip=socket

- name: Publish report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: seckit-report
path: ${{ env.SECKIT_REPORT_DIR }}/*.md
if-no-files-found: warn

- name: Gate
if: steps.scan.outcome == 'failure'
run: |
echo "::warning::SecKit reported findings - download the seckit-report artifact to triage."
Comment on lines +65 to +68
# To block merges on findings instead, replace the line above with:
# exit 1
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ![AzureIcon] ![BashIcon] ![PowershellIcon] Scripts

[![Scanned with SecKit](https://raw.githubusercontent.com/segraef/sec-kit/main/docs/media/badge.svg)](https://github.com/segraef/sec-kit)

A collection of automation scripts across PowerShell, Bash, Python and JavaScript for Azure, DevOps and general infrastructure tasks.

## Repository structure
Expand Down
Loading