Skip to content

Security hardening: SAST findings — JWT lifetime validation disabled; connector image runs as root #1338

Description

@SharedQA

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

  1. JWT lifetime validation disabledsrc/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.

  2. Container runs as rootsrc/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions