codeql
Skill by elastic
Works with CodeQL in the Kibana repository. It helps write, test and debug custom queries locally, fetch scan results from GitHub, and check inline suppression justifications.
Install codeql
Built from the published package, never by AI.
git clone --depth 1 https://github.com/elastic/kibana /tmp/kibana && mkdir -p ~/.claude/skills && cp -r /tmp/kibana/.agents/skills/codeql ~/.claude/skills/codeqlRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/elastic/kibana /tmp/kibana && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/kibana/.agents/skills/codeql ~/.gemini/antigravity-cli/skills/codeqlAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The codeql skill helps developers work with custom CodeQL queries in the Kibana repository. It covers writing queries in the kibana-custom-queries pack, creating unit test directories, and running those tests with a Docker-based script. It can also run a full analysis against a source directory and produce a SARIF results file.
A helper script fetches CodeQL SARIF results and code scanning alerts from GitHub for a pull request number or a git ref. It needs a GITHUB_TOKEN with the security_events scope. The skill also explains how inline suppression comments must include a specific justification. It is intended for Kibana contributors who write, test or review CodeQL queries and scan results.
Written from the project's SKILL.md and checked against it.
What it can do
- Local analysisRuns custom queries against a source directory using a Docker-based CodeQL database build.
- Unit testsRuns CodeQL unit tests for a single query directory or for the whole qlpack.
- Fetch remote SARIFDownloads CodeQL SARIF results and code scanning alerts from GitHub by PR number or ref.
- Query authoringGuides creating a new .ql query, its test directory, and its help documentation files.
- Suppression reviewChecks that inline codeql suppression comments include a specific, concrete justification.
- TroubleshootingLists common problems such as ARM Docker builds, missing qlpack.yml, and empty query results.
What you need
- Docker
- Node.js for the fetch_sarif.mjs script
- GITHUB_TOKEN with security_events scope for fetching remote results
- jq (optional, for the colored summary)
Try asking
- Run the CodeQL unit tests for the UnboundedArrayInRoute query
- Fetch the CodeQL scan results for PR 252121 from GitHub
- Check whether this codeql suppression comment has a valid justification
Good to know
- The fetch script needs a GITHUB_TOKEN with the security_events scope.
- On Apple Silicon the Docker image runs under linux/amd64 emulation.
- Test and mock directories are excluded by paths-ignore in codeql-config.yml, so queries may find nothing there.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/codeql/SKILL.md, .agents/skills/codeql/scripts/fetch_sarif.mjs. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md7 KB -
agents/openai.yaml43 B -
scripts/fetch_sarif.mjs5 KB
Alternatives to codeql
All alternatives →Retrieves lab biomarker results and clinician notes from Function Health through its FHIR API. It is for people who want an AI assistant to review their own lab history and notes.
Gives an AI assistant a methodology for finding and exploiting privilege escalation weaknesses on Windows systems during authorized penetration tests. It is for security testers and defenders validating escalation paths.
Guides the assistant through designing, debugging and hardening GitHub Actions CI/CD workflows. It is aimed at teams that run production pipelines on GitHub.
Develops evidence-backed structural security hardening proposals from disclosures, findings, source code, or Codex Security scans. It is for teams that need systemic fixes and architectural tradeoffs.
Claude Security scans code for security issues with Claude Code. It covers whole repositories, branch or pull request diffs, single commits, and existing findings from SARIF files or earlier reports.
Turns vulnerability notes, disclosure reports, PoCs, source code, or Codex Security findings into self-contained vulnerability reports. Built for security researchers who need claims the evidence supports.
Compare with function_health, windows-privilege-escalation or github-actions-advanced
codeql: common questions
What does the codeql skill do in Kibana?
It helps write, test and debug custom CodeQL queries locally and fetch scan results from GitHub. It also validates inline suppression comments.
How are CodeQL unit tests run?
Tests run through scripts/codeql/quick_check.sh with the -t option, using the codeql-env Docker image. The codeql-pr.yml workflow also runs them on pull requests.
Are suppression comments checked automatically?
The skill says every suppression must include a specific justification. Generic or missing justifications should be flagged during review.
How do I install codeql?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is codeql free?
The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.
Is codeql safe to use?
It scores 84 of 100. Grades: maintenance A, licence F, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to codeql?
Similar skills: function_health, windows-privilege-escalation, github-actions-advanced, propose-security-hardening.
