The Cycode Command Line Interface (CLI) is an application you can install locally to scan your repositories for secrets, infrastructure as code misconfigurations, software composition analysis vulnerabilities, and static application security testing issues.
This guide walks you through both installation and usage.
Alternatively, you can get a Cycode Client ID and Client Secret Key by following the steps detailed in the Service Account Token and Personal Access Token pages, which contain details on getting these values.
Installation
The following installation steps are applicable to both Windows and UNIX / Linux operating systems.
[!NOTE]
The following steps assume the use of python3 and pip3 for Python-related commands; however, some systems may instead use the python and pip commands, depending on your Python environment’s configuration.
Install Cycode CLI
To install the Cycode CLI application on your local machine, perform the following steps:
[!NOTE]
This is the recommended method for setting up your local machine to authenticate with Cycode CLI.
Type the following command into your terminal/command line window:
cycode auth
A browser window will appear, asking you to log into Cycode (as seen below):
Enter your login credentials on this page and log in.
You will eventually be taken to the page below, where you'll be asked to choose the business group you want to authorize Cycode with (if applicable):
[!NOTE]
This will be the default method for authenticating with the Cycode CLI.
Click the Allow button to authorize the Cycode CLI on the selected business group.
Once completed, you'll see the following screen if it was selected successfully:
In the terminal/command line screen, you will see the following when exiting the browser window:
Successfully logged into cycode
Using the Configure Command
[!NOTE]
If you already set up your Cycode Client ID and Client Secret through the Linux or Windows environment variables, those credentials will take precedent over this method.
Type the following command into your terminal/command line window:
cycode configure
Enter your Cycode API URL value (you can leave blank to use default value).
Cycode API URL [https://api.cycode.com]: https://api.onpremise.com
Enter your Cycode APP URL value (you can leave blank to use default value).
Cycode ID Token []: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
If the values were entered successfully, you'll see the following message:
Successfully configured CLI credentials!
or/and
Successfully configured Cycode URLs!
If you go into the .cycode folder under your user folder, you'll find these credentials were created and placed in the credentials.yaml file in that folder.
The URLs were placed in the config.yaml file in that folder.
If your organization uses OIDC authentication, you can provide the ID token instead (or in addition):
export CYCODE_ID_TOKEN={your Cycode OIDC ID token}
On Windows
From the Control Panel, navigate to the System menu:
Next, click Advanced system settings:
In the System Properties window that opens, click the Environment Variables button:
Create CYCODE_CLIENT_ID and CYCODE_CLIENT_SECRET variables with values matching your ID and Secret Key, respectively. If you authenticate via OIDC, add CYCODE_ID_TOKEN with your OIDC ID token value as well:
Insert the cycode.exe into the path to complete the installation.
Install Pre-Commit Hook
Cycode's pre-commit and pre-push hooks can be set up within your local repository so that the Cycode CLI application will identify any issues with your code automatically before you commit or push it to your codebase.
[!NOTE]
pre-commit and pre-push hooks are not available for IaC scans.
Perform the following steps to install the pre-commit hook:
Installing Pre-Commit Hook
Install the pre-commit framework (Python 3.10 or higher must be installed):
pip3 install pre-commit
Navigate to the top directory of the local Git repository you wish to configure.
Create a new YAML file named .pre-commit-config.yaml (include the beginning .) in the repository’s top directory that contains the following:
Modify the created file for your specific needs. Use hook ID cycode to enable scan for Secrets. Use hook ID cycode-sca to enable SCA scan. Use hook ID cycode-sast to enable SAST scan. If you want to enable all scanning types, use this configuration:
Generate report. You will need to specify which report type to perform as SBOM.
status
Show the CLI status and exit.
Certificates and Proxies
By default, Cycode CLI verifies HTTPS connections against the CA bundle shipped with the CLI.
If your organization uses a proxy that inspects HTTPS traffic, or an on-premises installation with
its own CA, you have two options.
Option 1 — use the certificates already installed on the machine. If your CA is in the machine
certificate store (as is usually the case on a managed device), opt in:
export CYCODE_CLI_ENABLE_TRUSTSTORE=1
The CLI then verifies against the Windows certificate store, the macOS Keychain, or the system CA
directory on Linux, and no certificate paths need to be configured.
[!IMPORTANT]
This is opt-in on purpose. Trusting the machine store means trusting every root certificate
present on that machine, including any an administrator or malicious software installed. Enable it
when you know your machine's certificate store is one you trust.
Option 2 — point the CLI at a CA bundle file. Works without opting in:
Environment Variable
Description
REQUESTS_CA_BUNDLE
Path to a CA bundle file (.pem or .crt) to trust.
CURL_CA_BUNDLE
Alias for REQUESTS_CA_BUNDLE, honored when the latter is unset.
The two options combine: with CYCODE_CLI_ENABLE_TRUSTSTORE=1, certificates from
REQUESTS_CA_BUNDLE are trusted in addition to the machine store, not instead of it.
[!TIP]
Run any command with -v to see which trust source is in use, for example cycode -v status.
Notes:
On Windows, the CLI has always fallen back to the system certificate store when neither
REQUESTS_CA_BUNDLE nor CURL_CA_BUNDLE is set. That behavior is unchanged.
Proxies themselves are configured with the standard HTTP_PROXY, HTTPS_PROXY, and NO_PROXY
environment variables.
MCP Command [EXPERIMENT]
The Model Context Protocol (MCP) command allows you to start an MCP server that exposes Cycode's scanning capabilities to AI systems and applications. This enables AI models to interact with Cycode CLI tools via a standardized protocol.
[!TIP]
For the best experience, install Cycode CLI globally on your system using pip install cycode or brew install cycode, then authenticate once with cycode auth. After global installation and authentication, you won't need to configure CYCODE_CLIENT_ID and CYCODE_CLIENT_SECRET environment variables in your MCP configuration files.
Starting the MCP Server
To start the MCP server, use the following command:
cycode mcp
By default, this starts the server using the stdio transport, which is suitable for local integrations and AI applications that can spawn subprocesses.
Available Options
Option
Description
-t, --transport
Transport type for the MCP server: stdio, sse, or streamable-http (default: stdio)
-H, --host
Host address to bind the server (used only for non stdio transport) (default: 127.0.0.1)
-p, --port
Port number to bind the server (used only for non stdio transport) (default: 8000)
--help
Show help message and available options
MCP Tools
The MCP server provides the following tools that AI systems can use:
Tool Name
Description
cycode_secret_scan
Scan for hardcoded secrets
cycode_sca_scan
Scan for Software Composition Analysis (SCA) - vulnerabilities and license issues
cycode_iac_scan
Scan for Infrastructure as Code (IaC) misconfigurations
cycode_sast_scan
Scan for Static Application Security Testing (SAST) - code quality and security flaws
cycode_status
Get Cycode CLI version, authentication status, and configuration information
Each scan tool accepts two mutually exclusive input modes:
paths(preferred) — one or more file or directory paths that exist on disk. Directories are scanned recursively. The Cycode engine handles file discovery and filtering, just as cycode scan -t <type> path ./src does from the CLI.
files(fallback) — a dictionary mapping file paths to their full content as strings. Use this only when the files are not available on disk (e.g. in-memory edits not yet saved).
[!TIP]
Use paths whenever possible. Passing large files (like package-lock.json) as inline content can exceed token limits and slow down the AI client. With paths, the Cycode engine reads files directly from disk.
All scan tools return a JSON object that includes a "summary" field with a human-readable violation count (e.g. "Cycode found 3 violations: 1 CRITICAL, 2 HIGH.") in addition to the full "detections" array.
Usage Examples
Basic Command Examples
Start the MCP server with default settings (stdio transport):
cycode mcp
Start the MCP server with explicit stdio transport:
cycode mcp -t stdio
Start the MCP server with Server-Sent Events (SSE) transport:
cycode mcp -t sse -p 8080
Start the MCP server with streamable HTTP transport on custom host and port:
Using MCP with Cursor/VS Code/Claude Desktop/etc (mcp.json)
[!NOTE]
For EU Cycode environments, make sure to set the appropriate CYCODE_API_URL and CYCODE_APP_URL values in the environment variables (e.g., https://api.eu.cycode.com and https://app.eu.cycode.com).
Follow this guide to configure the MCP server in your VS Code/GitHub Copilot. Keep in mind that in settings.json, there is an mcp object containing a nested servers sub-object, rather than a standalone mcpServers object.
For SSE transport (start server first, then configure client):
# Start the MCP server in the background
cycode mcp -t sse -p 8000 &
# Configure in mcp.json
{
"mcpServers": {
"cycode": {
"url": "http://127.0.0.1:8000/sse"
}
}
}
For streamable HTTP transport:
# Start the MCP server in the background
cycode mcp -t streamable-http -H 127.0.0.2 -p 9000 &
# Configure in mcp.json
{
"mcpServers": {
"cycode": {
"url": "http://127.0.0.2:9000/mcp"
}
}
}
Advanced Configuration
Timeouts and Custom Certificates (Proxy Environments)
If long-running scans are being cut short by your MCP client, increase the tool call timeout.
Environment Variable
Description
MCP_TOOL_TIMEOUT
Timeout (in seconds) that MCP clients such as Claude and GitHub Copilot wait for a tool call to complete. Increase this if long-running scans are being cut off before they finish.
Behind a corporate proxy, set the certificate variables in the MCP server's env block. See
Certificates and Proxies for the options: either
CYCODE_CLI_ENABLE_TRUSTSTORE=1 to use the certificates already on the machine, or
REQUESTS_CA_BUNDLE pointing at a CA bundle file.
Example mcp.json configuration with a custom CA bundle and a longer timeout:
[!NOTE]
The MCP server requires proper Cycode CLI authentication to function. Make sure you have authenticated using cycode auth or configured your credentials before starting the MCP server.
Pre-authorizing Tools for Subagents (Claude Code)
When Claude Code delegates work to background subagents (e.g. to run scans in parallel), those subagents cannot display interactive permission prompts. If the Cycode tools have not been pre-approved, scans will fail silently in subagent contexts.
To pre-authorize the Cycode MCP tools so they work in all contexts including subagents, add them to the allowedTools list in your Claude Code settings (~/.claude/settings.json):
Once added, Claude Code will not prompt for approval when these tools are called, and they will work correctly inside subagents.
Troubleshooting MCP
If you encounter issues with the MCP server, you can enable debug logging to get more detailed information about what's happening. There are two ways to enable debug logging:
Using the -v or --verbose flag:
cycode -v mcp
Using the CYCODE_CLI_VERBOSE environment variable:
CYCODE_CLI_VERBOSE=1 cycode mcp
The debug logs will show detailed information about:
Server startup and configuration
Connection attempts and status
Tool execution and results
Any errors or warnings that occur
This information can be helpful when:
Diagnosing connection issues
Understanding why certain tools aren't working
Identifying authentication problems
Debugging transport-specific issues
MCP Configuration
Platform Command [BETA]
[!WARNING]
The platform command is in beta. Commands, arguments, and output formats are generated dynamically from the Cycode API spec and may change between releases without notice. Do not rely on them in production automation yet.
The cycode platform command exposes the Cycode platform's read APIs as CLI commands. It groups endpoints by resource (e.g. projects, violations, workflows) and turns each endpoint's parameters into typed CLI arguments and --option flags.
The OpenAPI spec is fetched from the Cycode API on first use and cached at ~/.cycode/openapi-spec.json for 24 hours. Unrelated commands (cycode scan, cycode status, etc.) do not trigger a fetch.
[!NOTE]
You must be authenticated (cycode auth or CYCODE_CLIENT_ID / CYCODE_CLIENT_SECRET environment variables) for cycode platform to discover and run commands. Other Cycode CLI commands work without authentication.
Discovering Commands
Because commands are generated from the spec, the source of truth for what's available is --help:
cycode platform --help # list all resource groups
cycode platform projects --help # list actions on a resource
cycode platform projects list --help # list options/arguments for an action
Platform Examples
# List projects with pagination
cycode platform projects list --page-size 25
# View a single project by ID
cycode platform projects view <project-id>
# Count violations across the tenant
cycode platform violations count
# Filter using query parameters (see `--help` for what each endpoint supports)
cycode platform violations list --severity CRITICAL
All output is JSON by default — pipe it through jq for ad-hoc filtering:
cycode platform projects list --page-size 100 | jq '.items[].name'
Platform Notes & Limitations
Read-only today. Only GET endpoints are exposed in this beta.
Spec-driven. Adding a new endpoint to the API surfaces it automatically the next time the cache is refreshed.
No bundled spec. The first cycode platform invocation after install (or after the 24h cache expires) performs a network fetch. On slow connections this first call may take a few seconds; subsequent calls are near-instant until the cache expires.
Override the cache TTL with CYCODE_SPEC_CACHE_TTL=<seconds>.
AI Guardrails [BETA]
AI Guardrails installs hooks into supported AI coding agents (Claude Code, Cursor, Copilot, Codex) so that
prompts, files the agent reads, and MCP tool arguments are scanned for secrets before they reach the model.
Data Collected by AI Guardrails
Scanning happens server-side, so the scanned content leaves the machine: the prompt text, the contents of
files the agent reads, and MCP tool arguments are sent to your Cycode tenant to be checked for secrets.
For GitHub Copilot, Claude Code, Codex and Cursor, PNG and JPEG images attached to a prompt are sent along with its text.
Each event is also reported with context about the developer and the machine, so a finding can be attributed
to the device and user it came from. Some of this is personal data:
Device identifiers — the machine's hostname and hardware serial number.
User identifiers — the email address of the user signed in to the AI coding agent, and the local
operating-system username.
Environment details — operating system and version, the AI agent, its version and the model in use,
the contents of the agent's MCP configuration files, and its enabled plugins.
The hardware serial number is cached in a local temporary file, readable only by the user who ran the
command, so repeated hook invocations don't re-query the hardware.
If collecting this data is not acceptable in your environment, do not install the guardrails hooks
(cycode ai-guardrails uninstall removes hooks that are already installed).
Scan Command
Running a Scan
The Cycode CLI application offers several types of scans so that you can choose the option that best fits your case. The following are the current options and commands available:
Option
Description
-t, --scan-type [secret|iac|sca|sast]
Specify the scan you wish to execute (secret/iac/sca/sast), the default is secret.
--show-secret BOOLEAN
Show secrets in plain text. See Show/Hide Secrets section for more details.
--soft-fail BOOLEAN
Run scan without failing, always return a non-error status code. See Soft Fail section for more details.
For every scan performed using the Cycode CLI, a report is automatically generated and its results are sent to Cycode. These results are tied to the relevant policies (e.g., SCA policies for Repository scans) within the Cycode platform.
To have the direct URL to this Cycode report printed in your CLI output after the scan completes, add the argument --cycode-report to your scan command.
All scan results from the CLI will appear in the CLI Logs section of Cycode. If you included the --cycode-report flag in your command, a direct link to the specific report will be displayed in your terminal following the scan results.
[!WARNING]
You must have the owner or admin role in Cycode to view this page.
The report page will look something like below:
Package Vulnerabilities Option
[!NOTE]
This option is only available to SCA scans.
To scan a specific package vulnerability of your local repository, add the argument --sca-scan package-vulnerabilities following the -t sca or --scan-type sca option.
In the previous example, if you wanted to only run an SCA scan on package vulnerabilities, you could execute the following:
[!NOTE]
This option is only available to SCA scans.
To scan a specific branch of your local repository, add the argument --sca-scan license-compliance followed by the name of the branch you wish to scan.
In the previous example, if you wanted to only scan a branch named dev, you could execute the following:
cycode scan -t sca --sca-scan license-compliance repository ~/home/git/codebase -b dev
Unmaintained Packages Option
[!NOTE]
This option is only available to SCA scans.
To scan only for unmaintained packages (packages whose OpenSSF ScorecardMaintained check is low, meaning little or no recent commit and issue activity), add the argument --sca-scan unmaintained-packages following the -t sca or --scan-type sca option.
[!NOTE]
Whether unmaintained packages are reported at all is controlled by your organization's policy. This option narrows what a scan reports; it cannot enable a policy that is turned off for your tenant.
In the previous example, if you wanted to only run an SCA scan on unmaintained packages, you could execute the following:
[!NOTE]
This option is only available to SCA scans.
To scan only for malicious packages (dependencies that a security advisory has identified as malware rather than merely vulnerable), add the argument --sca-scan malicious-packages following the -t sca or --scan-type sca option.
Malicious package violations are always reported as Critical, and carry no CVSS score and no fix version: the only remediation is removing the dependency.
[!NOTE]
Whether malicious packages are reported at all is controlled by your organization's policy. This option narrows what a scan reports; it cannot enable a policy that is turned off for your tenant.
In the previous example, if you wanted to only run an SCA scan on malicious packages, you could execute the following:
[!NOTE]
This option is only available to SCA scans.
When running an SCA scan, Cycode CLI automatically attempts to restore (generate) a dependency lockfile for each supported manifest file it finds. This allows scanning transitive dependencies, not just the ones listed directly in the manifest. To skip this step and scan only direct dependencies, use the --no-restore flag.
The following ecosystems support automatic lockfile restoration:
By default, Cycode continues scanning even if a file cannot be read (e.g. due to a permission error) or a dependency lockfile cannot be generated during an SCA scan. The failed item is skipped with a warning and the scan proceeds with the remaining files.
Use --stop-on-error to change this behaviour: the scan aborts immediately on the first such failure and reports the error.
This is useful in CI pipelines where a silent failure would produce an incomplete scan result. When --stop-on-error is triggered you can either fix the underlying issue or, for SCA restore failures specifically, add --no-restore to skip lockfile generation and scan direct dependencies only.
When --stop-on-error is used, the CLI distinguishes between scan errors and policy violations via exit codes:
Exit code
Meaning
0
Scan completed with no violations
1
Scan completed and violations were found
2
Scan aborted due to an error (only when --stop-on-error is set)
Repository Scan
A repository scan examines an entire local repository for any exposed secrets or insecure misconfigurations. This more holistic scan type looks at everything: the current state of your repository and its commit history. It will look not only for secrets that are currently exposed within the repository but previously deleted secrets as well.
To execute a full repository scan, execute the following:
cycode scan repository {{path}}
For example, if you wanted to scan a repository stored in ~/home/git/codebase, you could execute the following:
cycode scan repository ~/home/git/codebase
The following option is available for use with this command:
Option
Description
-b, --branch TEXT
Branch to scan, if not set scanning the default branch
Branch Option
To scan a specific branch of your local repository, add the argument -b (alternatively, --branch) followed by the name of the branch you wish to scan.
Given the previous example, if you wanted to only scan a branch named dev, you could execute the following:
cycode scan repository ~/home/git/codebase -b dev
Path Scan
A path scan examines a specific local directory and all the contents within it, instead of focusing solely on a GIT repository.
To execute a directory scan, execute the following:
cycode scan path {{path}}
For example, consider a scenario in which you want to scan the directory located at ~/home/git/codebase. You could then execute the following:
cycode scan path ~/home/git/codebase
Terraform Plan Scan
Cycode CLI supports Terraform plan scanning (supporting Terraform 0.12 and later)
Terraform plan file must be in JSON format (having .json extension)
If you just have a configuration file, you can generate a plan by doing the following:
Initialize a working directory that contains Terraform configuration file:
terraform init
Create Terraform execution plan and save the binary output:
terraform plan -out={tfplan_output}
Convert the binary output file into readable JSON:
terraform show -json {tfplan_output} > {tfplan}.json
[!NOTE]
Commit History Scan is not available for IaC scans.
The commit history scan command provides two main capabilities:
Full History Scanning: Analyze all commits in the repository history
Diff Scanning: Scan only the changes between specific commits
Secrets scanning can analyze all commits in the repository history because secrets introduced and later removed can still be leaked or exposed. For SCA and SAST scans, the commit history command focuses on scanning the differences/changes between commits, making it perfect for pull request reviews and incremental scanning.
A commit history scan examines your Git repository's commit history and can be used both for comprehensive historical analysis and targeted diff scanning of specific changes.
To execute a commit history scan, execute the following:
cycode scan commit-history {{path}}
For example, consider a scenario in which you want to scan the commit history for a repository stored in ~/home/git/codebase. You could then execute the following:
cycode scan commit-history ~/home/git/codebase
The following options are available for use with this command:
Option
Description
-r, --commit-range TEXT
Scan a commit range in this git repository, by default cycode scans all commit history (example: HEAD~1)
Commit Range Option (Diff Scanning)
The commit range option enables diff scanning – scanning only the changes between specific commits instead of the entire repository history.
This is particularly useful for:
Pull request validation: Scan only the changes introduced in a PR
Incremental CI/CD scanning: Focus on recent changes rather than the entire codebase
Feature branch review: Compare changes against main/master branch
Performance optimization: Faster scans by limiting scope to relevant changes
Commit Range Syntax
The --commit-range (-r) option supports standard Git revision syntax:
[!TIP]
For CI/CD pipelines, you can use environment variables like ${{ github.event.pull_request.base.sha }}..${{ github.sha }} (GitHub Actions) or $CI_MERGE_REQUEST_TARGET_BRANCH_SHA..$CI_COMMIT_SHA (GitLab CI) to scan only PR/MR changes.
Pre-Commit Scan
A pre-commit scan automatically identifies any issues before you commit changes to your repository. There is no need to manually execute this scan; configure the pre-commit hook as detailed under the Installation section of this guide.
After installing the pre-commit hook, you may occasionally wish to skip scanning during a specific commit. To do this, add the following to your git command to skip scanning for a single commit:
SKIP=cycode git commit -m <your commit message>`
The following options are available for use with this command:
Option
Description
-b, --base-ref TEXT
Git ref (commit, branch, or tag) to diff against; defaults to HEAD, matching the pre-commit hook behavior
--include-unstaged
Also scan unstaged changes to tracked files, not just what is staged; off by default
--path PATH
Optional path(s) to scope the diff scan to; repeatable; defaults to the entire working directory
Local Diff Scanning (IDE Integrations)
--base-ref and --include-unstaged turn pre-commit into a general-purpose local diff scan: comparing any commit (default HEAD) against your current working directory — including edits that aren't staged yet. This is intended for IDE plugins and other tools that need continuous, real-time feedback as you work, rather than the git hook flow. Combined with --include-unstaged, --path lets an IDE scope the scan to just the file currently open in the editor.
[!NOTE]
Local diff scanning (via these flags) is not available for IaC scans.
Scan everything currently changed (staged + unstaged) against the last commit:
cycode scan pre-commit --include-unstaged
Scan changes against a specific commit or branch:
cycode scan pre-commit --include-unstaged --base-ref main
Scan only a specific file (e.g., the file currently open in your IDE):
A pre-push scan automatically identifies any issues before you push changes to the remote repository. This hook runs on the client side and scans only the commits that are about to be pushed, making it efficient for catching issues before they reach the remote repository.
[!NOTE]
Pre-push hook is not available for IaC scans.
The pre-push hook integrates with the pre-commit framework and can be configured to run before any git push operation.
Installing Pre-Push Hook
To set up the pre-push hook using the pre-commit framework:
Install the pre-commit framework (if not already installed):
pip3 install pre-commit
Create or update your .pre-commit-config.yaml file to include the pre-push hooks:
A successful installation will result in the message: Pre-push installed at .git/hooks/pre-push.
Keep the pre-push hook up to date:
pre-commit autoupdate
How Pre-Push Scanning Works
The hook scans every commit being pushed, one commit at a time, so a secret added in one commit and removed in a later one is still caught. When installed through the pre-commit framework, the pushed range is taken from the framework: new commits since the remote branch for existing branches, and the commits not yet on the remote for new branches (all commits when pushing to an empty remote). When run from a hand-written .git/hooks/pre-push, the range is read from git's hook input, and new branches are scanned from their merge base with the default branch (see below).
Pushes with nothing to scan, such as tags, branch deletions, and up-to-date pushes, pass without a scan. If the hook cannot determine what is being pushed, it fails and blocks the push instead of passing silently.
The Cycode pre-push hooks set always_run: true and pass_filenames: false, because the scan covers the pushed commits rather than a list of files. Without always_run, the pre-commit framework skips the hook when the pushed commits add up to no changed files, such as a secret added in one commit and deleted in the next. Without pass_filenames: false, the framework passes changed file names the scan does not use, and on large pushes it splits them into batches and runs the full scan once per batch. If you define the hook yourself (for example, as a repo: local hook), set both options.
Smart Default Branch Detection
When run from a hand-written hook, the pre-push scan detects the default branch for merge base calculation using this priority order:
This smart detection ensures the pre-push hook works correctly regardless of whether your repository uses main, master, develop, or any other default branch name.
Skipping Pre-Push Scans
To skip the pre-push scan for a specific push operation, use:
SKIP=cycode-pre-push git push
Or to skip all pre-push hooks:
git push --no-verify
[!TIP]
The pre-push hook is triggered on git push command and scans only the commits that are about to be pushed, making it more efficient than scanning the entire repository.
Exclude Paths From Scans
You can use a .cycodeignore file to tell the Cycode CLI which files and directories to exclude from scans.
It works just like a .gitignore file. This helps you focus scans on your relevant code and prevent certain paths from triggering violations locally.
How It Works
Create a file named .cycodeignore in your workfolder.
List the files and directories you want to exclude, using the same patterns as .gitignore.
Place this file in the directory where you plan to run the cycode scan command.
[!WARNING]
Invalid files: If the .cycodeignore file contains a syntax error, the CLI scan will fail and return an error.
Ignoring paths vs. violations: This file is for excluding paths. It's different from the CLI's capability to ignore specific violations (for example, by using the --ignore-violation flag).
Supported Scanners
SAST
IaC (comming soon)
SCA (comming soon)
Scan Results
Each scan will complete with a message stating if any issues were found or not.
If no issues are found, the scan ends with the following success message:
Good job! No issues were found!!! 👏👏👏
If an issue is found, a violation card appears upon completion instead. In this case you should review the file in question for the specific line highlighted by the result message. Implement any changes required to resolve the issue, then execute the scan again.
Show/Hide Secrets
In the examples below, a secret was found in the file secret_test, located in the subfolder cli. The second part of the message shows the specific line the secret appears in, which in this case is a value assigned to googleApiKey.
Note how the example obscures the actual secret value, replacing most of the secret with asterisks. Scans obscure secrets by default, but you may optionally disable this feature to view the full secret (assuming the machine you are viewing the scan result on is sufficiently secure from prying eyes).
To disable secret obfuscation, add the --show-secret argument to any type of scan.
In the following example, a Path Scan is executed against the cli subdirectory with the option enabled to display any secrets found in full:
cycode scan --show-secret path ./cli
The result would then not be obfuscated.
Soft Fail
In normal operation the CLI will return an exit code of 1 when issues are found in the scan results. Depending on your CI/CD setup this will usually result in an overall failure. If you don't want this to happen, you can use the soft fail feature.
By adding the --soft-fail option to any type of scan, the exit code will be forced to 0 regardless of whether any results are found.
Example Scan Results
Secrets Result Example
╭─────────────────────────────────────────────────────────────── Hardcoded generic-password is used ───────────────────────────────────────────────────────────────╮
│ Violation 12 of 12 │
│ ╭─ 🔍 Details ───────────────────────────────────────╮ ╭─ 💻 Code Snippet ─────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ Severity 🟠 MEDIUM │ │ 34 }; │ │
│ │ In file /Users/cycodemacuser/NodeGoat/test/s │ │ 35 │ │
│ │ ecurity/profile-test.js │ │ 36 var sutUserName = "user1"; │ │
│ │ Secret SHA b4ea3116d868b7c982ee6812cce61727856b │ │ ❱ 37 var sutUserPassword = "Us*****23"; │ │
│ │ 802b3063cd5aebe7d796988552e0 │ │ 38 │ │
│ │ Rule ID 68b6a876-4890-4e62-9531-0e687223579f │ │ 39 chrome.setDefaultService(service); │ │
│ ╰────────────────────────────────────────────────────╯ │ 40 │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ 📝 Summary ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ A generic secret or password is an authentication token used to access a computer or application and is assigned to a password variable. │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
IaC Result Example
╭──────────── Enable Content Encoding through the attribute 'MinimumCompressionSize'. This value should be greater than -1 and smaller than 10485760. ─────────────╮
│ Violation 45 of 110 │
│ ╭─ 🔍 Details ───────────────────────────────────────╮ ╭─ 💻 Code Snippet ─────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ Severity 🟠 MEDIUM │ │ 20 BinaryMediaTypes: │ │
│ │ In file ...ads-copy/iac/cft/api-gateway/ap │ │ 21 - !Ref binaryMediaType1 │ │
│ │ i-gateway-rest-api/deploy.yml │ │ 22 - !Ref binaryMediaType2 │ │
│ │ IaC Provider CloudFormation │ │ ❱ 23 MinimumCompressionSize: -1 │ │
│ │ Rule ID 33c4b90c-3270-4337-a075-d3109c141b │ │ 24 EndpointConfiguration: │ │
│ │ 53 │ │ 25 Types: │ │
│ ╰────────────────────────────────────────────────────╯ │ 26 - EDGE │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ 📝 Summary ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ This policy validates the proper configuration of content encoding in AWS API Gateway. Specifically, the policy checks for the attribute │ │
│ │ 'minimum_compression_size' in API Gateway REST APIs. Correct configuration of this attribute is important for enabling content encoding of API responses for │ │
│ │ improved API performance and reduced payload sizes. │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
SCA Result Example
╭─────────────────────────────────────────────────────── [CVE-2019-10795] Prototype Pollution in undefsafe ────────────────────────────────────────────────────────╮
│ Violation 172 of 195 │
│ ╭─ 🔍 Details ───────────────────────────────────────╮ ╭─ 💻 Code Snippet ─────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ Severity 🟠 MEDIUM │ │ 26758 "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", │ │
│ │ In file /Users/cycodemacuser/Node │ │ 26759 "dev": true │ │
│ │ Goat/package-lock.json │ │ 26760 }, │ │
│ │ CVEs CVE-2019-10795 │ │ ❱ 26761 "undefsafe": { │ │
│ │ Package undefsafe │ │ 26762 "version": "2.0.2", │ │
│ │ Version 2.0.2 │ │ 26763 "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.2.tgz", │ │
│ │ First patched version Not fixed │ │ 26764 "integrity": "sha1-Il9rngM3Zj4Njnz9aG/Cg2zKznY=", │ │
│ │ Dependency path nodemon 1.19.1 -> │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │ undefsafe 2.0.2 │ │
│ │ Rule ID 9c6a8911-e071-4616-86db-4 │ │
│ │ 943f2e1df81 │ │
│ ╰────────────────────────────────────────────────────╯ │
│ ╭─ 📝 Summary ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ undefsafe before 2.0.3 is vulnerable to Prototype Pollution. The 'a' function could be tricked into adding or modifying properties of Object.prototype using │ │
│ │ a __proto__ payload. │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
SAST Result Example
╭───────────────────────────────────────────── [CWE-208: Observable Timing Discrepancy] Observable Timing Discrepancy ─────────────────────────────────────────────╮
│ Violation 24 of 49 │
│ ╭─ 🔍 Details ───────────────────────────────────────╮ ╭─ 💻 Code Snippet ─────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ Severity 🟠 MEDIUM │ │ 173 " including numbers, lowercase and uppercase letters."; │ │
│ │ In file /Users/cycodemacuser/NodeGoat/app │ │ 174 return false; │ │
│ │ /routes/session.js │ │ 175 } │ │
│ │ CWE CWE-208 │ │ ❱ 176 if (password !== verify) { │ │
│ │ Subcategory Security │ │ 177 errors.verifyError = "Password must match"; │ │
│ │ Language js │ │ 178 return false; │ │
│ │ Security Tool Bearer (Powered by Cycode) │ │ 179 } │ │
│ │ Rule ID 19fbca07-a8e7-4fa6-92ac-a36d15509 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │ fa9 │ │
│ ╰────────────────────────────────────────────────────╯ │
│ ╭─ 📝 Summary ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ Observable Timing Discrepancy occurs when the time it takes for certain operations to complete can be measured and observed by attackers. This vulnerability │ │
│ │ is particularly concerning when operations involve sensitive information, such as password checks or secret comparisons. If attackers can analyze how long │ │
│ │ these operations take, they might be able to deduce confidential details, putting your data at risk. │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Company Custom Remediation Guidelines
If your company has set custom remediation guidelines in the relevant policy via the Cycode portal, you'll see a field for “Company Guidelines” that contains the remediation guidelines you added. Note that if you haven't added any company guidelines, this field will not appear in the CLI tool.
Ignoring Scan Results
Ignore rules can be added to ignore specific secret values, specific SHA512 values, specific paths, and specific Cycode secret and IaC rule IDs. This will cause the scan to not alert these values. The ignoring rules are written and saved locally in the ./.cycode/config.yaml file.
[!WARNING]
Adding values to be ignored should be done with careful consideration of the values, paths, and policies to ensure that the scans will pick up true positives.
The following are the options available for the cycode ignore command:
Option
Description
--by-value TEXT
Ignore a specific value while scanning for secrets. See Ignoring a Secret Value for more details.
--by-sha TEXT
Ignore a specific SHA512 representation of a string while scanning for secrets. See Ignoring a Secret SHA Value for more details.
--by-path TEXT
Avoid scanning a specific path. Need to specify scan type. See Ignoring a Path for more details.
--by-rule TEXT
Ignore scanning a specific secret rule ID/IaC rule ID/SCA rule ID. See Ignoring a Secret or Iac Rule for more details.
--by-package TEXT
Ignore scanning a specific package version while running an SCA scan. Expected pattern - name@version. See Ignoring a Package for more details.
--by-cve TEXT
Ignore scanning a specific CVE while running an SCA scan. Expected pattern: CVE-YYYY-NNN.
-t, --scan-type [secret|iac|sca|sast]
Specify the scan you wish to execute (secret/iac/sca/sast). The default value is secret.
-g, --global
Add an ignore rule and update it in the global .cycode config file.
Ignoring a Secret Value
To ignore a specific secret value, you will need to use the --by-value flag. This will ignore the given secret value from all future scans. Use the following command to add a secret value to be ignored:
cycode ignore --by-value {{secret-value}}
In the example at the top of this section, the command to ignore a specific secret value is as follows:
cycode ignore --by-value h3110w0r1d!@#$350
In the example above, replace the h3110w0r1d!@#$350 value with your non-masked secret value. See the Cycode scan options for details on how to see secret values in the scan results.
Ignoring a Secret SHA Value
To ignore a specific secret SHA value, you will need to use the --by-sha flag. This will ignore the given secret SHA value from all future scans. Use the following command to add a secret SHA value to be ignored:
cycode ignore --by-sha {{secret-sha-value}}
In the example at the top of this section, the command to ignore a specific secret SHA value is as follows:
In the example above, replace the a44081db3296c84b82d12a35c446a3cba19411dddfa0380134c75f7b3973bff0 value with your secret SHA value.
Ignoring a Path
To ignore a specific path for either secret, IaC, or SCA scans, you will need to use the --by-path flag in conjunction with the -t, --scan-type flag (you must specify the scan type). This will ignore the given path from all future scans for the given scan type. Use the following command to add a path to be ignored:
cycode ignore -t {{scan-type}} --by-path {{path}}
In the example at the top of this section, the command to ignore a specific path for a secret is as follows:
In the example above, replace the ~/home/my-repo/config value with your path value.
Ignoring a Secret, IaC, SCA, or SAST Rule
To ignore a specific secret, IaC, SCA, or SAST rule, you will need to use the --by-rule flag in conjunction with the -t, --scan-type flag (you must specify the scan type). This will ignore the given rule ID value from all future scans. Use the following command to add a rule ID value to be ignored:
In the example above, replace the dc21bc6b-9f4f-46fb-9f92-e4327ea03f6b value with the rule ID you want to ignore.
Ignoring a Package
[!NOTE]
This option is only available to the SCA scans.
To ignore a specific package in the SCA scans, you will need to use the --by-package flag in conjunction with the -t, --scan-type flag (you must specify the sca scan type). This will ignore the given package, using the {{package_name}}@{{package_version}} formatting, from all future scans. Use the following command to add a package and version to be ignored:
In the example above, replace pyyaml with package name and 5.3.1 with the package version you want to ignore.
Ignoring via a config file
The applied ignoring rules are stored in the configuration file called config.yaml.
This file could be easily shared between developers or even committed to remote Git.
These files are always located in the .cycode folder.
The folder starts with a dot (.), and you should enable the displaying of hidden files to see it.
Path of the config files
By default, all cycode ignore commands save the ignoring rule to the current directory from which CLI has been run.
Example: running ignoring CLI command from /Users/name/projects/backend will create config.yaml in /Users/name/projects/backend/.cycode
The second option is to save ignoring rules to the global configuration files.
The path of the global config is ~/.cycode/config.yaml,
where ~ means user`s home directory, for example, /Users/name on macOS.
Saving to the global space could be performed with the -g flag of the cycode ignore command.
For example: cycode ignore -g --by-value test-value.
Proper working directory
It is incredibly important to place the .cycode folder and run CLI from the same place.
You should double-check it when working with different environments like CI/CD (GitHub Actions, Jenkins, etc.).
You can commit the .cycode folder to the root of your repository. In this scenario, you must run CLI scans from the repository root. If that doesn't fit your requirements, you could temporarily copy the .cycode folder to wherever you want and perform a CLI scan from this folder.
Structure ignoring rules in the config
It's important to understand how CLI stores ignored rules to be able to read these configuration files or even modify them without CLI.
Possible values of scanTypeName: iac, sca, sast, secret.
Possible values of ignoringType: paths, values, rules, packages, shas, cves.
[!WARNING]
Values for "ignore by value" are not stored as plain text!
CLI stores sha256 hashes of the values instead.
You should put hashes of the string when modifying the configuration file by hand.
A software bill of materials (SBOM) is an inventory of all constituent components and software dependencies involved in the development and delivery of an application.
Using this command, you can create an SBOM report for your local project or for your repository URI.
The following options are available for use with this command:
Option
Description
Required
Default
-f, --format [spdx-2.2|spdx-2.3|cyclonedx-1.4]
SBOM format
Yes
-o, --output-format [JSON]
Specify the output file format
No
json
--output-file PATH
Output file
No
autogenerated filename saved to the current directory
--include-vulnerabilities
Include vulnerabilities
No
False
--include-dev-dependencies
Include dev dependencies
No
False
The following commands are available for use with this command:
Command
Description
path
Generate SBOM report for provided path in the command
repository-url
Generate SBOM report for provided repository URI in the command
Repository
To create an SBOM report for a repository URI: cycode report sbom --format <sbom format> --include-vulnerabilities --include-dev-dependencies --output-file </path/to/file> repository_url <repository url>
To create an SBOM report for a path: cycode report sbom --format <sbom format> --include-vulnerabilities --include-dev-dependencies --output-file </path/to/file> path </path/to/project>
The path subcommand supports the following additional options:
Option
Description
--no-restore
Skip lockfile restoration and scan direct dependencies only. See Lock Restore Option for details.
--gradle-all-sub-projects
Run the Gradle restore command for all sub-projects (use from the root of a multi-project Gradle build).
--maven-settings-file
For Maven only, allows using a custom settings.xml file when building the dependency tree.
Import Command
Importing SBOM
A software bill of materials (SBOM) is an inventory of all constituent components and software dependencies involved in the development and delivery of an application.
Using this command, you can import an SBOM file from your file system into Cycode.
The following options are available for use with this command:
Option
Description
Required
Default
-n, --name TEXT
Display name of the SBOM
Yes
-v, --vendor TEXT
Name of the entity that provided the SBOM
Yes
-l, --label TEXT
Attach label to the SBOM
No
-o, --owner TEXT
Email address of the Cycode user that serves as point of contact for this SBOM