Skip to content

Bug: ash report ignores config file — resolve_config returns default when source_dir is None #353

Description

@rafaelpereyra

The ash report subcommand silently ignores the configuration file (.ash.yaml) even when explicitly passed via -c. Settings like ash_plugin_modules defined in the config file have no effect.

Root Cause

In automated_security_helper/config/resolve_config.py, the resolve_config() function has an early return when source_dir is None:

if source_dir is None and fallback_to_default:
    ASH_LOGGER.verbose("source_dir is null, returning the default config")
    if config_overrides:
        return apply_config_overrides(config, config_overrides)
    return config

The report subcommand (cli/report.py line ~138) calls resolve_config(config_path=config, config_overrides=config_overrides) without passing source_dir, so it always hits this early return and never reads the config file — even when config_path is explicitly provided.

Steps to Reproduce

  1. Create .ash/.ash.yaml with:
ash_plugin_modules:
  - automated_security_helper.plugin_modules.ash_aws_plugins
  1. Run:
ash report --format bedrock-summary-reporter \
  --output-dir .ash/ash_output \
  -c .ash/.ash.yaml \
  --log-level VERBOSE
  1. Observe the log: source_dir is null, returning the default config
  2. The reporter plugin is not found because ash_plugin_modules was never loaded from the file.

Expected Behavior

When -c / --config is explicitly provided, resolve_config should read and parse that file regardless of whether source_dir is set.

Workaround

Use --config-overrides to force the value:

ash report --format bedrock-summary-reporter \
  --config-overrides 'ash_plugin_modules=["automated_security_helper.plugin_modules.ash_aws_plugins"]'

Suggested Fix

In resolve_config(), check config_path before the early return:

if source_dir is None and config_path is None and fallback_to_default:
    ASH_LOGGER.verbose("source_dir is null, returning the default config")
    ...
    return config

Or pass source_dir from the report command (e.g., default to Path.cwd()).

Environment

  • ASH version: v3 (installed via uvx)
  • OS: Linux (Amazon Linux)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions