github / github/codeql

False positive: Workflow does not contain permissions

Offen
#20,487 10 Kommentare 8 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
false-positive
Vorherrschende Sprache
CodeQL
Sterne
10.1k
Forks
2.1k
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
141

Beschreibung

**Description of the false positive**

We get a lot of `Workflow does not contain permissions` alerts.

It's description states

> If a GitHub Actions job or workflow has no explicit permissions set, then the repository permissions are used. Repositories created under organizations inherit the organization permissions. The organizations or repositories created before February 2023 have the default permissions set to read-write. Often these permissions do not adhere to the principle of least privilege and can be reduced to read-only, leaving the write permission only to a specific types as issues: write or pull-requests: write.

While our org was created before February 2023, the default permission on the org is set to read contents and packages only, and in the repository I can't even change the setting.

Image

**Code samples or links to source code**

https://github.com/intility/templates/blob/8653a13809c06c5046e57cb689d8479726380414/.github/workflows/build-react.yml#L13-L36

**URL to the alert on GitHub code scanning (optional)**

https://github.com/intility/templates/security/code-scanning/4

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit dem verlinkten Workflow unter .github/workflows/build-react.yml, Zeilen 13–36, und vergleiche dessen Berechtigungen mit dem gemeldeten code-scanning alert. Bestimme anhand der Standardwerte für Organisation und Repository, ob der Alert ein False Positive ist, und überprüfe anschließend, ob das Verhalten des Alerts oder das Abfrageergebnis dem dokumentierten Berechtigungsmodell entspricht.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
github-actions
Bereich
ci-cd, security
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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