NO-JIRA: Restrict metrics and webhook ingress #1670
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 167 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.307
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #1670"
general
weight: 0.35
jmencak
Add timeouts to the metrics server to mitigate Slowloris-style connection exhaustion.
The allow-metrics-traffic NetworkPolicy allowed ingress to the operator's metrics port (TCP/60000) from any source. Add a namespaceSelector so that only pods in the openshift-monitoring namespace can reach the endpoint.
Limit webhook ingress (TCP/4343) to the hostNetwork policy group (kube-apiserver only), instead of allowing ingress from any namespace.
The metrics_cert_rotation e2e test previously probed the endpoint from a TuneD Pod on an arbitrary worker node, which the new policy no longer permits. It now execs openssl directly inside the operator Pod and connects to the operator Pod's own IP.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Security
Metrics traffic on port 60000 is restricted to pods in the
openshift-monitoringnamespace.Webhook traffic on port 4343 is restricted to the
openshift-host-networknamespace, replacing the previous broader ingress rules.Reliability
* The metrics server now enforces limits on how long it waits to receive request headers, read and write requests, and keep connections idle, helping prevent connections from remaining open indefinitely.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->