Created
February 8, 2023 14:28
-
-
Save djnorrisdev/062de4d1d71df69beed32c212404df85 to your computer and use it in GitHub Desktop.
Revisions
-
djnorrisdev created this gist
Feb 8, 2023 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ Create a key pair and b64 encode them: ``` ssh-keygen -t rsa -b 4096 -m PEM -f ./jwtcookie.key rsa_priv_key=$(openssl base64 -in jwtcookie.key -A) rsa_pub_key=$(openssl base64 -in jwtcookie.key.pub -A) ``` Put the base-64 encoded keys into a json file like so: ``` cat << EOL > jwtkeys.json { "rsa_priv_key": "$rsa_priv_key", "rsa_pub_key": "$rsa_pub_key" } EOL ``` Create the secret in AWS, referencing the json file created above ``` aws $AWSENV secretsmanager create-secret --name jwt_secret_for_tea \ --description "RS256 keys for app JWT cookies" \ --secret-string file://jwtkeys.json ```