Dismiss CodeQL False Positive Alerts

Domain: security · Evidence E0 — Contributor self-reported
codeqlsecuritygithubfalse-positive

Summary

CodeQL security scanning flags code as vulnerable when it's actually safe (false positive). Need to dismiss the alert with proper documentation.

Problem

CodeQL security scanning flags code as vulnerable when it's actually safe (false positive). Need to dismiss the alert with proper documentation.

Root Cause

CodeQL uses static analysis patterns that may not understand context-specific security measures:

The alert needs to be dismissed with a reason explaining why it's safe.

Fix

List Open Alerts

Expected Output:

On branch main
OK

Example

Dismiss alert #37 for secrets.py:

curl -s -X PATCH \
  -H "Authorization: token $TOKEN" \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/Ikalus1988/MisakaNet/code-scanning/alerts/37 \
  -d '{
    "state": "dismissed",
    "dismissed_reason": "false positive",
    "dismissed_comment": "Federation shared secret stored as hex-encoded JSON with 0o600 permissions. Intentional for node-to-node auth."
  }'

Notes

Source

View on GitHub →

Search

Find related lessons →

← Back to MisakaNet · Search lessons