Skip to content

fix(security): a Popeye scan with no namespace scans only the namespace of the context, but the adapter and its spec say every namespace #2421

Closed

Description

@dan-petty

Problem Description

A Popeye scan with no namespace does not scan every namespace. The adapter and its documents say that it does.

  • build_popeye_cmd (src/devops_cli/config/commands.py) and PopeyeScanner.build_command (src/devops_cli/security/popeye.py) say "over namespace, or every namespace".
  • The spec agent-scan-tools said "over every namespace when the agent names none", and the test test_popeye_scans_the_whole_cluster_when_it_gets_no_namespace in tests/test_secops.py has the same name.
  • The command is popeye -o json -l warn, with no -A. Popeye 0.22.1 then scans only the namespace of the current context.

Reproduction Steps

  1. Set a namespace on the current context: kubectl config set-context --current --namespace=<namespace>.
  2. Run popeye -o json -l warn and count the resources in the report.
  3. Run popeye -o json -l warn -A and count again.

Expected vs Actual Behavior

Expected: the scope of a scan with no namespace and the words of the code, the spec and the tests agree. A person decides the scope: every namespace (-A), or the namespace of the context.

Actual: on a test cluster, the scan with no -n read 3 config maps of the namespace of the context, and the scan with -A read 58. With no namespace on the context, Popeye scanned only default.

Environment Diagnostics

Popeye 0.22.1, kubectl v1.37.1, devops-cli at origin/main 86d5bce.

Logs, Traces, or Terminal Output

None. The counts above come from the JSON report of each run.

Pre-Submission Checklist

  • I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
  • I have checked existing issues and pull requests to ensure this is not a duplicate.

Source: #2132

Proposed design

Problem statement

A Popeye scan with no namespace should cover every namespace, as the code docstrings, the spec, and the test name all state. But the command omits the -A flag, so Popeye 0.22.1 scans only the namespace of the current context. Security findings in other namespaces go undetected.

Acceptance criteria

  • Criterion 1: build_popeye_cmd includes -A in the command when namespace is None.
    Verification: Run uv run devops ci test tests/test_secops.py and confirm test_popeye_scans_the_whole_cluster_when_it_gets_no_namespace passes.
  • Criterion 2: build_popeye_cmd includes -n and no -A when namespace is provided.
    Verification: Run uv run devops ci test tests/test_secops.py and confirm test_popeye_reports_each_issue_of_its_report_at_warn_level passes.
  • Criterion 3: The test test_popeye_scans_the_whole_cluster_when_it_gets_no_namespace asserts the expected command contains -A.
    Verification: Inspect tests/test_secops.py and confirm the expected command list includes -A.

Key questions

  • Does -A conflict with the --context flag?: No. --context selects the cluster context. -A selects all namespaces within that cluster. They are orthogonal. [sources: src/devops_cli/config/commands.py]
  • What is the intended scope when no namespace is given?: Every namespace. The docstrings in build_popeye_cmd and PopeyeScanner.build_command both state the scan covers every namespace when none is named. [sources: src/devops_cli/config/commands.py, src/devops_cli/security/popeye.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    on Oct 28, 2026
  2. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

    • Type: type/bug. The Popeye adapter omits the -A flag, so the scan covers fewer namespaces than the code, spec, and tests all state it should.
    • Priority: P1-High. Security scans silently skip namespaces, so vulnerabilities in other namespaces go undetected.
    • Value: High. Users rely on the scan to cover every namespace, and the current gap can hide real findings.
    • Effort: Low. The fix adds the -A flag to the existing popeye command in two files and updates the test assertion.
    • Related: fix(security): kubeconform and checkov are pinned and their adapters read what those tools write, or the adapters go #2214, which asks for a different change. Both concern security scanner adapters not working as intended, but #2214 fixes missing tool installation while this fixes a missing -A flag in the Popeye command.
  3. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at 73d1807 (see proposed design in issue body).

  4. added a commit that references this issue on Oct 28, 2026
    4d5f789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    source/agenttype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions