Summary
The SAST gate (semgrep p/default, added in #1317) surfaces pre-existing security-hardening findings. The gate runs report-only for now so it doesn't block all merges on this backlog; this issue tracks fixing the findings so the gate can flip to blocking (--error).
Findings
-
JWT lifetime validation disabled — src/backend/services/identity/src/Insight.Identity.Api/Program.cs:156
ValidateLifetime = false,
With ValidateLifetime = false, expired JWTs are accepted. Confirm this is intentional (e.g. lifetime enforced upstream at the gateway); if not, set it to true (line 135 has the commented-out true) or document why it's off.
-
Container runs as root — src/ingestion/tools/declarative-connector/Dockerfile
No USER directive; the image ends on ENTRYPOINT as root. Add a non-root USER before the entrypoint.
(Additional lower-severity items may appear in the full semgrep --config p/default run; this issue covers the blocking ones.)
Acceptance
- Each finding fixed or explicitly waived with a rationale (
.semgrepignore / inline # nosemgrep with justification).
security-gates.yml sast step re-enabled with --error (blocking) once the baseline is clean.
Summary
The SAST gate (semgrep
p/default, added in #1317) surfaces pre-existing security-hardening findings. The gate runs report-only for now so it doesn't block all merges on this backlog; this issue tracks fixing the findings so the gate can flip to blocking (--error).Findings
JWT lifetime validation disabled —
src/backend/services/identity/src/Insight.Identity.Api/Program.cs:156With
ValidateLifetime = false, expired JWTs are accepted. Confirm this is intentional (e.g. lifetime enforced upstream at the gateway); if not, set it totrue(line 135 has the commented-outtrue) or document why it's off.Container runs as root —
src/ingestion/tools/declarative-connector/DockerfileNo
USERdirective; the image ends onENTRYPOINTas root. Add a non-rootUSERbefore the entrypoint.(Additional lower-severity items may appear in the full
semgrep --config p/defaultrun; this issue covers the blocking ones.)Acceptance
.semgrepignore/ inline# nosemgrepwith justification).security-gates.ymlsast step re-enabled with--error(blocking) once the baseline is clean.