Explicit auth with TEMP tokens
Informs #56536
Use of external storage temp tokens, together with explicit authentication is dangerous. In general, explicitly specified tokens could expire while long running operation (backup, restore) is still executing, without any way for us to regenerate such temp token.
We should error out if external storage URI uses temporary credentials for backup, restore, import, scheduled backup and cdc.
We should also provide an extra URI parameter for the user to specify if they really wish to override this behavior: "&REALLY_USE_TEMP_CREDENTIALS"
Epic CRDB-71
Jira issue: CRDB-2924
hey @miretskiy , may I pick up this issue?
@xuhui-lu of course
@xuhui-lu @miretskiy is it still valid? May I grab it?
As I understand the problem is with s3 external storage uses temp token.
@miretskiy , you specified a set of operation where usage of temp token should be forbidden. Does it make sense to add temp token check to the ExternalStorageConfFromURI only? Or should other operations like WriteFile, ListFiles still work with temp tokens?
I would start with adding new field really_use_temp_credentials to S3 message in roachpb/api.proto.
@mneverov @miretskiy is this issue still valid? is it currently being worked on?
stale or active?
is it active?
I've been reading the current code and want to confirm the intended boundary before attempting this.
-
Where should the rejection live?
newS3Storage(pkg/cloud/amazon/s3_storage.go:401parsesAWS_SESSION_TOKENintoTempToken;:433-456and:494-519validateauth) runs for every S3 URI, so a check there would also break read-only uses (e.g. external tables). The body scopes this to backup/restore/import/scheduled backup/CDC. Should we reject at conf-parse time (simple, but over-broad), or thread the operation kind down to storage construction so only the long-running ops reject temp tokens? -
Is
&REALLY_USE_TEMP_CREDENTIALSstill the agreed spelling, and should it be a newS3field inpkg/cloud/cloudpb/external_storage.proto(next totemp_token = 5/auth = 8) rather than an ad-hoc URI param? -
@mneverov's 2021 question is still unanswered: should
WriteFile/ListFileskeep working with temp tokens? My reading is yes (short-lived), which argues for checking at operation construction, not URI parse.
Happy to pick this up if it's still wanted.