-
Notifications
You must be signed in to change notification settings - Fork 477
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
Invalid tag when assuming role #18
Comments
My preference would be sanitizing the username in some way. My intentions in including all of those tags is so that the owner of that role can define fine-grained IAM policies that limit what event triggers are allowed to assume the role and so that CloudTrail logs would have a clear and useful audit information. We should also make sure that none of the other tags have this issue. I suspect that Another concern in doing any sanitization is that we need to make sure that we don't sanitize in a way that will conflict with another valid value (ex: |
Yeah encoding would be easiest, but would definitely make the logs a lot less clear. It would also make the fine-grained IAM policies difficult to define and would remove and ability to use wildcards for it. At least for A Github Repository name is alphanumeric +
To summarise: |
I can't seem to find actual docs on the character space for username/repo, so I'm using the website error messages as a stand-in: GITHUB_ACTORPer the new-user creation page:
Agreed, we appear to be safe with the one special case. GITHUB_REPOSITORYThe repo creation page doesn't actually complain if you put "bad" characters in the name, but apparently it just turns anything it doesn't like into either a It also appears to truncate the name to 100 characters. We'll want to apply the same sanitization as the username because this value is actually the Agreed, we appear to be safe here. Others
|
For reference so I don't have to search for it again, the restrictions on tag values are here: https://docs.aws.amazon.com/STS/latest/APIReference/API_Tag.html
|
Nah I don't think it's the job name. The docs say:
So it's actually the action itself that the current running step is using (I think). The reason I say I think it's generated from the repo name is from having used some terraform actions. You can see here it will comment out
As far as I can tell this is "org + repo + 3". I'm not exactly sure why it's "3"... I assume for a user it would be "user + repo + #" 🤷♂ Either way I reckon this means it won't require any sanitisation. |
Possibly, yeah. If that's the case then I think the only potential issue would be the length. Looks like the max username length is 39 characters, and I assume the same is true for orgs, since they're [kindasorta] just fancy users. That gives us 139 possible characters for the username + repo, leaving 117 for whatever is added to the end. If that's just the action execution counter, that should be plenty. |
Well, it looks like this is a legitimate workflow name...: (I just used Python's string.punctuation) |
Not sure if creating a new issue is the way to go... I recently experienced this error:
The strange thing is, I am using the exact same workflow in a different repo and it works. I have double-checked the credentials, so I don't think that's it. |
Hi 👋
I've just been trying to use the new role-assuming feature in master, but I've run into an issues with the session tagging.
I'm getting the following error:
My theory is that this is caused by tagging the session with the
GITHUB_ACTOR
environment variable.In this line, the session is tagged with
GITHUB_ACTOR
.The actor of the run (and so
GITHUB_ACTOR
) wasdependabot-preview[bot]
.It seems that
[
and]
are not valid characters in AWS session tags, and so this is crashing the program.Seems like the tag must be removed or the variable sanitised.
The text was updated successfully, but these errors were encountered: