Skip to content

Policy drift detector — tell me when an edit makes my policy weaker #418

Closed

Description

@shubhamkataria2005

As someone maintaining a policy, I want to know when an edit quietly makes it weaker, before I apply it.

What it does

Compare two versions of the same policy file and report each place the new one protects less than the old:

  • a rule removed
  • a prohibition that now covers less traffic (narrowed)
  • a requirement that now covers more traffic (widened), so more must be allowed

Acceptance criteria

  • Pure logic over the two policy files; no Batfish
  • Each weakening names the rule, the old and new traffic, and which direction it weakened
  • Rules matched across versions by number; a renumbered rule is reported as removed + added, never silently paired
  • Anything that cannot be compared is reported as undecidable, never as "unchanged" (same three answers as US-30 — Tell me if my own policy contradicts itself #322)
  • A command line: python -m analysis.policy_drift old.json new.json, exit 1 when it weakened
  • Mutation-tested

Depends on

analysis/policy_conflicts.py (#387) for parsing header spaces. Needs a new containment test ("is A inside B"), which is stricter than the overlap test #387 has.


Epic: Policy | Assigned: @shubhamkataria2005

Raised for Studio 6 as one of ten features in my area (policy compliance and change impact). Comment here if you disagree with the scope; the acceptance criteria are what I will build to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or requestlayer: analysisLayer 1 — Batfish orchestration, checks, the pipelinephase: 3Market readiness -- what stands between us and a product someone could buy.policy-compliancesize: MAbout a week.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions