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

improvement: rego unit test and gator test polishing #2767

Merged
merged 3 commits into from
Mar 9, 2023

Conversation

ArrisLee
Copy link
Collaborator

@ArrisLee ArrisLee commented Mar 9, 2023

Which issue this PR addresses:
https://issues.redhat.com/browse/ARO-2222

What this PR does / why we need it:
Prevents non-privileged namespaces from having pods that have masters toleration taints.
non-privileged namespaces can match (openshift-logging|openshift-operators)

Test plan for issue:
Rego unit test + Gator test

Is there any documentation that needs to be updated for this PR?
May need to update the policy design doc for guardrail

@ArrisLee ArrisLee changed the title rego unit test and gator test polishing improvement: rego unit test and gator test polishing Mar 9, 2023
Copy link
Contributor

@yjst2012 yjst2012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yjst2012 yjst2012 merged commit 154a962 into Azure:feature/guardrails-policy Mar 9, 2023
hawkowl pushed a commit that referenced this pull request Jul 18, 2023
* Revert "temporarily remove policies other than the machine one as the example and test policy to create a base code pr"

This reverts commit 08d377d.

* extracted shared rego resources to a separate lib

* improvement: rego unit test and gator test polishing (#2767)

* rego unit test and gator test polishing
* lint fix
* rego lint fix

* adjusted user id related judgement plus match kinds for resources other than pod

* added test cases for priv'd ns to cover pull-secret deletion

* add new policy for machine config modification (#2879)

* add new policy for machine config modification
* reformat yaml
* revise api group logic

* added pod host path policy

* dont run guardrails if a standard gatekeeper instance is already started

* comment out corresponding gator tests as r/w PV check is temporarily removed

* satisfy mega linter

* temporarily backoff the standard gatekeeper check

* enable standard gatekeeper check with proper test case modifications

* comment out non-namespaced resources

* add k8s specific namespaces to the priv'd list

* update README plus add two SA to allowed list

* update Guardrails README

* a typo in README

* allow policies to enforce on openshift-azure-guardrails namespace

* added group support for user validation

* update: Guardrail policy scripts and doc updates (#2941)

* update generate.sh to support single dir gen
* update scripts to support params
* update README

* added usage print for scripts

* change to flexible mode for username, group and SA name validation

* update get func to print more debug info

* rely solely on userInfo for user authentication

* extend audit-interval to slow down the audit run, plus display more violations

* roll back a temp change for local test

* dont allow updates for machine and machineset

* removed MachineSet

* unified the constraint filename and resource name to make the config easier

* adjust constraint and template name and kind as per convention

* update gatekeeper params, affinity and tolerations

* log violations

* white list more user and group

* extend priv'd ns protection to ns itself

* add guardrails policy generate entry in makefile

* make gator in README lower cased to keep consistent with official doc

---------

Co-authored-by: Arris Li <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants