()
| 162 | // The prover output is categorical, not severity-graded. |
| 163 | #[test] |
| 164 | fn test_findings_for_github_policy() { |
| 165 | use finding::category; |
| 166 | |
| 167 | let policy_path = testdata_dir().join("policy.yaml"); |
| 168 | let creds_path = testdata_dir().join("credentials.yaml"); |
| 169 | |
| 170 | let pol = parse_policy(&policy_path).expect("parse policy"); |
| 171 | let cred_set = credentials::load_credential_set_embedded(&creds_path).expect("load creds"); |
| 172 | let bin_reg = registry::load_embedded_binary_registry().expect("load registry"); |
| 173 | |
| 174 | let z3_model = build_model(pol, cred_set, bin_reg); |
| 175 | let findings = run_all_queries(&z3_model); |
| 176 | |
| 177 | let categories: std::collections::HashSet<&str> = |
| 178 | findings.iter().map(|f| f.query.as_str()).collect(); |
| 179 | assert!( |
| 180 | categories.contains(category::L7_BYPASS_CREDENTIALED), |
| 181 | "expected l7_bypass_credentialed finding for bypass-L7 binary with credential in scope; \ |
| 182 | got categories: {categories:?}" |
| 183 | ); |
| 184 | // Every emitted category must be one of the four v1 categories. |
| 185 | let allowed: std::collections::HashSet<&str> = [ |
| 186 | category::LINK_LOCAL_REACH, |
| 187 | category::L7_BYPASS_CREDENTIALED, |
| 188 | category::CREDENTIAL_REACH_EXPANSION, |
| 189 | category::CAPABILITY_EXPANSION, |
| 190 | ] |
| 191 | .into_iter() |
| 192 | .collect(); |
| 193 | for c in &categories { |
| 194 | assert!( |
| 195 | allowed.contains(*c), |
| 196 | "unexpected category {c} emitted by the prover" |
| 197 | ); |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | #[test] |
| 202 | fn test_wildcard_endpoint_covering_credential_host_emits_credential_reach() { |
nothing calls this directly
no test coverage detected