fix(telemetry): use the operator identity for protected readiness probes

This commit is contained in:
2026-11-20 21:07:53 +03:00
parent adcdaf9584
commit 45cf1532aa
3 changed files with 965 additions and 8 deletions
+3 -2
View File
@@ -16,7 +16,8 @@ ENDPOINTS = {
def fetch(service, path, *, params=None, json_result=True):
if service == "otel":
operator_probe = service == "otel" or path in {"/-/ready", "/ready"}
if operator_probe:
from scripts.bootstrap_security import OPERATOR, SECRET, write_private
# Operator credentials can change during CA rollover; never keep a
@@ -32,7 +33,7 @@ def fetch(service, path, *, params=None, json_result=True):
url += "?" + urlencode(params, doseq=True)
code = (
f"import urllib.request; from src.security_probe import context; service={service!r}; "
f"r=urllib.request.urlopen(urllib.request.Request({url!r},headers={{'Accept':'application/json'}}),timeout=8,context=context('operator' if 'otel' == service else 'grafana')); "
f"r=urllib.request.urlopen(urllib.request.Request({url!r},headers={{'Accept':'application/json'}}),timeout=8,context=context({'operator' if operator_probe else 'grafana'!r})); "
"print(r.read().decode())"
)
text = compose(