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

Deny specific image tag in the Tenant #132

Closed
emanuelr93 opened this issue Nov 11, 2020 · 3 comments
Closed

Deny specific image tag in the Tenant #132

emanuelr93 opened this issue Nov 11, 2020 · 3 comments
Labels
needs-discussion No outline on the feature, discussion is welcome

Comments

@emanuelr93
Copy link

emanuelr93 commented Nov 11, 2020

Describe the feature

A Tenant could just use a specific regex to validate image tag. The rule can be setted in Deny or Allowed mode.
This can be useful for example in Production Tenant.
For example:

  • I want to disallow the usage of latest image in Production
  • I want to allow only image with tag that use Semantic Version in production (eg. X.Y.Z)

Another use case would be to only allow the use of the Image Digest instead of the tag as best practices recommend.

How would the new interaction with Capsule look like?

  1. setup a Validating Admission webhook for every Pod
  2. retrieve the Tenant from the namespace indexer
  3. check if the image tag match with rules on Tenant

Expected behavior

  • if the Pod is running on a non-Capsule namespace, return Allowed without further actions
  • if the Pod is running on a Capsule namespace with a non allowed tag, return Forbidden
  • if the Pod is running on a Capsule namespace with an allowed tag, return Allowed
@emanuelr93 emanuelr93 added the blocked-needs-validation Issue need triage and validation label Nov 11, 2020
@prometherion prometherion added needs-discussion No outline on the feature, discussion is welcome and removed blocked-needs-validation Issue need triage and validation labels Nov 11, 2020
@prometherion
Copy link
Member

Definitely, an interesting feature proposal.

I got just a single remark, here: this seems more a business logic that should be handled at CD level.
Although that could be implemented in the Tenant definition, I would say that additional custom checks could be added here.

What we're planning is to provide a programmable admission webhooks spec using the REGO DSL, and most of the actual logic (as the ones we're planning to implement) could be translated there.

But let's start the discussion, anyway: @bsctl what do you think about this?

@bsctl
Copy link
Member

bsctl commented Nov 11, 2020

I would say leave it as part of #51.

@prometherion
Copy link
Member

LGTM, let's close as you said but I'd like to thanks @emanuelr93 for your feature request: we're going to address when implementing natively OPA/Gatekeeper and I guess this validation can be a valid use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-discussion No outline on the feature, discussion is welcome
Projects
None yet
Development

No branches or pull requests

3 participants