The ArmorCode Release Gate plugin for Jenkins enables security teams to enforce security requirements as part of the CI/CD pipeline. It provides a build step that polls ArmorCode's build validation endpoint to either "block" (fail the build) or "warn" (mark the build as unstable) based on security validation results from the ArmorCode platform.
The plugin also includes a job discovery feature that periodically scans for Jenkins jobs, sending their information to ArmorCode for monitoring and analysis. This allows for a comprehensive view of all jobs, not just those actively using the release gate.
- Enforce Security Gates: Integrate security validation directly into your CI/CD pipeline.
- Flexible Control: Choose to either block builds or mark them as unstable on failure.
- Job Discovery: Discover and monitor all Jenkins jobs within your instance.
- Broad Project Support: Works with Pipeline, Freestyle, and Multi-branch projects.
- Easy Configuration: Simple to set up global settings and credentials.
- Pipeline as Code: Use a simple script to integrate with your Jenkins Pipelines.
- UI Configuration: Configure Freestyle projects through the Jenkins UI.
- Manually download the
.hpiplugin file from the plugin's release page. - In Jenkins, navigate to Manage Jenkins > Plugins > Advanced settings.
- In the Deploy Plugin section, upload the downloaded
.hpifile. - Restart Jenkins to complete the installation.
Once installed, the ArmorCode Release Gate plugin will be available as a build step for Freestyle projects and in the Pipeline Syntax Snippet Generator.
- In Jenkins, go to Manage Jenkins > System.
- Scroll down to the ArmorCode Configuration section.
- Enter your ArmorCode instance URL in the ArmorCode Base URL field.
To securely store your ArmorCode API token, you need to create a Jenkins credential.
- Go to Manage Jenkins > Credentials.
- Select the
(global)domain and click Add Credentials. - Set the Kind to Secret text.
- Set the ID to
ARMORCODE_TOKEN. This is a required value. - Paste your ArmorCode API token into the Secret field.
- Click Create to save the credential.
The ArmorCode Release Gate plugin is compatible with Pipeline, Freestyle, and Multi-branch projects.
This method requires a script to be added to your Jenkins Pipeline project.
- In the ArmorCode platform, navigate to Manage > Integrations > Jenkins.
- Select the Jenkins Plugin option.
- Enter the required values, including Group, Subgroup, Environment, and Mode (block or warn). You can also select All Subgroups under a particular group if desired.
- Copy the generated Groovy script.
- In your Jenkins dashboard, create a new Pipeline project and paste the code into the script editor.
You can now run the pipeline, which will use the plugin for real-time validation.
pipeline {
agent any
stages {
stage('Build') {
steps {
script {
armorcodeReleaseGate(product: "<product>", "subProducts": ["<sub-product-1>","<sub-product-2>"], env: "Production", mode: "warn")
}
}
}
}
}
| Parameter | Required | Description |
|---|---|---|
product |
Yes | Identifier of the product in ArmorCode. |
subProduct |
Yes | Identifier of the sub-product (or group) in ArmorCode. |
env |
Yes | Deployment environment (e.g., Production, Staging, QA). |
mode |
No | Behavior if the security validation fails: block – Block the build on failure. warn – Mark as unstable but continues. Default: block. |
maxRetries |
No | Number of times to check status before failing. Default: 5. |
targetUrl |
No | Custom ArmorCode API endpoint (overrides global configuration). |
This method allows for direct plugin configuration without needing to write a script.
- Create a new Freestyle project in Jenkins.
- In the Build Steps section, click Add build step and select ArmorCode Release Gate.
- Enter the required details for Group, Subgroup, and Environment.
- In the Advanced settings, you can customize the Max Retries, choose the Mode (Block or Warn), and define a Target URL if needed.
- Click Apply, then Save.
- Click Build Now and check the console logs for validation results.
The ArmorCode Jenkins Plugin allows you to discover and monitor all Jenkins jobs within an instance.
To enable discovery in Jenkins:
- Go to Manage Jenkins > System.
- Scroll down to the ArmorCode Configuration section.
- Check the Enable Discovery checkbox.
- You can update the Discovery Schedule (a cron expression) to determine how often the list of Jenkins jobs is sent to ArmorCode.
This plugin is licensed under the MIT License.