Quick revision
The short answer
I would define one company-wide audit event standard (actor identity, action, resource, time, source and correlation id), collect every source into one protected store with retention set by regulation and legal hold, and make identity flow end to end so a database action can be tied to the human or service behind it. Then we prove it works with regular investigation drills against a target time to answer, and fund it as a risk programme with measurable goals for coverage and speed.
What to remember
In this answer, we turned scattered audit logs into a capability that answers who accessed customer data quickly. We defined a company-wide event standard with actor, action, resource, time, source and correlation id, centralised collection into protected write-once storage with retention by regulation and legal hold, made identity flow from requests into database sessions and removed shared human accounts, proved the result with timed investigation drills, and funded it as a risk programme measured by coverage, identity resolution and time to answer.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
I would define one company-wide audit event standard (actor identity, action, resource, time, source and correlation id), collect every source into one protected store with retention set by regulation and legal hold, and make identity flow end to end so a database action can be tied to the human or service behind it. Then we prove it works with regular investigation drills against a target time to answer, and fund it as a risk programme with measurable goals for coverage and speed.
Why this question is asked
An investigation that takes weeks is not just slow; it means the company cannot reliably tell a regulator, a customer or a court what happened to their data. Usually the logs exist, but they are in different formats, with different clocks, identities that do not match and retention periods that ended before anyone looked. Interviewers ask this senior leadership question to see whether we can turn scattered logging into an organisational capability. In this answer, we will diagnose why the investigation took weeks, then set a standard, centralise and protect the data, make identity flow end to end, test the capability with drills, and fund and measure it.
1Why the Investigation Took Weeks
It helps to be concrete about where the weeks went, because each cause points to a fix. Analysts had to find which systems held logs at all, then get access from each owning team. Each source had its own format, so a database log line, an application JSON event and a cloud provider's access log all named users and resources differently. Clocks and time zones differed. The database logs said app_rw, not a person, so someone had to match timestamps across systems by hand to guess who was behind each query. And some logs had already been deleted under a 30-day default.
So the goal is not more logs. It is logs that answer one question, who accessed this customer's data, in hours, by joining sources on shared fields.
2A Company-Wide Audit Event Standard
The first step is a short standard that every audit source must meet, either natively or through a translation step at collection time. Every event must answer the same questions with the same field names, so a search for one person or one customer works across every source.
| Field | Meaning | Example |
|---|---|---|
| actor | human or workload identity | user:alice@corp or svc:orders-prod |
| action | what was done, from a shared vocabulary | READ, UPDATE, EXPORT, GRANT |
| resource | what it was done to | customer:42, table:payments.cards |
| time | UTC with milliseconds, synced clock | 2026-03-14T09:12:44.120Z |
| source | system that recorded it | pg-orders-prod, crm-api, cloud-iam |
| correlation_id | request or session id across systems | req-7f3a91 |
3Central, Protected Collection
Next, all audit sources ship to one central store owned by a security or platform team, not by the teams being audited. Databases send pgAudit and audit plugin logs, applications send their audit events, cloud providers send their access logs. The store is append-only for writers, with write-once retention so nobody, including administrators, can delete events early, and access to it is itself audited.
Retention is set per data class by the legal and compliance teams according to regulation, for example years for financial records, and legal hold lets an ongoing case freeze relevant events beyond normal retention. The reason to centralise is not only convenience: an attacker who compromises a system often tries to delete its local logs, and a copy already shipped elsewhere survives that.
4Making Identity Flow End to End
The hardest gap is the database one. Applications use pooled accounts, so database logs show a service, not a person. We close it in two ways. For application traffic, every request carries a correlation id from the edge through every service, written into application audit events and passed to the database session, for example as the application name or a SQL comment, so it appears in database audit lines. Joining on correlation_id then ties each query to the person in the application event. For direct human access to databases, we remove shared accounts entirely: people connect through an access broker with their SSO identity and temporary accounts, so the database log itself names them.
- Start from the customerresource = customer:42 in the central store
- Application eventsactor alice, action READ, correlation req-7f3a
- Join on correlation iddatabase statements for req-7f3a
- Direct database sessions?YesSSO identity names the personNoDone: actor known for each access
- Cloud access logsexports or snapshot copies of the database
5 steps in order. Play them, or step through them one at a time.
With the standard fields this is a search, not a project.
5Proving It With Investigation Drills
A capability nobody tests decays quietly: a new service skips the standard, a log pipeline breaks, a retention setting changes. So the security team runs drills every quarter. They pick a realistic scenario, such as list everyone who viewed customer 42's bank details in the last 90 days and how they did it, plant a few known accesses beforehand, and time how long the investigators take to produce a complete answer. Every gap found in a drill, such as a system whose events lack the correlation id, becomes a ticket with an owner. Over time the target time to answer, say under four hours for a single customer, becomes a measured service level.
6Funding It as a Risk Programme
This work spans every team and competes with features, so it needs an executive sponsor and a budget, framed as reducing a specific risk: regulatory penalties and lost trust when the company cannot answer. The programme has a few measurable targets reported quarterly. Coverage is the share of systems holding customer data that send standard events to the central store, aiming for 100 percent of critical systems in the first year. Identity resolution is the share of database accesses in drills that could be tied to a person or service. Time to answer comes from the drills. Each team gets its integration work in its roadmap, with a platform library that emits standard events so the cost per team is small.
7Follow-up questions
How do you handle third-party SaaS tools that have their own audit logs?
We include their export APIs in the collection pipeline and map their fields to the standard during ingestion, and we make audit log export with sufficient retention a requirement in vendor selection for any tool that holds customer data.
Is a SIEM product the answer?
A SIEM or log platform is a reasonable central store and search tool, but buying one does not solve the problem. The standard fields, end-to-end identity and drills are what make investigations fast, and those are organisational work, whatever tool sits underneath.
How do you keep sensitive data out of the audit store itself?
The standard says what to log: identities, actions and resource ids, not the data values. Where a value is needed, such as a changed field, it is masked or hashed at the source, and the central store has its own strict access rules.
8Conclusion
In this answer, we turned scattered audit logs into a capability that answers who accessed customer data quickly. We defined a company-wide event standard with actor, action, resource, time, source and correlation id, centralised collection into protected write-once storage with retention by regulation and legal hold, made identity flow from requests into database sessions and removed shared human accounts, proved the result with timed investigation drills, and funded it as a risk programme measured by coverage, identity resolution and time to answer.
Open with
The weeks went into finding the logs, getting access, translating formats, guessing which person was behind a pooled database account, and discovering that some logs were already deleted.
Then, if they want more
So I would fix it as a capability, not with more logs. First, a company-wide audit event standard with six fields every source must provide, natively or through translation at ingestion: actor identity, action from a shared vocabulary, resource, UTC time, source and a correlation id.
Second, central collection into one store owned by security, append-only with write-once retention set by regulation, legal hold, and audited access, so local log deletion by an attacker does not matter.
Third, end-to-end identity: a correlation id from the edge through every service into the database session, so database statements join to the application event that names the person, and no shared human database accounts, only SSO-based temporary access.
Fourth, quarterly investigation drills with planted accesses, timed against a target like four hours for one customer, with every gap ticketed to an owner. Finally, I would fund it as a risk programme with an executive sponsor, a platform library that makes emitting standard events cheap, and quarterly metrics on coverage, identity resolution and time to answer.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- PostgreSQL documentation, MySQL reference manual
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Your company's audit logs come from databases, applications and cloud providers in...": https://scrivio-interview-library.netlify.app/databases/database-security/c33b65ea04/