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

Add a setting disallowing access to all namespaces #7237

Merged

Conversation

chmouel
Copy link
Member

@chmouel chmouel commented Oct 19, 2023

With the cluster resolver we allow access to all namespaces by default if empty. This is not always desirable and we should have a way to only allow explicitly the namespaces that are allowed.

Let the user configure the blocked-namespaces setting to * to disallow all namespaces by default and only allow access to namespaces with the allowed-namespaces setting.

Changes

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

Add special value `*` to the blocked-namespace setting for the cluster-resolver to disallow by default all namespaces and only allow the namespaces explicitly listed in `allowed-namespace` setting.

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Oct 19, 2023
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 19, 2023
@vdemeester
Copy link
Member

@chmouel any reason to not change the default value as well ?

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/cluster/resolver.go 82.7% 83.3% 0.7

@chmouel chmouel force-pushed the cluster-resolver-disallow-everything-option branch from 00a8f90 to 823f45b Compare October 19, 2023 08:14
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/cluster/resolver.go 82.7% 83.3% 0.7

@chmouel
Copy link
Member Author

chmouel commented Oct 19, 2023

@chmouel any reason to not change the default value as well ?

I didn't think it's fair to our users to change the default behavior unless it's decided to be a security issue in #7236 then i guess we should change the default to star...

We could as well make empty value ("") in blocked-namespaces disallowing everything by default and allowed-namespaces == * allow everything if we wanted too... which does seem a tiny bit more logical but either way i am fine..

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/cluster/resolver.go 82.7% 83.3% 0.7

@chmouel
Copy link
Member Author

chmouel commented Oct 19, 2023

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 19, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/cluster/resolver.go 82.7% 83.3% 0.7

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/cluster/resolver.go 82.7% 83.3% 0.7

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 19, 2023
@vdemeester
Copy link
Member

cc @abayer

docs/cluster-resolver.md Outdated Show resolved Hide resolved
With the cluster resolver we allow access to all namespaces by default
if empty. This is not always desirable and we should have a way to only
allow explicitly  the namespaces that are allowed.

Let the user configure the `blocked-namespaces` setting to `*` to
disallow all namespaces by default and only allow access to namespaces
with the `allowed-namespaces` setting.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
@chmouel chmouel force-pushed the cluster-resolver-disallow-everything-option branch from 66f70cb to 64f73ec Compare October 20, 2023 03:39
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/cluster/resolver.go 82.7% 83.3% 0.7

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/cluster/resolver.go 82.7% 83.3% 0.7

@chmouel chmouel changed the title Add a setting to disallow access to all namespaces Add a setting to disallowing access to all namespaces Oct 23, 2023
@chmouel chmouel changed the title Add a setting to disallowing access to all namespaces Add a setting disallowing access to all namespaces Oct 23, 2023
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester, Yongxuanzhang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Yongxuanzhang,vdemeester]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/cluster/resolver.go 82.7% 83.3% 0.7

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/cluster/resolver.go 82.7% 83.3% 0.7

@vdemeester
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 24, 2023
@tekton-robot tekton-robot merged commit b958eb5 into tektoncd:main Oct 24, 2023
12 checks passed
@chmouel chmouel deleted the cluster-resolver-disallow-everything-option branch October 24, 2023 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants