All CompTIA exams

Free CAS-005 practice test: 30 questions with answers

30 original questions for CompTIA SecurityX, drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.

Free questions
30
Full bank
100 questions
Real exam
Maximum of 90 questions, 165 min
Passing score
Pass/fail only

CAS-005 exam guide: topics, cost and format

All 30 CAS-005 questions with answers

The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.

Security engineering (8 questions)

  1. Question 1

    A company must allow developers to deploy containers that call a payment API. The API must accept only traffic from workloads with a verified identity, and no static API keys may be stored in images. Which control best meets this?

    1. AWorkload identity with short-lived tokens issued by a workload identity provider, validated by the API gateway
    2. BBasic authentication with a password stored in the container configuration file and passed to the API gateway as a base64 header
    3. CA shared API key stored in an environment variable baked into the image during the build step
    4. DSource IP allowlisting of the cluster egress NAT address on the gateway using a static /24 CIDR rule
    Show answer and explanation
    Correct answer: A

    Short-lived workload identities remove static secrets and let the gateway verify who is calling. A shared key in an image is exactly the secret exposure the requirement forbids, and IP allowlisting does not prove workload identity.

  2. Question 2

    A security engineer must protect data at rest in a cloud object store using keys that the company controls, with the ability to revoke access to the data quickly. Which approach is best?

    1. ARelying on TLS to protect data stored at rest, since the bucket uses HTTPS
    2. BEncrypting files with a password written in the same bucket as the objects
    3. CProvider-managed keys with no rotation policy, so the tenant has no direct key revocation path for the bucket
    4. DCustomer-managed keys in a KMS with a key policy that can be disabled to revoke access
    Show answer and explanation
    Correct answer: D

    Customer-managed keys let the organization disable or revoke the key, which makes the data unreadable on demand. TLS protects data in transit, not at rest, and keeping passwords beside the data defeats encryption.

  3. Question 3

    A web team is deploying a new TLS-enabled service. The security team requires forward secrecy and removal of legacy protocols. Which configuration meets these requirements?

    1. ATLS 1.0 with static RSA key exchange and CBC cipher suites
    2. BSSL 3.0 with RC4 for legacy compatibility
    3. CTLS 1.2 with export-grade ciphers enabled for legacy clients
    4. DTLS 1.3 with ECDHE key exchange and TLS 1.0 disabled
    Show answer and explanation
    Correct answer: D

    TLS 1.3 uses ephemeral key exchange, which provides forward secrecy, and legacy protocols are disabled. Static RSA key exchange lacks forward secrecy, and SSL 3.0, RC4 and export ciphers are broken.

  4. Question 4

    An organization wants to limit the impact if a single compromised virtual machine is used to move laterally to other workloads. Which design principle addresses this most directly?

    1. AIncreasing the VM disk size and vCPUs for the hypervisor
    2. BDisabling endpoint logging to reduce noise in the SOC queue
    3. CEnabling DHCP reservations on the hypervisor hosts for IP planning
    4. DMicrosegmentation with default-deny east-west policies
    Show answer and explanation
    Correct answer: D

    Microsegmentation with default-deny policies restricts which workloads can talk to each other, which contains lateral movement. The other options do not limit east-west traffic.

  5. Question 5

    A security architect must select a cryptographic primitive to verify that a downloaded software package has not been modified by an unauthorized party, where the verifier should not be able to create signatures. Which mechanism is appropriate?

    1. AA plain SHA-1 hash published on the same web page as the download and served over HTTP
    2. BA digital signature created with the publisher's private key and verified with the public key
    3. CA reversible encryption of the package with the public key so verifiers can recover it
    4. DA symmetric MAC shared between publisher and every verifier with the installer package
    Show answer and explanation
    Correct answer: B

    A digital signature lets anyone verify with the public key while only the publisher holds the private key. A shared MAC would let verifiers forge tags, and a hash on the same page can be replaced by an attacker who controls the page.

  6. Question 6

    A legacy application stores session tokens in cookies without the Secure or HttpOnly attributes. Which combined change most directly reduces the risk of token theft?

    1. ALengthen the session timeout to one year and keep it across restarts
    2. BDisable cookies entirely and log tokens to a file on the shared application server
    3. CSet Secure and HttpOnly on the cookies and serve the site only over HTTPS
    4. DStore tokens in the URL query string so they appear in browser history and proxy logs
    Show answer and explanation
    Correct answer: C

    Secure prevents transmission over plain HTTP, and HttpOnly stops JavaScript from reading the cookie, which reduces theft via network sniffing and script injection. Longer lifetimes and URL tokens increase exposure.

  7. Question 7

    A team must select a method to handle sensitive configuration values during CI/CD, with rotation and audit of each read. Which option is most appropriate?

    1. APlain-text values committed to the repository in a private branch for code review
    2. BA managed secrets service with access policies, rotation, and audit logging, referenced at runtime
    3. CValues written into the build log for debugging during each CI pipeline run
    4. DShared spreadsheets with one password for every engineer on the platform team, stored in a shared drive folder
    Show answer and explanation
    Correct answer: B

    A managed secrets service with rotation and audit logs keeps secrets out of code and records access. Committed or logged secrets leak, and shared spreadsheets lack control and auditability.

  8. Question 8

    Which TWO practices most directly protect a CI/CD pipeline from being used to inject malicious code into production? (Choose two.)

    1. AStore signing keys in the repository alongside the source code
    2. BRequire signed commits and protected branches with mandatory review before merge
    3. CVerify build provenance and sign artifacts before promotion to production
    4. DGive every developer administrator rights on the build server
    Show answer and explanation
    Correct answer: B, C

    Protected branches with review and signed artifacts with verified provenance prevent unreviewed or tampered code reaching production. Broad admin rights and keys in the repository make tampering easy.

Security operations (8 questions)

  1. Question 9

    A SOC analyst notices repeated failed logins followed by a successful login from an unusual country for a privileged account. Which response is the most appropriate first step?

    1. AWait a week and monitor whether the failed login pattern repeats later
    2. BDisable or lock the account pending verification, and review recent session activity
    3. CClose the alert because the login succeeded with valid credentials and an approved MFA prompt on record
    4. DShare the account password in the incident channel to speed up review of the session records
    Show answer and explanation
    Correct answer: B

    Locking the account and reviewing session activity contains a likely account takeover quickly. Waiting, closing the alert and exposing credentials all increase the damage.

  2. Question 10

    A security team wants to reduce mean time to detect malicious activity across endpoints, cloud accounts, and identity systems. Which capability is most valuable?

    1. AStoring logs locally on each device with a 24-hour overwrite cycle before SOC review
    2. BDisabling alerts with low severity to reduce analyst fatigue in the queue
    3. CCentralized log collection and correlation in a SIEM with tuned detection rules
    4. DQuarterly manual log reviews conducted by one analyst from exported CSV log files
    Show answer and explanation
    Correct answer: C

    Centralized, correlated logging with tuned detections across sources shortens detection time. Local-only logs, disabled alerts and quarterly reviews all delay detection.

  3. Question 11

    An incident response team has confirmed that a server is infected with malware. The business wants the service restored quickly, but evidence must be preserved for legal review. What should happen first?

    1. AReboot the server to clear the infection and then investigate with logs left in place
    2. BWipe the disk immediately without imaging and rebuild from the standard template
    3. CDelete the malware files and continue operating once the antivirus engine reports clean
    4. DCapture volatile data and forensic images, then isolate the host and restore from a clean image
    Show answer and explanation
    Correct answer: D

    Capturing volatile memory and disk images before containment preserves evidence, and isolation then limits spread. Rebooting or deleting files destroys evidence, and wiping without imaging does the same.

  4. Question 12

    A vulnerability scan reports a critical flaw in an internet-facing web server that has an active public exploit. The patch will require a planned outage. What is the best next step?

    1. AApply compensating controls such as a WAF rule or isolation now and schedule an expedited patch window
    2. BDisable the scanner so that the report stops and suppress findings until the next audit cycle
    3. CWait for the next annual maintenance window and keep the web server exposed to the internet until then with the exploit available
    4. DIgnore the finding because the scanner has false positives and the vendor has not confirmed it yet
    Show answer and explanation
    Correct answer: A

    Compensating controls reduce exposure immediately, and an expedited patch follows the risk. Ignoring or waiting leaves the exposure open, and disabling scans hides the risk.

  5. Question 13

    A threat hunting team wants to find attacker behaviour that evades signature-based detection, such as living-off-the-land techniques. Which approach is most suitable?

    1. AReviewing the firewall deny logs for blocked connections across perimeter and internal segments, filtered by source country and port
    2. BRelying on antivirus signature updates and scheduled full-disk scans to flag known malware hashes
    3. CHypothesis-driven hunting using behavioural analytics and ATT&CK-mapped techniques over endpoint telemetry
    4. DBlocking PowerShell, WMI and scripting engines across the estate through application control policy without business review
    Show answer and explanation
    Correct answer: C

    Hypothesis-driven hunts using behavioural telemetry and ATT&CK techniques find activity that signatures miss. Signature-only detection and blanket blocks miss or disrupt legitimate work, and deny logs cover a narrow slice.

  6. Question 14

    A company's security operations center must answer whether an alert about a suspicious binary is a true positive. The team has the binary's hash, file path, and execution history. What should the analyst do first?

    1. ACheck the hash against threat intelligence and review the execution context on the host
    2. BIgnore the alert until the vendor confirms it, and pause triage until the publisher replies
    3. CQuarantine every file with a similar name across the company and reimage each matching host image
    4. DPublish the hash on a public forum so the community can quickly help classify it
    Show answer and explanation
    Correct answer: A

    Checking the hash against threat intelligence and reviewing its execution context gives fast evidence of whether the alert is malicious. Broad quarantine and public posting are premature, and waiting for the vendor delays response.

  7. Question 15

    Which TWO actions are appropriate during the containment phase of an incident involving a compromised user account? (Choose two.)

    1. ARevoke active sessions and reset credentials through the identity provider
    2. BDelete all mailbox content to remove the attacker's data
    3. CDisable the logging agent so the attacker cannot see alerts
    4. DPreserve authentication logs and session records for analysis
    Show answer and explanation
    Correct answer: A, D

    Revoking sessions and resetting credentials stop the attacker's access, and preserving logs supports analysis. Deleting content and disabling logging destroy evidence and reduce visibility.

  8. Question 16

    A SOC receives an alert from an endpoint detection tool that a process is injecting code into another process. The analyst needs to decide whether to isolate the host. Which evidence most strongly supports isolation?

    1. AThe file was created by an administrator last year and digitally signed by the IT department
    2. BThe host has a high CPU load during business hours while a scheduled backup and a nightly reporting job run in parallel
    3. CThe process name is similar to a common system tool such as a Windows utility spelled with one altered letter in its path
    4. DConfirmed suspicious parent-child process chain plus outbound connection to a known malicious address
    Show answer and explanation
    Correct answer: D

    A suspicious process chain with a known-bad outbound connection is strong evidence of compromise. Name similarity, age and load alone are weak indicators.

Security architecture (7 questions)

  1. Question 17

    An enterprise is designing a zero-trust network for remote employees accessing internal applications. Which principle should guide the design?

    1. ATrust is granted per request based on identity, device posture, and context rather than network location
    2. BPerimeter firewalls with strict ingress rules are the primary control required at the edge
    3. CUsers connected through the corporate VPN are trusted by default and their subnet is internal
    4. DAccess is granted once at login and the session is then trusted without reevaluation for its lifetime, even after device changes
    Show answer and explanation
    Correct answer: A

    Zero trust evaluates each access request using identity, device health and context, and it does not assume trust from network location. Perimeter-only and VPN-based trust models contradict this principle.

  2. Question 18

    A company runs workloads in three clouds and on-premises, and must enforce the same identity policy everywhere while keeping one authoritative identity source. Which architecture pattern is most appropriate?

    1. AFederated identity with a central identity provider and SCIM or SAML/OIDC integration to each platform
    2. BSeparate local accounts on every platform managed by hand with a spreadsheet of logins
    3. CReplicating passwords to each platform nightly in cleartext through a batch sync job
    4. DA single shared administrator account with its password kept in a team wiki page
    Show answer and explanation
    Correct answer: A

    Federation with a central identity provider gives one source of truth and consistent policy, with automated provisioning such as SCIM. Local accounts and shared administrators cannot be governed consistently.

  3. Question 19

    A network architect must allow a partner to reach one internal API. The partner must not have visibility into the rest of the internal network. Which design best meets this?

    1. APlace the API on a public IP address without authentication behind a load balancer
    2. BGive the partner a VPN into the full internal subnet with split tunneling off and a flat route to the corporate range
    3. COpen inbound ports on the perimeter firewall to the partner IP range, with the internal subnets reachable as needed
    4. DExpose the API through a reverse proxy or API gateway in a DMZ with mutual TLS and a narrow route
    Show answer and explanation
    Correct answer: D

    A DMZ gateway with mutual TLS exposes only the required API and keeps the internal network hidden. A full VPN or open firewall ports reveal far more than the partner needs.

  4. Question 20

    A security architect is evaluating a cloud-native application that must keep working during a regional outage while maintaining confidentiality of data in both regions. Which design choice is most important?

    1. AReplicate encrypted data to a second region with keys managed consistently and tested failover
    2. BStore unencrypted backups in a public bucket for speed with anonymous read access enabled for failover drills
    3. CDisable encryption to reduce replication latency across the WAN link between regions during peak business hours
    4. DUse a single region and rely on provider SLAs and accept that the cloud SLA covers regional failure
    Show answer and explanation
    Correct answer: A

    Encrypted cross-region replication with consistent key management and tested failover preserves both availability and confidentiality. Unencrypted public copies and disabling encryption violate confidentiality, and a single region does not survive a regional outage.

  5. Question 21

    A software vendor is designing a hardened image for a server role. The image must reduce attack surface and allow reproducible builds. Which practice is most appropriate?

    1. AInstall the full package repository on every server so debugging utilities, compilers and language runtimes are present
    2. BBuild from a minimal base with only required packages, pinned versions, and a signed, scanned artifact
    3. CKeep default credentials to simplify troubleshooting for the appliance vendor's support team, which needs them to reach the console
    4. DUse an image built manually on a laptop and copied to servers with uncommitted local tweaks and no build record
    Show answer and explanation
    Correct answer: B

    A minimal, pinned and signed image reduces attack surface and makes builds reproducible. Installing everything and manual laptop builds increase exposure and drift, and default credentials are a direct weakness.

  6. Question 22

    Which THREE controls reduce the risk of a compromised workload moving laterally across a cloud environment? (Choose three.)

    1. AShared administrative credentials across environments
    2. BA single flat network shared by all tiers
    3. CSegmented subnets with restrictive security groups
    4. DLeast-privilege IAM roles for each workload
    5. ECentral logging of east-west flow records and anomaly alerts
    Show answer and explanation
    Correct answer: C, D, E

    Segmentation, least-privilege identities and flow monitoring each limit or reveal lateral movement. A flat network and shared admin credentials make movement easier.

  7. Question 23

    An enterprise is redesigning its perimeter for a hybrid workforce. Users must reach SaaS applications directly without backhauling all traffic through the data center, while security inspection continues. Which architecture is most suitable?

    1. ASecure Access Service Edge with cloud-delivered inspection, identity-aware access, and posture checks
    2. BRemoving inspection and content filtering for SaaS traffic because the vendor is trusted
    3. CRouting SaaS sessions through a single on-premises firewall cluster and legacy proxy
    4. DAllowing unrestricted outbound internet access from every endpoint without egress rules
    Show answer and explanation
    Correct answer: A

    SASE delivers inspection and identity-based access from the cloud without forcing traffic through the data center. Backhauling adds latency, and removing inspection increases risk.

Governance, risk, and compliance (7 questions)

  1. Question 24

    A regulated company must demonstrate that access to sensitive systems is reviewed regularly. Which control best provides this evidence?

    1. ADeleting logs after a week to free storage on the collectors and shorten index rebuilds
    2. BPeriodic access reviews with documented approvals, removals, and retained records
    3. CGranting administrator rights to every staff member by default so helpdesk tickets close faster
    4. DAn undocumented verbal agreement with managers reviewed once a year
    Show answer and explanation
    Correct answer: B

    Periodic, documented access reviews with retained records give auditors evidence of control operation. Verbal agreements, broad rights and short log retention fail the requirement.

  2. Question 25

    A vendor contract requires the vendor to notify the company of security breaches affecting its data within a defined time. Which governance mechanism should the security team use to verify compliance over time?

    1. APerforming a single questionnaire at contract signing and filing results
    2. BTrusting the vendor's marketing claims and sales collateral about its controls
    3. CThird-party risk assessments and contractual audit rights with periodic evidence reviews
    4. DAssuming the vendor is compliant because it signed the contract and its terms
    Show answer and explanation
    Correct answer: C

    Third-party assessments, audit rights and periodic evidence reviews verify compliance throughout the relationship. Marketing claims, assumptions and one-time checks do not prove ongoing compliance.

  3. Question 26

    A company is preparing for a privacy audit and must show that personal data is retained only as long as needed. Which artifact best demonstrates this control?

    1. AA roster of employees' home addresses, personal phone numbers, emergency contacts
    2. BA copy of the marketing brochure with privacy commitments and product news
    3. CA data retention schedule mapped to data categories, with automated deletion evidence
    4. DA network diagram of the office floor with Wi-Fi access points and sensors
    Show answer and explanation
    Correct answer: C

    A retention schedule with evidence of automated deletion demonstrates the control. The other artifacts do not show retention decisions or enforcement.

  4. Question 27

    Which TWO elements should a risk register contain for each identified risk? (Choose two.)

    1. AOwner and assessed likelihood and impact
    2. BCurrent treatment decision and review date
    3. CUnrelated stock prices of competitors
    4. DThe developer's personal phone number
    Show answer and explanation
    Correct answer: A, B

    A risk register records ownership, assessed likelihood and impact, the treatment decision and review dates. Personal and unrelated data do not belong there.

  5. Question 28

    An auditor asks how the organization ensures that a new cloud service meets security requirements before it is adopted. Which process provides this assurance?

    1. AReviewing the service configuration and contract terms after an incident is contained by the team
    2. BAssuming the vendor's certification covers the tenant configuration by default at launch
    3. CAdoption by business teams through self-service provisioning without a security review in the cloud marketplace during sprints
    4. DA security and privacy assessment with documented requirements, risk decision, and approval before go-live
    Show answer and explanation
    Correct answer: D

    A documented assessment and approval before go-live provides evidence of due diligence. Adoption without review, reliance on certificates alone and post-incident review fail the requirement.

  6. Question 29

    A company must demonstrate compliance with a policy requiring security awareness training for all staff annually. Which evidence best supports this?

    1. AA manager's verbal confirmation that training was completed by the team, recorded in a shared spreadsheet at year end
    2. BA slide deck covering annual security topics without attendance data or quiz scores
    3. CCompletion records from the learning system tied to each employee and a retained annual training record
    4. DA written statement that annual training is offered in the office and through the intranet
    Show answer and explanation
    Correct answer: C

    Completion records tied to each employee provide verifiable evidence. Offers, unlinked slides and verbal confirmation are not auditable.

  7. Question 30

    A business unit wants to start processing health information in a new application. Which governance step should occur first?

    1. AStoring the health data in a personal file share on a laptop with a local sync client and no encryption at rest
    2. BA data protection impact assessment and a review of the legal basis and controls before processing begins
    3. CSharing the data with an external analytics partner under a standard NDA for benchmarking across clinics
    4. DLaunching the patient portal to users and assessing privacy risks in a later release
    Show answer and explanation
    Correct answer: B

    A privacy impact assessment and legal review before processing ensure requirements are met. Launching first or sharing externally creates unmanaged compliance risk.