You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm trying to launch a container in GitHub Actions and the image I want to use is in ECR. I find the default 12 hour authorization token expiration time of aws ecr get-login-password to be quite long for our use cases and checking the base64 encoded output of an aws-actions/amazon-ecr-login docker_password output would indicate that this action has the same 12 hour expiration. Considering that actions might be run multiple times per day and seemingly a new password is generated each time, this seems like we're generating a lot of overlapping tokens, which as far as I'm aware can't be manually (or automatically) revoked.
Describe the solution you'd like
I would like an input argument, something like auth-token-duration-minutes, where I can define in minutes how long the authorization token will be active. Eg:
Doesn't matter if it's seconds or minutes, whichever would be fine.
Describe alternatives you've considered
There are some alternative solutions, eg. https://dev.to/phouchens/github-actions-using-a-aws-ecr-image-as-a-container-38g, where a secondary job is used to update a repository/org secret in GitHub, which is run in a cron schedule. While this seems like a decent alternative, this requires you to use a separate GitHub PAT token (since GITHUB_TOKEN doesn't have access to secrets https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token) and I don't think the current access control in GitHub PAT tokens is that great, most if the scopes seem fairly wide to me and you don't seem to be able to target them to specific repositories or specific secrets etc. Additionally I don't feel too comfortable that an action has the ability to manage secrets in the repo or the org, it seems to me that it allows anyone with write access to the repo the ability to change those secrets at will, which naturally doesn't seem great.
Additional context
#455 seems sort of related, but I think the logout helps in a single job scope, and not in cases where you might need to reuse the login token, best example being the previously described container job which uses ECR images.
Something similar is already present in the credentials configuration job (https://github.com/aws-actions/configure-aws-credentials), where one can set role-duration-seconds. This is great, but as far as I can tell the ECR password can be used independantly of roles, so the permission cannot be revoked via role access expiration.
Here is a stripped down and masked version of what I'm using:
While passing these secrets as outputs is far from fantastic, I like the ability of performing temporary authentications for each run rather than updating tokens via cron schedules every n hours. The problem is when I might be running this task a few times an hour, which means I'm generating tons of authorization tokens quite needlessly. I took a visual look at the generated password with this task in a private repository: (the output is in plain text so of course this should not be done in a public repo)
Is your feature request related to a problem? Please describe.
I'm trying to launch a container in GitHub Actions and the image I want to use is in ECR. I find the default 12 hour authorization token expiration time of
aws ecr get-login-password
to be quite long for our use cases and checking the base64 encoded output of an aws-actions/amazon-ecr-login docker_password output would indicate that this action has the same 12 hour expiration. Considering that actions might be run multiple times per day and seemingly a new password is generated each time, this seems like we're generating a lot of overlapping tokens, which as far as I'm aware can't be manually (or automatically) revoked.Describe the solution you'd like
I would like an input argument, something like auth-token-duration-minutes, where I can define in minutes how long the authorization token will be active. Eg:
Doesn't matter if it's seconds or minutes, whichever would be fine.
Describe alternatives you've considered
There are some alternative solutions, eg. https://dev.to/phouchens/github-actions-using-a-aws-ecr-image-as-a-container-38g, where a secondary job is used to update a repository/org secret in GitHub, which is run in a cron schedule. While this seems like a decent alternative, this requires you to use a separate GitHub PAT token (since GITHUB_TOKEN doesn't have access to secrets https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token) and I don't think the current access control in GitHub PAT tokens is that great, most if the scopes seem fairly wide to me and you don't seem to be able to target them to specific repositories or specific secrets etc. Additionally I don't feel too comfortable that an action has the ability to manage secrets in the repo or the org, it seems to me that it allows anyone with write access to the repo the ability to change those secrets at will, which naturally doesn't seem great.
Additional context
#455 seems sort of related, but I think the logout helps in a single job scope, and not in cases where you might need to reuse the login token, best example being the previously described container job which uses ECR images.
Something similar is already present in the credentials configuration job (https://github.com/aws-actions/configure-aws-credentials), where one can set role-duration-seconds. This is great, but as far as I can tell the ECR password can be used independantly of roles, so the permission cannot be revoked via role access expiration.
Here is a stripped down and masked version of what I'm using:
While passing these secrets as outputs is far from fantastic, I like the ability of performing temporary authentications for each run rather than updating tokens via cron schedules every n hours. The problem is when I might be running this task a few times an hour, which means I'm generating tons of authorization tokens quite needlessly. I took a visual look at the generated password with this task in a private repository: (the output is in plain text so of course this should not be done in a public repo)
The returned format of docker_password seems to be the exact same as with
aws ecr get-login-password
with the same 12h expiration.Please let me know if I'm wrong with some of my points or if this is a duplicate.
EDIT: added some extra formatting, sorry for the wall of text
The text was updated successfully, but these errors were encountered: