Skip to content

Commit 53fe6b2

Browse files
committed
fix(pq): prevent is_pq_rule_id false positive on go/insecure-tls-skip-verify
id.contains("insecure-tls") matches non-PQ rules like go/insecure-tls-skip-verify. Use exact match for the one Dockerfile rule that belongs in the PQ set.
1 parent 3e61964 commit 53fe6b2

1 file changed

Lines changed: 3 additions & 17 deletions

File tree

src/app.rs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -493,23 +493,9 @@ fn validate_rules_path(rules: Option<&str>) -> Result<(), String> {
493493

494494
/// Returns `true` if the rule ID belongs to the PQ audit rule set.
495495
fn is_pq_rule_id(id: &str) -> bool {
496-
matches!(
497-
id,
498-
"py/pq-vulnerable-crypto"
499-
| "js/pq-vulnerable-crypto"
500-
| "go/pq-vulnerable-crypto"
501-
| "java/pq-vulnerable-crypto"
502-
| "rs/pq-vulnerable-crypto"
503-
| "config/nginx-pq-vulnerable-tls"
504-
| "config/apache-pq-vulnerable-tls"
505-
| "config/haproxy-pq-vulnerable-tls"
506-
| "config/dockerfile-insecure-tls-env"
507-
| "manifest/cargo-pq-vulnerable-dep"
508-
| "manifest/pip-pq-vulnerable-dep"
509-
| "py/hardcoded-crypto-algorithm"
510-
| "js/hardcoded-crypto-algorithm"
511-
| "java/hardcoded-crypto-algorithm"
512-
)
496+
id.contains("pq-vulnerable")
497+
|| id.contains("hardcoded-crypto-algorithm")
498+
|| id == "config/dockerfile-insecure-tls-env"
513499
}
514500

515501
fn collect_changed_targets(path: &str, changed: bool) -> Result<Option<Vec<PathBuf>>, String> {

0 commit comments

Comments
 (0)