Courseiva

CCNA Security And SCC Questions

70 questions · Security And SCC · All types, answers revealed

1
MCQeasy

An administrator is auditing Pod Security Standards compliance across several namespaces in an OpenShift cluster. Which namespace label must be applied to enforce the restricted Pod Security standard while logging violations?

A.pod-security.kubernetes.io/enforce: restricted
B.pod-security.openshift.io/standard: restricted
C.security.openshift.io/scc.enforce: restricted
D.openshift.io/cluster-monitoring: "true"
AnswerA

This label enforces the restricted Pod Security Standard, blocking non-compliant pods.

Why this answer

To enforce a standard while generating audit log violations, the audit level is set to enforce while warning/audit levels are configured via namespace labels.

2
MCQmedium

An administrator needs to configure a new project so that pods deployed within it run with the restricted-v2 Security Context Constraint by default. Which action should the administrator perform?

A.Annotate the Namespace with security.openshift.io/scc: restricted-v2
B.Edit the default cluster-wide SCC object directly to set restricted-v2 as priority zero
C.Create a RoleBinding linking the restricted-v2 ClusterRole to the system:authenticated group
D.Patch the PodSecurity standards admission configuration in the APIServer resource
AnswerA

This annotation instructs the SCC admission plugin to assign restricted-v2 as the default for pods in the namespace.

Why this answer

Applying the security.openshift.io/scc: restricted-v2 annotation to the Namespace forces pods requesting no specific SCC to default to restricted-v2 via admission control.

3
Multi-Selecthard

Which THREE commands are used to manage service account secrets?

Select 3 answers
A.oc secret create
B.oc secrets link
C.oc secrets add
D.oc secrets new-dockercfg
E.oc secret update
AnswersB, C, D

This links a secret to a service account.

Why this answer

Service accounts use secrets for pull credentials and API tokens.

4
MCQeasy

An administrator needs to secure a Route using a custom wildcard certificate. The certificate and private key are stored in a TLS Secret named wildcard-tls-secret in the same namespace as the Route. Which section of the Route manifest should reference this Secret?

A.spec.backend.tlsSecret.
B.spec.tls with termination: edge and certificate, key, and caCertificate fields pointing to the secret keys.
C.spec.wildcardPolicy with secretName: wildcard-tls-secret.
D.metadata.annotations using the route.openshift.io/tls-secret annotation.
AnswerB

The spec.tls block defines the termination strategy and references the secret keys.

Why this answer

Custom TLS certificates for routes are configured under the spec.tls block of the Route resource, referencing the certificate and key components in a TLS secret.

5
MCQhard

A pod fails to start in a restricted namespace because it attempts to bind to a privileged host port (port 80). The administrator wants to create a custom SCC that permits binding to privileged ports only for this specific application workload, without granting full root privileges. Which custom SCC configuration field should be explicitly set?

A.allowHostPorts: true
B.runAsUser.type: RunAsAny
C.allowPrivilegedContainer: true
D.privileged: true
AnswerA

Setting allowHostPorts to true allows pods to bind to ports on the host node, including privileged ports.

Why this answer

Allowing pods to bind to privileged ports (< 1024) is controlled by setting allowHostPorts to true or defining allowedHostPorts in a custom SCC.

6
MCQhard

An administrator is troubleshooting an Ingress routing issue where external clients receive a 503 error when trying to access a secure application through a Route configured with passthrough TLS termination. What is the most likely cause of this issue?

A.The Route manifest is missing the spec.tls.destinationCACertificate field
B.The default Ingress controller wildcard certificate has expired
C.The target application pod is not configured to terminate TLS and present a valid certificate matching the route hostname
D.The Route object lacks an annotation specifying openshift.io/router.router-credentials
AnswerC

Passthrough routes send encrypted TLS traffic directly to the pod, requiring the application inside the pod to handle TLS termination.

Why this answer

With passthrough TLS termination, the router passes encrypted traffic directly to the backend pod, meaning the pod must handle TLS termination and present a valid certificate matching the hostname.

7
Multi-Selecthard

An administrator is troubleshooting an OAuth authentication failure where users receive an error indicating invalid credentials against an HTPasswd provider. Which TWO steps or checks are critical for resolving this issue? (Choose TWO)

Select 2 answers
A.Verify that the Secret containing the htpasswd file is located in the openshift-config namespace.
B.Restart the kube-apiserver static pods to apply the new password file.
C.Verify that all users have cluster-admin privileges assigned automatically.
D.Ensure the password hashes in the htpasswd file use a supported hashing algorithm such as bcrypt.
E.Check that the Secret is labeled with security.openshift.io/htpasswd-provider=true.
AnswersA, D

The OAuth server reads identity provider secrets specifically from the openshift-config namespace.

Why this answer

Troubleshooting HTPasswd involves verifying that the referenced Secret exists in the openshift-config namespace and that the file format uses valid bcrypt or sha passwords.

8
MCQmedium

An administrator creates a new custom Security Context Constraint (SCC) named restrict-root. After creating the SCC resource, users complain that pods using a ServiceAccount tied to this SCC are still falling back to the restricted-v2 SCC. What is the most likely cause?

A.The SCC object is missing the metadata.labels.openshift.io/scc label set to restrict-root.
B.Custom SCCs are disabled by default in OpenShift Container Platform 4.14 and require an operator configuration change.
C.The ServiceAccount lacks the RBAC permission to use the restrict-root SCC via a ClusterRoleBinding or RoleBinding to the system:openshift:scc:restrict-root ClusterRole.
D.The Pod Security Standards admission plugin is blocking custom SCC creation at the namespace level.
AnswerC

OpenShift controls SCC assignment via RBAC roles matching the system:openshift:scc:<name> convention.

Why this answer

In OpenShift, users or service accounts must be explicitly granted access to an SCC via RBAC (binding the system:openshift:scc:<scc-name> ClusterRole to the ServiceAccount) or by assigning priority so that evaluation happens correctly, though authorization is driven by RBAC.

9
Multi-Selectmedium

Which TWO methods can an administrator use to inspect or troubleshoot Security Context Constraint (SCC) assignments for a specific ServiceAccount in a namespace?

Select 2 answers
A.Examine the /etc/origin/master/scc.yaml file on control plane nodes.
B.Use oc auth can-i create pods --as=system:serviceaccount:<namespace>:<serviceaccount-name> to test permissions.
C.Inspect the service account's annotations for the kubernetes.io/scc-assignment-override key.
D.Run oc adm policy who-can use scc restricted-v2 to see which users and service accounts have access to the SCC.
E.Check the logs of the kube-apiserver static pod for SCC admission failures.
AnswersB, D

Checking authorization with '--as' on the service account helps verify its operational context.

Why this answer

Administrators can check SCC assignments by evaluating who can bind to the SCC cluster roles using 'oc adm policy' commands or by checking effective SCCs using 'oc auth can-i'.

10
MCQeasy

An administrator needs to view the current list of active Security Context Constraints installed in an OpenShift cluster. Which command should be executed?

A.oc get securityconstraints
B.oc get scc
C.oc adm policy list-constraints
D.oc describe clustersecurity
AnswerB

oc get scc retrieves all Security Context Constraints present in the OpenShift cluster.

Why this answer

SCCs are cluster-scoped resources. Running oc get scc lists all security context constraints available in the cluster.

11
MCQmedium

An administrator is configuring an OAuth identity provider and needs to map claims from an external provider to OpenShift usernames. Which field in the OAuth configuration specifies the claim to use as the username?

A.metadata.annotations['oauth.openshift.io/username-claim']
B.mappingMethod and attributes.username
C.spec.identityProviders.providerConfig.userField
D.status.providerStatus.usernameMapping
AnswerB

The attributes.username field specifies which token claim maps to the OpenShift username.

Why this answer

When configuring identity providers like OpenID in the OAuth resource, the mapping is defined using attributes such as username for claims.

12
MCQmedium

An administrator wants to prevent developers from creating pods that run as the root user across the entire cluster. Which OpenShift resource or admission mechanism is best suited to enforce this restriction globally?

A.Disabling the ServiceAccount controller in the cluster operator configuration
B.Adding a cluster-wide ValidatingWebhookConfiguration that intercepts Route creations
C.Creating a global ConfigMap in the openshift-config namespace named root-blocker
D.Modifying the restricted-v2 SCC to ensure root execution is disallowed via user ID restrictions
AnswerD

The restricted-v2 SCC is applied by default and restricts root execution cluster-wide for unprivileged workloads.

Why this answer

OpenShift enforces user restrictions cluster-wide primarily through Security Context Constraints (SCC) where runAsUser.type is set to MustRunAsRange or MustRunAs, restricting root execution.

13
MCQhard

You need to update the CA certificate used for the web console. Where is this configured?

A.In the cluster config map
B.In the authentication operator
C.In the 'ingress' operator configuration
D.In the 'console' operator configuration
AnswerD

The console operator manages the certificates used for the web console.

Why this answer

The console CA is configured via the 'console' operator object in 'openshift-console' namespace.

14
Multi-Selectmedium

An administrator is configuring authentication in OpenShift. Which TWO of the following identity provider types are natively supported by the OpenShift OAuth server? (Choose TWO)

Select 2 answers
A.HTPasswd
B.LDAP
C.CustomDatabaseProvider
D.LocalFileAuthService
E.ActiveDirectoryNativeProtocol
AnswersA, B

HTPasswd is a natively supported identity provider type using flat files and htpasswd generated secrets.

Why this answer

OpenShift natively supports multiple identity providers including HTPasswd, LDAP, OpenID Connect, GitHub, and Keystone.

15
MCQhard

You are integrating an external LDAP identity provider. Which secret must be created to store the bind password for the LDAP server?

A.A secret in the 'openshift-authentication' namespace
B.A project-level secret in the target application namespace
C.A secret in the 'kube-system' namespace
D.A generic secret in the 'openshift-config' namespace
AnswerD

The secret containing the bind password must be in the 'openshift-config' namespace for the OAuth operator to read it.

Why this answer

OpenShift requires the LDAP bind password to be stored in a secret referenced by the OAuth configuration.

16
Multi-Selecteasy

Which THREE fields are critical for controlling pod volume access in an SCC?

Select 3 answers
A.privileged
B.readOnlyRootFilesystem
C.fsGroup
D.hostNetwork
E.volumes
AnswersB, C, E

This enforces a read-only root.

Why this answer

SCCs use 'volumes', 'fsGroup', and 'readOnlyRootFilesystem' to control filesystem access.

17
Multi-Selectmedium

An administrator is managing service accounts and wants to understand how tokens work in OpenShift 4.14+. Which TWO statements are correct regarding ServiceAccount tokens in this version? (Choose TWO)

Select 2 answers
A.Service accounts are now deprecated in favor of OAuth user objects.
B.Tokens must be stored in plaintext ConfigMaps for pods to read them.
C.Service accounts can no longer authenticate against the Kubernetes API server.
D.Long-lived API tokens are no longer automatically created as secrets when a new ServiceAccount is created.
E.Bound service account tokens are ephemeral and time-bound by default using TokenRequest API.
AnswersD, E

To avoid unbounded token risks, automatic secret creation for service accounts is disabled by default in 4.14+.

Why this answer

In OpenShift 4.14+, bound service account tokens are audience-bound and ephemeral by default, while legacy long-lived secrets are no longer automatically created for new service accounts.

18
Multi-Selecthard

An administrator is auditing Security Context Constraints and wants to identify which settings can be controlled within a custom SCC definition. Which THREE fields are valid configuration options inside an SCC resource? (Choose THREE)

Select 3 answers
A.routeAdmissionLimit
B.networkPolicyMode
C.requiredDropCapabilities
D.allowPrivilegedContainer
E.volumes
AnswersC, D, E

requiredDropCapabilities specifies Linux capabilities that must be dropped from containers.

Why this answer

Valid SCC fields include allowPrivilegedContainer, requiredDropCapabilities, and volumes.

19
Multi-Selectmedium

Which TWO authentication methods are supported by the OpenShift OAuth server?

Select 2 answers
A.Htpasswd
B.Local file system user list
C.LDAP
D.Custom SSH keys
E.Direct database connection
AnswersA, C

Htpasswd is a supported provider.

Why this answer

OpenShift natively supports various identity providers including LDAP and Htpasswd.

20
MCQmedium

A pod requires access to the hostPath volume. Which SCC field must be configured to allow this?

A.allowHostPath: true
B.privileged: true
C.mounts: host
D.volumes: ["hostPath"]
AnswerD

This allows the pod to mount hostPath volumes.

Why this answer

The 'volumes' field in the SCC must include 'hostPath'.

21
MCQmedium

You want to ensure that all pods in a namespace are denied access to the host network. Which policy mechanism is most effective for this?

A.Configure the IngressController
B.Use a NetworkPolicy
C.Configure an SCC with 'hostNetwork: false'
D.Use an ImagePolicyWebhook
AnswerC

Setting 'hostNetwork: false' in an SCC prevents pods from using the host's network namespace.

Why this answer

SCCs control host networking capabilities. Editing the SCC bound to the service account or creating a restricted custom SCC is the way to enforce this.

22
MCQmedium

What happens if a pod does not match any SCC?

A.The pod runs with no constraints
B.The pod is rejected
C.The pod is assigned the 'restricted' SCC by default
D.The pod is assigned the 'privileged' SCC
AnswerB

Admission control fails if no SCC can be assigned.

Why this answer

If no SCC matches the pod's security context, the pod creation request is rejected by the admission controller.

23
Multi-Selecthard

An administrator needs to troubleshoot an image pull failure caused by missing credentials. Which TWO locations or methods can be used to associate an image pull secret with a workload in OpenShift? (Choose TWO)

Select 2 answers
A.Defining the secret inside the cluster Ingress controller custom resource spec
B.Placing the pull secret in the global openshift-config ConfigMap
C.Annotating the Namespace with openshift.io/image-pull-secret-ref
D.Linking the image pull secret to the ServiceAccount referenced by the deployment's pod spec via oc secrets link
E.Adding the secret to the imagePullSecrets array within the pod template specification of a Deployment
AnswersD, E

Linking a secret to a ServiceAccount automatically populates imagePullSecrets for any pods using that ServiceAccount.

Why this answer

Image pull secrets can be referenced directly in the pod template spec under imagePullSecrets, or linked directly to the ServiceAccount used by the pods.

24
Multi-Selectmedium

Which TWO of the following are valid ways to secure a route?

Select 2 answers
A.Allowing all traffic on port 80
B.Using insecure edge termination
C.Using 'edge' termination with a custom certificate
D.Disabling TLS completely
E.Using 'reencrypt' termination to ensure end-to-end encryption
AnswersC, E

This is a standard secure configuration.

Why this answer

Route security can be handled by choosing the right termination mode and using proper certificates.

25
MCQeasy

A developer deploys an application using a Route that terminates TLS using the Edge termination strategy. The developer wants to ensure that all insecure HTTP traffic to the route is automatically redirected to HTTPS. Where must this setting be configured?

A.By modifying the haproxy.config global template ConfigMap in the openshift-ingress namespace.
B.In the Route resource spec.tls.insecureEdgeTerminationPolicy field set to Redirect.
C.In the IngressController custom resource under spec.routeAdmission.wildcardPolicy.
D.In the Service resource annotations using route.openshift.io/termination: redirect.
AnswerB

Setting insecureEdgeTerminationPolicy to Redirect instructs the router to send a 301 redirect for HTTP requests.

Why this answer

Insecure edge termination policy can be set on the Route resource itself using the spec.tls.insecureEdgeTerminationPolicy field set to Redirect.

26
Multi-Selectmedium

Which THREE parameters are commonly found in the SCC 'spec' section?

Select 3 answers
A.seLinuxContext
B.namespaceSelector
C.runAsUser
D.imagePullPolicy
E.allowedCapabilities
AnswersA, C, E

This controls SELinux labels.

Why this answer

SCCs control security via fields like 'seLinuxContext', 'runAsUser', and 'capabilities'.

27
MCQeasy

When configuring an OAuth identity provider of type HTPasswd, which object type must be created to store the username and hashed password pairs?

A.A ServiceAccount with special token annotations
B.A Secret containing the htpasswd flat-file data
C.A ConfigMap containing plain-text user credentials
D.A custom resource of kind HTPasswdProvider in the openshift-config namespace
AnswerB

An HTPasswd identity provider references a Secret containing the htpasswd formatted file.

Why this answer

HTPasswd identity providers require a Secret containing the htpasswd file data referenced by the OAuth configuration.

28
Multi-Selecteasy

Which TWO service accounts have special roles in OpenShift projects regarding SCCs?

Select 2 answers
A.oauth-proxy
B.kube-system
C.default
D.builder
E.system-admin
AnswersC, D

The default service account is used by pods.

Why this answer

The 'default' and 'builder' service accounts are commonly used and often have pre-configured roles.

29
MCQmedium

Which tool should be used to troubleshoot why an SCC is being rejected for a pod?

A.oc adm top scc
B.oc adm policy scc-review
C.oc get scc --debug
D.oc explain scc
AnswerB

This tool reviews pod specifications against available SCCs.

Why this answer

The 'oc adm policy scc-review' command helps determine why an SCC is or is not being assigned.

30
MCQeasy

You need to allow a specific service account to run pods as root. Which command should you use to associate the 'privileged' SCC with the 'default' service account in the 'web-apps' namespace?

A.oc add scc privileged default -n web-apps
B.oc adm policy add-scc-to-user privileged -z default -n web-apps
C.oc apply scc privileged --user=default -n web-apps
D.oc patch scc privileged -p '{"users": ["default"]}'
AnswerB

This correctly grants the privileged SCC to the default service account in the specified namespace.

Why this answer

The 'oc adm policy add-scc-to-user' command is the standard way to grant an SCC to a service account.

31
MCQeasy

An administrator wants to pull container images from a private container registry that requires authentication for a specific deployment. Where must the image pull secret be referenced so that the deployment pods can successfully pull the image?

A.As an annotation on the cluster-scoped Namespace object
B.Inside the Route object spec under tls.imagePullSecret
C.In the Deployment configuration spec under template.spec.imagePullSecrets
D.As an environment variable named IMAGE_PULL_SECRET in the container specification
AnswerC

Specifying imagePullSecrets inside the pod template spec ensures pods created by the deployment use the credentials.

Why this answer

Image pull secrets can be specified directly in the pod spec under imagePullSecrets, or linked to the ServiceAccount used by the pod.

32
Multi-Selecthard

Which THREE restrictions or behaviors are enforced by the default restricted-v2 Security Context Constraint in OpenShift Container Platform?

Select 3 answers
A.Containers are prohibited from running with privileged mode enabled.
B.Containers are allowed to mount host network, host IPC, and host PID namespaces.
C.Containers must drop all capabilities, though NET_BIND_SERVICE may be added back.
D.Pods are automatically assigned a random UID from the namespace's pre-allocated UID range.
E.Containers cannot run as the root user (UID 0).
AnswersA, C, E

Privileged containers are strictly forbidden by restricted-v2.

Why this answer

The restricted-v2 SCC enforces strict security best practices, including disallowing running as root, forbidding privileged containers, and requiring the drop of all capabilities except NET_BIND_SERVICE.

33
MCQhard

An administrator has created a custom SCC named restricted-custom. During testing, pods using this SCC still fail because they are assigned the non-root UID range automatically, but the application container requires writing to a specific directory owned by UID 1000. How should the administrator configure the SCC to ensure the container runs consistently as UID 1000?

A.Set runAsUser.type to RunAsAny and add securityContext.runAsUser: 1000 in the pod spec
B.Configure fsGroup.type to MustRunAs with uid: 1000
C.Set privileged: true and map the container user via supplementalGroups
D.Set runAsUser.type to MustRunAs and specify uid: 1000 in the uidRange
AnswerD

Setting runAsUser.type to MustRunAs with the appropriate UID ensures the container always runs as the specified user ID.

Why this answer

To force a specific UID execution, the runAsUser strategy must be set to MustRunAs with a uidRange specifying UID 1000.

34
Multi-Selecthard

Which TWO actions are necessary when migrating from Htpasswd to OIDC?

Select 2 answers
A.Restart the kube-apiserver
B.Update the OAuth cluster resource
C.Rebuild all container images
D.Delete all existing secrets
E.Define the new identity provider in the OAuth configuration
AnswersB, E

The configuration must reflect the new provider.

Why this answer

Migration involves updating the OAuth configuration and potentially mapping existing identities.

35
MCQeasy

Which command displays the SCCs currently assigned to a specific service account?

A.oc auth can-i -list
B.oc describe sa <sa-name>
C.oc get scc
D.oc adm policy who-can use scc
AnswerD

This command identifies who can use specific SCCs.

Why this answer

Describing the service account shows the security context constraints it can access.

36
MCQmedium

A container needs to run as a specific non-root UID. Which SCC field configuration is needed?

A.runAsUser: MustRunAsRange
B.runAsUser: RunAsAny
C.runAsUser: MustRunAs, uid: 1000
D.runAsUser: None
AnswerC

This forces the container to run with the specified UID.

Why this answer

The 'runAsUser' strategy must be set to 'MustRunAs' with a specific UID range defined.

37
MCQhard

You are configuring an OAuth identity provider using 'htpasswd'. Which secret must contain the file?

A.A secret in 'openshift-config'
B.A ConfigMap in 'openshift-config'
C.A local file on the master node
D.A secret in 'openshift-authentication'
AnswerA

This is the required location for the OAuth configuration secret.

Why this answer

The htpasswd file must be stored in a secret in the 'openshift-config' namespace.

38
MCQhard

A security engineer needs to configure the cluster-wide OAuth identity provider to use an existing LDAP server. The administrator creates an LDAP identity provider object in the cluster OAuth configuration resource (cluster). Which configuration property specifies the attribute mapping to map the LDAP entry's unique identifier to the OpenShift user name?

A.mappingMethod: lookup with attributes.id set to the unique attribute like uid or sAMAccountName.
B.url specifying the bind DN and attributes.username set to cn.
C.identityProviders.ldap.mapping.rules pointing to a ConfigMap containing user maps.
D.bindPassword referencing a Secret containing the attribute translation matrix.
AnswerA

attributes.id defines the attribute used to uniquely identify the user in OpenShift.

Why this answer

The LDAP identity provider configuration requires defining attribute mapping fields such as id, preferredUsername, name, and email. The id field maps the unique LDAP attribute to the OpenShift username.

39
MCQhard

You are hardening a cluster. Which Pod Security Standard level is the default in OpenShift 4.14 for new projects?

A.restricted
B.baseline
C.privileged
D.enforce
AnswerA

The restricted profile is the default baseline for OpenShift projects.

Why this answer

OpenShift 4.14 uses the 'restricted' SCC by default, which aligns with the Pod Security Standard 'restricted' profile.

40
MCQeasy

Which service account is used by default for pods that do not specify a service account in their manifest?

A.builder
B.default
C.system
D.deployer
AnswerB

Every namespace has a 'default' service account for this purpose.

Why this answer

The 'default' service account is used when none is provided.

41
MCQhard

You are troubleshooting a TLS certificate issue on a route. Which command shows the current certificate status and details?

A.oc describe route <route-name>
B.oc check tls <route-name>
C.oc inspect route
D.oc get tls
AnswerA

This provides detailed information about the route, including TLS status.

Why this answer

The 'oc get route' command with output formatting or 'oc describe route' is the standard way to inspect route TLS.

42
MCQeasy

How do you view the currently active OAuth identity providers in an OpenShift cluster?

A.oc get identityproviders
B.oc describe auth
C.oc get oauth cluster -o yaml
D.oc get configmap oauth -n openshift-config
AnswerC

The cluster OAuth configuration object contains all providers.

Why this answer

The OAuth configuration is stored in the 'cluster' OAuth object.

43
Multi-Selectmedium

Which THREE components are involved in TLS termination for routes?

Select 3 answers
A.Secret
B.Route
C.IngressController
D.Service
E.ConfigMap
AnswersA, B, C

The secret stores the TLS data.

Why this answer

Termination involves the ingress controller, the route object, and the secret containing the keys.

44
MCQeasy

How can you view the list of all SCCs available in the cluster?

A.oc get scc
B.oc show scc
C.oc describe scc
D.oc list scc
AnswerA

This command lists all SCC resources.

Why this answer

The 'oc get scc' command lists all available security context constraints.

45
Multi-Selecthard

Which THREE of the following are required when configuring an OIDC identity provider?

Select 3 answers
A.Client Secret reference
B.Htpasswd file path
C.Client ID
D.LDAP bind password
E.Issuer URL
AnswersA, C, E

The secret is required for authentication.

Why this answer

OIDC requires specific parameters to identify the provider, client, and client secret.

46
MCQeasy

Where do you define the default image pull secrets for all service accounts in a namespace?

A.In the ClusterOperator configuration
B.In the Namespace metadata
C.By linking the secret to the 'default' service account
D.In the project configuration object
AnswerC

Linking the secret to the 'default' service account ensures it is used by pods that do not specify a service account.

Why this answer

You can link a secret to the 'builder' or 'default' service accounts, but creating a secret and linking it to the default service account is the standard method.

47
MCQeasy

An administrator needs to configure re-encrypt TLS termination on a Route. In addition to the router certificate, what other certificate component must typically be provided in the route configuration?

A.The destination CA certificate to validate the backend pod's TLS certificate
B.A base64 encoded kubeconfig file for the ingress operator
C.An identity provider public key for JSON Web Token validation
D.A client certificate for mutual TLS authentication against the OAuth server
AnswerA

Re-encrypt routes re-encrypt traffic from the router to the backend, requiring the router to trust the backend pod via a destination CA.

Why this answer

Re-encrypt routes require a destination CA certificate (spec.tls.destinationCACertificate) so the router can trust the backend pod's self-signed or internal certificate.

48
MCQeasy

Which command checks if a specific service account can use a restricted SCC?

A.oc check scc restricted -z mysa
B.oc describe scc restricted
C.oc adm policy can-i use scc restricted --as=system:serviceaccount:myns:mysa
D.oc auth can-i use scc restricted
AnswerC

This is the correct command to verify if a service account has the 'use' verb for a specific SCC.

Why this answer

The 'oc adm policy can-i' command is used to verify permissions, including SCC usage.

49
MCQhard

A developer needs to expose a service via a route with re-encryption. What is required in the Route configuration?

A.Enable 'insecureEdgeTerminationPolicy: Allow'
B.Configure a ServiceMesh resource
C.Set 'termination: reencrypt' in the spec.tls section
D.Set 'termination: edge' and add a proxy
AnswerC

This enables re-encryption termination mode.

Why this answer

Re-encryption requires a termination configuration that specifies the certificate for the route and potentially the certificate for the destination service.

50
MCQmedium

When creating a custom SCC, what is the best practice for assigning it to users?

A.Bind the SCC to the 'cluster-admin' user
B.Bind the SCC to a specific service account in a specific namespace
C.Bind the SCC to the 'system:authenticated' group
D.Assign the SCC to the namespace object directly
AnswerB

This follows the principle of least privilege.

Why this answer

Binding the SCC to specific groups or service accounts is safer than broad cluster assignments.

51
MCQhard

An application deployed in a secured namespace requires access to the Kubernetes API to query pod statuses. The administrator wants to follow the principle of least privilege. How should the administrator configure the ServiceAccount and RBAC?

A.Create a dedicated ServiceAccount, a Role granting get and list on pods, and a RoleBinding linking them in the namespace
B.Bind the cluster-admin ClusterRole to the default ServiceAccount in the namespace using a ClusterRoleBinding
C.Annotate the default ServiceAccount with rbac.authorization.k8s.io/authtype: reader
D.Grant the system:openshift:scc:restricted ClusterRole to the ServiceAccount using a RoleBinding
AnswerA

This restricts the ServiceAccount permissions strictly to the namespace and specific verbs required.

Why this answer

To grant least privilege API access, create a dedicated ServiceAccount, bind a custom Role or ClusterRole with limited verbs (get, list, watch) on pods via a RoleBinding in that namespace.

52
MCQmedium

You have a private image registry that requires credentials. Where should you place the 'imagePullSecret' so that it is automatically injected into all pods created by a specific service account?

A.oc annotate sa default imagePullSecret=<secret-name>
B.oc edit namespace <ns> --add-secret=<secret-name>
C.oc set image-pull-secret <secret-name>
D.oc secrets link default <secret-name>
AnswerD

The 'oc secrets link' command attaches the pull secret to the service account.

Why this answer

Adding the imagePullSecret to the service account ensures it is used for all pods using that service account.

53
MCQmedium

An administrator needs to secure a Route with edge termination using a custom TLS certificate and private key. Which section of the Route manifest must contain these certificate details?

A.spec.endpoint.tls with base64 encoded string data
B.metadata.annotations containing openshift.io/tls-cert and openshift.io/tls-key
C.spec.tls.certificate, spec.tls.key, and spec.tls.caCertificate
D.status.ingress.tls for automatic cert-manager synchronization
AnswerC

An edge-terminated route defines certificate, key, and optional CA certificate directly within the spec.tls object.

Why this answer

Edge termination routes configure TLS settings directly inside the spec.tls block of the Route resource.

54
Multi-Selecthard

An administrator is securing routes in an OpenShift cluster. Which THREE TLS termination types are supported natively by OpenShift Routes? (Choose THREE)

Select 3 answers
A.Passthrough
B.Edge
C.Proxy
D.FullMesh
E.Re-encrypt
AnswersA, B, E

Passthrough passes encrypted TLS traffic directly through the router to the backend pod.

Why this answer

OpenShift Routes support edge, re-encrypt, and passthrough TLS termination types.

55
MCQmedium

An administrator needs to ensure that a newly created ServiceAccount automatically receives a long-lived API token when created in OpenShift 4.14+. What is the correct procedure?

A.Patch the default cluster authentication profile to revert to automountServiceAccountToken globally
B.Add the annotation serviceaccounts.openshift.io/want-token: "true" to the ServiceAccount metadata
C.Execute the oc create token command and store the output in a ConfigMap
D.Create a Secret of type kubernetes.io/service-account-token and reference the ServiceAccount name in the secret metadata annotations
AnswerD

Manually creating a Secret of type kubernetes.io/service-account-token with the kubernetes.io/service-account.name annotation generates a permanent token.

Why this answer

In OpenShift 4.14+, bound service account tokens are ephemeral by default. To create a legacy long-lived token, a Secret object must be explicitly created and linked to the service account.

56
MCQhard

When using OIDC for authentication, what does the 'issuer' field in the configuration represent?

A.The secret key for the OIDC provider
B.The client ID of the OpenShift cluster
C.The hostname of the OpenShift API
D.The URL of the OIDC provider
AnswerD

The issuer URL is required by OpenShift to verify the identity tokens.

Why this answer

The 'issuer' is the URL where the OIDC provider publishes its configuration.

57
MCQmedium

A pod fails to start with 'container has runAsNonRoot and image will run as root'. Which SCC field needs to be adjusted in a custom SCC to allow this image to run?

A.runAsUser: MustRunAsRange
B.readOnlyRootFilesystem: false
C.runAsUser: RunAsAny
D.allowPrivilegedEscalation: true
AnswerC

RunAsAny allows the container to run as the user defined in the image, even if that user is root.

Why this answer

The runAsUser strategy in the SCC determines how the UID is handled for containers.

58
Multi-Selectmedium

An administrator needs to restrict pod creation based on Pod Security Standards namespaces. Which TWO of the following are valid Pod Security Standard levels defined by Kubernetes and supported in OpenShift? (Choose TWO)

Select 2 answers
A.hardened
B.restricted
C.baseline
D.secured
E.isolated
AnswersB, C

The restricted level provides heavily hardened security best practices.

Why this answer

Kubernetes and OpenShift support three Pod Security Standard levels: privileged, baseline, and restricted.

59
MCQhard

An application pod needs to run with a specific user ID (UID 10005000) that falls outside the restricted-v2 SCC default allocated range for the namespace. The administrator decides to create a custom SCC. Which SCC security context strategy parameter must be adjusted to allow this specific UID?

A.supplementalGroups with type: RunAsAny and fsGroup set to 10005000.
B.seLinuxContext with type: MustRunAs and level set to s0:c100,c200.
C.runAsUser with type: RunAsAny or specifying the UID range in uidRanges.
D.runAsUser with type: MustRunAs and uidRange or uid settings covering the required value.
AnswerC

Configuring runAsUser to RunAsAny or including the target UID inside the uidRanges of a MustRunAsRange strategy permits the pod to run with that UID.

Why this answer

The runAsUser strategy in an SCC determines how UIDs are assigned. Setting it to MustRunAsRange with an expanded range or RunAsAny (depending on cluster security posture) allows specific UIDs.

60
MCQmedium

An administrator needs to configure an authentication mechanism where users logging into the OpenShift web console are authenticated via an external corporate directory using LDAP. Which resource object should the administrator configure?

A.A Secret named identity-provider in the openshift-authentication namespace
B.The cluster OAuth custom resource named cluster
C.An Authentication custom resource named cluster in the kube-system namespace
D.A ConfigMap named ldap-config in the openshift-config namespace
AnswerB

The cluster-scoped OAuth resource manages identity providers such as LDAP, HTPasswd, and OpenID Connect.

Why this answer

LDAP identity providers are configured inside the cluster-scoped OAuth custom resource under the spec.identityProviders array.

61
Multi-Selecteasy

Which TWO security standards are natively tracked in OpenShift?

Select 2 answers
A.isolated
B.custom
C.restricted
D.privileged
E.secure
AnswersC, D

This is one of the standard profiles.

Why this answer

OpenShift aligns with Pod Security Standards including 'privileged' and 'restricted'.

62
MCQeasy

Which SCC is assigned by default to authenticated users who are not service accounts?

A.restricted
B.anyuid
C.nonroot
D.privileged
AnswerA

The restricted SCC is the default for most workloads.

Why this answer

The 'restricted' SCC is the default SCC applied to all users and service accounts unless otherwise specified.

63
Multi-Selectmedium

An administrator is reviewing the default Security Context Constraints in OpenShift 4.14+. Which THREE of the following SCCs are built-in and provided out-of-the-box by OpenShift? (Choose THREE)

Select 3 answers
A.root-container-v1
B.custom-app-scc
C.nonroot
D.restricted-v2
E.privileged
AnswersC, D, E

