Run security scans (SAST, SCA, secrets, vulnerability scanning) in your GitHub Actions CI/CD pipeline. Scans are powered by HenKaiPan — a self-hosted security posture manager.
- Go to your HenKaiPan instance → Settings → API Tokens
- Click New Token, give it a name (e.g.
GitHub Actions) - Copy the token — it's shown only once
- In your GitHub repository, go to Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
HENKAIPAN_API_KEY, Value: paste your token
Create .github/workflows/security.yml:
name: HenKaiPan Security Scan
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
security-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run HenKaiPan Security Scan
uses: dyallab/henkaipan-action@v1
with:
api-url: https://app.henkaipan.com # or your self-hosted URL
api-key: ${{ secrets.HENKAIPAN_API_KEY }}
scanners: all
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}No project setup needed. When project-id is omitted, the project is auto-created from your repository name (owner/repo) on the first scan. All subsequent scans use the same project.
💡 Want explicit control? Set
project-id: ${{ secrets.HENKAIPAN_PROJECT_ID }}orauto-create-project: "false".
To get scan results posted as comments on your Pull Requests, you need two things:
- Pass
GITHUB_TOKENas an environment variable (as shown above) - Grant
pull-requests: writepermission to the workflow:
jobs:
security-scan:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # required for PR comments
steps:
- uses: actions/checkout@v4
- name: Run HenKaiPan Security Scan
uses: dyallab/henkaipan-action@v1
with:
api-url: https://app.henkaipan.com
api-key: ${{ secrets.HENKAIPAN_API_KEY }}
project-id: your-project-uuid
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}PR comments are posted automatically on pull_request events. The action also writes results to the GitHub Actions Summary tab for all event types (push, manual, etc).
| Input | Required | Default | Description |
|---|---|---|---|
api-url |
Yes | — | Base URL of your HenKaiPan instance |
api-key |
Yes | — | API token (stored as a GitHub Secret) |
project-id |
No | (auto) | UUID of the project to scan. If omitted, the project is auto-created from the repo name |
auto-create-project |
No | true |
When project-id is empty, auto-create a project using the repo name (owner/repo). Set to "false" to require an explicit project-id |
scanners |
No | all |
Comma-separated list or pack (all, sast, sca, secrets, vuln, containers) |
fail-on-severity |
No | (none) | Exit code 1 if findings ≥ severity (critical, high, medium, low) |
scan-branch |
No | current branch | Git branch to scan |
post-pr-comment |
No | true |
Post a summary comment to the GitHub Pull Request with scan results |
cf-access-client-id |
No | — | Cloudflare Access Service Token Client ID (for instances behind a Cloudflare Tunnel) |
cf-access-client-secret |
No | — | Cloudflare Access Service Token Client Secret (for instances behind a Cloudflare Tunnel) |
| Pack | Scanners |
|---|---|
all |
semgrep, trivy, gitleaks, grype, nuclei |
sast |
semgrep |
sca |
trivy, grype |
secrets |
gitleaks |
vuln |
grype, nuclei |
containers |
trivy, grype |
To specify individual scanners: scanners: semgrep,trivy,gitleaks
| Output | Description |
|---|---|
scan-id |
Comma-separated scan IDs |
finding-count |
Total findings |
finding-critical |
Critical findings count |
finding-high |
High findings count |
finding-medium |
Medium findings count |
finding-low |
Low findings count |
- uses: actions/checkout@v4
- name: Run HenKaiPan Security Scan
uses: dyallab/henkaipan-action@v1
with:
api-url: https://app.henkaipan.com
api-key: ${{ secrets.HENKAIPAN_API_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}The project is auto-created from the repo name on the first run. All subsequent runs use the same project.
- name: Run HenKaiPan Security Scan
uses: dyallab/henkaipan-action@v1
with:
api-url: https://app.henkaipan.com
api-key: ${{ secrets.HENKAIPAN_API_KEY }}
project-id: ${{ secrets.HENKAIPAN_PROJECT_ID }}
scanners: all
fail-on-severity: high- name: Run SAST Scan
uses: dyallab/henkaipan-action@v1
with:
api-url: https://app.henkaipan.com
api-key: ${{ secrets.HENKAIPAN_API_KEY }}
project-id: ${{ secrets.HENKAIPAN_PROJECT_ID }}
scanners: sast
fail-on-severity: mediumFor HenKaiPan behind a VPN or internal network, use a self-hosted runner on the same network:
jobs:
security-scan:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Run HenKaiPan Security Scan
uses: dyallab/henkaipan-action@v1
with:
api-url: http://10.0.0.5:8080
api-key: ${{ secrets.HENKAIPAN_API_KEY }}
project-id: your-project-uuid
scanners: allFor HenKaiPan behind a Cloudflare Tunnel with Access policies, authenticate via a Service Token:
- In Cloudflare Zero Trust → Access → Service Auth → create a Service Token
- Copy the Client ID and Client Secret
- Add them as GitHub secrets (e.g.
CF_CLIENT_IDandCF_CLIENT_SECRET) - In Cloudflare Access → your app → add a policy that requires the Service Token
- name: Run HenKaiPan Security Scan
uses: dyallab/henkaipan-action@v1
with:
api-url: https://henkaipan.internal.yourdomain.com
api-key: ${{ secrets.HENKAIPAN_API_KEY }}
project-id: ${{ secrets.HENKAIPAN_PROJECT_ID }}
scanners: all
cf-access-client-id: ${{ secrets.CF_CLIENT_ID }}
cf-access-client-secret: ${{ secrets.CF_CLIENT_SECRET }}The action automatically adds CF-Access-Client-Id and CF-Access-Client-Secret headers to every API request when both values are provided.
By default, the action posts a comment to the PR with findings summary. To disable:
- name: Run HenKaiPan Security Scan
uses: dyallab/henkaipan-action@v1
with:
api-url: https://app.henkaipan.com
api-key: ${{ secrets.HENKAIPAN_API_KEY }}
project-id: ${{ secrets.HENKAIPAN_PROJECT_ID }}
scanners: all
post-pr-comment: "false"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}In addition to PR comments, the action writes scan results to the Actions Summary tab (visible in the GitHub Actions run page). This works for all event types — push, pull_request, workflow_dispatch, etc.
No extra configuration needed — it uses the built-in $GITHUB_STEP_SUMMARY environment variable.
- Never hardcode API tokens in workflow files — use GitHub Secrets
- Create tokens with minimal scope — project-scoped tokens can only trigger scans for that project
- Tokens are shown only once at creation time — store them immediately
- Rotate tokens regularly (Settings → API Tokens → Revoke old → Create new)
- For private networks, ensure the runner has access to the HenKaiPan instance
Q: I don't have a project-id. Can I still use the action?
A: Yes! From v1.5.0+, project-id is optional. The action auto-creates a project named after your repository (owner/repo) on the first scan. All subsequent scans reuse the same project.
Q: How do I find the auto-created project?
A: Log in to your HenKaiPan instance → Projects. The project is named after your GitHub repository (owner/repo). You can copy its UUID from the project settings and use it as project-id in future workflows for explicit control.
Q: Can I disable auto-creation?
A: Yes. Set auto-create-project: "false" in your workflow. When disabled, you must provide an explicit project-id or the action will fail.
Q: The scan keeps timing out.
A: Default max wait is 20 minutes. For large repos, consider using scanners: semgrep,trivy instead of all, or increase the worker pool size on your HenKaiPan instance.
Q: The action fails with "token is not scoped to this project".
A: The token was created with a specific project scope and you're trying to scan a different project. Create a new token without a project scope, or use a token scoped to the correct project.
Q: Can I use this for GitLab CI / Jenkins / CircleCI?
A: Yes! The action is just a Docker container. Any CI system that can run a Docker container can use it. See the CI/CD Integration docs for examples.
Q: How do I see the full scan results?
A: Log in to your HenKaiPan instance → Scans → select the scan ID. The action outputs scan-id so you can reference them in follow-up steps.
Q: Can I block merges based on findings?
A: Yes. Set fail-on-severity to the minimum severity that should block. For example, critical will exit with code 1 only if critical findings exist.
| Version | Description |
|---|---|
v1 |
Latest stable release |
v1.0.0 |
Pin to specific version |
@main |
Bleeding edge (not recommended) |
Recommend pinning to v1 or a specific tag (v1.0.0) in production.
The action is a Docker container. You can also run it manually:
docker run \
-e HENKAIPAN_API_URL=https://app.henkaipan.com \
-e HENKAIPAN_API_KEY=your-token \
-e HENKAIPAN_SCANNERS=all \
dyallab/henkaipan-action:v1Or with arguments (all 10 positional args):
docker run \
dyallab/henkaipan-action:v1 \
"https://app.henkaipan.com" "hkp_your_token" "" "all" "critical" "" "" "" "" "true"Positional args:
api-url api-key project-id scanners fail-on-severity scan-branch post-pr-comment cf-client-id cf-client-secret auto-create-project
MIT — see LICENSE