vexance / Stratustryke

A small work-in-progress modular cloud security tool
2 stars 0 forks source link

[STSK19] AWSCredential.assume_role() ExternalId must be a minimum of 2 characters #19

Closed vexance closed 1 year ago

vexance commented 1 year ago

Current default value for ext_id for AWSCredential.assume_role() is set to an empty string ''. This will lead to InputValidationException as ExternalIds for the sts:AssumeRole call must be a minimum of two characters. We can fix this by setting the default value of ext_id to be any arbitrary 2-character (or longer if necessary) string (e.g., 'stratustryke'). This will allow AssumeRole calls to work when an ExternalId is not required, and also when an ExternalId is supplied as the value will update to the supplied id.

vexance commented 1 year ago

The current workaround for this issue until a fix is merged is to pass a arbitrary 2 character string in any assume_role() calls. An in-module example is shown below.

def run(self):
    cred = self.get_cred()
    role_creds = cred.assume_role(......., ext_id='xx')
vexance commented 1 year ago

Fixed with #22 . Closing