Authentication, Authentication, Authorization Flashcards

(42 cards)

1
Q

Export the existing OAuth cluster resource to a file

A

oc get oauth cluster -o yaml > oauth.yaml

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Update oAuth cluster resource afters aving it to file

A

oc replace -f oauth.yaml

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Create the htpasswd file

A

htpasswd -c -B -b /tmp/htpasswd student redhat123

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Add or update credentials in htpasswd file

A

htpasswd -b /tmp/htpasswd student redhat1234

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Delete credentials in htpasswd file

A

htpasswd -D /tmp/htpasswd student

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

create a secret that contains the htpasswd file data

A

oc create secret generic htpasswd-secret –from-file htpasswd=/tmp/htpasswd -n openshift-config

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

3 steps to completely detele a htpasswd user

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

List all identity resources

A

oc get identities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Delete an identity resource

A

oc delete identity my_htpasswd_provider:manager

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Assign the cluster-admin role to the student user

A

oc adm policy add-cluster-role-to-user cluster-admin student

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Assign the cluster-role role to the student user

A

oc adm policy add-cluster-role-to-user cluster-role student

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Remove the cluster-role role from the student user

A

oc adm policy remove-cluster-role-from-user cluster-role student

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Determine if a user can execute an action on a resource

A

oc adm policy who-can delete user

oc adm policy who-can /verb/ /resource/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Add a specified role to a user

A

oc adm policy add-role-to-user role-name username -n project

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Mentally list all user types

A
  1. regular users
  2. system users
  3. service accounts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Create a generic secret containing key-value pairs from literal values typed on the command line

A

oc create secret generic secret_name –from-literal key1=secret1 –from-literal key2=secret2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Create a generic secret using key names specified on the command line and values from files

A

oc create secret generic ssh-keys –from-file id_rsa=/path-to/id_rsa –from-file id_rsa.pub=/path-to/id_rsa.pub

18
Q

Create a secret specifying a certificate and the associated key

A

oc create secret tls secret-tls –cert /path-to-certificate –key /path-to-key

19
Q

set application environment variables from secrets

A

oc set env deployment/demo –from secret/demo-secret –prefix MYSQL_

20
Q

mount secrets as file in a pod

A

oc set volume deployment/demo –add –type secret –secret-name demo-secret –mount-path /app-secrets

21
Q

create a configuration map

A

oc create configmap my-config –from-literal key1=config1 –from-literal key2=config2

22
Q

Save the cm data to a specific directory

A

oc extract cm/myconfig –to /tmp/ –confirm

23
Q

Update modified secret file

A

oc set data secret/htpasswd-ppklq -n openshift-config –from-file /tmp/htpasswd

24
Q

Command to list all scc defined in OpenShift

25
Obtain more info on an scc
oc describe scc anyuid
26
view the security context constraint that a pod uses
oc describe pod console-5df4fcbb47-67c52 -n openshift-console | grep scc
27
Command to list all the security context constraints that can overcome the limitations of a container
oc get pod podname -o yaml | oc adm policy scc-subject-review -f -
28
Create service account
oc create serviceaccount service-account-name
29
Associate a service account with an SCC
oc adm policy add-scc-to-user SCC -z service-account
30
Modify an existing deployment o to use a service account
oc set serviceaccount deployment/deployment-name service-account-name
31
Create self signed cert
openssl x509 -in training.csr -out training.pem -req -signkey training.key
32
nginx image
twalter/openshift-nginx
33
List all cluster role bindings that reference the self-provisioner cluster role
oc get clusterrolebinding | grep -E 'NAME|self-provisioner'
34
Confirm that the group system:authenticated:oauth has the self-provisioner role
**oc describe clusterrolebindings self-provisioners**
35
Remove the self-provisioner role from group system:authenticated:oauth
**oc adm policy remove-cluster-role-from-group self-provisioner system:authenticated:oauth**
36
Grant project administration privileges to user leader on project auth-rbac
**oc adm policy add-role-to-user admin leader**
37
Create a group called dev-group
**oc adm groups new dev-group**
38
Add the qa-engineer user to qa-group
**oc adm groups add-users qa-group qa-engineer**
39
List all groups
oc get groups
40
Add write privileges to dev-group on the current project in which current user is logged in
oc adm policy add-role-to-group edit dev-group
41
Add read privileges to dev-group on the current project in which current user is logged in
**oc policy add-role-to-group view qa-group**
42
Check all roles people have on tthe current project
**get rolebindings -o wide**