Configuration Overrides
ASH supports runtime configuration overrides through the --config-overrides CLI parameter. This allows you to modify configuration values without editing the configuration file.
Basic Usage
You can specify multiple overrides by using the parameter multiple times:
ash \
--config-overrides 'reporters.cloudwatch-logs.options.aws_region=us-west-2' \
--config-overrides 'global_settings.severity_threshold=LOW'
Supported Value Types
The configuration override system automatically converts values to appropriate types:
- Strings:
'key=value' - Numbers:
'key=123'or'key=3.14' - Booleans:
'key=true'or'key=false' - Null:
'key=null'or'key=none' - Lists:
'key=[item1, item2, item3]'or'key=["item1", "item2", "item3"]' - Dictionaries:
'key={"subkey1": "value1", "subkey2": "value2"}'
Advanced Features
List Append Mode
You can append to existing lists by adding a + at the end of the key path:
# Add a new plugin module without replacing existing ones
ash --config-overrides 'ash_plugin_modules+=["my_ash_plugins"]'
Complex Structures
For complex structures, you can use JSON syntax:
# Add a new ignore path
ash --config-overrides 'global_settings.ignore_paths+=[{"path": "build/", "reason": "Generated files"}]'
Examples
-
Change severity threshold:
-
Enable a specific scanner:
-
Configure AWS region for CloudWatch Logs reporter:
-
Replace the list of plugin modules:
-
Add a plugin module to the existing list:
-
Configure multiple scanner options:
Configuration Management
ASH provides several ways to manage your configuration:
Configuration File
ASH uses YAML configuration files by default. The standard location is .ash/.ash.yaml in your project directory. You can also use JSON format with .ash/.ash.json.
A basic configuration file looks like this:
# yaml-language-server: $schema=https://raw.githubusercontent.com/awslabs/automated-security-helper/refs/heads/main/automated_security_helper/schemas/AshConfig.json
project_name: my-project
global_settings:
severity_threshold: MEDIUM
ignore_paths:
- path: 'tests/test_data'
reason: 'Test data only'
scanners:
bandit:
enabled: true
options:
confidence_level: high
reporters:
markdown:
enabled: true
options:
include_detailed_findings: true
JSON Schema Support
ASH provides a JSON schema for configuration files, which enables validation and auto-completion in compatible editors. Add this line at the top of your YAML file:
# yaml-language-server: $schema=https://raw.githubusercontent.com/awslabs/automated-security-helper/refs/heads/main/automated_security_helper/schemas/AshConfig.json
Configuration Commands
ASH provides several commands to manage your configuration:
Initialize a Configuration
Create a new configuration file:
This creates a default configuration file at .ash/.ash.yaml.
View Current Configuration
View the current configuration:
You can also apply overrides when viewing the configuration:
Update Configuration
Update an existing configuration file:
ash config update --set 'scanners.bandit.enabled=false' --set 'global_settings.severity_threshold=LOW'
You can use the same syntax as --config-overrides, including list operations:
# Add a new ignore path
ash config update --set 'global_settings.ignore_paths+=[{"path": "build/", "reason": "Generated files"}]'
# Preview changes without writing to file
ash config update --set 'scanners.semgrep.enabled=false' --dry-run
Validate Configuration
Validate your configuration file:
You can also validate with overrides:
Custom Plugins
You can add custom plugins to ASH by specifying them in the ash_plugin_modules list.
The top-level package must be inside ASH's plugin namespace: either under
automated_security_helper., or a top-level package whose name ends in ash_plugins
(my_ash_plugins, acme_ash_plugins). A module outside that namespace is skipped with
a warning rather than imported, so a name like my_plugins silently registers nothing.
Or using the override:
Notes
- Configuration overrides are applied after loading the configuration file
- Overrides work with both default and explicit configurations
- An override that cannot be parsed, or that produces a configuration failing
validation, stops the run with exit code 3 (
invalid config). Nothing is scanned, because continuing would mean scanning with settings you did not choose. Note that a top-level key ASH does not recognise is still ignored rather than rejected, for compatibility with configuration files written against other ASH versions. - For complex values, use valid JSON syntax
- Environment variables can be referenced in YAML configuration files using
!ENV ${VAR_NAME:default_value}syntax.VAR_NAMEmust begin withASH_, or be one ofAWS_REGION,AWS_DEFAULT_REGIONorAWS_PROFILE. A reference to any other name is left in the configuration exactly as written and a warning names it; ASH does not read the variable. The names are matched exactly, so write them in upper case.
ASH reads the configuration file it finds in the directory it is scanning, so
which variables that file may name is ASH's decision rather than the file's.
To reference a variable of your own, give it an ASH_ prefix — ASH_MY_BUCKET
rather than MY_BUCKET — and set it under that name wherever you run ASH.
A reference with no default, ${VAR_NAME}, has never resolved and still does
not; write ${VAR_NAME:default_value}. A reference must also be the whole
value, not part of a longer string.