Bounded five-tuple policy semantic diff built on MoonBDD and cidr-audit
Dependencies
moon add hutingyu-nuist/moonpolicyproof@0.1.1git clone https://github.com/hutingyu-nuist/moonpolicyproof.git
cd moonpolicyproof
moon update
node tools/verify.mjsnode _build/js/debug/build/cmd/main/main.js diff examples/01-change/before.policy examples/01-change/after.policynode _build/js/debug/build/cmd/main/main.js diff examples/01-change/before.policy examples/01-change/after.policy examples/01-change/business.scopenode _build/js/debug/build/cmd/main/main.js audit examples/02-shadow/policy.policynode _build/js/debug/build/cmd/main/main.js check examples/03-regression/policy.policy examples/03-regression/good.assertions
node _build/js/debug/build/cmd/main/main.js check examples/03-regression/policy.policy examples/03-regression/bad.assertionsmoon build --target js --deny-warn
node tools/serve.mjsmoonpolicyproof 1
default deny
rule web allow tcp 10.0.0.0/24 192.0.2.10/32 * 443| 退出码 | 含义 |
|---|---|
| 0 | 分析完成;diff 等价或 check 全部通过;audit 仅表示成功生成报告 |
| 1 | diff 存在语义差异,或 check 有失败断言 |
| 2 | 输入/格式/参数错误 |
| 3 | 资源预算耗尽,没有得出结论 |
| 4 | 内部反例回放校验失败,没有得出结论 |
pub struct DiffReport {
newly_allowed : ChangeWitness?
newly_denied : ChangeWitness?
retained_nodes : Int
} derive(Eq, Debug)fn Packet::new(source : String, destination : String, protocol : Protocol, source_port : Int, destination_port : Int) -> Packet raise PolicyErrorfn Policy::check_assertions(self : Policy, assertions : Array[Assertion], max_nodes? : Int) -> Array[AssertionResult] raise PolicyErrorfn compare_scoped(before : Policy, after : Policy, scope : Scope, max_nodes? : Int) -> DiffReport raise PolicyErrorfn handle_request(text : String) -> (Int, String)Install
Download zipBounded five-tuple policy semantic diff built on MoonBDD and cidr-audit
Dependencies