Clarify the importance of NOINHERIT to properly create a role on the DOCS
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 45/100
- Issue-Typ
- Dokumentation
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- postgresql
- Bereich
- documentation, security
Rechercherichtung
Beginne mit der Prüfung der im Issue verlinkten PostgreSQL-GRANT-Dokumentation und finde die entsprechende Anleitung zur Rollenerstellung in diesem Repository. Kläre das Verhalten von NOINHERIT, die Persistenz von Rollen und das separate ALTER-ROLE-Beispiel; als erledigt gilt die Aufgabe, wenn die Dokumentation das Autorisierungsrisiko korrekt erklärt und nicht impliziert, dass ein späteres CREATE ROLE eine bestehende Rolle ändert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
When a ROLE is created in PG, it may inherit privileges from other roles. It specially inherits all privileges from the PUBLIC role.
From the DOCs:
"Any particular role will have the sum of privileges granted directly to it, privileges granted to any role it is presently a member of, and privileges granted to PUBLIC.".
If your application is implementing a whitelist logic (most of the cases), this may represent a leak of authorization. So all roles must be created using the NOINHERIT clause, but there is another gotcha: creating a role and them altering it to NOINHERIT is a safer option than creating a role with NOINHERIT.
-- OK if there is no graphile_visitor already in your system
CREATE ROLE graphile_visitor NOINHERIT;
-- A better option, specially during development if you use dropdb to "reset" your application
CREATE ROLE graphile_visitor;
ALTER ROLE graphile_visitor NOINHERIT;
When a ROLE is created, it's not stored into the database itself, but inside a private catalog called pg_user. If graphile_visitor by accident was crate without the NOINHERIT, dropping the database won't erase it, so adding the NOINHERIT to its creation clause afterward will have no effect at all.
-- this is a mistake
CREATE ROLE graphile_visitor;
-- this isn't a bug fix
CREATE ROLE graphile_visitor NOINHERIT;
This happens because, when it runs the second query, PG will identify that a role with the same name already exists so it will skip the CREATE ROLE. Keeping creation and alteration separated will ensure the intended behavior.
- Vorherrschende Sprache
- SCSS
- Sterne
- 27
- Forks
- 124
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus graphile/graphile.github.io
-
help wanted quick
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 38/100
graphile/graphile.github.io#401 · 1 Kommentar · 1 Reaktion ·
-
website: Update details on homepage and sponsor pageEvtl. wieder frei @jemgillam hat das vor 1119 Tagen übernommen, und es ist kein Pull Request offen. Offenquick
graphile/graphile.github.io#399 · 4 Kommentare · 1 zugewiesene Person ·
-
sponsor page: New wording around Grafast needed!Evtl. wieder frei @jemgillam hat das vor 1149 Tagen übernommen, und es ist kein Pull Request offen. Offen
graphile/graphile.github.io#393 · 1 Reaktion · 1 zugewiesene Person ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 38/100
graphile/graphile.github.io#341 · 1 Reaktion ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 25/100
graphile/graphile.github.io#280 · 2 Kommentare · 5 Reaktionen ·
Alle Issues in graphile/graphile.github.io
Ähnliche Issues
-
agent/scanner bug stage/010-actionable
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
torch-spyre/spyre-inference#1812 ·
Maintainer antworten meist innerhalb von 1 Tag
-
sync-en
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
[oblt-aw][autodoc] Update autodoc routing docs for relative in-repo lock usesEvtl. vergeben @github-actions hat das heute übernommen. Offen
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 87/100
Maintainer antworten meist innerhalb von 1 Tag
-
[Enhancement] platform-engineer: a definition change does not re-render running Applications; say how to roll it outEvtl. vergeben @anoop2811 hat das heute übernommen. Offenneeds-triage type/enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
cloudflare/workers-sdk#17189 ·
Maintainer antworten meist innerhalb von 1 Tag