Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Use md5 hashing for redshift_user passwords#7

Merged
winglot merged 1 commit intobrainly:masterfrom
sworisbreathing:use-hashed-passwords
Jul 16, 2021
Merged

Use md5 hashing for redshift_user passwords#7
winglot merged 1 commit intobrainly:masterfrom
sworisbreathing:use-hashed-passwords

Conversation

@sworisbreathing
Copy link
Copy Markdown
Contributor

Per https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_USER.html:

As a more secure alternative to passing the CREATE USER password parameter as clear text, you can specify an MD5 hash of a string that includes the password and user name.

Note
When you specify an MD5 hash string, the CREATE USER command checks for a valid MD5 hash string, but it doesn't validate the password portion of the string. It is possible in this case to create a password, such as an empty string, that you can't use to log on to the database.

To specify an MD5 password, follow these steps:

  1. Concatenate the password and user name.
    For example, for password ez and user user1, the concatenated string is ezuser1.

  2. Convert the concatenated string into a 32-character MD5 hash string. You can use any MD5 utility to create the hash string. The following example uses the Amazon Redshift MD5 function and the concatenation operator ( || ) to return a 32-character MD5-hash string.

select md5('ez' || 'user1');
md5                             
--------------------------------
153c434b4b77c89e6b94f12c5393af5b
  1. Concatenate 'md5' in front of the MD5 hash string and provide the concatenated string as the md5hash argument.
create user user1 password 'md5153c434b4b77c89e6b94f12c5393af5b';
  1. Log on to the database using the user name and password.
    For this example, log on as user1 with password ez.

@winglot winglot added the enhancement New feature or request label Jul 15, 2021
@winglot winglot merged commit 942b821 into brainly:master Jul 16, 2021
@sworisbreathing sworisbreathing deleted the use-hashed-passwords branch July 18, 2021 23:22
StevenKGER referenced this pull request in dbsystel/terraform-provider-redshift Oct 25, 2024
…go-v2-credentials-1.x

Update module github.com/aws/aws-sdk-go-v2/credentials to v1.13.40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants