CloudBees CI CasC provides support for managing the configuration of CloudBees CI Role Based Access Control (RBAC) for controllers and folders on controllers.
In this lab we will explore updating the configuration bundle of your dev controller to manage RBAC with its CasC bundle.
Using CasC for RBAC requires that you allow Managed Controllers to opt-out of inheriting the Operations Center authorization strategy, meaning that the managed controller will not inherit roles or groups from Operations Center but will still authenticate through Operations Center. As noted in the previous lab, your dev controller was provisioned with the setting already configured to opt out of inheriting the Operations Center authorization strategy.
The configuration from the dev-controller controller.yaml that allows configuring RBAC with CasC for controllers:
- optOutProperty:
securityEnforcerOptOutMode:
authorizationOptOutMode: {
}
In addition to using CasC to configure RBAC for your dev controller, we will also utilize the Jenkins Overall/Manage and Overall/SystemRead permissions to limit the amount of configuration that your CloudBees CI user is able to make via the UI. The Overall/Manage permission will still allow your user to reload updated configuration bundles but the actual configuration changes must be committed to your dev-controller repository.
dev-controller repository.bundle.yaml version to 2, added an rbac entry and added the bundle/rbac.yaml file. 
rbac.yaml file. Note that we are adding two roles, administrator and manager; and creating two groups using those roles with your regular user being added as a member of the Managers group and your admin user being added to the Administrators group. 
main branch job of the dev-controller Multibranch pipeline project in the controller-casc-update Organization Folder on your Ops controller.main branch job has completed successfully, navigate to the top level of your dev controller, and click on the Manage Jenkins link in the left menu.

dev-controller repository.bundle.yaml version to 3, added an items entry and added the bundle/folder.yaml file. 
folder.yaml file and notice that we are creating a controller-jobs folder with a Job Managers group. 
rbac.yaml file. Note that we are adding the job-manager role being used in the folder.yaml file above. 
folders.yaml, and the changes to the rbac.yaml and bundle.yaml files, click on the Conversation tab of the Folder RBAC pull request, scroll down and click the green Merge pull request button and then click the Confirm merge button.main branch job of the dev-controller Multibranch pipeline project in the controller-casc-update Organization Folder on your Ops controller.main branch job has completed successfully, navigate to the top level of your dev controller and there will be a new controller-jobs folder. 
