Authentication, Authentication, Authorization Flashcards
Export the existing OAuth cluster resource to a file
oc get oauth cluster -o yaml > oauth.yaml
Update oAuth cluster resource afters aving it to file
oc replace -f oauth.yaml
Create the htpasswd file
htpasswd -c -B -b /tmp/htpasswd student redhat123
Add or update credentials in htpasswd file
htpasswd -b /tmp/htpasswd student redhat1234
Delete credentials in htpasswd file
htpasswd -D /tmp/htpasswd student
create a secret that contains the htpasswd file data
oc create secret generic htpasswd-secret –from-file htpasswd=/tmp/htpasswd -n openshift-config
3 steps to completely detele a htpasswd user
1) htpasswd -D /tmp/htpasswd manager
2) oc set data secret/htpasswd-secret –from-file htpasswd=/tmp/htpasswd -n openshift-config
3) oc delete user manager
List all identity resources
oc get identities
Delete an identity resource
oc delete identity my_htpasswd_provider:manager
Assign the cluster-admin role to the student user
oc adm policy add-cluster-role-to-user cluster-admin student
Assign the cluster-role role to the student user
oc adm policy add-cluster-role-to-user cluster-role student
Remove the cluster-role role from the student user
oc adm policy remove-cluster-role-from-user cluster-role student
Determine if a user can execute an action on a resource
oc adm policy who-can delete user
oc adm policy who-can /verb/ /resource/
Add a specified role to a user
oc adm policy add-role-to-user role-name username -n project
Mentally list all user types
- regular users
- system users
- service accounts
Create a generic secret containing key-value pairs from literal values typed on the command line
oc create secret generic secret_name –from-literal key1=secret1 –from-literal key2=secret2