Commit Graph

39 Commits

Author SHA1 Message Date
Josh Meranda aea1b7c94d
[main] Validate auditlog (#960)
* add AuditPolicy to codegen

* go generate

* add validation checks and tests

* use external dependencies
2025-06-30 11:43:20 -04:00
Jonathan Crowther 2618ee01f1
Add new User validation webhook (#786)
* Add new User validation

* Fix linter errors
2025-03-10 12:01:31 -04:00
Peter Matseykanets c61e597ef5
Validate LDAP/AD authconfigs (#682)
https://github.com/rancher/rancher/issues/48071
2025-02-24 13:37:28 -05:00
Vatsal Parekh f449e4babc
Update dependencies for k8s 1.32 (#672)
Signed-off-by: Vatsal Parekh <vatsalparekh@outlook.com>
2025-02-18 21:13:46 +05:30
Tom Lebreux 47d3795124
Update year to 2025 (#578) 2025-01-07 17:22:52 -05:00
Peter Matseykanets 6b74a9a900
Validate creatorId and creator-principal-name annotations for cluster/project (#501)
Ref: https://github.com/rancher/rancher/issues/46828
2024-09-19 15:40:04 -04:00
Peter Matseykanets 46f1698b49
Check that {disable|delete}-inactive-user-after setting is not less than auth-user-session-ttl-minutes (#471)
Ref: https://github.com/rancher/rancher/issues/46648
2024-09-09 15:24:39 -04:00
Sakala Venkata Krishna Rohit 40e8eae329
Add validation for ClusterRepo (#470)
* Add clusterrepo validations

* Add docs

* unit tests
2024-08-12 14:03:54 -04:00
Tom Lebreux 97679b88dd
Add k8s 1.30 support (#412) 2024-06-28 09:23:25 -04:00
Raul Cabello Martin f5cfd9821f
[v0.5] s4: Fixes 374 (#409)
* Verify ExternalRules in RoleTemplates

If the feature flag external-rules is enabled, the validation for RT follows this sequence:
- 1) Reject if externalRules are provided and the user doesn’t have escalate permissions on RoleTemplates.
- 2) Validate the policy rules defined in externalRules the same way as the already existing rules field. This validation leverages Kubernetes’ upstream validation. Webhook will validate this only if external is set to true.
- 3) Use externalRules for resolving rules if provided.
- 4) Use backing ClusterRole in the local cluster if externalRules are not provided.
- 5) Reject if externalRules are not provided and there is no backing ClusterRole in the local cluster.

For PRTB or CRTB:
- 1) Use externalRules for resolving rules if provided.
- 2) Use backing ClusterRole in the local cluster if externalRules are not provided.

The previous verification process applies if the external-rules feature flag is disabled.

* Allow Restricted Admin to update external-rules feature flag (#102)

---------
Co-authored-by: Raul Cabello Martin <raulcabm@gmail.com>
Co-authored-by: Jonathan Crowther <jonathan.crowther@suse.com>

* bump rancher to be able to use ExternalRules

* fix test conflict

---------

Co-authored-by: Peter Matseykanets <peter.matseykanets@suse.com>
2024-06-25 10:34:38 +02:00
Raul Cabello Martin af2d8bd5d2
Fleet RBAC - InheritedFleetWorkspacePermissions validation (#348)
- Validate the user have enough permission to create/update the rules defined in InheritedFleetWorkspacePermissions.ResourceRules
- Validate the user have enough permission to create/update the rules that are generated based on the InheritedFleetWorkspacePermissions.WorkspaceVerbs

---------

Co-authored-by: Michael Bolot <michael.bolot@suse.com>
2024-06-24 09:49:31 +02:00
Peter Matseykanets b3bccd2707
[v0.5] s4: Fixes 227 (#404)
* Validate user retention userattribute fields and settings (#90)
* [v0.4.s4] Don't allow empty lastLogin user attribute (#97)
2024-06-18 07:26:38 -04:00
Chad Roberts 8e3d96998f
Add validator for clusterproxyconfigs to make sure only one is ever created for a given cluster (#327)
* Add validator for clusterproxyconfigs to make sure only one is ever created for a given cluster
* Add integration test for clusterProxyConfigs
2024-04-03 12:02:30 -04:00
Tom Lebreux 49160dee86
Add support for k8s 1.28 (#341) 2024-03-27 16:56:34 -04:00
Jonathan Crowther b18c38740a
Add webhook checks for NamespacedRules (#309)
* Add role and rolebinding webhook validation. Add NamespacedRules escalation checks for GlobalRoles

* Update rancher/pkg/apis

* Fix linting issue

* Log error and add test for it
2024-01-15 17:17:15 -05:00
Jacob Lindgren 9253ca52d1
`go generate` to update copyright year 2024-01-11 10:06:31 -06:00
Michael Bolot 707f7876c7 Adding validation for cluster/projectName for prtb
Adds validation on clusterName and projectName for prtbs to make sure
they refer to existing projects/clusters and that the project refers to
the cluster in the spec
2023-09-25 13:56:30 -05:00
Michael Bolot 7766409968 Adding validation for grb owner label immutability
Adds validation on the grb owner label, allowing crtbs with this label
to use locked roleTemplates, and prventing users from changing this
value or setting it to an invalid grb
2023-09-01 09:24:07 -05:00
Colleen Murphy 16d548f8b9 Add validation and mutation for Projects
New validations:
- prohibit deleting the system project
- check that quota fields are consistent with one another and sufficient
  for existing quota usage

New mutations:
- adds creator-role-bindings annotation
2023-08-16 12:13:21 -07:00
Kevin Joiner 874bd484da Bumps wrangler and pkg/apis, then run go generate. 2023-07-14 08:36:29 -04:00
Jacob Lindgren 0a8256b1d0 Add Validation on NodeDriver update/delete to prevent machine deletion 2023-06-30 12:12:00 -05:00
Michael Bolot a6c9cc2978 Adding docs for some resources 2023-06-07 12:36:53 -05:00
Jiaqi Luo eac139ee86 add the support for using PSACT on RKE2/K3S clusters 2023-02-07 10:46:45 -07:00
Jiaqi Luo e04f021140 go generate 2023-01-03 18:50:08 -07:00
Jiaqi Luo 8b5a1f2262 [code gen] add PodSecurityAdmissionConfigurationTemplate 2023-01-03 15:49:47 -07:00
Harrison Affel 96af75c7e3 go generate 2022-12-21 14:18:21 -05:00
Chad Roberts 5495fda809
Add webhook handler for namespaces to govern PSA label editing 2022-12-19 15:39:51 -05:00
Kevin Joiner 5f4f390a87 Restructered webhook registration.
Webhook request routing is now handled by K8s.
2022-12-15 12:05:58 -05:00
Kevin Joiner dcd0990569 Simplify object decoding from request.
Object decoding was perfroming excessive casting and
had unnecessary dependencies on wrangler.
2022-11-30 08:24:17 -05:00
Michael Bolot 2619688858 Basic boilerplate for some role resolvers 2022-09-19 14:09:20 -04:00
Donnie Adams 6bf29f224b Run go generate 2022-01-05 13:37:57 -07:00
Donnie Adams b0142e3fad Run go generate for 2022 copyright 2022-01-03 10:57:05 -07:00
Ricardo Weir 8de04965f8 Add feature type 2021-08-25 09:22:41 -07:00
Donnie Adams 42c30d033c Add generation for getting objects from requests
In order to validate objects, the new and old objects, if they exist,
should be pull from the webhook request. This process is identical for
all objects except that the return types would be different. This is a
candidate for code generation, and this generation is added.
2021-07-27 11:06:52 -07:00
Dan Ramich c2532cb33a Generated changes 2021-07-01 16:28:18 -06:00
Darren Shepherd 6c859a4b29 Update generated code 2021-02-19 19:59:34 -07:00
Darren Shepherd b1cbb02b5c Update generated code 2020-11-09 22:04:09 -07:00
Dan Ramich d203741554 Generated changes 2020-09-29 20:49:57 -06:00
Dan Ramich 698db66abb Generated changes 2020-09-24 11:22:16 -06:00