CLI
Usage
Scanner provides a Python CLI for validating and running tests on YAML files to aid in writing detection rules.
To install the Scanner CLI:
You will need to provide the API URL of your Scanner instance and an API key. Go to Settings > API Keys to find your API URL and API key.
You can either set these values as environment variables:
or provide them as arguments to the CLI:
Validate detection rule
To validate files:
To validate directories:
Only YAML files with the correct schema header will be validated. Multiple files or directories can be provided. To recursively search through directories, use the recursive flag -r
.
Example
Run detection rule tests
To run detection rule tests on files:
To run detection rule tests on directories:
This will only run tests on YAML files with the correct schema header. Multiple files or directories can be provided. To recursively search through directories, use the recursive flag -r
.
Example
Last updated