GitHub Actions
Integrate Cortex Cloud Application Security with GitHub Actions to allow dynamic, automated, and context-specific scans within your development workflow. This includes continuous scanning of your workflows whenever changes are pushed or triggered, integrating security checks, and detecting issues as soon as they are introduced.
Prerequisite
Before you begin:
User permissions: Ensure the user performing the integration has permissions to edit pipeline configurations (such as YAML files) and manage secrets/credentials within the CI platform to store the Cortex Cloud API key securely
Onboarding steps
On the Cortex Cloud console:
Navigate to Settings → Data Sources & Integrations → + Add New.
Search for and hover over GitHub Actions, and click Add, or Add Another Instance if an instance is already onboarded.
On the Add Environment Variables step of the wizard.
Select Generate API key.
The API key secret and API key ID values are generated and populate their respective fields.
Optional: Change the default system architecture detected by the system.
Click Next.
Store your Cortex Cloud API key and API key ID in the GitHub Actions Secrets credential store.
Copy the CORTEX_API_KEY and CORTEX_API_KEY_ID variable names from their respective fields in the wizard.
Add the CORTEX_API_KEY and CORTEX_API_KEY_ID and their corresponding values as separate environment variables (secrets) to the GitHub Actions Secrets credential store.
Select Generate API key, then copy the CORTEX_API_KEY and CORTEX_API_KEY_ID values from their respective fields.
Add the CORTEX_API_KEY and CORTEX_API_KEY_ID and their corresponding values as separate environment variables (secrets) to the GitHub Actions Secrets credential store.
For more information on passing secrets as environment variables to GitHub Actions, refer to Using secrets in GitHub Actions.
4. Copy and paste the pre-populated sample code from the Configure Job step of the integration wizard into your GitHub Actions job configuration → Done
5. Ensure that the Connector Created Successfully message is displayed in the final step of the wizard, and click Close.
Verify integration
On the Data Sources & Integrations page, search for GitHub Actions in the search bar.
Hover over the resulting entry and click View Details.
Locate your instance and verify that the status is Connected.
Next steps
View scan results and mitigate issues.
GitHub Actions code scan workflow template
Use the GitHub Actions code scan workflow template to configure Cortex CLI code scanning in your workflow.
Manage the integration
Instance-level actions
Navigate to Settings → Data Sources & Integrations and search for GitHub Actions.
Select the matching result.
Locate your instance from the displayed list. Right-click it, then select an option:
Edit instance: Opens the onboarding wizard, where you can change the instance configuration.
Delete instance: Deletes the instance and previous scan data.
Copy entire row: Copies all row values to the clipboard.
Repository-level actions
Right-click a connected repository to Set Scanned Branches, run a manual scan through Scan Repository, modify the Scan Configuration, or Remove Repository. In Scan Configuration, you can toggle scanners and manage pull request behavior.
Locate your instance. See Instance-level actions.
Select the instance. A list of connected repositories appears.
Right-click a repository, select the required action, then select Save.
Last updated
Was this helpful?
