-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Decrypt SecureString value obtained by SsmHook #29142
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
Conversation
ferruzzi
left a comment
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.
Nice catch! IMHO, if we are decoding by default then masking sounds like the right answer to me. I'm not really up to date on best practices when using SecureString though, so I'm happy to defer if someone feels otherwise.
Well there is not easy answer as well as best practices. We do not know what users might store into SSM Parameter Store and how they intend to use it. If it credentials the answer straightforward, yes we should, like here: airflow/airflow/providers/amazon/aws/hooks/base_aws.py Lines 662 to 666 in 3b25168
IMHO, In general if you create secure string you do not want to some one who does not have access to KMS keys see value. |
It would be ideal if only the password got masked, but I think if a user is setting the parameter as a secure string, it would be better to assume more security than less. |
|
Since we cant be sure where it password and where it is not than better mask all. |
ferruzzi
left a comment
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.
Nice, thanks for adding the masking.
|
@o-nikolas if you have a time could you also have a look (you have a binding approval power) and maybe we could merge it |
eladkal
left a comment
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.
LGTM
Right now if we try to get SecureString by
SsmHook.get_parameter_valuethen we get encrypted value, which is useless for further usage without decryption.Without this changes
AQICAHiA4cbp5//uho/.../Mlb3cleB4/7XXjkhAfter this changes
postgresql+psycopg2://airflow:insecurepassword@postgres/airflowWDYT, should we also mask value if value has type
SecureString?