Skip to content

Add CodeQL security analysis - #1247

Closed
jeyjenushan wants to merge 6 commits into
fastapi-practices:masterfrom
jeyjenushan:security-testing
Closed

jeyjenushan wants to merge 6 commits into
fastapi-practices:masterfrom
jeyjenushan:security-testing

Conversation

@jeyjenushan

Copy link
Copy Markdown

No description provided.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@wu-clan

wu-clan commented Nov 8, 2026

Copy link
Copy Markdown
Member

Thanks for the effort, but we're going to close this one for now — the four overlapping SAST workflows don't fit this repository, and a few of them can't actually report anything as written.

Why we're closing

  1. Wrong tool for this repo. FBA is a scaffold/template rather than a running service. SAST against the shared boilerplate produces mostly noise from the framework wrappers, while the risk that actually reaches users of the template is in the dependency tree. There's no dependency scanning here (pip-audit / OSV-Scanner), which is where the value would be.

  2. Four tools doing the same job. CodeQL + Semgrep CE + Semgrep AppSec + Snyk overlap heavily. CodeQL is free for public repos and already covers the Python cases we care about; AppSec additionally requires a paid SEMGREP_APP_TOKEN.

  3. The results wouldn't surface. codeqlanalysis.yml writes SARIF to results/ and uploads it as an artifact but never runs github/codeql-action/upload-sarif, so nothing reaches the Security tab (security-events: write is declared but unused). The Semgrep AppSec and Snyk jobs depend on repo-level secrets (SEMGREP_APP_TOKEN, SNYK_TOKEN) that aren't available to fork PRs, and both steps are marked continue-on-error: true — a failed scan still goes green, so the workflow reports success without scanning anything.

  4. Small correctness issues. The security-testing branch doesn't exist in this repository; security-events: write in a job triggered by pull_request will fail for contributions opened from forks; the file name synk.yml is misspelled and three of the files miss a trailing newline.

What we'd be happy to review instead

A single consolidated workflow that:

  • runs CodeQL with security-and-quality and adds the missing upload-sarif step, so findings land in the Security tab;
  • adds dependency scanning with OSV-Scanner or pip-audit;
  • drops Semgrep AppSec, Snyk, and the continue-on-error: true escape hatches (a red run is more useful than a silent green one);
  • triggers on pull_request and push to master only, with the non-existent branch removed;
  • documents in the workflow or the PR description how findings are handled and how false positives are suppressed.

Happy to reopen or discuss — just say the word.

@wu-clan

wu-clan commented Nov 8, 2026

Copy link
Copy Markdown
Member

Closing for the reasons described in my comment above. Reopen any time if you'd like to rework this into a consolidated CodeQL + dependency-scanning workflow — happy to review that version.

@wu-clan wu-clan closed this Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants