RBAC Flashcards

(15 cards)

1
Q

What is the purpose of RBAC in Kubernetes?

A

RBAC is used to control what actions a user or service account can perform on specific resources in the cluster.

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

What Kubernetes object is used to define a set of permissions for a namespace?

A

A Role object defines a set of permissions within a namespace.

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

What three fields are used inside each RBAC rule?

A

Each RBAC rule is built from apiGroups resources and verbs.

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

How do you specify the core API group in a Role rule?

A

For core resources such as pods you leave the apiGroups field empty.

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

In the lecture example what resources and actions were given to the developer role?

A

The developer role was allowed to work with pods using verbs such as get list create and delete and was also allowed to create ConfigMaps.

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

What object connects a user to a Role in Kubernetes RBAC?

A

A RoleBinding connects a user group or service account to a Role.

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

What are the two main sections inside a RoleBinding spec?

A

A RoleBinding mainly uses subjects to define who gets access and roleRef to define which Role is being granted.

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

Are Roles and RoleBindings namespaced or cluster scoped?

A

Roles and RoleBindings are namespaced objects and their permissions apply only within that namespace.

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

How do you give a user access in a different namespace?

A

You create the Role and RoleBinding in that target namespace instead of the default namespace.

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

Which command lets you check whether your current identity can perform an action?

A

kubectl auth can-i lets you test whether an action is allowed.

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

How can an administrator test another users permissions without logging in as that user?

A

An administrator can use kubectl auth can-i with the –as option to impersonate that user.

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

How can you test whether a user can perform an action in a specific namespace?

A

Use kubectl auth can-i with the action and resource plus the namespace option such as -n.

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

What does the resourceNames field in an RBAC rule let you do?

A

The resourceNames field lets you restrict access to specific named resources instead of all resources of that type.

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

In the lecture example how could resourceNames be used for pods?

A

It could be used to allow access only to specific pods such as blue and orange instead of every pod in the namespace.

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

What is a very important CKAD distinction related to Roles that is useful to remember even beyond this lecture?

A

Role and RoleBinding are namespaced while ClusterRole and ClusterRoleBinding are used for cluster wide permissions.

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