-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: introduce the new role option CREATELOGIN
This commit introduces a new SQL-level role option (alongside LOGIN etc) called `CREATELOGIN`. This is used to control access to: - the `WITH PASSWORD` clause for `CREATE/ALTER USER/ROLE`: initializing, changing or removing password on users. - the `VALID UNTIL` clause for `CREATE/ALTER USER/ROLE`: changing the expiration date for a password. - `ALTER USER/ROLE CREATELOGIN/NOCREATELOGIN`: granting or removing the option for a user or role. - `ALTER USER/ROLE LOGIN/NOLOGIN`: enabling a user/role to log in using either passwords, certs or another valid auth method This feature enables a site operator to separate the responsibility of administrating users and roles, which requires the CREATEROLE privilege, from that of administrating authentication principals, which now requires CREATELOGIN. For example, it can be used to ensure that no SQL client can choose their own passwords for users/roles, even if they are privileged enough to create new users or roles. Release note (security update): Defining or changing authentication principals or their credentials now requires the new `CREATELOGIN` option to be set for the requesting user or one of its roles. This includes setting/removing the LOGIN option (wether the principal can log in); initializing or changing the password of a SQL user, as well as setting the expiration date for a password. Previously, only the `CREATEROLE` option was sufficient to perform these changes. The pseudo-option `NOCREATELOGIN` can be used to revoke `CREATELOGIN`. The two predefined `root` and `admin` roles have the option `CREATELOGIN` set by default. Release note (security update): Only a user which already has option `CREATELOGIN` (either itself or one of its roles) can grant this option or use `NOCREATELOGIN`.
- Loading branch information
Showing
16 changed files
with
418 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.