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

Cortex CLI pre-receive hooks

Integrate the Application Security secrets scanner as a pre-receive hook into your workflows to scan for errors before code is accepted into your repository.

Integrate the Cortex Cloud Application Security secrets scanner as pre-receive hook into your workflows installing the Cortex CLI. The hook runs on the remote server before changes are pushed, allowing you to enforce checks before code is accepted into version control.

Supported version control systems

Pre-receive hooks are supported for GitHub Enterprise, GitLab self-managed, and Bitbucket Data Center. To setup pre-receive hook on these platforms refer to Setup on third-party platforms below.

Pre-receive hook workflow setup

  1. Install the pre-receive hook.

Setup requirements

Prerequisites

Configure credentials

It is recommended to configure credentials for the Cortex Cloud Application Security Cortex CLI using a configuration file, instead of embedding them directly in the hook script.

  1. Create a directory:

    Note

    Make sure to create the directory under the home directory of the Linux user that runs the Git hooks. This user is typically not the root user.

  2. Configure credentials: Open the .cortex.yaml file in the ~/.cortexcli/ directory and add the following configuration parameters:

    • CORTEX_API_BASE_URL: <API base URL>

    • CORTEX_API_KEY_ID: < API key ID >

    • CORTEX_API_KEY: < API key>

Setup on third-party platforms

To set up the Cortex CLI as a pre-receive hook on supported third-party platforms, refer to the official vendor documentation:

Reference script

Use the script below as reference to extend or modify your existing pre-receive hooks in your VCS provider.

Last updated

Was this helpful?