Skip to content

ci: add semgrep and ast-grep rules #400

Closed

Description

@uniqueg

Problem

Cloud Registry runs project-specific static analysis rules that FOCA doesn't: ast-grep rules (.ast-grep/, sgconfig.yml) and semgrep rules (.semgrep/, e.g., flask-debug-enabled, JWT decoding without verification), wired into pre-commit and the "Static code analysis" CI job. FOCA, which implements the security-relevant code (auth, access control, URL checks) that apps rely on, has only the shared ruff and mypy setup.

Expected

  • Bring FOCA up to Cloud Registry's level: the same semgrep rule set (plus rules that fit a framework, e.g., no jwt.decode without verification and allowed algorithms, no eval/exec, no unsafe YAML loading, no verify=False in requests), and ast-grep rules where they make sense for FOCA (e.g., the ones Cloud Registry has for logging and exceptions), each with rule tests.
  • Wired into .pre-commit-config.yaml and the CI lint job, versions pinned in one place and updated by Dependabot (as ruff and mypy since fix: pre-release review low findings #388).
  • Findings on current dev fixed, or suppressed inline with a justification.
  • Rules shared with Cloud Registry kept identical, so the template stays in sync.

Activity

  1. added
    priority: medium
    status: triage
    type: ci / cd
    type: security
    workload: hours
    on Oct 22, 2026
  2. uniqueg commented on Oct 23, 2026

    @uniqueg
    MemberAuthor

    Done in #416.

  3. removed
    status: triage
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumtype: ci / cdtype: securityworkload: hours

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions