The AccuKnox SAST GitHub Action seamlessly integrates Static Application Security Testing (SAST) into your CI/CD workflows. It leverages SonarQube to analyze source code for security vulnerabilities and uploads findings to the AccuKnox Console, ensuring comprehensive security insights.
β
Automated Code Security Analysis β Detects security vulnerabilities using SonarQube.
β
Seamless CI/CD Integration β Easily integrates into GitHub workflows.
β
Centralized Security Insights β Uploads findings to AccuKnox Console.
β
Quality Gate Enforcement β Blocks insecure code from merging.
β
Customizable Parameters β Configure project-specific security settings.
Before using this GitHub Action, ensure the following:
1οΈβ£ An AccuKnox Account β Required for accessing the AccuKnox Console.
2οΈβ£ SonarQube Setup β A working SonarQube instance for static analysis.
3οΈβ£ GitHub Repository with Actions Enabled β Required to run workflows.
4οΈβ£ AccuKnox API Token & Tenant ID β Required for authentication (see Token Generation).
1οΈβ£ Get SonarQube project details and credentials from the SonarQube instance 2οΈβ£ Store Securely β Copy and securely store these credentials for workflow usage.
To authenticate with AccuKnox Console, retrieve the required credentials from the AccuKnox Console:
1οΈβ£ Go to Settings β Navigate to the Tokens section in the AccuKnox Console.
2οΈβ£ Create a New Token β Click on Create Token to generate accuknox_token.
3οΈβ£ Store Securely β Copy and securely store these credentials for workflow usage.
Create a workflow file .github/workflows/accuknox-sast.yml and add the following configuration:
name: AccuKnox SAST Workflow
on:
push:
branches:
- main
jobs:
sast-scan:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run AccuKnox SAST
uses: accuknox/[email protected]
with:
skip_sonar_scan: false
sonar_project_key: ${{ secrets.SONAR_PROJECT_KEY }}
sonar_token: ${{ secrets.SONAR_TOKEN }}
sonar_host_url: ${{ secrets.SONAR_HOST_URL }}
sonar_organization_id: ${{ secrets.SONAR_ORG_ID }}
accuknox_endpoint: ${{ secrets.ACCUKNOX_ENDPOINT }}
accuknox_token: ${{ secrets.ACCUKNOX_TOKEN }}
accuknox_label: ${{ secrets.ACCUKNOX_LABEL }}
soft_fail: false| Input Value | Description | Optional/Required | Default Value |
|---|---|---|---|
sonar_token |
Personal access token for authenticating with SonarQube. | Required | None |
sonar_host_url |
URL of the SonarQube server to run the SAST. | Required | None |
accuknox_endpoint |
AccuKnox API endpoint URL to upload the scan results. | Required | None |
accuknox_token |
Token for authenticating with AccuKnox API. | Required | None |
accuknox_label |
Label in AccuKnox SaaS for tagging scan results. | Required | None |
sonar_project_key |
Project key in SonarQube for identifying the project. | Required | None |
sonar_organization_id |
Organisation ID for SonarQube (For cloud user only). | Optional | None |
skip_sonar_scan |
Skip SonarQube scan, for advanced users | Optional | false |
soft_fail |
Do not return an error code if there are failed checks. | Optional | false |
- SonarQube scans your repositoryβs source code for vulnerabilities.
- The AccuKnox SAST GitHub Action formats the scan results for better security insights.
- The scan results are automatically sent to AccuKnox Console for centralized security tracking.
- The pipeline fails if security issues exceed the defined threshold, preventing insecure code from merging.
- Adjust the quality gate settings to allow lower-severity issues.
- Use SonarQubeβs exclusion rules to filter out non-critical findings.
- Ensure your API tokens are correctly set in GitHub Secrets.
- Regenerate the token from the AccuKnox Console if needed.
- Regular Scans β Automate scanning on every pull request & deployment.
- Enforce Policies β Set quality gates to prevent high-risk vulnerabilities.
- Least Privilege Access β Store secrets securely in GitHub Secrets.
π Read More: AccuKnox Docs
π§ Contact Support: [email protected]
The AccuKnox SAST GitHub Action enables teams to detect vulnerabilities early, enforce security best practices, and seamlessly integrate security testing into CI/CD pipelines.
πΉ Enhance Your DevSecOps Pipeline with AccuKnox SAST β Start Today! π