The nonroot SCC ensures pods run as a non-root UID without restricting capabilities as heavily as restricted.

Why this answer

OpenShift provides several built-in SCCs including restricted-v2, privileged, and nonroot.

64
Multi-Selectmedium

Which TWO actions are required when configuring an external OpenID Connect (OIDC) identity provider in OpenShift Container Platform?

Select 2 answers
A.Reference a Secret containing the clientSecret used to authenticate against the OIDC provider.
B.Create a dedicated OAuthClient resource for every single cluster user.
C.Deploy an internal LDAP directory synchronization cronjob inside the openshift-authentication namespace.
D.Provide the issuer URL pointing to the OIDC provider's discovery endpoint.
E.Generate a self-signed CA certificate for the API server using openshift-install.
AnswersA, D

OIDC identity providers require a client secret for confidential client flows, usually referenced via a Kubernetes Secret.

Why this answer

Configuring an OIDC identity provider requires providing client credentials (clientId and clientSecret, often stored in a Secret), defining the issuer URL, and specifying claim mappings.

65
MCQhard

A developer deploys a custom application pod that requires the hostIPC capability, but the pod creation is rejected by the apiserver. Upon inspecting the cluster SCCs, the administrator determines that the application uses a ServiceAccount named app-sa in the production namespace. How should the administrator grant the restricted SCC privileges safely without compromising cluster security?

A.Add a subject entry referencing system:serviceaccount:production:app-sa to the users list inside the restricted SCC definition
B.Create a RoleBinding in the production namespace referencing the system:openshift:scc:hostaccess cluster role and the app-sa ServiceAccount
C.Annotate the app-sa ServiceAccount with openshift.io/scc.constraint: hostaccess
D.Create a ClusterRoleBinding that binds the system:openshift:scc:restricted cluster role to system:serviceaccount:production:app-sa
AnswerB

RoleBindings targeting the system:openshift:scc:hostaccess cluster role grant the necessary elevated SCC permissions to the specified ServiceAccount within that namespace.

Why this answer

To grant specific SCC privileges, the administrator must bind the SCC's corresponding cluster role to the target service account.

66
MCQeasy

Which command removes an SCC from a service account?

A.oc remove-scc
B.oc delete scc-binding
C.oc patch scc
D.oc adm policy remove-scc-from-user
AnswerD

This is the correct command for removing SCC assignments.

Why this answer

The 'oc adm policy remove-scc-from-user' command reverses the policy assignment.

67
MCQeasy

A cluster administrator needs to grant a Deployment in the production namespace permission to pull images from a private container registry. The image pull secret is named my-registry-secret. Which step must be performed so that pods created by this Deployment can successfully pull the image?

A.Create a RoleBinding mapping the secret to the cluster-readers cluster role.
B.Annotate the Deployment resource with the full base64-encoded dockerconfigjson payload.
C.Run oc set data secrets/my-registry-secret --namespace=production.
D.Patch the default ServiceAccount in the production namespace to include my-registry-secret in its imagePullSecrets array.
AnswerD

Adding the secret to the default ServiceAccount ensures pods referencing it automatically get the pull secret.

Why this answer

Service accounts in OpenShift automatically reference image pull secrets in their imagePullSecrets array if they are intended to be used by pods, or you patch the default service account to include the secret so pods using that service account inherit it.

68
MCQhard

You need to terminate TLS for a route using a custom certificate. Which object must contain the TLS key and certificate?

A.A Secret in the same namespace as the route
B.A ConfigMap in the 'openshift-config' namespace
C.A custom resource definition of type TLS
D.The ingress controller configuration
AnswerA

For custom certificates, the TLS data is typically stored in a Secret referenced by the Route.

Why this answer

The Route object itself holds the configuration, but the certificate and key are referenced within the Route's 'spec.tls' section, often pulled from a Secret.

69
MCQmedium

A cluster administrator wishes to enforce the restricted Pod Security Standard across an entire namespace named auditing-ns. Which label should the administrator apply to the namespace to enforce this policy while generating audit warnings for non-compliant pods?

A.pod-security.kubernetes.io/enforce: restricted and pod-security.kubernetes.io/audit: restricted
B.security.openshift.io/scc.enforce: restricted-v2
C.security.openshift.io/pod-security-standard: enforce-restricted
D.admission.cluster.openshift.io/validate-psa: true
AnswerA

This combination sets the enforcement level to restricted and logs audit warnings.

Why this answer

Namespace-level Pod Security Standards are enforced using standard Kubernetes labels. To enforce while auditing, the enforce label is set to restricted, and the audit label can also be set.

70
Multi-Selecthard

Which TWO things must be configured to use a Private Image Registry?

Select 2 answers
A.A route to the registry
B.A docker-registry type secret
C.Linking the secret to the service account
D.Creating a new ClusterRole
E.Updating the node configuration
AnswersB, C

This holds the credentials.

Why this answer

You must create a secret with the credentials and then link it to the service account.

Ready to test yourself?

Try a timed practice session using only Security And SCC questions.