github-samples / github-samples/pets-workshop

GitHub security workshop: Add a custom CodeQL query exercise

Offen
#274 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

priority: deferred
Vorherrschende Sprache
Python
Sterne
80
Forks
161
Ø Merge
31 Min.
Gemergte PRs (30 T.)
1

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie mit dem Python-Code der pets app und dem in der Aufgabe beschriebenen unterstützten CodeQL CLI- oder hosted-workflow-Pfad. Definieren Sie ein deterministisches positives und negatives Beispiel und dokumentieren Sie anschließend die Starterabfrage, das Packaging, die Konfiguration, die erwarteten Ergebnisse, die Validierung, die Einschränkungen und den Fallback, damit die Übung jedes Akzeptanzkriterium erfüllt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
github-actions, python
Bereich
ci-cd, documentation, security, testing-qa
Issue-Typ
Dokumentation
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
64/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.