Checking Policy Compliance with roxctl
Alauda Container Security provides the roxctl CLI to help you check deployment YAML files and container images for policy compliance. This guide explains how to use roxctl for these checks and interpret the results.
TOC
Prerequisites
-
Set the
ROX_ENDPOINTenvironment variable:Replace
<host:port>with the address of your Alauda Container Security Central instance.
Output Formats
When running roxctl deployment check or roxctl image check, you can specify the output format using the -o option. Supported formats are json, table, csv, and junit. If not specified, the default is table for deployment and image checks, and json for image scans.
Example
Output Options
The following table summarizes the available output options:
Example: Custom Headers and JSONPath
Checking Policy Compliance for Deployments
To check build-time and deploy-time policy violations in your deployment YAML files, run:
<yaml_filename>: Path to the deployment YAML file(s). You can specify multiple files by repeating the--fileflag.<cluster_namespace>: (Optional) Namespace for context. Default isdefault.<cluster_name_or_id>: (Optional) Cluster name or ID for context.--verbose: (Optional) Show additional information, such as RBAC permissions and network policies.
Note: Additional deployment information is included in JSON output, regardless of the
--verboseflag.
To force Alauda Container Security to re-pull image metadata and scan results, add the --force option.
Permission Requirement:
To check specific image scan results, your token must have bothreadandwritepermissions for theImageresource. The default Continuous Integration system role includes these permissions.
The deployment check validates:
- Configuration options in the YAML file (e.g., resource limits, privilege settings)
- Image aspects (e.g., components, vulnerabilities)
Checking Policy Compliance for Images
To check build-time policy violations in images, run:
To force Alauda Container Security to re-pull image metadata and scan results, add the --force option.
Permission Requirement:
To check specific image scan results, your token must have bothreadandwritepermissions for theImageresource. The default Continuous Integration system role includes these permissions.
Viewing Image Scan Results
To view the components and vulnerabilities found in an image in JSON format, run:
To force Alauda Container Security to re-pull image metadata and scan results, add the --force option.
Permission Requirement:
To check specific image scan results, your token must have bothreadandwritepermissions for theImageresource. The default Continuous Integration system role includes these permissions.