Skip to main content

Security Quiz

Last Updated: 2026-12-01 Status: Complete

Test your judgment on audit trails, data protection and access control. Answers are collapsed; try each question before opening it.

Question 1: Who looked at the bank details?​

A support agent is suspected of browsing merchant bank details. Your audit log only records changes. What do you do?

View answer

Reads of sensitive data must be audited as well as writes. Add an explicit audit event whenever bank details are revealed, recording the actor, target reference id, tenant and source, and index it by target so you can answer "who viewed this merchant in the last 30 days". Mask by default and require a deliberate reveal action. Past reads cannot be reconstructed from a change-only log, so check application and access logs for the period, and alert on unusual read volume per actor. See What Should You Log?.

Question 2: Tampering after the fact​

During an investigation you must show the audit table was not edited by a database administrator. What design makes that provable?

View answer

Append-only grants and triggers prevent changes but do not prove none occurred. Add a hash chain, where each record stores the hash of the previous record, so editing or removing any row breaks every later hash. Periodically sign the chain head with a key in a KMS or HSM and write it to a separate write-once store, then run a verification job from the last anchor. Run the log pipeline in a separate account so administrators of the application database cannot rewrite it. See How Do You Make the Log Tamper-Evident?.

Question 3: Retention for two years of history​

An inquiry asks for every action on one merchant over the last two years. Your audit table has billions of rows. How should it have been built?

View answer

Partition by month on the event time and index by tenant, target type, target id and time, so the query prunes to 24 partitions and uses an index in each. Keep the recent window in the database and move older partitions to write-once object storage laid out by tenant and month, queryable by an engine that scans only that merchant's files. Keep records for the longest applicable retention period and honor legal holds. Test the query at production scale before you need it. See How Long Do You Keep Audit Data?.

Question 4: Hashing bank accounts​

Your team wants to hash bank account numbers with SHA-256 to detect duplicate sub-merchants. What is wrong with that?

View answer

Bank account numbers have a small, structured input space, so an unkeyed hash can be brute-forced or looked up in a precomputed table if the database leaks. Use a keyed hash, such as HMAC with a dedicated secret in a KMS, as a blind index in a separate column. Normalize the input first, combine routing and account numbers, restrict who can query the column and rotate by re-indexing. PCI DSS Requirement 3.5.1.1 requires keyed hashes for PAN, and the same reasoning applies here. See How Do You Mask, Truncate and Look Up Sensitive Values?.

Question 5: The card number in the logs​

A support ticket attachment shows a customer's full card number from a request log. What do you fix, beyond deleting that log line?

View answer

Treat it as a potential security event and involve your security team before investigating it further. Then fix the cause: a code path logged a whole request object. Move to allowlist-based structured logging, redact at the serialization boundary, and scrub error trackers and APM request bodies. Stop the card number reaching your servers at all by using hosted fields so only tokens arrive. Scan free-text fields for card-like numbers. Scope impact is for your QSA to assess. See How Do You Keep Sensitive Data Out of Logs?.

Question 6: Deletion request​

A sub-merchant asks you to delete all its data, but you hold KYC records and payment history. What is your approach?

View answer

Erasure is not absolute. GDPR Article 17(3)(b) and (e) exclude processing needed for a legal obligation or for legal claims. Verify the requester, check holds, classify each record against a retention schedule, delete what is eligible, restrict processing of retained records, keep ledger and audit entries that hold ids rather than personal values, and schedule deletion when retention ends. Crypto-shredding helps for isolated, deletable data. Legal counsel should approve the schedule and the response. See Deletion vs Retention.

Question 7: Tenant id from the query string​

A pull request reads the tenant id from a query parameter for a payment lookup. What is the risk and the fix?

View answer

The caller controls the parameter, so they can substitute another tenant's id and read that tenant's payments. This is broken object level authorization, the first item in the OWASP API Security Top 10. Derive the tenant from the authenticated principal, require it in every repository method so an unscoped query cannot be written, and return not found for other tenants' objects. Add automated tests that attempt cross-tenant access on every endpoint, and consider row-level security as a second layer. See Tenant Isolation.

Question 8: A leaked secret key​

A secret API key is found in a public repository. What happens next, and what should the key design have provided?

View answer

Revoke the key immediately, issue a replacement, review audit and access logs for use of the key, and notify the customer. If you suspect misuse, escalate to your security team. The design should have provided a recognizable prefix for secret scanners, hashed storage so your own database leaks nothing, scopes limiting the damage, overlapping rotation so replacement does not cause an outage, last-used tracking and anomaly alerts. See Secret API Keys.

Question 9: Changing a payout account​

An attacker with a stolen session cookie changes a merchant's payout bank account. Which controls should have stopped or limited this?

View answer

Step-up MFA with a phishing-resistant factor for the change, even inside a valid session. Notify existing contacts and consider a hold before the first payout to the new destination. Alert on a destination change followed quickly by a payout, and audit the change with masked before and after values. Limit who has the permission and require a second approver where risk warrants. Short session lifetimes and cookie protections reduce the chance of theft. See How Should MFA Work?.

Question 10: Production debugging​

A developer needs to debug a payout issue involving real merchant data. How do you grant access safely?

View answer

Avoid standing access. Use just-in-time access with a ticket, second-person approval, a narrowly scoped role and automatic expiry, with the session logged and sensitive reads audited. Try a masked read replica or synthetic reproduction first. Keep a break-glass path for emergencies that sounds an alarm and requires review afterward. Never copy production PII or card data into development environments, and review privileges on a regular schedule. See How Should You Control Production Access?.

Share: