Courseiva

CCNA Cloud And Hybrid Infrastructure Security Questions

43 questions · Cloud And Hybrid Infrastructure Security topic · All types, answers revealed

1
MCQmedium

During an Azure penetration test, an attacker identifies an Azure Function with an HTTP trigger that uses function-level keys. However, the function key was leaked in a public GitHub repository. What level of access does this key provide?

A.It allows unauthenticated invocation of the specific Azure Function endpoint associated with that key.
B.It allows the attacker to decrypt all Azure Key Vault secrets in the tenant.
C.It provides direct SSH root access to the underlying Azure App Service worker nodes.
D.It grants full Owner-level administrative access to the entire Azure subscription.
AnswerA

Function-level keys authorise invocation of only the specific function they belong to, not the whole Function App or subscription. A leaked key therefore permits unauthenticated calls to that single HTTP-triggered endpoint, matching the stem's scope.

Why this answer

Azure Function keys are per-function (or per-host) shared secrets used only to authorize HTTP invocations of that function's endpoint. A leaked function-level key lets an unauthenticated attacker call that specific function URL, but it does not grant Azure RBAC permissions, Key Vault access, or subscription-level control. The blast radius is limited to whatever the function itself does.

Exam trap

The trap is conflating a function-level shared secret with Azure AD/RBAC credentials — candidates overestimate the blast radius and pick subscription-wide or Key Vault options.

How to eliminate wrong answers

Option B is wrong because Key Vault secret decryption requires Azure AD authentication plus Key Vault access policies or RBAC roles — a function key is not an Azure AD token and cannot decrypt secrets. Option C is wrong because function keys do not grant SSH or worker-node access; the underlying App Service infrastructure is managed by Microsoft and not reachable via a function key. Option D is wrong because Owner-level subscription access requires Azure AD identity with an RBAC role assignment; function keys are scoped to the function app's HTTP endpoint only.

2
MCQmedium

An auditor is reviewing an Azure Kubernetes Service (AKS) cluster and discovers that Role-Based Access Control (RBAC) was disabled during cluster creation, and Azure Active Directory integration is not enabled. What is the primary security consequence?

A.Azure Security Center deletes the cluster automatically.
B.All API requests are treated with full administrative privileges, allowing any compromised pod or user to execute arbitrary cluster-level commands.
C.Pods are automatically restricted from communicating with external IP addresses.
D.The AKS cluster control plane is automatically exposed to the public internet on port 22.
AnswerB

Without Kubernetes RBAC, AKS grants every authenticated request full cluster-admin authority, since no authorisation layer evaluates subjects against roles. Combined with Microsoft Entra ID integration being absent, no identity-based binding restricts actions, so any compromised pod or user reaching the API server executes arbitrary cluster-level commands.

Why this answer

When RBAC and Azure AD integration are disabled at AKS cluster creation, the cluster falls back to Kubernetes local accounts with certificate-based authentication, and any authenticated request effectively has full cluster-admin privileges. This means a compromised pod or user can execute arbitrary cluster-level commands, escalate privileges, and access secrets across namespaces.

Exam trap

CPENT often tests the assumption that disabling RBAC only affects user permissions, when it actually grants full admin to any authenticated principal.

How to eliminate wrong answers

Option A is wrong because Azure Security Center (Defender for Cloud) does not delete clusters; it only provides recommendations and alerts. Option C is wrong because pod egress restrictions are governed by network policies, not RBAC or Azure AD settings. Option D is wrong because the AKS control plane is not automatically exposed on port 22; SSH access is to nodes, and the API server uses port 443.

3
MCQeasy

A penetration tester is evaluating a Google Cloud Platform (GCP) environment and discovers a service account key file stored in a public Cloud Storage bucket. The service account has the roles/editor role on the project. What is the most direct way for the tester to leverage this key to gain unauthorized access to the project's resources?

A.Use the key to sign a JWT and impersonate a user with higher privileges.
B.Use the key to authenticate with gcloud auth activate-service-account and then list and access resources.
C.Use the key to decrypt data in Cloud Storage buckets encrypted with customer-managed encryption keys (CMEK).
D.Use the key to access the GCP metadata server and retrieve instance credentials.
AnswerB

The service account key file contains a private key that can be used to authenticate as the service account. By running gcloud auth activate-service-account --key-file=KEY_FILE, the tester can assume the identity of the service account. With the editor role, they can then access and modify most resources in the project, achieving full compromise.

Why this answer

A leaked service account key file allows an attacker to authenticate as that service account. Using gcloud auth activate-service-account with the key file grants the tester the service account's permissions, which include the editor role. This provides broad access to the project's resources, enabling the tester to list, read, and modify data, and potentially escalate further.

Exam trap

The trap here is overcomplicating the exploitation; the simplest and most direct use of a service account key is to authenticate with it, not to attempt indirect methods like JWT signing or metadata access.

4
Multi-Selectmedium

During a penetration test of an Azure Active Directory tenant, an attacker identifies multiple security misconfigurations. Which TWO of the following techniques represent common Azure AD attack vectors or misconfigurations? (Choose TWO)

Select 2 answers
A.Exploiting user consent settings that allow any user to grant application permissions to third-party multi-tenant apps.
B.Configuring Azure AD Connect with Password Hash Sync disabled for cloud-only users.
C.Implementing Azure Key Vault access policies with strict RBAC permissions.
D.Allowing legacy authentication protocols (e.g., POP3, IMAP) that bypass Azure AD Conditional Access policies and MFA.
E.Enforcing Azure Multi-Factor Authentication for all administrative and privileged roles.
AnswersA, D

User consent settings permitting any user to grant permissions to third-party multi-tenant apps enable illicit consent grant attacks, where a malicious app obtains delegated access to mail, files and contacts without admin approval. This misconfiguration is a recognised Microsoft Entra ID attack vector.

Why this answer

Option A is correct because when Azure AD user consent settings permit all users to consent to third-party multi-tenant applications, attackers can register a malicious multi-tenant app and trick users into granting OAuth permissions (e.g., Mail.Read, offline_access), enabling persistent access and data exfiltration without stealing credentials. Option D is correct because legacy authentication protocols such as POP3, IMAP, and SMTP AUTH do not support modern authentication and therefore bypass Conditional Access policies and MFA, making them a prime vector for password-spray and credential-stuffing attacks. Option B is not a misconfiguration attack vector: disabling Password Hash Sync for cloud-only users is irrelevant since cloud-only accounts have no on-premises password to synchronize, and PHS is a defensive feature rather than an exposure.

Option C is not an attack vector because strict RBAC access policies on Key Vault are a security best practice that reduces, not expands, the attack surface. Option E is not a misconfiguration because enforcing MFA for all administrative and privileged roles is a recommended hardening control that mitigates credential-based attacks.

Exam trap

The trap is selecting options that are actually security best practices (like enforcing MFA or strict RBAC) as misconfigurations; candidates must distinguish between secure configurations and vulnerable ones.

5
MCQhard

A penetration tester is analyzing a Kubernetes cluster where pods utilize service accounts with automountServiceAccountToken set to true globally or on sensitive pods. The tester gains remote code execution inside a pod running with a high-privilege service account token. How can they use this token against the Kubernetes API?

A.Use the token in HTTP Authorization Bearer headers to query the Kubernetes API server and inspect or manipulate cluster resources based on the service account's RBAC privileges.
B.Convert the token into an Azure AD refresh token using Microsoft Graph API.
C.Submit the token to the AWS IAM STS assume-role API to gain root access to the underlying AWS cloud account.
D.Inject the token into the Linux kernel keyring to escalate the container to host root privileges.
AnswerA

The mounted token authenticates to the API server as its service account, so sending it as a Bearer credential grants exactly that account's RBAC permissions. This satisfies the stem's constraint that automountServiceAccountToken exposes a usable credential inside the compromised pod.

Why this answer

A Kubernetes service account token is a JWT that authenticates to the Kubernetes API server when presented as a Bearer token in the HTTP Authorization header. The API server validates the token's signature and expiry, then maps it to the service account's identity and enforces RBAC policies. With a high-privilege service account, the tester can list, create, or delete resources (e.g., secrets, pods) permitted by that account's RoleBindings or ClusterRoleBindings.

This is the standard method for exploiting a compromised service account token in a cluster.

Exam trap

CPENT often tests the misconception that Kubernetes service account tokens can be used directly with other cloud providers' identity systems (like AWS STS or Azure AD) without proper federation configuration, or that they can escalate privileges at the OS level, when in fact they are solely for authenticating to the Kubernetes API.

How to eliminate wrong answers

