github-samples / github-samples/pets-workshop

GitHub security workshop: Add a custom CodeQL query exercise

Open
#274 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: deferred
Dominant language
Python
Stars
80
Forks
161
Avg merge
31m
Merged PRs (30d)
1

Description

Goal

Teach how CodeQL can enforce an organization-specific security rule that is not represented by the default query suite.

Scope

Choose one simple, app-relevant Python pattern and provide a small starter query that learners can understand and extend. Document the tested execution path using supported CodeQL tooling, then show how a query pack or configuration is incorporated into repository analysis.

Acceptance criteria

  • The target pattern is security-relevant, specific to the pets app, and has a deterministic positive and negative example.
  • The exercise explains the query metadata, imports, predicates, result selection, and help text at an introductory level.
  • A pinned/tested CodeQL CLI or supported hosted workflow is documented.
  • Learners run the query and see exactly the expected result set.
  • The custom query is packaged and referenced using a currently supported CodeQL configuration.
  • A subsequent repository analysis reports the custom result with recognizable metadata.
  • Maintainer validation detects query compilation failures and result drift.
  • The exercise documents feature or plan constraints and an observation-only fallback.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the pets app's Python code and the supported CodeQL CLI or hosted-workflow path described in the issue. Define one deterministic positive and negative example, then document the starter query, packaging, configuration, expected results, validation, constraints, and fallback so the exercise meets every acceptance criterion.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, python
Domain
ci-cd, documentation, security, testing-qa
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.