-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: PUC-752: reading OIDCCryptoPassphrase from a file #650
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you write a description of why the change is needed to leave us some bread crumbs for future logic. I've recently found myself needing to refer to our commits in upstream OpenStack projects and our commits have been lacking in explanation which would be helpful.
323ef12
to
19b5006
Compare
52478cb
to
2a78532
Compare
2a78532
to
8b9d3fc
Compare
scripts/gitops-secrets-gen.sh
Outdated
default_pwgen() { | ||
"${SCRIPTS_DIR}/pwgen.sh" 2>/dev/null | ||
} | ||
|
||
# Custom password generator with only alphabets | ||
# shellcheck disable=SC2317 | ||
alpha_only_pwgen() { | ||
head /dev/urandom | tr -dc A-Za-z | head -c 32 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default_pwgen() { | |
"${SCRIPTS_DIR}/pwgen.sh" 2>/dev/null | |
} | |
# Custom password generator with only alphabets | |
# shellcheck disable=SC2317 | |
alpha_only_pwgen() { | |
head /dev/urandom | tr -dc A-Za-z | head -c 32 | |
} | |
default_pwgen() { | |
"${SCRIPTS_DIR}/pwgen.sh" 2>/dev/null | |
} | |
# Custom password generator with only alphabets | |
# shellcheck disable=SC2317 | |
alpha_only_pwgen() { | |
head /dev/urandom | tr -dc A-Za-z | head -c 32 | |
} |
So we're not setting LC_ALL to C like the pwgen.sh
script does. Let's instead add another parameter to pwgen.sh
and let you specify the range.
So in that script do tr -dc ${2:-_A-Z-a-z-0-9}
scripts/gitops-secrets-gen.sh
Outdated
@@ -274,7 +286,7 @@ load_or_gen_os_secret() { | |||
return 1 | |||
else | |||
echo "Generating ${secret_var}" | |||
data="$("${SCRIPTS_DIR}/pwgen.sh" 2>/dev/null)" | |||
data="$(${gen_func})" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data="$(${gen_func})" | |
data="$("${SCRIPTS_DIR}/pwgen.sh" 32 "A-Za-z" 2>/dev/null)" |
1e56cc6
to
b29edcd
Compare
Problem:
Unable to authenticate when the user receives the initial state, it is encrypted with a key from pod A, then user is redirected to the identity provided and finally when they get back through redirect, they may land on pod B which is no longer able to decrypt the state.
Solution:
OIDCCryptoPassphrase is a password used for encryption of the state cookie and cache entries and it must be the same on all replicas.
Previously we were setting the OIDCCryptoPassphrase to a random value that is generated on pod startup and multiple pods have different value.