API Security, Authentication and Authorization Questions
Controlling who can call an API, what they may do, and defending it against abuse. Covers the access-control mechanics: API keys, OAuth 2.0 flows, OpenID Connect, JWT issuance/validation, session vs. token auth, scopes/roles for fine-grained authorization, token lifetime and refresh, mutual TLS, and machine-to-machine vs. user-delegated access. Also covers the adversarial hardening view: input validation, injection and deserialization risks, broken object-level authorization (BOLA), mass assignment, secrets handling, and the OWASP API Security Top 10, plus securing data in transit, preventing enumeration/scraping, and testing APIs for vulnerabilities.
Walk me through how you'd build a scalable pipeline to detect API abuse (credential stuffing, scraping, fraud) across hundreds of services and millions of requests per minute. Include data collection and enrichment (geo, ASN, device fingerprint), real-time detection and scoring (streaming feature aggregation, ML models), alerting to SIEM/SOAR, automated blocking/lists and the feedback loop for model updates, while preserving low latency on request paths.
Sample Answer
Direct answer
At the scale described (hundreds of services, millions of requests per minute) the pipeline has
to split into a fast synchronous path that adds only a few milliseconds per request, and a
slower asynchronous path that does the expensive enrichment and model scoring off to the side
and feeds its verdicts back as a cache the fast path can check cheaply. You cannot run full
machine-learning scoring inline on every request at that volume without blowing the latency
budget, so the design's central decision is what stays synchronous (a cheap reputation lookup)
versus what happens asynchronously and only changes future requests (enrichment, scoring, model
updates).
Structured elaboration
Sizing the problem first. "Millions of requests per minute" is on the order of tens of
thousands of requests per second; for example 5,000,000 requests/minute is about 83,000
requests/second sustained. Any synchronous, per-request check has to fit inside a latency budget
of a few milliseconds at that rate, which rules out anything that calls out to a heavyweight
model or an external enrichment API inline.
Data collection and enrichment. Capture request metadata at the edge (source IP, user agent,
TLS fingerprint, authenticated identity if any) and enrich it: geolocation and ASN (autonomous
system number, which identifies the network/ISP a request came from) lookups from a local,
periodically-refreshed dataset rather than a live network call; device fingerprinting from
client-side signals where available. Do the enrichment lookups against an in-memory or
local-cache copy of the reference data, not a network round trip per request, since a network
call per request at 83,000 requests/second is its own outage risk.
Real-time detection and scoring. Split scoring into two tiers:
- A cheap, synchronous tier that checks a precomputed verdict (IP or identity already on a
blocklist or flagged as high-risk from a shared, low-latency cache) and applies simple rules
(velocity thresholds) that need no model inference. - An asynchronous tier that aggregates streaming features (request velocity per identity, ratio
of failed to successful auth attempts, geographic dispersion of a single credential's usage)
over sliding windows, and periodically runs those aggregated features through a scoring model.
The model's output updates the shared verdict cache that the synchronous tier reads, so the
request path never blocks on model inference; it only ever blocks on a cache read.
Alerting to SIEM/SOAR. Route confirmed and borderline detections to the security team's SIEM
(security information and event management system, which centralizes security logs for
investigation) and SOAR (security orchestration, automation and response, which can trigger
automated response playbooks) rather than only auto-blocking. High-confidence, high-severity
patterns can trigger automated blocking directly; medium-confidence patterns should raise an
alert for a human or a scripted playbook to act on, since automated blocking on a weak signal
risks blocking real users (a false positive that costs revenue and trust).
Automated blocking and the feedback loop. Blocking decisions (IP bans, credential lockouts,
CAPTCHA challenges) need to be revisable: log every automated action with the signal that caused
it, and feed confirmed false positives (a legitimate user who got blocked and later proved it,
for example by successfully completing account recovery) back into the model's training data or
into rule exceptions, so the system's precision improves rather than accumulating permanent
mistakes.
Preserving low latency on request paths. The single most important architectural rule is
that nothing on the synchronous request path may depend on the availability or latency of the
detection pipeline's slower components. If the verdict cache is unreachable, the request path
should fail open to "no additional friction" (log the miss, do not block), not fail closed to
"block everything," unless the product's risk tolerance explicitly demands the opposite for a
specific high-value action (initiating a payment, for example).
Worked example
graph LR
R[API Request] --> E[Enrichment: geo, ASN, device fingerprint]
E --> F[Streaming Feature Aggregation]
F --> ML[Real time ML Scoring]
ML -->|high risk| B[Auto Block or Challenge]
ML -->|medium risk| SIEM[Alert to SIEM and SOAR]
ML -->|low risk| P[Pass Through]
B --> FB[Feedback Loop]
SIEM --> FB
FB --> ML
Reading the diagram left to right: the synchronous request path is only the leftmost box, since
everything from "Streaming Feature Aggregation" onward runs asynchronously against buffered
data, not inline with the request. At 83,000 requests/second, if the synchronous enrichment plus
a verdict-cache read together cost 2ms, that is a fully absorbable addition to a typical API's
latency budget; if the same path instead waited on the "Real time ML Scoring" box per request,
the pipeline would need that box to sustain 83,000 scoring calls per second with sub-millisecond
latency each, which is why that box is drawn as feeding a cache asynchronously rather than
sitting inline.
Trade-offs and pitfalls
- Fail-open vs. fail-closed under detector outage. Failing open (letting requests through
when the detection pipeline is down) protects availability and revenue but temporarily loses
abuse protection; failing closed protects against abuse but can turn a detection-pipeline
outage into a full product outage. State this trade-off explicitly per endpoint rather than
picking one default for the whole system, since a login endpoint and a public read-only search
endpoint have very different risk profiles. - False positives have a real cost, not just a technical one. An overly aggressive
auto-block tier degrades the experience for legitimate users and generates support load; this
is why the design routes medium-confidence signals to an alert instead of an automatic block,
and why the feedback loop exists at all. - Common wrong turn: scoring every request synchronously "to be safe." This looks more
thorough on paper but does not scale to the stated volume and turns the fraud pipeline into
the system's latency bottleneck; the asynchronous, cache-backed design is not a shortcut, it is
the only version of this architecture that survives the request rate. - Common wrong turn: treating the feedback loop as optional. Without it, the model's
precision decays as attackers adapt and as the false-positive rate silently rises, since
nothing in the system is measuring or correcting for it.
Design an audit logging and telemetry schema for APIs to support security investigations and compliance (e.g., GDPR, SOC2). Specify required log fields (principal, action, resource, timestamp, request/response metadata, trace-id), redaction rules, retention policies, storage backends, indexing strategies, sampling, and how to balance forensic needs with cost and privacy.
Sample Answer
Direct answer
An audit logging schema for API security investigations and compliance needs a small, consistent
set of required fields on every event (who did what, to what, and when, with enough correlation
context to reconstruct a request across services), a redaction policy that strips or masks
sensitive payload data before it is ever written to the log store, and a two-tier storage design:
a shorter-retention, fully indexed "hot" store for active investigation, and a cheaper, longer-
retention "cold" store for the multi-year retention many compliance regimes (SOC2, a common third-party audit standard for how a company handles customer data, and GDPR) actually
require.
Structured elaboration
Required log fields. At minimum, every audit event needs: principal (who or what made the
request: a user id, a service identity, or an API key id), action (what operation was
performed, ideally a stable, enumerable name rather than a raw HTTP method plus path), resource
(what was acted on, an object id or resource path), timestamp (in a single consistent timezone,
UTC, with enough precision to establish ordering), and trace_id (a correlation identifier that
ties this event to the same identifier used in distributed tracing, so a single user-visible
request can be reconstructed across every service it touched). Request/response metadata (source
IP, user agent, response status code, and which fields were affected on a write, not necessarily
their full before/after values) rounds this out without yet crossing into the redaction concerns
below.
Redaction rules. Decide, per field, whether it is safe to log at all, needs to log a masked
or hashed form (so investigators can still tell "these two events touched the same account
number" without the log storing the raw account number), or must never appear in the log under
any circumstance (a raw password, a full payment card number, an authentication token). This
decision has to be made at the schema level, before any log line is written, not left to
individual services to decide ad hoc, since an inconsistent policy across services is what turns
"we log for security investigations" into its own data-exposure incident.
Retention policies. Different investigation and compliance needs justify different retention
windows: an active-investigation window (commonly 30 to 90 days) needs to be fully indexed and
fast to query; a compliance-driven retention window (often measured in years, depending on the
framework and jurisdiction) can tolerate slower, cheaper retrieval, since it is accessed rarely,
typically only for an audit or a legal request.
Storage backends. A streaming ingestion layer (a message queue or log-streaming platform)
decouples "the API just emitted an audit event" from "the event is durably stored and queryable,"
which matters because audit logging must never become a synchronous dependency that can slow
down or fail the request it is auditing. From there, route to a hot, indexed store (built for the
security team's investigation queries) and a cold, cheap object-storage tier (built for
long-term, infrequent-access retention and legal hold).
Indexing strategies. Index the fields investigators actually query by: principal,
resource, trace_id, and timestamp range are the common ones; avoid indexing full free-text
payload fields by default, since that is expensive at volume and is exactly the kind of field
most likely to need redaction rather than indexing anyway.
Sampling. For extremely high-volume, low-sensitivity read traffic, full logging of every
single event may not be economically justified; a documented sampling policy (log 100% of
writes and authentication events, sample a smaller percentage of high-volume reads) is a
legitimate trade-off, as long as it is an explicit, reviewed decision rather than an
accidental byproduct of a storage cost optimization that nobody flagged as a compliance-relevant
change.
Balancing forensic needs with cost and privacy. More logged detail, retained longer, always
helps a future investigation; it also always costs more to store and increases the amount of
personal data the organization is responsible for protecting and eventually deleting under
frameworks like GDPR (General Data Protection Regulation, the EU's data-protection law), which
directly constrains how long personal data, including audit logs that contain it, can be
retained without a specific justified purpose. The schema's redaction rules and retention tiers
are the two levers that resolve this tension: log less of the truly sensitive data, and retain
the two tiers for different, explicitly justified lengths of time, rather than either
under-logging (a real investigation gap) or over-retaining raw sensitive data indefinitely (a
real compliance and breach-impact risk).
Worked example
graph LR
Req[API Request and Response] --> Cap[Capture: principal, action, resource, trace id]
Cap --> Red[Redaction Layer]
Red --> Buf[Streaming Buffer]
Buf --> Hot[Hot Store - indexed, 30 to 90 days]
Buf --> Cold[Cold Store - object storage, years]
Hot --> SIEM[SIEM and Investigation Queries]
Cold --> Compliance[Compliance and Legal Hold Export]
Sizing the hot tier with concrete numbers: an API sustaining roughly 10,000 requests/second, with
one structured audit log line per request averaging about 800 bytes (a realistic size for the
required fields above plus modest request metadata), produces:
raw throughput : 10,000 req/sec * 800 bytes = 8,000,000 bytes/sec = 8 MB/sec
raw daily volume : 8,000,000 bytes/sec * 86,400 sec/day ~= 691 GB/day
compressed daily : 691 GB / 5 (a typical ~5x text-log compression ratio) ~= 138 GB/day
90-day hot tier : 138 GB/day * 90 days ~= 12.4 TB
These are illustrative planning numbers, not a measured production figure, since they depend
entirely on the assumed request rate and per-line size; the point of walking through them is the
method (raw rate times record size, times the retention window, adjusted for compression), which
is exactly the calculation a real capacity-planning exercise would run against the actual
traffic and schema. At roughly 12.4 TB for a 90-day hot window, keeping the same three years of
data fully indexed would mean holding onto roughly 12x that volume in the expensive, indexed
tier, which is the concrete cost argument for a cheaper cold tier handling the years-long
compliance retention instead.
Trade-offs and pitfalls
- A synchronous, blocking audit-log write is a latency and availability risk on the request
path itself. The streaming-buffer design exists specifically so a slow or briefly unavailable
log backend degrades log durability (a small window of events might be delayed or, in a worst
case, lost) rather than degrading the API's own availability for the request being audited. - Redaction is a one-way decision once data has already been logged unredacted. If a field is
discovered to have been logged in raw form when it should have been redacted, remediation means
finding and scrubbing every copy across hot and cold storage, including backups, which is far
more expensive than getting the redaction rule right before the first log line was ever
written. - Common wrong turn: indexing everything "in case it's useful later." This inflates the hot
tier's cost roughly in proportion to how much gets indexed, without a matching increase in
investigative value, since most fields nobody ever actually queries by; index what
investigators demonstrably query, and keep the rest in the cheaper tier where it is still
retrievable, just not indexed. - Common wrong turn: one retention policy for all data. Treating a routine read event and an
authentication failure with the same retention and redaction rules ignores that they carry very
different forensic value and very different privacy sensitivity; tier both retention and
redaction by the event's actual investigative and privacy weight, not uniformly.
Lay out the API contract and operational controls for partner integrations that will process PII and PCI data. Cover authentication (mutual TLS, OAuth), token lifecycle management, field-level encryption, throttling and quota models, audit trails and logging, data retention and deletion policies, and how you'd demonstrate compliance during pre-sales and onboarding.
Sample Answer
Treat authentication, encryption, and auditability as three independent layers that each have to hold up on their own: mutual TLS plus OAuth 2.0 for authentication, envelope field-level encryption so sensitive fields stay encrypted even from your own logs, and an immutable audit trail. Then package all three into a documented onboarding artifact so compliance is something you can demonstrate to a partner's security team before the contract is signed, not something you merely assert.
Authentication layer
Mandatory mutual TLS (mTLS) at the transport layer: the partner presents a client certificate mapped to a partner id, in addition to any application token, so identity survives even if a token leaks. OAuth 2.0 (Client Credentials for service-to-service calls, Authorization Code for any human-in-the-loop flow) issues short-lived JSON Web Token (JWT) access tokens, TTL under 5 minutes, with narrow scopes such as payments:write or pii:read:limited.
Token lifecycle
Access tokens are short-lived and verified locally. Refresh tokens are single-use, rotated, encrypted at rest, and revocable via an introspection endpoint (a network call to the issuer asking whether a token is still valid) or admin endpoint. Certificates rotate on a fixed cadence, for example quarterly; any remaining client secrets rotate at least as often.
Field-level encryption
Envelope encryption: the partner encrypts sensitive fields client-side with a one-time Data Encryption Key (DEK), and the DEK itself is encrypted with your published Key Encryption Key (KEK), held in a Key Management Service (KMS) or Hardware Security Module (HSM). Only a hardened decryption service inside your trust boundary can unwrap the DEK and read the field, the gateway, load balancers, and general application logs never see plaintext PII (Personally Identifiable Information) or PCI (Payment Card Industry) data. Tokenize card numbers, storing a PCI-DSS-compliant token in place of the real number, rather than letting raw card data flow through more of the system than absolutely necessary.
Throttling and quota model
Multi-tier limits, per-second burst, per-minute sustained, and daily cap, all keyed by partner id, not IP. A soft limit returns 429 with a Retry-After header; a hard limit blocks; anomaly-triggered dynamic throttling reduces a partner's limit automatically if abuse is suspected.
Audit trails and logging
Append-only (write-once, read-many, or WORM) storage for every access event: timestamp, partner id, endpoint, allow/deny decision, certificate fingerprint, token id, and a hash of the payload, never the raw sensitive fields, so the trail is forensically useful without itself becoming a second copy of the sensitive data. Retain per the stricter of contractual or regulatory requirement, PCI DSS often drives a roughly one-year retention floor for certain logs, and make retention length a documented, per-data-class policy rather than a single global number.
Retention and deletion
Retention is classification-driven: PCI data, PII, and metadata each get their own clock. Deletion is cryptographic as well as row-level: mark the record deleted, then destroy the DEK for that record, so even a backup copy of the encrypted blob becomes unrecoverable. This is what lets you honor a deletion request against systems (backups, replicas) you can't reach directly to delete individual rows from.
Demonstrating compliance during pre-sales and onboarding
A documented onboarding package: an API spec with per-field sensitivity classification, an architecture summary (mTLS plus OAuth plus envelope encryption), current compliance artifacts (a PCI Attestation of Compliance, an assessor's certification that you meet card-data-security standards; a recent penetration-test summary, evidence that an independent tester actively tried to break in and documented the results; a SOC 2 Type II report if available, an independent auditor's confirmation that your security controls actually operated correctly over months, not just on paper), and a sandbox environment with synthetic data so the partner's security team can test the flow before any real data moves. A signed Data Processing Addendum (DPA), and a Business Associate Agreement (BAA) if health data is ever in scope, belong in the onboarding checklist, not something discovered mid-integration.
Worked example
A partner submits a payment record containing a card number and a customer's mailing address. The card number is tokenized before it ever reaches your API, using your published tokenization SDK. The mailing address, a PII field, is envelope-encrypted client-side with a per-request DEK, wrapped by your KEK. At the gateway, the mTLS handshake confirms partner identity, the OAuth JWT confirms scope payments:write, and the request is logged with a hash of the still-encrypted address field, never the plaintext. Only the downstream payment-processing service, running inside a separate, narrowly-scoped trust boundary, holds the KMS permission to unwrap that specific DEK and read the address. If a customer later exercises a deletion right, the deletion service destroys that record's DEK; the encrypted blob remains in backups but is now permanently unreadable, satisfying the deletion obligation without reaching into every backup copy individually.
Trade-offs and pitfalls
Field-level envelope encryption is strong but adds real integration complexity for the partner; provide a client SDK so partners aren't implementing DEK/KEK handling by hand, or implementations will be inconsistent and error-prone across partners. Short token TTLs and frequent certificate rotation improve security but raise operational overhead, automate rotation end to end or it will lapse under deadline pressure. Destroying the DEK to satisfy a deletion request is an elegant way to handle backups you can't directly edit, but it means losing that data permanently the moment the key is destroyed, get sign-off on retention windows before deletion becomes irreversible.
What is API discovery and inventory, and why is it critical for API security? Describe manual and automated approaches (runtime discovery, CI scanning, OpenAPI catalogs), metadata to track (owner, risk, exposure), and how inventory ties into vulnerability scanning and incident response.
Sample Answer
Direct answer
API discovery and inventory is the practice of maintaining an accurate, current list of every API endpoint your organization actually exposes, including the ones nobody remembers building. It matters because you cannot secure, patch, or monitor an endpoint you do not know exists; this maps directly to the OWASP (Open Web Application Security Project) API Security Top 10:2023's API9 category, Improper Inventory Management.
Structured elaboration
Why it's critical: "shadow APIs" (endpoints that exist but were never catalogued, such as a debug route left in place) and "zombie APIs" (old versions still live after a supposed deprecation) are both invisible to security review, firewall rules, and vulnerability scanning by definition. If it is not inventoried, nobody is watching it.
Manual approaches: developer-maintained catalogs or wikis, and architecture review sign-off when a new service ships. These are weak on their own, since they rely on humans remembering to log every endpoint, and they decay as teams change and documentation ages.
Automated approaches:
- OpenAPI (or equivalent) catalogs generated directly from code or framework configuration at build time, so the spec cannot drift from what is actually deployed.
- Continuous Integration (CI) scanning that diffs the deployed route table against the declared catalog and fails the build, or at least alerts, on any undeclared route.
- Runtime discovery: passive traffic analysis at the gateway or network layer that observes real requests hitting real endpoints and flags anything not in the catalog. This is the only one of the three that reliably catches a genuinely forgotten endpoint, since it does not depend on anyone having declared it correctly in the first place.
Metadata to track per endpoint:
- Owner: which team or person is accountable, so a finding has somewhere to go.
- Risk: does it touch PII (Personally Identifiable Information), payments, or admin functions, driving review priority.
- Exposure: internal-only versus public internet, authenticated versus anonymous, the single biggest risk multiplier, since a forgotten public and anonymous endpoint is far worse than a forgotten internal and authenticated one.
Ties to vulnerability scanning: a scanner can only target what is in the inventory, so "we scanned every API" quietly means "we scanned every API we knew about" if the inventory itself is incomplete.
Ties to incident response: during an incident, accurate exposure and owner metadata is what lets you answer "what else does this compromised credential reach" and "who owns the thing that just got hit" in minutes instead of hours of tribal-knowledge archaeology.
Worked example
A team decommissions a v1 orders endpoint but leaves it deployed "just in case." Six months later it is still live, unpatched, and unmonitored, because it dropped out of the maintained API catalog when the team stopped documenting it, but nobody removed the actual route from the load balancer. A credential-stuffing bot eventually finds it. Runtime discovery, observing that traffic is still hitting /v1/orders, is the only one of the three approaches described above that would have caught this: the manually maintained wiki no longer listed it, and an OpenAPI catalog generated from current code would not show a route the code no longer declares either.
Trade-offs & pitfalls
A manually maintained catalog silently rots as teams move on. Automated OpenAPI generation only catches routes the framework's own routing layer produces, missing anything bolted on outside it, such as a raw reverse-proxy rule. Runtime discovery has a cold-start problem: it can only flag traffic it has actually observed, so a rarely called but dangerous endpoint can go unnoticed for a long time. The three approaches are complementary, not substitutes for one another.
Perform a threat model for an internal REST API that returns user profiles containing PII (name, email, phone, SSN). Identify actors, assets, trust boundaries, and top threats (data exfiltration, broken access controls, excessive data exposure). Prioritize mitigations (authentication, authorization, field-level encryption, logging, least privilege) and propose a remediation roadmap.
Sample Answer
Direct answer
Start by naming who can actually reach this API and from where (the trust boundary), because "internal" is often an assumption rather than a fact. Then rank the threats by how directly they expose the Social Security Number (SSN), the single highest-sensitivity field here, and mitigate in the order that closes the biggest exposure fastest: access control first, then field-level protection, then the logging that lets you detect and prove what happened.
Structured elaboration
Actors, assets, and trust boundaries
- Actors: legitimate internal callers (other services, employee-facing internal tools); a compromised internal credential or service (insider misuse, or an attacker who moved laterally after breaching something else); an external attacker who reaches this "internal" endpoint anyway, through a VPN compromise, a server-side request forgery pivot, or a cloud network misconfiguration that exposes it publicly.
- Assets: the Personally Identifiable Information (PII) fields themselves, with the SSN as the highest-value target; the credentials that unlock the API; and the audit trail itself, which is an asset in its own right, since a tampered or missing log destroys your ability to detect or later prove what happened.
- Trust boundaries: caller to API (is "internal-only" actually enforced at the network layer, or just assumed), API to data store (does the API connect with a narrowly scoped read role or an overprivileged one), and API to the logging/observability pipeline (do the logs themselves become a second copy of the PII sitting in a less-protected system).
Top threats, mapped to the OWASP API Security Top 10:2023 (Open Web Application Security Project's current API-specific list)
- Broken access controls: a caller can request another user's record by changing an ID (API1:2023 Broken Object Level Authorization), or a caller without admin privileges can reach a bulk-export or admin-only route (API5:2023 Broken Function Level Authorization).
- Data exfiltration: no cap on page size or query volume lets one call retrieve far more records than any legitimate use case needs (API4:2023 Unrestricted Resource Consumption).
- Excessive data exposure: the endpoint returns the full profile object, SSN included, even to callers whose actual use case only needed a name and email (API3:2023 Broken Object Property Level Authorization), so any downstream leak of a normal, "authorized" response still contains the SSN.
Mitigations, prioritized by exposure closed per unit of effort
- Authentication: every caller presents a verifiable identity, no anonymous internal calls.
- Authorization, at two levels: object-level (does this caller own or have a legitimate reason to access this specific record) and property-level (does this caller's role need the SSN field at all, or only name and email).
- Least privilege: the API's own database credential should not be able to read columns it never needs, and individual caller roles should be scoped narrowly, so a support-tool integration gets name and email, never SSN.
- Field-level encryption: encrypt the SSN at rest with a key managed by a separate service, decrypted only inside the narrow code path that is actually authorized to see it, so a raw database dump or an unscoped query does not yield a plaintext SSN.
- Logging: audit access to the SSN field specifically (who viewed which record's SSN and when), and make sure the logging pipeline itself never records the SSN in cleartext, or you have just built a second unprotected copy of the same asset.
Worked example
A marketing internal tool calls GET /users/{id} to fetch a display name for personalization, but the endpoint returns the entire user object, SSN included, because nobody scoped the response by caller role. An engineer debugging the tool copies the raw JSON response into a shared internal channel to ask for help. With property-level authorization in place, that same call would have returned only {name, email}, so the copy-pasted response could never have contained the SSN in the first place, even though the original access was by a legitimate, authenticated caller doing a legitimate task. This is the case for prioritizing property-level authorization highly: it protects the data even when every other control behaved correctly and the access itself was "allowed."
Remediation roadmap
- Weeks 1 to 2 (quick wins): enforce authentication on every path, add object-level ownership checks, cap page size, closing the largest exfiltration exposure fastest.
- Month 1: add property-level response scoping per caller role so most callers stop receiving the SSN field entirely, and turn on SSN-access audit logging.
- Quarter: implement field-level encryption for the SSN with a dedicated decrypt path, formally review and tighten the API's database role to least privilege, and set up a recurring access review of exactly which callers and integrations can reach this endpoint.
Trade-offs & pitfalls
Restricting response fields can break internal tools that grew a habit of over-fetching; plan a deprecation window rather than a hard cutover that breaks something in production on day one. Field-level encryption adds real latency and operational complexity, so target it at the SSN and comparable regulator-sensitive fields specifically rather than encrypting every column by default. Without the audit logging piece, the rest of this roadmap is unverifiable after the fact: treat logging as a control this design depends on, not an afterthought bolted on for debugging.
That is every published API Security, Authentication and Authorization question for Information Security Analyst so far. Browse the other topics in this category, or practice this one interactively.