TOC
title: Checking Policies with roxctl description: Learn how to evaluate deployments and images against policies by using roxctl in Alauda Security Service. weight: 10PrerequisitesOutput FormatsExampleOutput OptionsExample: Custom Headers and JSONPathChecking Policies for DeploymentsChecking Policies for ImagesViewing Image Scan Resultstitle: Checking Policies with roxctl description: Learn how to evaluate deployments and images against policies by using roxctl in Alauda Security Service. weight: 10
Checking Policies with roxctl
Alauda Security Service provides the roxctl CLI to help you evaluate deployment YAML files and container images against the current policy set in Central. Use these commands in CI, pre-deployment checks, and troubleshooting workflows when you want results without navigating the web console.
Prerequisites
-
Set the
ROX_ENDPOINTenvironment variable:Replace
<host:port>with the address of your Alauda Security Service 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 Policies 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 Security Service 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 evaluates:
- Configuration options in the YAML file (e.g., resource limits, privilege settings)
- Image aspects (e.g., components, vulnerabilities)
Checking Policies for Images
To check build-time policy violations in images, run:
To force Alauda Security Service 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 Security Service 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.