For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

  1. On the Cortex Cloud console:

    1. Navigate to SettingsData Sources & Integrations+ Add New.

    2. Search for and hover over GitHub Actions, and click Add, or Add Another Instance if an instance is already onboarded.

  2. On the Add Environment Variables step of the wizard.

    1. Select Generate API key.

      The API key secret and API key ID values are generated and populate their respective fields.

    2. Optional: Change the default system architecture detected by the system.

    3. Click Next.

  3. Store your Cortex Cloud API key and API key ID in the GitHub Actions Secrets credential store.

  1. Copy the CORTEX_API_KEY and CORTEX_API_KEY_ID variable names from their respective fields in the wizard.

  2. 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.

  1. Select Generate API key, then copy the CORTEX_API_KEY and CORTEX_API_KEY_ID values from their respective fields.

  2. 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.

Do not change the names of the environment variables provided by Cortex Cloud. They are required for proper integration and functionality.

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

The code is only a reference. Replace the placeholder values with your build-specific values.

5. Ensure that the Connector Created Successfully message is displayed in the final step of the wizard, and click Close.

Verify integration

  1. On the Data Sources & Integrations page, search for GitHub Actions in the search bar.

  2. Hover over the resulting entry and click View Details.

  3. 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

  1. Navigate to SettingsData Sources & Integrations and search for GitHub Actions.

  2. Select the matching result.

  3. 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.

  1. Locate your instance. See Instance-level actions.

  2. Select the instance. A list of connected repositories appears.

  3. Right-click a repository, select the required action, then select Save.

Last updated

Was this helpful?