Option B is wrong because Kubernetes service account tokens are not convertible to Azure AD refresh tokens; they are distinct authentication artifacts for different identity systems, and Microsoft Graph API does not accept Kubernetes tokens. Option C is wrong because AWS IAM STS assume-role requires an AWS IAM role ARN and a valid AWS identity (e.g., via web identity federation with OIDC), not a Kubernetes service account token directly; while some clusters use IRSA, the token itself is not submitted to STS without proper OIDC trust configuration. Option D is wrong because injecting a token into the Linux kernel keyring does not escalate container privileges to host root; kernel keyrings are for cryptographic key storage, not authentication to Kubernetes or privilege escalation.

6
MCQmedium

During an AWS penetration test, the tester finds an Amazon API Gateway REST API configured with an AWS_IAM authorizer, but one specific method is mistakenly set to 'Authorization: None' (Open API method). What security risk does this introduce?

A.AWS WAF will automatically block all traffic to the API Gateway.
B.CloudFront distribution logs will fail to record incoming requests.
C.The API Gateway becomes vulnerable to SQL injection attacks against its internal DynamoDB storage.
D.Unauthenticated clients can invoke the specific API method directly, bypassing the intended AWS IAM signature authentication.
AnswerD

Setting the method's authorization type to None removes API Gateway's AWS_IAM signature check for that route, so requests reach the backend without SigV4 credentials. Any unauthenticated client can therefore invoke the method directly, bypassing the intended IAM authorisation.

Why this answer

Setting a method's authorization type to 'None' (also called 'Open') on an API Gateway REST API removes the AWS_IAM SigV4 requirement for that specific method. Any unauthenticated client on the internet can then invoke that method's integration endpoint directly, bypassing the IAM-signed request flow the rest of the API enforces. This is a classic broken-access-control misconfiguration that exposes backend Lambda functions, DynamoDB operations, or internal services to anonymous abuse.

Exam trap

The trap here is conflating 'authorization: None' with broader security controls (WAF, CloudFront, SQLi), when the actual effect is simply that unauthenticated callers can invoke that one method.

How to eliminate wrong answers

Option A is wrong because AWS WAF is an optional layer that must be explicitly attached to the API stage; it does not automatically block traffic just because a method is open, and WAF rules are not triggered by the authorization setting. Option B is wrong because CloudFront logging is independent of API Gateway authorization; CloudFront logs requests regardless of whether the origin requires IAM signing. Option C is wrong because API Gateway does not have 'internal DynamoDB storage' and SQL injection is not the risk introduced by an open method — the risk is unauthenticated invocation, not injection into a nonexistent SQL backend.

7
MCQmedium

During an assessment of a Google Cloud Platform (GCP) environment, a penetration tester finds a Compute Engine instance with default service account credentials and scopes set to https://www.googleapis.com/auth/cloud-platform. What security implication does this broad scope present?

A.Google Cloud automatically rotates the service account private key every 60 seconds.
B.The service account possesses permissions across all GCP services unless explicitly restricted by IAM project-level bindings.
C.The instance is automatically accessible via SSH from any external IP address without firewall rules.
D.The instance metadata server disables access tokens to prevent Server-Side Request Forgery.
AnswerB

The cloud-platform scope grants OAuth access tokens covering every GCP API, so the default service account can call any service; IAM bindings are the only remaining restriction, meaning over-privileged tokens widen the blast radius if the instance is compromised.

Why this answer

The scope https://www.googleapis.com/auth/cloud-platform is the broadest OAuth scope available in GCP, granting the service account access to essentially all GCP APIs. IAM bindings then determine which specific actions the account can actually perform, but the scope itself does not restrict the API surface. Therefore, the service account can potentially reach every GCP service unless IAM policies explicitly deny or limit permissions.

Exam trap

CPENT often tests the misconception that OAuth scopes alone enforce fine-grained access control, when in reality IAM bindings are the primary authorization mechanism and scopes only set an upper bound.

How to eliminate wrong answers

Option A is wrong because Google Cloud does not automatically rotate service account private keys every 60 seconds; key rotation is a manual or customer-managed process, and default service accounts use Google-managed keys that are rotated periodically but not on a 60-second cycle. Option C is wrong because SSH accessibility is controlled by VPC firewall rules and instance-level SSH keys, not by OAuth scopes; a broad scope does not open SSH ports. Option D is wrong because the metadata server does not disable access tokens; it serves them to the instance, and SSRF attacks often exploit this behavior rather than being prevented by it.

8
MCQmedium

A penetration tester is analyzing an Azure environment and discovers that an Azure Function App has been configured with managed identity enabled and possesses 'Contributor' access to the subscription. The function code contains a Server-Side Request Forgery (SSRF) vulnerability. How can the tester exploit the Azure Instance Metadata Service (IMDS) via this SSRF to elevate privileges?

A.Query 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01' with the header 'Metadata: true' to obtain an Azure access token using the managed identity.
B.Send a crafted SOAP request to the Azure Resource Manager endpoint to extract the storage account account key.
C.Extract the master deployment credentials from the Azure Web Job environment variables via port 443.
D.Exploit the Azure Function proxy configuration to read the /etc/passwd file from the underlying hypervisor.
AnswerA

Querying the IMDS endpoint at 169.254.169.254 with the required 'Metadata: true' header lets the SSRF retrieve an OAuth2 token minted for the function's managed identity. Because that identity holds Contributor over the subscription, the token grants control-plane access, satisfying the privilege-escalation objective without needing credentials.

Why this answer

The Azure Instance Metadata Service (IMDS) is accessible at http://169.254.169.254 and can provide an OAuth2 token for the managed identity when the request includes the header 'Metadata: true'. By exploiting SSRF, the tester can make the Function App issue a request to this endpoint and retrieve the token, which can then be used to access Azure resources with the Contributor role. This is a classic SSRF-to-cloud-metadata attack.

Exam trap

CPENT often tests cloud metadata SSRF exploitation; candidates may forget the required 'Metadata: true' header or confuse AWS IMDSv2 with Azure IMDS, leading to incorrect answers.

How to eliminate wrong answers

Option B is wrong because Azure Resource Manager does not accept SOAP requests; it uses REST, and extracting storage account keys typically requires authenticated access, not a SOAP request. Option C is wrong because Azure Web Job environment variables do not contain master deployment credentials, and port 443 is for HTTPS traffic, not for extracting credentials from environment variables. Option D is wrong because the Azure Function proxy configuration cannot read /etc/passwd from the hypervisor; the hypervisor is not accessible from within the function sandbox.

9
MCQhard

A penetration tester is analyzing a Kubernetes deployment where a ClusterRole grants the verbs get, list, and watch on secrets, combined with a ClusterRoleBinding assigning this to a default service account in a public-facing namespace. How can an external attacker exploit this configuration?

A.By exploiting an application vulnerability to obtain the service account token, then querying the Kubernetes API to dump all cluster-wide secrets.
B.By executing a kernel-level exploit against the etcd database directly from outside the cluster.
C.By generating a self-signed certificate authority to impersonate the kube-apiserver.
D.By performing a DNS poisoning attack against CoreDNS to redirect authentication tokens.
AnswerA

ClusterRole verbs get, list and watch on secrets, bound cluster-wide, let any holder read secrets in every namespace. Stealing the default service account token via an app flaw gives the external attacker that API access, satisfying the cluster-wide dump objective.

Why this answer

A ClusterRole granting get/list/watch on secrets, bound cluster-wide to a service account in a public namespace, means any holder of that SA token can read every secret in every namespace via the API server. An external attacker who exploits an application vulnerability (e.g., SSRF, RCE, or a leaked token) to obtain the mounted service account token can then call the Kubernetes API with that bearer token and dump cluster-wide secrets, including database credentials, TLS keys, and other service account tokens.

Exam trap

The trap is that candidates focus on exotic cluster-level attacks (etcd, CoreDNS, CA impersonation) instead of recognizing that a valid SA token plus over-broad RBAC is the straightforward, intended exploitation path.

How to eliminate wrong answers

Option B is wrong because etcd is normally bound to localhost or a private interface with mutual TLS client certs; an external attacker cannot reach it directly, and a kernel exploit against etcd is not the exploitation path implied by an RBAC misconfiguration. Option C is wrong because impersonating the kube-apiserver requires compromising its serving certificate or CA private key, which is unrelated to a ClusterRole secret-read permission. Option D is wrong because DNS poisoning of CoreDNS does not yield authentication tokens — Kubernetes API auth uses bearer tokens or client certs, not DNS-resolved credentials.

10
MCQhard

During a penetration test of a Microsoft Azure environment, a tester obtains a managed identity token for a virtual machine. The token has permissions to read secrets from an Azure Key Vault. Which technique can the tester use to escalate privileges by leveraging the Key Vault access?

A.Modify the Key Vault's firewall rules to allow the tester's IP address, then access the Key Vault directly with the managed identity token.
B.Use the managed identity to add a new access policy to the Key Vault that grants the tester's own Azure AD user full permissions.
C.Use the managed identity to export the Key Vault's private keys and then forge a token for an Azure AD administrator.
D.Retrieve a secret from the Key Vault that contains credentials for a service principal with higher privileges, then authenticate as that service principal.
AnswerD

Key Vault secrets often store credentials such as service principal secrets or connection strings. If the managed identity can read secrets, the tester can extract a secret that contains credentials for a more privileged identity. Using those credentials, the tester can authenticate and escalate privileges within the Azure environment.

Why this answer

The managed identity can read secrets from Key Vault. Secrets often contain credentials for other identities. By retrieving a secret that holds higher-privileged credentials, the tester can authenticate as that identity and escalate privileges.

This is a common lateral movement technique in Azure.

Exam trap

The trap here is assuming that Key Vault access alone allows direct modification of access policies or key export, when the realistic escalation path is extracting stored credentials from secrets.

11
MCQhard

A security engineer discovers that an AWS IAM user has an active access key and permissions to run ec2:RunInstances, iam:PassRole, and iam:CreateRole. What privilege escalation path does this permission combination represent?

A.The user can launch a new EC2 instance and attach a privileged IAM role via iam:PassRole, then access the instance to obtain temporary security credentials.
B.The user can modify the trust policy of the root user account using iam:CreateRole.
C.The user can inject malicious code into the AWS Nitro Enclave hypervisor layer.
D.The user can escalate privileges by updating their own MFA device via the EC2 metadata service.
AnswerA

The combination of ec2:RunInstances and iam:PassRole lets the user launch an instance with an existing privileged role attached, then retrieve its temporary credentials from the instance metadata service. iam:CreateRole is unnecessary here, but PassRole is the pivot that satisfies the escalation constraint.

Why this answer

The combination of ec2:RunInstances, iam:PassRole, and iam:CreateRole allows a user to launch an EC2 instance with an attached IAM role that has higher privileges. By passing a privileged role to the instance (iam:PassRole), the user can then access the instance (e.g., via SSH or SSM) and retrieve temporary credentials from the instance metadata, effectively escalating privileges. The iam:CreateRole permission can be used to create a new role with elevated permissions if needed.

Exam trap

CPENT often tests AWS IAM privilege escalation paths; candidates may overlook the need for iam:PassRole and focus on other permissions, or confuse iam:CreateRole with iam:CreatePolicy.

How to eliminate wrong answers

Option B is wrong because iam:CreateRole allows creating new IAM roles, but it does not permit modifying the trust policy of the root user account; root account trust policies are not modifiable in that way. Option C is wrong because AWS Nitro Enclave hypervisor layer is not accessible via IAM permissions; it is a hardware-based isolation feature. Option D is wrong because updating MFA devices is done via IAM APIs, not through the EC2 metadata service, and the EC2 metadata service does not provide MFA management.

12
Multi-Selecteasy

An auditor reviews cloud logging and monitoring configurations across an enterprise multi-cloud environment. Which TWO of the following practices represent critical security deficiencies? (Choose TWO)

Select 2 answers
A.Configuring automated alerts for unusual spikes in cloud resource creation.
B.Hardcoding cloud provider API access keys directly into public application source code repositories.
C.Using cloud-native Key Management Services with automatic key rotation enabled.
D.Disabling centralized cloud audit logging (such as AWS CloudTrail or Azure Activity Logs) to save storage costs.
E.Enforcing least-privilege access principles across all IAM service accounts.
AnswersB, D

Embedding long-lived cloud provider API keys in publicly accessible repositories exposes credentials to anyone, enabling unauthorised access and resource abuse. This directly violates the stem's requirement to identify a critical logging and monitoring security deficiency, since leaked keys bypass audit controls entirely.

Why this answer

Option B is correct because hardcoding cloud provider API access keys into public source code repositories exposes long-lived credentials to anyone who can view the repo, enabling unauthorized API calls, resource creation, and data exfiltration; secrets should instead be stored in a secrets manager or KMS-backed vault and injected at runtime. Option D is correct because disabling centralized audit logging such as AWS CloudTrail or Azure Activity Logs destroys the tamper-evident record of control-plane and data-plane activity, eliminating detection, forensic investigation, and compliance evidence, which is a critical monitoring deficiency regardless of storage cost savings. The unmarked options do not belong: A is a sound detection practice that surfaces anomalous resource creation, C is a recommended key-management practice using cloud-native KMS with automatic rotation, and E is a foundational IAM control that reduces blast radius by enforcing least privilege.

13
MCQmedium

A penetration tester is assessing a Microsoft 365 tenant and discovers that a global administrator account has no multi-factor authentication (MFA) enforcement. The tester wants to exploit this to gain persistent access to the tenant's email and files. Which Azure AD feature, if misconfigured, would allow the attacker to maintain access even after the initial password is changed?

A.Azure AD application with a client secret that has a long expiration
B.Azure AD password protection with a custom banned password list
C.Azure AD Privileged Identity Management (PIM) with just-in-time access
D.Azure AD Conditional Access policy that blocks legacy authentication
AnswerA

An Azure AD application with a client secret can be used to authenticate as a service principal. If an attacker compromises a global admin, they can create or modify an application and add a long-lived secret. This secret remains valid even after the user's password is changed, providing persistent access to resources the application is granted.

Why this answer

A global administrator can create or modify an Azure AD application and add a client secret. This secret acts as a credential for the service principal and remains valid until it expires or is revoked, regardless of the user's password changes. Attackers often use this technique to maintain persistence in Microsoft 365 environments, as it allows continued access to mail, files, and other resources granted to the application.

Exam trap

The trap here is assuming that password changes or MFA enforcement automatically revoke all access, overlooking that application secrets and service principals provide an independent authentication path.

14
MCQeasy

A penetration tester is assessing a Microsoft Azure environment and finds that a virtual machine has a system-assigned managed identity. The tester has obtained a shell on the VM and wants to use the managed identity to access an Azure Key Vault. Which endpoint should the tester query to obtain an access token for the Key Vault?

A.http://169.254.169.254/metadata/identity/oauth2/token
B.https://login.microsoftonline.com/<tenant-id>/oauth2/token
C.http://localhost:8080/identity/token
D.http://169.254.169.254/latest/meta-data/iam/security-credentials/
AnswerA

Azure VMs expose the Instance Metadata Service at 169.254.169.254. The managed identity token endpoint is /metadata/identity/oauth2/token, which returns an OAuth2 token for the specified resource. By requesting a token for the Key Vault resource, the tester can authenticate to Key Vault using that token.

Why this answer

Azure managed identities obtain tokens from the Instance Metadata Service (IMDS) at 169.254.169.254. The correct endpoint is http://169.254.169.254/metadata/identity/oauth2/token, where you specify the resource parameter as the target service, such as https://vault.azure.net. The token returned can then be used to authenticate to Key Vault.

Exam trap

The trap here is confusing Azure's IMDS endpoint with AWS's, or assuming you need to go through Azure AD's login endpoint when the managed identity token service is locally accessible.

15
MCQeasy

An administrator needs to secure communication between microservices running across different AWS Virtual Private Clouds (VPCs). Which native AWS networking feature provides private connectivity without exposing traffic to the public internet?

A.Amazon CloudFront origin access control (OAC).
B.AWS VPC Endpoints powered by AWS PrivateLink.
C.AWS Web Application Firewall (WAF) rule groups.
D.AWS Identity and Access Management resource-based policies.
AnswerB

AWS PrivateLink creates unidirectional elastic network interfaces in each VPC, letting service consumers reach providers over private IP addresses within the AWS backbone. This satisfies the stem's requirement for private connectivity across separate VPCs without internet exposure, unlike VPC peering, which demands non-overlapping CIDRs and transitive routing.

Why this answer

AWS VPC Endpoints (powered by AWS PrivateLink) allow private connections between VPCs and AWS services or other VPCs without internet gateways.

16
MCQeasy

An AWS penetration tester uncovers an IAM policy attached to a user that contains the action 'iam:PutUserPolicy' with a resource of '*'. What privilege escalation vector does this enable?

A.The user can modify the AWS billing dashboard and delete all EC2 instances.
B.The user can decrypt all KMS keys in the AWS region.
C.The user can delete the AWS account root user credentials.
D.The user can attach an inline policy to their own IAM user granting full administrative access (AdministratorAccess).
AnswerD

The `iam:PutUserPolicy` action with a `*` resource lets the user write an inline policy directly onto their own IAM identity. Because inline policies are evaluated immediately and can grant any action, the tester can inject `AdministratorAccess`-equivalent permissions, escalating from limited rights to full account control without needing existing admin privileges.

Why this answer

The IAM action iam:PutUserPolicy allows a principal to create or replace an inline policy on any IAM user (when Resource is '*'). Because the policy can be attached to the attacker's own user, they can inject a policy granting themselves AdministratorAccess or any other privileged permissions, achieving full privilege escalation. This is a classic self-escalation path documented by Rhino Security Labs and others.

Exam trap

CPENT often tests the misconception that iam:PutUserPolicy only affects the target user's permissions in a limited way, when in fact it allows arbitrary policy injection leading to full privilege escalation.

How to eliminate wrong answers

Option A is wrong because iam:PutUserPolicy has no effect on billing dashboards or EC2 instances; those require services like aws-portal:ModifyBilling or ec2:TerminateInstances. Option B is wrong because KMS decryption requires kms:Decrypt and access to the key policy, not IAM policy modification. Option C is wrong because the AWS account root user credentials cannot be deleted via IAM policies; root account actions require root login and are not governed by IAM user policies.

17
MCQhard

A penetration tester is evaluating a Kubernetes cluster utilizing Role-Based Access Control (RBAC) and notes that a custom role has the create verb on pods/exec resources. What security risk does this specific permission entail?

A.The user can extract the master node's etcd database encryption keys.
B.The user can modify the cluster's underlying cloud provider IAM policies.
C.A user with this permission can execute arbitrary commands inside any running pod in the cluster, leading to potential node or cluster compromise.
D.The user can bypass network policies by altering iptables rules on the host node.
AnswerC

The create verb on pods/exec authorises spawning exec subresources, letting the holder run arbitrary commands inside any pod in the cluster, which enables credential theft, service account token abuse and potential node or cluster compromise.

Why this answer

The create verb on pods/exec in Kubernetes RBAC allows a user to invoke the exec subresource, which runs arbitrary commands inside a running container. This is effectively remote code execution within the pod's namespace, and if the pod has a mounted service account token or hostPath volume, the attacker can pivot to the node or cluster.

Exam trap

CPENT often tests the misconception that pods/exec is a benign debugging permission — candidates underestimate that it grants arbitrary code execution and can lead to full cluster compromise.

How to eliminate wrong answers

Option A is wrong because etcd encryption keys are stored on the control plane node's filesystem and are not accessible via the pods/exec subresource — extracting them requires node-level access or a control plane compromise. Option B is wrong because cloud provider IAM policies are managed outside Kubernetes (via AWS IAM, Azure RBAC, etc.) and cannot be modified through a pod exec permission. Option D is wrong because iptables rules on the host node are managed by kube-proxy and CNI plugins; pods/exec does not grant host-level network manipulation unless the pod is privileged and has hostNetwork access.

18
MCQmedium

During an assessment of a Google Cloud Platform project, a penetration tester finds that a Cloud Storage bucket has the allUsers principal granted the Storage Object Viewer role. What security flaw does this represent, and how should it be fixed?

A.The bucket is vulnerable to GCP IAM privilege escalation via service account impersonation.
B.Google Cloud Armor automatically deletes the bucket objects.
C.The bucket is public; the allUsers or allAuthenticatedUsers IAM binding must be removed to secure the data.
D.Compute Engine instances can no longer mount the bucket as a persistent disk.
AnswerC

Granting allUsers the Storage Object Viewer role binds the bucket to the public internet, letting anyone read its objects without authentication. Removing that IAM binding, along with any allAuthenticatedUsers entry, restores private access; this directly addresses the anonymous exposure described in the stem.

Why this answer

Granting allUsers IAM role bindings on a Cloud Storage bucket makes its objects publicly readable over the internet. Remediation requires removing the allUsers binding.

19
MCQeasy

An Azure penetration tester identifies a Virtual Machine with public IP access that has an incoming Network Security Group (NSG) rule allowing TCP port 3389 (RDP) from any source ('Any' or 'Internet'). What is the recommended remediation?

A.Restrict the NSG rule source IP to trusted administrative networks or implement Azure Bastion for secure management.
B.Disable the Azure Key Vault service across the subscription.
C.Enable Azure Active Directory Pass-Through Authentication on the VM guest OS.
D.Attach an AWS IAM instance profile to the Azure Virtual Machine.
AnswerA

Exposing RDP to Any or Internet invites brute-force and exploitation attempts. Restricting the NSG source to trusted administrative networks, or routing management through Azure Bastion, removes public exposure while preserving administrative access to the virtual machine.

Why this answer

The NSG rule exposes RDP (TCP 3389) to the entire internet, which is the primary attack surface for brute-force, BlueKeep-style exploits, and ransomware initial access. The correct remediation is to narrow the source to trusted administrative IP ranges or, better, remove the public RDP exposure entirely and use Azure Bastion, which provides browser-based RDP/SSH over TLS through the Azure portal without a public IP on the VM. This directly addresses the misconfiguration while preserving administrative access.

Exam trap

CPENT often tests whether candidates confuse identity-layer controls (AAD, Key Vault, IAM) with network-layer controls, so any answer that doesn't touch the NSG rule or RDP exposure is a distractor.

How to eliminate wrong answers

Option B is wrong because Azure Key Vault is a secrets-management service unrelated to network exposure of RDP; disabling it would break secret/certificate operations without closing the port. Option C is wrong because AAD Pass-Through Authentication is an identity-synchronization method for hybrid tenants and does nothing to restrict inbound TCP 3389 from the internet. Option D is wrong because AWS IAM instance profiles are an AWS construct that has no meaning in Azure — Azure uses Managed Identities and RBAC, and neither would block the NSG rule.

20
MCQeasy

An auditor identifies that an organization's Azure storage account allows anonymous public read access to containers and blobs. What configuration change must be applied to remediate this finding?

A.Rotate the primary storage account access key every 24 hours.
B.Enable Azure Defender for Storage and configure automatic threat remediation.
C.Set the 'Allow Blob public access' property to Disabled on the storage account.
D.Apply an Azure Firewall rule blocking port 443 inbound to the storage account.
AnswerC

Disabling the 'Allow Blob public access' property at the storage account level blocks all anonymous read requests, overriding any container-level public access settings. This directly satisfies the auditor's finding by removing anonymous access to containers and blobs, ensuring authentication is required for every request.

Why this answer

Disabling public blob access on the storage account blocks anonymous requests globally.

21
Multi-Selecteasy

An auditor reviews network security configurations in an AWS VPC. Which TWO of the following network configurations represent potential security risks? (Choose TWO)

Select 2 answers
A.A security group allowing inbound TCP port 3389 (RDP) from 0.0.0.0/0.
B.Enabling AWS Shield Advanced for DDoS protection on Application Load Balancers.
C.Using AWS PrivateLink to connect securely to VPC endpoint services.
D.A security group allowing inbound TCP port 22 (SSH) from 0.0.0.0/0.
E.A VPC Flow Log enabled and streaming traffic data to an encrypted S3 bucket.
AnswersA, D

Security groups are stateful allow-lists; permitting 0.0.0.0/0 inbound on 3389 exposes RDP to the entire internet, enabling brute-force and BlueKeep-style exploitation. The stem asks for risky configurations, and unrestricted source ranges on management ports qualify.

Why this answer

Option A is correct because a security group permitting inbound TCP 3389 (RDP) from 0.0.0.0/0 exposes Windows Remote Desktop to the entire internet, inviting brute-force and ransomware attacks. Option D is correct because allowing inbound TCP 22 (SSH) from 0.0.0.0/0 exposes Linux/Unix remote shell access to all source IPs, enabling credential brute-forcing and exploitation of SSH vulnerabilities. Option B is not a risk but a mitigation, since AWS Shield Advanced provides enhanced DDoS protection for Application Load Balancers.

Option C is not a risk because AWS PrivateLink privately connects VPCs to endpoint services without exposing traffic to the public internet. Option E is not a risk because VPC Flow Logs to an encrypted S3 bucket is a secure, recommended monitoring practice.

22
Multi-Selecteasy

An auditor reviews an enterprise's hybrid cloud identity architecture. Which TWO of the following configurations represent insecure identity practices? (Choose TWO)

Select 2 answers
A.Disabling multi-factor authentication requirements for global administrator accounts during emergency maintenance windows.
B.Enforcing strong password complexity and expiration policies for all cloud user accounts.
C.Implementing Microsoft Entra ID Protection to detect compromised credentials and risky sign-ins.
D.Configuring service accounts with passwords that never expire and granting them interactive logon rights.
E.Utilizing Azure AD managed identities for Azure resources instead of hardcoded credentials.
AnswersA, D

Disabling MFA for global administrator accounts removes the second authentication factor protecting the highest-privilege identities, so a compromised password alone grants full tenant control. Emergency maintenance windows do not justify this exposure; privileged access should use temporary credentials or break-glass accounts with compensating controls.

Why this answer

Option A is correct because disabling multi-factor authentication for global administrator accounts—even temporarily during emergency maintenance—removes the strongest protection on the most privileged identities, exposing the tenant to credential-stuffing, phishing, and token-replay attacks that MFA would otherwise block. Option D is correct because non-expiring service account passwords combined with interactive logon rights create long-lived, human-usable credentials that violate least privilege and the separation of service and interactive accounts, making lateral movement and credential theft far easier. Option B is not an insecure practice: strong password complexity and expiration policies are standard hardening controls for cloud user accounts.

Option C is not insecure: Microsoft Entra ID Protection is a defensive tool that detects compromised credentials and risky sign-ins. Option E is not insecure: Azure managed identities eliminate hardcoded credentials by issuing tokens through the platform, which is a recommended secure practice.

Exam trap

CPENT often tests the identification of insecure identity practices, and candidates may mistakenly think that temporary MFA disablement is acceptable or that service accounts with non-expiring passwords are fine, when both are considered high-risk.

23
MCQhard

A penetration tester is evaluating a hybrid Active Directory environment. They compromise an on-premises user account that has been synchronized to Azure AD. They discover that the on-premises account is a member of a high-privilege local group, but Azure AD Connect has filtered out this group synchronization. How can the tester leverage Azure AD Connect configuration weaknesses?

A.Use the Azure AD Connect database password stored in the local SQL Express instance to perform a DCShadow attack.
B.Force Azure AD Connect to disable multi-factor authentication for all cloud administrators.
C.Examine Azure AD Connect synchronization rules and connector filters for misconfigurations or export rules that might inadvertently expose directory objects or allow rule manipulation.
D.Inject a malicious DLL into the Azure AD Connect health agent service to execute arbitrary code on the Azure cloud domain controller.
AnswerC

Synchronisation rules and connector filters determine which objects and attributes reach Microsoft Entra ID. Reviewing them for misconfigured export rules or filtering gaps reveals whether the high-privilege group or its members can be surfaced despite the intended filter.

Why this answer

Azure AD Connect synchronization rules and connector filters determine which on-premises objects and attributes flow to Azure AD. Misconfigurations — such as overly broad scoping filters, custom sync rules, or export rules — can inadvertently expose high-privilege objects or allow an attacker to manipulate rules to sync a privileged account into the cloud, enabling privilege escalation in Azure AD.

Exam trap

CPENT often tests the distinction between AD Connect configuration weaknesses (sync rules/filters) and unrelated attack techniques (DCShadow, MFA bypass, DLL injection) — candidates pick exotic techniques instead of the documented sync-rule abuse path.

How to eliminate wrong answers

Option A is wrong because the AD Connect database password (for the local SQL Express) does not enable a DCShadow attack — DCShadow requires domain admin or replication rights and is unrelated to the sync database credentials. Option B is wrong because Azure AD Connect cannot disable MFA for cloud administrators; MFA is managed in Azure AD/Entra ID, not by the sync engine. Option D is wrong because injecting a DLL into the health agent service is a code-execution technique on the AD Connect server, not a configuration weakness in sync rules, and it does not target an 'Azure cloud domain controller' (Azure AD is not a domain controller).

24
Multi-Selecteasy

An auditor is evaluating cloud storage security across multiple cloud providers. Which TWO of the following settings indicate improper security configurations for cloud storage buckets? (Choose TWO)

Select 2 answers
A.An Amazon S3 bucket configured with ACLs allowing public read and write access.
B.An Azure Storage Account with 'Secure transfer required' set to Enabled.
C.A Google Cloud Storage bucket with IAM binding granting storage.objectViewer to allUsers.
D.Enabling versioning and object lock on financial data storage buckets.
E.Enabling AWS S3 Block Public Access at the account level.
AnswersA, C

S3 ACLs granting public read and write let anyone list, download, and overwrite or delete bucket objects without authentication. This is a critical misconfiguration exposing data confidentiality and integrity, and is a classic cloud storage security failure.

Why this answer

Option A is correct because an S3 bucket ACL granting public read and write access (e.g., AllUsers with WRITE or WRITE_ACP permissions) allows anyone on the internet to upload, overwrite, or delete objects, which is a serious misconfiguration and a common cause of data breaches. Option C is correct because binding storage.objectViewer to allUsers in Google Cloud Storage makes every object in the bucket readable by anyone on the internet, exposing data without authentication. Option B is not improper: setting 'Secure transfer required' to Enabled on an Azure Storage Account enforces HTTPS/TLS for all requests, which is a security best practice.

Option D is not improper: versioning plus object lock (e.g., S3 Object Lock in compliance mode) protects financial data against deletion or tampering and supports retention requirements. Option E is not improper: enabling S3 Block Public Access at the account level is a recommended guardrail that overrides bucket policies and ACLs to prevent public exposure.

25
MCQhard

A penetration tester is evaluating a Kubernetes environment and discovers that the Kubernetes dashboard is deployed with cluster-admin privileges and is exposed to the internet via a NodePort service without authentication. How can this be exploited?

A.The dashboard exposes the cloud provider root account password in plain text logs.
B.The attacker can harvest Kerberos ticket-granting tickets from the dashboard cache.
C.An external attacker can access the dashboard web interface without credentials and deploy malicious pods with host-level access, resulting in complete cluster compromise.
D.The attacker can perform a buffer overflow against the etcd TLS listener via the dashboard port.
AnswerC

An unauthenticated NodePort-exposed dashboard with cluster-admin rights lets any external attacker reach the web interface and create workloads. Deploying a pod with hostPath or privileged settings grants node access, escalating to full cluster compromise as the scenario describes.

Why this answer

An unauthenticated Kubernetes dashboard exposed via NodePort allows an attacker to execute arbitrary commands, deploy malicious pods, and take over the entire cluster.

26
MCQeasy

A penetration tester is auditing an AWS environment and discovers that an IAM role used by an EC2 instance has an overly permissive trust policy allowing any principal in an external AWS account to assume it without specifying an ExternalId. What is the standard security term and remediation for this vulnerability?

A.Access Key exposure; remediate by rotating the static credentials associated with the IAM role.
B.Cross-account confused deputy vulnerability; remediate by adding a Condition block requiring an 'sts:ExternalId'.
C.Resource-based policy escalation; remediate by disabling cross-account access entirely in AWS Organizations.
D.IAM privilege escalation via PassRole; remediate by removing iam:PassRole permissions from the instance profile.
AnswerB

The trust policy lacks an ExternalId condition, letting any principal in the external account assume the role and exploit the confused deputy flaw. Adding a Condition block requiring 'sts:ExternalId' binds assumption to a shared secret, satisfying the stem's remediation requirement.

Why this answer

Allowing external accounts to assume a role without an ExternalId leaves the configuration vulnerable to the 'Confused Deputy' problem. Remediation involves adding a condition using 'sts:ExternalId' to the trust policy.

27
MCQeasy

An AWS penetration tester discovers that an Amazon RDS database instance has the 'Publicly Accessible' flag set to true, and its security group allows inbound traffic from 0.0.0.0/0 on port 3306. What is the immediate risk, and what is the recommended control?

A.S3 bucket policies will automatically override database access controls.
B.The database is vulnerable to container escape via Docker socket exposure.
C.IAM role trust policies are bypassed by external SQL injection attacks.
D.The database can be reached from the internet; the security group should be restricted to trusted CIDR blocks and public accessibility disabled.
AnswerD

Publicly Accessible plus 0.0.0.0/0 on port 3306 exposes MySQL directly to internet scanning and brute force. Restricting the security group to trusted CIDR blocks and disabling public accessibility removes that exposure, satisfying the stem's immediate-risk and control requirement.

Why this answer

The database is exposed to the public internet, requiring network ACLs, security group restriction, and disabling public accessibility.

28
MCQhard

A penetration tester gains shell access inside a Docker container running on a Linux host. They inspect the container's capabilities using capsh --print and notice CAP_SYS_ADMIN is enabled, and the cgroup v1 filesystem is mounted read-write inside the container. Which specific container escape vector is immediately available?

A.Writing directly to the host's /etc/passwd file via a shared memory segment mounted at /dev/shm.
B.Leveraging the cgroups release_agent notification mechanism to execute arbitrary commands on the host operating system.
C.Using the ptrace system call to inject code into the host's systemd daemon process.
D.Issuing a mount command to repartition the host's primary storage block device.
AnswerB

CAP_SYS_ADMIN plus a read-write cgroup v1 mount lets the tester write to the release_agent file, which the host kernel executes outside the container's namespace. This directly satisfies the escape precondition the stem describes, yielding host-level command execution.

Why this answer

With CAP_SYS_ADMIN and a read-write cgroup v1 mount, the attacker can write a path to the release_agent file and then trigger a cgroup release, causing the kernel to execute that path as root in the host's initial namespace. This is the canonical cgroup v1 container escape (CVE-2022-0492 is a related kernel-side variant). No other listed vector is available from inside a standard container without additional host misconfigurations.

Exam trap

The trap here is assuming any CAP_SYS_ADMIN container is trivially escapable via mount or ptrace, when the specific writable cgroup v1 release_agent condition is what actually enables the escape.

How to eliminate wrong answers

Option A is wrong because /dev/shm is a tmpfs shared-memory mount inside the container's mount namespace; it is not the host's /etc/passwd and writing there does not affect the host. Option C is wrong because ptrace cannot cross PID namespaces by default and systemd runs in the host's PID namespace, so the container cannot see or attach to it. Option D is wrong because repartitioning a block device requires the device node to be exposed and CAP_SYS_ADMIN plus write access to the raw device, which is not implied by the scenario and would be blocked by the container's device cgroup.

29
MCQmedium

During a CPENT engagement against a Microsoft 365 tenant, you obtain a low-privileged user's credentials and successfully authenticate. You need to determine whether the tenant has enabled Security Defaults or configured custom Conditional Access policies, because this affects your ability to perform password spraying and legacy authentication attacks. Which Microsoft Graph endpoint should you query to retrieve the tenant's Conditional Access policy configuration?

A.GET https://graph.microsoft.com/v1.0/identity/conditionalAccess/policies
B.GET https://graph.microsoft.com/v1.0/policies/identitySecurityDefaultsEnforcementPolicy
C.GET https://graph.microsoft.com/v1.0/auditLogs/signIns
D.GET https://graph.microsoft.com/v1.0/identity/conditionalAccess/namedLocations
AnswerA

The Microsoft Graph endpoint /identity/conditionalAccess/policies returns the collection of conditionalAccessPolicy objects, including their state (enabled/disabled), conditions, grant controls, and session controls. With a token possessing Policy.Read.All or Policy.Read.ConditionalAccess, a tester can enumerate exactly which policies exist, whether legacy authentication is blocked, and which users or apps are excluded, directly informing the attack plan.

Why this answer

Conditional Access policy objects are exposed through the Microsoft Graph identity namespace, and enumerating them reveals the enabled state, included/excluded users and apps, client app types (such as legacy authentication), and grant controls like MFA. This directly determines whether password spraying or legacy protocol attacks will succeed. Security Defaults is a separate object, named locations are only conditions, and sign-in logs are historical rather than configuration data.

Exam trap

The trap here is assuming that Security Defaults being disabled means no authentication protections exist, when custom Conditional Access policies can still block legacy authentication and enforce MFA.

30
Multi-Selectmedium

During a Kubernetes cluster security assessment, a penetration tester identifies multiple misconfigurations. Which TWO of the following findings represent high-risk security flaws in Kubernetes RBAC and cluster setup? (Choose TWO)

Select 2 answers
A.Exposing the Kubernetes API server endpoint directly to the public internet (0.0.0.0/0) without IP whitelisting or robust authentication.
B.Enabling Pod Security Standards (e.g., Restricted profile) across all namespaces.
C.Using network policies to isolate sensitive database pods from frontend web pods.
D.Binding the cluster-admin ClusterRole to the default service account in the default namespace via a ClusterRoleBinding.
E.Enabling Kubernetes Role-Based Access Control (RBAC) across all API groups.
AnswersA, D

A publicly exposed API server on 0.0.0.0/0 without IP whitelisting or strong authentication lets unauthenticated attackers reach the control plane, enumerate resources and attempt privilege escalation. This directly satisfies the stem's high-risk cluster setup flaw criterion.

Why this answer

Option A is correct because exposing the Kubernetes API server to 0.0.0.0/0 removes network-level protection, allowing unauthenticated or brute-forced access to the control plane; the API server is the cluster's most sensitive endpoint, so public exposure without IP whitelisting or strong authentication is a high-risk misconfiguration. Option D is correct because binding the cluster-admin ClusterRole to the default service account in the default namespace grants every pod running under that service account full cluster-wide administrative privileges, enabling trivial privilege escalation and lateral movement if any such pod is compromised. Option B is not a flaw — enabling the Restricted Pod Security Standard hardens workloads by enforcing least-privilege pod settings.

Option C is not a flaw — network policies that isolate database pods from frontend pods implement proper microsegmentation. Option E is not a flaw — enabling RBAC across all API groups is the recommended secure default, not a misconfiguration.

31
MCQeasy

An auditor finds an Amazon S3 bucket configured with public read access enabled via an Access Control List (ACL), but the bucket policy explicitly denies public read access. How does AWS evaluate these conflicting permissions?

A.AWS generates a configuration error and blocks all traffic until the conflict is resolved manually.
B.Access is granted because any Allow permission supersedes bucket restrictions.
C.The explicit Deny in the bucket policy takes precedence, resulting in access being denied.
D.The public ACL takes precedence because ACLs are evaluated before bucket policies.
AnswerC

AWS evaluates all applicable policies together, and any explicit Deny overrides every Allow, whether from an ACL, bucket policy or identity policy. The public-read ACL grant is therefore negated by the bucket policy's explicit Deny, so anonymous requests receive Access Denied.

Why this answer

AWS evaluates all applicable policies (identity-based, resource-based, ACLs, SCPs, permission boundaries) together, and any explicit Deny anywhere in the evaluation chain overrides every Allow. Because the bucket policy contains an explicit Deny for public read, that Deny wins over the ACL's public-read grant, and the request is denied. This is the fundamental 'explicit deny always wins' rule in AWS IAM policy evaluation logic.

Exam trap

The trap here is the misconception that ACLs and bucket policies are evaluated in a priority order, when in fact AWS uses a single unified evaluation where explicit Deny always overrides Allow.

How to eliminate wrong answers

Option A is wrong because AWS does not generate a configuration error or block all traffic when ACLs and bucket policies conflict — it simply evaluates them using the standard deny-overrides-allow logic. Option B is wrong because the claim that 'any Allow supersedes bucket restrictions' is the opposite of how AWS works; explicit Deny always takes precedence over any Allow. Option D is wrong because ACLs are not evaluated before bucket policies in a way that gives them priority — all policies are evaluated together, and an explicit Deny in the bucket policy overrides the ACL grant.

32
Multi-Selecteasy

When reviewing container security and Kubernetes cluster configurations, which THREE practices or misconfigurations commonly lead to container escapes or host compromise? (Choose three)

Select 3 answers
A.Using a non-root user directive (USER 1000) inside the Dockerfile.
B.Exposing sensitive host directories (such as '/' or '/proc') via 'hostPath' volumes.
C.Enabling the 'privileged: true' security context flag in the pod specification.
D.Mounting the Docker daemon UNIX socket (/var/run/docker.sock) inside a container.
E.Enabling Kubernetes Role-Based Access Control (RBAC) with least-privilege binding.
AnswersB, C, D

A hostPath volume bind-mounts a host filesystem path directly into the pod, bypassing the container's isolated mount namespace. Mounting '/' or '/proc' exposes host files, credentials and kernel interfaces, enabling escape by writing to host binaries or reading sensitive host data.

Why this answer

Option B is correct because mounting sensitive host directories such as '/' or '/proc' through a hostPath volume gives the container direct read/write access to host files, kernel interfaces, and process information, which an attacker can abuse to modify host binaries, read secrets, or escape the container boundary. Option C is correct because setting privileged: true disables most container isolation, grants all Linux capabilities, and removes seccomp/AppArmor restrictions, effectively giving the container root-level control over the host devices and kernel. Option D is correct because mounting /var/run/docker.sock exposes the Docker daemon API to the container, allowing an attacker to create a new privileged container that mounts the host filesystem and thereby compromise the node.

Option A is not a risk but a hardening practice, since running as a non-root UID (USER 1000) reduces the impact of a compromise. Option E is also a security best practice, as RBAC with least-privilege bindings limits what identities can do in the cluster rather than enabling escapes.

33
Multi-Selecteasy

An auditor is reviewing an AWS cloud environment and identifies several common misconfigurations related to identity and access management. Which TWO of the following practices represent significant security risks? (Choose TWO)

Select 2 answers
A.Enabling multi-factor authentication (MFA) on all IAM users with console access.
B.Enabling AWS CloudTrail logging across all regions in the account.
C.Using the AWS account root user credentials for day-to-day operational tasks.
D.Maintaining active access keys for the AWS account root user.
E.Attaching AWS managed policies for read-only access to auditing roles.
AnswersC, D

The root user holds unrestricted, non-revocable privileges across the entire AWS account, so using it for routine operations removes least-privilege boundaries and exposes every resource to accidental or malicious compromise. This is a significant identity and access management risk.

Why this answer

Using root credentials for daily tasks and creating active access keys for root users violate foundational AWS security best practices.

34
MCQmedium

An attacker gains access to an Azure environment and enumerates App Service Configuration settings. They discover that connection strings and database passwords are stored in plaintext within the application settings rather than being referenced via Azure Key Vault references. What attack path does this enable?

A.The attacker can perform a Golden Ticket attack against the Azure Active Directory Domain Services.
B.Azure Firewall automatically terminates the web application due to compliance violations.
C.Any user or service principal with read access to the App Service configuration can extract plaintext database credentials.
D.The App Service hypervisor becomes vulnerable to guest-to-host breakout.
AnswerC

Plaintext connection strings in App Service application settings are readable by anyone holding Reader or Contributor on the resource, exposing database credentials directly. This satisfies the stem's attack path: no Key Vault reference means no separate secret access control.

Why this answer

Storing connection strings and passwords in plaintext within App Service configuration settings means that anyone with read access to the App Service's configuration can retrieve these secrets. This includes users or service principals with Reader role or higher on the App Service resource. The attack path is straightforward: extract credentials and use them to access backend databases or other services, potentially leading to data breach or further compromise.

Exam trap

CPENT often tests the misconception that App Service configuration settings are always secure, when in fact plaintext secrets are a common misconfiguration leading to credential exposure.

How to eliminate wrong answers

Option A is wrong because a Golden Ticket attack requires compromising the KRBTGT account hash, which is not related to App Service configuration settings. Option B is wrong because Azure Firewall does not automatically terminate applications for compliance violations; it is a network security service, not a compliance enforcement tool. Option D is wrong because guest-to-host breakout is a hypervisor vulnerability, not a consequence of plaintext credentials in App Service settings.

35
MCQeasy

An auditor reviews an Azure storage account and notes that 'Secure transfer required' is set to Disabled. What security risk does this misconfiguration introduce?

A.Storage account access keys are transmitted in plaintext during Azure Resource Manager API calls.
B.Shared Access Signatures (SAS) tokens expire immediately upon generation.
C.Data in transit between clients and the storage account can be intercepted over unencrypted HTTP connections.
D.Blob storage data at rest is stored without AES-256 encryption.
AnswerC

With Secure transfer required disabled, the storage account accepts requests over plain HTTP, so credentials, tokens and object data travel unencrypted. An attacker positioned on the network path can capture that traffic, satisfying the question's focus on interception of data in transit.

Why this answer

Disabling secure transfer allows unencrypted HTTP connections to the storage account, enabling potential Man-in-the-Middle (MitM) attacks to intercept data in transit.

36
MCQmedium

In a hybrid enterprise environment, an organization uses Azure AD Seamless Single Sign-On (Seamless SSO). During a penetration test, an attacker compromises a domain-joined workstation and attempts to abuse Seamless SSO. What is the mechanism by which Seamless SSO authenticates users, and what is a known security consideration?

A.It requires all users to store their plaintext Active Directory passwords in Azure Key Vault.
B.It bypasses all Conditional Access policies for users connecting from corporate networks.
C.It forces the domain controllers to export NTLMv1 hashes to the Azure cloud directory.
D.It uses a computer account (AZUREADSSOACC$) in on-premises AD to generate Kerberos tickets for users authenticating to cloud services via browser redirection.
AnswerD

Seamless SSO creates the AZUREADSSOACC$ computer account in on-premises AD, whose Kerberos decryption key Microsoft Entra ID shares. Domain-joined users obtain a Kerberos service ticket for that account, which the browser presents for cloud authentication. Compromising the account's key enables forging tickets for any user, satisfying the hybrid SSO constraint.

Why this answer

Seamless SSO uses a computer account named AZUREADSSOACC$ in on-premises AD whose Kerberos decryption key is shared with Azure AD. When a user on a domain-joined machine accesses a Microsoft 365 resource, the browser is redirected to Azure AD, which returns a Kerberos challenge; the local machine requests a service ticket for AZUREADSSOACC$ from the on-prem DC, and the browser presents it to Azure AD, which decrypts it with the shared key to authenticate the user without re-entering credentials.

Exam trap

The trap is that candidates confuse Seamless SSO with Password Hash Synchronization or Pass-through Authentication, or assume it bypasses Conditional Access, when it actually uses Kerberos tickets via the AZUREADSSOACC$ account.

How to eliminate wrong answers

Option A is wrong because Seamless SSO never stores plaintext passwords in Azure Key Vault — it relies on Kerberos tickets, not password synchronization. Option B is wrong because Seamless SSO does not bypass Conditional Access; CA policies still evaluate sign-in risk, device compliance, and location. Option C is wrong because Seamless SSO does not export NTLMv1 hashes to Azure AD; that describes neither its mechanism nor a real behavior.

37
MCQeasy

A penetration tester is evaluating an AWS environment and discovers that an IAM role attached to an Amazon EC2 instance has an overly permissive trust policy allowing any user in the account to assume it via the sts:AssumeRole API without external conditions. Which specific remediation step should the cloud administrator apply to fix this risk?

A.Modify the IAM role trust policy to include a Condition block restricting the principal or requiring multi-factor authentication.
B.Rotate the AWS account root user access keys immediately.
C.Attach an explicit Deny policy to the EC2 instance metadata service version 2 configuration.
D.Disable the AWS Security Token Service endpoint globally across the AWS organization.
AnswerA

The trust policy's Principal element is what permits any account user to call sts:AssumeRole. Adding a Condition block — restricting the principal or demanding MFA via aws:MultiFactorAuthPresent — closes that gap while preserving legitimate role assumption, directly addressing the overly permissive trust relationship.

Why this answer

The overly permissive trust policy allows any user in the account to assume the role, which is a significant risk. The remediation is to modify the trust policy to include a Condition block that restricts the principal (e.g., specific IAM users or roles) or requires multi-factor authentication. This ensures that only authorized entities can assume the role, following the principle of least privilege.

Exam trap

The trap is thinking that rotating keys or disabling STS endpoints fixes the issue, when the core problem is the trust policy's Principal and Condition elements.

How to eliminate wrong answers

Option B is wrong because rotating root user access keys does not address the trust policy issue; the root user is not necessarily involved. Option C is wrong because attaching a Deny policy to the EC2 instance metadata service version 2 configuration is not a valid remediation; IMDSv2 is a security enhancement, but denying it would not fix the trust policy. Option D is wrong because disabling the AWS STS endpoint globally would break many services and is not a targeted fix for the trust policy.

38
MCQhard

A penetration tester is assessing an AWS environment where an EC2 instance is associated with an IAM role that trusts an external third-party AWS account in its trust policy, but the external account ID was mistyped or left overly broad (e.g., condition missing external ID or using an insecure principal). What vulnerability does this introduce?

A.The EC2 instance is vulnerable to local root privilege escalation via kernel module injection.
B.AWS CloudTrail logs for the instance are permanently deleted.
C.The third-party account gains direct SSH access to the EC2 instance filesystem.
D.The trusted external account can assume the role, and without an ExternalID condition, it is vulnerable to cross-account confusion or unauthorized assumption.
AnswerD

The role's trust policy names the external account as principal, so any identity in that account can call sts:AssumeRole. Absent an ExternalID condition, the confused-deputy weakness lets that account assume the role without proving it is the intended tenant.

Why this answer

When an IAM role trust policy allows an external AWS account to assume the role without an ExternalID condition, any principal in that account with sts:AssumeRole permissions can assume the role. If the external account ID is mistyped or overly broad, it could allow unintended accounts to assume the role, leading to unauthorized access. The ExternalID is a best practice to prevent the confused deputy problem, especially when third-party vendors are involved.

Exam trap

CPENT often tests the confused deputy problem and the importance of ExternalID in cross-account trust policies, so candidates must recognize that missing ExternalID is a vulnerability.

How to eliminate wrong answers

Option A is wrong because the trust policy vulnerability does not grant local root privilege escalation via kernel module injection; that is a separate host-level vulnerability unrelated to IAM trust policies. Option B is wrong because AWS CloudTrail logs are not deleted by a trust policy misconfiguration; CloudTrail is a separate service and would continue to log API activity unless explicitly tampered with. Option C is wrong because assuming an IAM role does not grant direct SSH access to an EC2 instance filesystem; SSH access requires network access and key-based authentication, not IAM role assumption.

39
Multi-Selectmedium

During an Azure subscription review, a security assessor checks for role-based access control and resource configuration best practices. Which TWO of the following findings represent high-severity security risks? (Choose TWO)

Select 2 answers
A.Enabling Azure Defender for SQL on all Azure SQL databases.
B.Assigning the Owner role to external guest users at the root management group level without justification.
C.Configuring Azure Monitor alerts for failed sign-in attempts.
D.Enabling soft-delete and purge protection on Azure Key Vaults.
E.Storage account access keys remaining unchanged for over a year with broad data access.
AnswersB, E

Owner at root management group scope grants external guests full control over every subscription and resource, including RBAC changes. This violates least privilege at the broadest possible scope, making it a high-severity finding in the stem's review.

Why this answer

Option B is correct because assigning the Owner role to external guest users at the root management group level grants them full control over every subscription and resource in the tenant, violating least-privilege and creating a severe privilege-escalation and data-exfiltration risk. Option E is correct because long-lived, unchanged storage account access keys with broad data access effectively act as permanent shared secrets; if leaked, they allow full access to the storage account's data, and key rotation is a core configuration best practice. Option A is not a risk but a recommended defense, since Azure Defender for SQL provides threat detection and vulnerability assessment for Azure SQL databases.

Option C is not a risk because Azure Monitor alerts on failed sign-in attempts improve detection of brute-force or credential-stuffing activity. Option D is not a risk because soft-delete and purge protection on Azure Key Vaults are recommended safeguards that prevent accidental or malicious permanent deletion of secrets, keys, and certificates.

40
Multi-Selectmedium

During an AWS security review, a penetration tester identifies several identity and storage policies. Which TWO of the following configurations are considered insecure? (Choose TWO)

Select 2 answers
A.An IAM role trust policy that permits assumption by any AWS account across the entire AWS partition without external ID checks.
B.Enabling Amazon S3 Object Versioning on critical document storage buckets.
C.Enabling AWS KMS key rotation for all customer-managed cryptographic keys annually.
D.An AWS KMS key policy granting kms:* permissions to the root user and trusted admin roles only.
E.An S3 bucket policy utilizing a wildcard principal ("Principal": "*") combined with an Allow action without sufficient condition constraints.
AnswersA, E

A trust policy allowing any AWS account in the partition to assume the role, with no ExternalId condition, enables the confused deputy problem: any third party can obtain the role's credentials. This is the insecure cross-account assumption configuration the review seeks.

Why this answer

Option A is insecure because an IAM role trust policy whose Principal allows any AWS account in the partition (for example, "AWS": "arn:aws:iam::*:root" or a wildcard account) lets arbitrary external accounts assume the role; without a sts:ExternalId condition, this enables the confused deputy problem and unauthorized cross-account access. Option E is insecure because an S3 bucket policy with "Principal": "*" and an Allow effect lacking restrictive conditions (such as aws:SourceArn, aws:SourceAccount, or aws:PrincipalOrgID) exposes the bucket to anonymous or unintended public access. Option B is not insecure: enabling S3 Object Versioning protects against overwrites and deletions and aids recovery, so it is a security best practice.

Option C is not insecure: annual AWS KMS key rotation for customer-managed keys is a recommended practice that limits the blast radius of key compromise. Option D is not insecure: granting kms:* to the account root and trusted admin roles is the standard KMS key policy pattern, since the root principal is constrained by IAM policies and does not by itself grant broad access.

Exam trap

CPENT often tests whether candidates can distinguish secure-by-default configurations (versioning, key rotation, scoped KMS policies) from genuinely risky ones (wildcard principals, missing ExternalId) — the trap is flagging best practices as insecure.

41
MCQmedium

During an Azure assessment, an attacker discovers that an App Service web application has Managed Identity enabled and the underlying application code is vulnerable to Server-Side Request Forgery (SSRF). How can the attacker chain these vulnerabilities?

A.By extracting the plaintext storage account keys from the kudu SCM debug console logs.
B.By using the SSRF vulnerability to query the Azure Instance Metadata Service (IMDS) and retrieve access tokens for the Managed Identity.
C.By forcing the App Service to downgrade its TLS version to SSLv3.
D.By injecting malicious PowerShell commands into the Azure Active Directory synchronization pipe.
AnswerB

SSRF lets the attacker reach the link-local IMDS endpoint (169.254.169.254), which issues OAuth2 access tokens for the assigned Managed Identity via its metadata endpoint. This satisfies the stem's chaining constraint, escalating from a web request forgery to authenticated access to Azure resources.

Why this answer

An attacker exploiting SSRF can query the Azure Instance Metadata Service (IMDS) endpoint at 169.254.169.254 to acquire OAuth access tokens for the managed identity.

42
Multi-Selectmedium

A CPENT tester is targeting a hybrid cloud environment that uses AWS IAM Identity Center (successor to AWS Single Sign-On) to federate with an on-premises Active Directory. The tester has obtained read-only access to the AWS Organizations management account. Which TWO actions should the tester perform to enumerate potential privilege escalation paths into member accounts? (Choose two.)

Select 2 answers
A.Call organizations:ListPolicies to retrieve all service control policies and infer which actions are denied.
B.Call organizations:ListAccounts to identify all member accounts and their IDs.
C.Call iam:ListRoles in the management account to find roles with AdministratorAccess.
D.Call sso-admin:ListPermissionSets and sso-admin:ListAccountAssignments for each account.
E.Call sts:GetCallerIdentity to confirm the current role and then attempt sts:AssumeRole on every role ARN discovered.
AnswersB, D

ListAccounts enumerates every account in the organization along with its ID, ARN, email, and status. From the management account, this provides the target list of member accounts that could be reachable through identity center permission sets or cross-account roles. Without this enumeration, the tester cannot know which accounts exist or where to focus escalation attempts, making it a necessary first step.

Why this answer

To map escalation from a management account into member accounts via IAM Identity Center, the tester must first enumerate the accounts with ListAccounts, then inspect the permission sets and their assignments with ListPermissionSets and ListAccountAssignments. Together these reveal which federated identities can assume which roles in which accounts. IAM role listing, GetCallerIdentity, and SCP retrieval do not expose the identity center assignment graph.

Exam trap

The trap here is focusing on IAM roles and SCPs within the management account while overlooking that IAM Identity Center permission set assignments are the actual bridge to member accounts.

43
Multi-Selectmedium

A penetration tester is assessing a Microsoft Azure environment and discovers that a virtual machine (VM) has a system-assigned managed identity enabled. The VM is running a web application that is vulnerable to server-side request forgery (SSRF). The tester wants to exploit the SSRF to gain access to Azure resources. Which TWO of the following actions can the tester perform to leverage the managed identity? (Choose two.)

Select 2 answers
A.Query the Azure Instance Metadata Service (IMDS) endpoint at http://169.254.169.254/metadata/identity/oauth2/token to obtain an access token for the managed identity.
B.Modify the managed identity's role assignments by sending a PATCH request to the IMDS endpoint to add the Contributor role.
C.Retrieve the managed identity's certificate from the IMDS endpoint and use it to authenticate as the managed identity to any Azure service.
D.Use the managed identity's credentials to authenticate to Azure Active Directory (Azure AD) and enumerate all users and groups in the tenant.
E.Use the obtained access token to call the Azure Resource Manager API and list all resources in the subscription, provided the managed identity has Reader permissions on the subscription.
AnswersA, E

The IMDS endpoint is accessible from within the VM and provides OAuth2 tokens for the managed identity when requested with the appropriate header. By exploiting SSRF, an attacker can make the web application send a request to this endpoint and retrieve the token. This token can then be used to authenticate to Azure services that the managed identity has access to, such as Azure Resource Manager or Key Vault.

Why this answer

The two correct actions are querying the IMDS endpoint to obtain an access token and using that token to call Azure Resource Manager if the managed identity has Reader permissions. These steps allow an attacker to leverage SSRF to steal the managed identity's token and then access Azure resources. The other options are incorrect because they assume capabilities that IMDS does not provide, such as retrieving certificates or modifying role assignments, or they require permissions not typically granted to managed identities.

Exam trap

The trap here is assuming that the IMDS endpoint can be used to modify role assignments or retrieve certificates, when it only provides OAuth2 tokens.

Ready to test yourself?

Try a timed practice session using only Cloud And Hybrid Infrastructure Security questions.