StatCan / gatekeeper-policies

Policies that are to be enforced by GateKeeper for the Cloud Native Platform
Other
16 stars 12 forks source link

DRAFT: @cbrown/1335 non employee rbac #44

Closed Collinbrown95 closed 2 years ago

Collinbrown95 commented 2 years ago

Description

Refactor deny-external-users and deny-employee-only-features to make use of the new capability-based labels of profiles-state-controller. Specific changes

deny-external-users

In summary: if the user being added does not have a Statcan domain or is in the list of exception cases, and the user is being added to a namespace that has state.aaw.statcan.gc.ca/has-sas-notebook-feature: true (i.e. there is a pod with the sas-notebook feature enabled), then the request should be denied since a non-employee user without an exception is being added to a namespace with the sas-notebook feature present in at least one pod.

deny-employee-only-features

In summary: if a pod with a SAS image is being created in a namespace with state.aaw.statcan.gc.ca/exists-non-sas-notebook-user: true, then the request should be denied as there exists at least one user in the namespace who does not have the sas-notebook capability.

Collinbrown95 commented 2 years ago

Closing in favour of https://github.com/StatCan/gatekeeper-policies/pull/46