Clarify the importance of NOINHERIT to properly create a role on the DOCS
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- postgresql
- Área
- documentation, security
Línea de trabajo
Comienza revisando la documentación de PostgreSQL GRANT enlazada en el issue y localiza la guía correspondiente sobre la creación de roles en este repositorio. Aclara el comportamiento de NOINHERIT, la persistencia de los roles y el ejemplo separado de ALTER ROLE; se considera terminado cuando la documentación explica correctamente el riesgo de autorización y evita dar a entender que un CREATE ROLE posterior cambia un rol existente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- SCSS
- Estrellas
- 27
- Forks
- 124
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de graphile/graphile.github.io
-
help wanted quick
Dificultad 2/5 1-3 horas Aptitud para principiantes 38/100
graphile/graphile.github.io#401 · 1 comentario · 1 reacción ·
-
website: Update details on homepage and sponsor pageQuizá libre de nuevo @jemgillam la tomó hace 1119 días y no hay ningún pull request abierto. Abiertoquick
graphile/graphile.github.io#399 · 4 comentarios · 1 asignado ·
-
sponsor page: New wording around Grafast needed!Quizá libre de nuevo @jemgillam la tomó hace 1149 días y no hay ningún pull request abierto. Abierto
graphile/graphile.github.io#393 · 1 reacción · 1 asignado ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 38/100
graphile/graphile.github.io#341 · 1 reacción ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
graphile/graphile.github.io#280 · 2 comentarios · 5 reacciones ·
Todos los issues de graphile/graphile.github.io
Issues similares
-
marketing
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
gke-labs/kube-agents#7308 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
-
chore
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
lugassawan/swe-workbench#841 ·