@@ -507,80 +507,42 @@ updated.
507
507
[[updating-policy-definitions]]
508
508
== Updating Policy Definitions
509
509
510
- After a cluster upgrade, the default roles
510
+ During a cluster upgrade, and on every restart of any master, the
511
511
xref:../architecture/additional_concepts/authorization.adoc#roles[default
512
- cluster roles] are automatically updated. To check if all defaults are set as
513
- recommended for your environment, run:
512
+ cluster roles] are automatically reconciled to restore any missing permissions.
514
513
514
+ . If you customized default cluster roles and want to ensure a role reconciliation
515
+ does not modify them, protect each role from reconciliation:
516
+ +
515
517
----
516
- # oc adm policy reconcile-cluster-roles
518
+ $ oc annotate clusterrole.rbac <role_name> --overwrite rbac.authorization.kubernetes.io/autoupdate=false
517
519
----
518
-
520
+ +
519
521
[WARNING]
520
522
====
521
- If you have customized default cluster roles and want to ensure a role reconciliation
522
- does not modify those customized roles, annotate them with `openshift.io/reconcile-protect`
523
- set to `true` when using the old Openshift policy format. When using the new RBAC
524
- roles, use `rbac.authorization.kubernetes.io/autoupdate` set to `false` instead.
525
- In doing so, you are responsible for manually updating those roles with any new
526
- or required permissions during upgrades.
523
+ You must manually update the roles that contain this setting to include any new
524
+ or required permissions after upgrading.
527
525
====
528
526
529
- This command outputs a list of roles that are out of date and their new proposed
530
- values. For example:
531
-
532
- ----
533
- # oc adm policy reconcile-cluster-roles
534
- apiVersion: v1
535
- items:
536
- - apiVersion: v1
537
- kind: ClusterRole
538
- metadata:
539
- creationTimestamp: null
540
- name: admin
541
- rules:
542
- - attributeRestrictions: null
543
- resources:
544
- - builds/custom
545
- ...
527
+ . Generate a default bootstrap policy template file:
528
+ +
546
529
----
547
-
530
+ $ oc adm create-bootstrap-policy-file --filename=policy.json
531
+ ----
532
+ +
548
533
[NOTE]
549
534
====
550
- Your output will vary based on the OpenShift version and any local
551
- customizations you have made. Review the proposed policy carefully .
535
+ The contents of the file vary based on the {product-title} version, but the file
536
+ contains only the default policies .
552
537
====
553
538
554
- You can either modify this output to re-apply any local policy changes you have
555
- made, or you can automatically apply the new policy using the following process:
556
-
557
- . Reconcile the cluster roles:
558
- +
559
- ----
560
- # oc adm policy reconcile-cluster-roles \
561
- --additive-only=true \
562
- --confirm
563
- ----
539
+ . Update the *_policy.json_* file to include any cluster role customizations.
564
540
565
- . Reconcile the cluster role bindings:
566
- +
567
- ----
568
- # oc adm policy reconcile-cluster-role-bindings \
569
- --exclude-groups=system:authenticated \
570
- --exclude-groups=system:authenticated:oauth \
571
- --exclude-groups=system:unauthenticated \
572
- --exclude-users=system:anonymous \
573
- --additive-only=true \
574
- --confirm
575
- ----
576
- +
577
- Also run:
541
+ . Use the policy file to automatically reconcile roles and role bindings that
542
+ are not reconcile protected:
578
543
+
579
544
----
580
- # oc adm policy reconcile-cluster-role-bindings \
581
- system:build-strategy-jenkinspipeline \
582
- --confirm \
583
- -o name
545
+ $ oc auth reconcile -f policy.json
584
546
----
585
547
586
548
. Reconcile security context constraints:
0 commit comments