Skip to content

refactor(security): delete scan suppression and devops scan fix #7505

Done

Description

@dan-petty

Problem

Two security modules of devops-cli do the work of open tools that already run. No workflow uses them.

The code (lines at commit d0bc3dffa):

  • src/devops_cli/security/suppression.py (236 lines, about 28 tests). It holds a suppression policy with an expiry for scan findings. Only an optional --suppress option reaches it (commands/scan.py:771-780, security/pipeline.py:33). CI passes no policy. The native ignore files with an expiry do this: the project already uses .trivyignore.yaml with expired_at.
  • src/devops_cli/security/dependency_remediator.py (240 lines, about 53 tests). devops scan fix uses it (commands/scan.py:592-656, security/scan_plans.py:19). It wraps uv lock --upgrade-package and npm update. Renovate already does this.

A third dead file is src/devops_cli/github/branch_protection.py (502 lines, 25 tests) with commands/gh.py:1845-1975. #5329 already asks to delete it, so this item leaves it to #5329.

Change

Delete the two modules, and use the open tools that already run.

  • Trivy ignore files with expired_at (Trivy, Apache-2.0, already used) replace the suppression policy.
  • Renovate (already used) opens the upgrade PRs that devops scan fix plans.

Delete:

  • security/suppression.py, the --suppress option of the scan commands, and the suppression parts of security/pipeline.py.
  • security/dependency_remediator.py, the command devops scan fix, its plans in security/scan_plans.py, and its rows in the docs and the CLI reference.
  • The tests of both modules.

Existing tool considered

  • Trivy .trivyignore.yaml with expired_at. It covers an accepted finding with an expiry. Each other scanner has its own native ignore file.
  • Renovate. It covers the upgrade of a vulnerable dependency, and it opens the PR. It does not run on demand on a local tree.

Done when

  • suppression.py, dependency_remediator.py, devops scan fix and --suppress are gone from src, the docs and the CLI reference.
  • devops scan report runs with no policy and gives the same findings as before.
  • The CI checks pass.

Source

Source: https://github.com/dan-petty/devops-cli/blob/d0bc3dffa781951f7b49935ba545cad82b2ecfaf/src/devops_cli/security/suppression.py

Alternatives check of 2026-11-28: not-applicable.
Class: refactor, no model call.
Tool: none found.

Proposed design

Problem statement

devops-cli keeps a suppression policy and a dependency remediator that duplicate open tools. No workflow calls the suppression policy, and Renovate already opens dependency upgrades. The change deletes both modules and their command surface.

Acceptance criteria

Requirement: Suppression module removed

The devops_cli.security package SHALL not provide the suppression module.

Scenario: Suppression module import fails

  • WHEN A test imports devops_cli.security.suppression with importlib.import_module.
  • THEN The import raises ModuleNotFoundError.

Requirement: Suppress option removed

The devops scan commands SHALL reject the --suppress option.

Scenario: Suppress option is unknown

  • WHEN A test invokes devops scan report --suppress policy.yaml through the CLI runner.
  • THEN The CLI exits non-zero and reports that --suppress is not a valid option.

Requirement: Dependency remediator module removed

The devops_cli.security package SHALL not provide the dependency_remediator module.

Scenario: Dependency remediator import fails

  • WHEN A test imports devops_cli.security.dependency_remediator with importlib.import_module.
  • THEN The import raises ModuleNotFoundError.

Requirement: Scan fix command removed

The devops scan group SHALL not provide the fix command.

Scenario: Scan fix command is absent

  • WHEN A test invokes devops scan fix through the CLI runner.
  • THEN The CLI exits non-zero and reports that the command does not exist.

Requirement: Scan report keeps findings without a policy

The devops scan report command SHALL report the same findings when no suppression policy exists.

Scenario: Report with no suppression policy

  • WHEN A test imports devops_cli.security.pipeline and runs the report path with a stub scanner that returns one finding and no policy file.
  • THEN The import succeeds and the report output contains that finding.

Requirement: Documentation drops removed scan features

The user documentation and the CLI reference SHALL not name devops scan fix or --suppress.

Scenario: Documentation scan finds no removed feature

  • WHEN A test searches README.md, docs/CLI_REFERENCE.md and the files under docs/ outside docs/adr/ for devops scan fix and --suppress.
  • THEN The search returns no match.

Existing Tool Considered

The alternatives check in the issue body records not-applicable for this refactor and names no tool. The change deletes code and builds no replacement. The repository already uses Trivy .trivyignore.yaml with expired_at for accepted findings. It also uses Renovate for dependency upgrades, but Renovate does not run on demand on a local tree.

Key questions

  • Does a Trivy ignore file with expired_at cover an accepted scan finding with an expiry?: Yes. The repository already uses .trivyignore.yaml entries with expired_at, and Trivy reads that file. The suppression policy is redundant. [sources: .trivyignore.yaml:6, src/devops_cli/security/trivy.py]
  • Does Renovate cover the dependency upgrades that devops scan fix plans?: Yes. The repository uses Renovate for dependency updates and security fixes. The devops scan fix command duplicates that work and has no workflow caller. (best practice) [sources: AGENTS.md, CONTEXT.md]
    • Rejected: Keep devops scan fix. It duplicates Renovate and has no workflow caller.
    • Chosen: Delete devops scan fix and use Renovate. Renovate already opens dependency upgrade pull requests.
  • Should devops scan report keep its current finding output after the suppression policy is removed?: Yes. The report must keep each finding when no policy is loaded. The --suppress option is optional, and CI passes no policy. (best practice) [sources: src/devops_cli/commands/scan.py:771-780, src/devops_cli/security/pipeline.py:33]
    • Rejected: Remove devops scan report too. The issue keeps the report command and requires the same findings.
    • Chosen: Keep devops scan report with no policy. The report does not need the suppression policy to list findings.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/refactor
    scope/security
    source/agent
    status/new
    value/medium
    on Nov 28, 2026
  2. dan-petty commented on Nov 28, 2026

    @dan-petty
    OwnerAuthor
  3. added
    effort/medium
    priority/p2-medium
    on Nov 28, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 28, 2026
  5. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  6. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 29, 2026
  7. removed
    status/in-review
    owner/agent
    on Nov 29, 2026
  8. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 03:13 UTC

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

    effort/mediumpriority/p2-mediumscope/securitysource/agenttype/refactorvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions