Skip to content
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

AWS Support target "repository" as a prefix #640

Open
ryanfaircloth opened this issue Jan 9, 2024 · 5 comments
Open

AWS Support target "repository" as a prefix #640

ryanfaircloth opened this issue Jan 9, 2024 · 5 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@ryanfaircloth
Copy link

currently images are pushed to ecr in /docker.io/ syntax in some cases where multiple eks clusters are in the same account in the same region but may not share authorized images a parent repository path is appropriate add a prefix to the aws target config and prepend the value to the target path to ensure separation as needed

@estahn
Copy link
Owner

estahn commented Jan 30, 2024

@ryanfaircloth Interesting. Why would you want to separate those, as they would be identical?

@estahn estahn added enhancement New feature or request question Further information is requested labels Jan 30, 2024
@mikebryant
Copy link

mikebryant commented Feb 7, 2024

We'd like this, but for a slightly different reason. We want to give k8s-image-swapper access to store images from arbitrary registries, but also in the same AWS account have our own images that it should not be able to write to.

Currently we're having to explicitly list out all the different registries that we're swapping - if we could put a prefix there it would be much simpler to use and reason about :)

(The reason for this is simply that our corporate security policy mandates least-privilege access control)

@ryanfaircloth
Copy link
Author

Without the prefix it's possible to trick image swapper into pulling a malicious image from another registry with the same name

@estahn
Copy link
Owner

estahn commented Feb 13, 2024

@ryanfaircloth I'm just discussing some mechanics to change the source image in #660 and wondered if that could be useful in your case as well, but on the target end:

source:
  filters:
  - jmespath: "contains(container.image, '.dkr.ecr.') && contains(container.image, '.amazonaws.com')"

  preprocessor:
  - replace:
       from: dkr.ecr.eu-west-1.amazonaws.com
       to: dkr.ecr.us-east-1.amazonaws.com

In your case it's probably something like:

source:
  filters:
  - jmespath: "contains(container.image, '.dkr.ecr.') && contains(container.image, '.amazonaws.com')"

  preprocessor:
  - prefix: <myprefix>

target:
  preprocessor:
  - prefix: <myprefix>

Thoughts?

@ryanfaircloth
Copy link
Author

I think this could work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants