What SOC 2 asks of a PostgreSQL database
A SOC 2 examination that includes a PostgreSQL database will be measured against the AICPA's 2017 Trust Services Criteria, in the version with the revised points of focus published in 2022. Security is covered by the common criteria CC1 to CC9, and those apply to every SOC 2 report. The availability, processing integrity, confidentiality and privacy categories add criteria only when your organization includes them in scope. If the database holds customer data that you have committed to keep available or confidential, expect the auditor to ask for evidence under those categories as well. Confirm the scope with your auditor before you start collecting evidence, because the scope decides which criteria the database must support.
For the database itself, the evidence falls into a few groups that map to the common criteria: who holds access and how it is reviewed, which activity is logged and retained, how schema and data changes are approved and tested before they reach production, whether backups are taken and restored in practice, and whether connections are encrypted in transit. PostgreSQL gives you the mechanisms for each of these, including roles and privileges, pg_hba.conf rules, TLS settings, pgAudit logs and restore tests, but a mechanism only becomes evidence when you can show it was configured, reviewed and operated over the audit period. PostgreSQL cannot supply the auditor's opinion, the policies your organization writes, the identity provider's MFA enforcement, or the training and vendor management records that sit around the database. Those come from your own governance and from the systems that front the database.
DeployOpen prepares the database, its configuration and the evidence trail for a SOC 2 examination. We do not issue SOC 2 reports, attestations or certifications, and we do not decide whether your controls are sufficient; your CPA firm does. Before work starts, ask your auditor which Type they expect (Type 1 tests design as of a date, Type 2 tests operating effectiveness over a period), which systems are in scope, and which samples they will draw. Those answers determine how far back the logs, reviews and restore records must go.
Which PostgreSQL capability answers each SOC 2 criteria series
This table maps each SOC 2 criteria series in the AICPA 2017 Trust Services Criteria to the PostgreSQL capability and configuration that supports it. Confirm exact criterion numbers and wording in the AICPA document before you write control descriptions, since the series titles here are a starting point. Read each row as a question an auditor will ask and the database evidence that answers it.
| Criteria series | PostgreSQL capability | Configuration to set up | Evidence to keep |
|---|---|---|---|
| CC6 logical and physical access | Authentication methods and role design | Use SCRAM password hashing, certificate or GSSAPI authentication where available, and scope pg_hba.conf entries to named networks and roles | Current pg_hba.conf, role inventory, quarterly privilege review sign-off |
| CC6 directory-backed access | LDAP, GSSAPI or OAuth 2.0 authentication | Map database logins to identity provider groups, disable shared application accounts, confirm supported methods for your version | Identity provider group mapping, login test results, list of disabled local accounts |
| CC6 privileged access | Least-privilege roles and superuser restriction | Grant privileges to group roles, limit superuser and replication attributes to break-glass accounts, revoke default PUBLIC privileges | Role grants export, superuser account list, break-glass access log |
| CC7 system operations | pgAudit and PostgreSQL logging | Enable pgAudit for DDL, role changes and sensitive reads or writes, set log_connections and log_disconnections, ship logs off the database host | Sample audit entries, logging configuration file, log retention settings |
| CC7 monitoring of anomalies | Log review and alerting | Alert on failed logins, role changes and access outside expected hours, and record who reviews alerts and how often | Alert rules, review tickets, examples of investigated events |
| CC8 change management | Schema migrations under version control | Run migrations through a reviewed pipeline, use separate approval for production, record the migration tool version and applied migration history | Merged change requests, approval records, migration history table exports |
| CC9 risk mitigation and vendor dependencies | Supported major versions and patch cadence | Track the PostgreSQL support end dates for your major version, apply minor releases on a documented schedule, and track PgBouncer security releases | Version inventory, upgrade plan, patch records with dates |
| A1 availability | Point-in-time recovery and replication | Schedule base backups, archive WAL to separate storage, and test restores to a recovery environment on a documented cadence | Backup job logs, restore test reports with measured recovery time, replication status |
| C1 confidentiality | TLS and encryption in transit | Require TLS for client and replication connections, restrict certificate authorities, and disable plaintext listeners where the setup allows | Server TLS settings, client connection checks, certificate inventory |
How Type 1 and Type 2 reports change the database evidence set
A SOC 2 Type 1 report covers management's description of the system and the suitability of control design as of a specific date. For the database team, the evidence is a snapshot: the state of roles, privileges, authentication settings and logging configuration on that day, plus proof that the designed controls exist. The auditor is asking whether the controls, as built, would address the criteria, not whether they worked over time.
- Role and privilege export: A dated listing of every role, its attributes and its granted privileges, produced from the catalog views rather than from memory or a spreadsheet.
- Authentication configuration: The effective
pg_hba.confrules, thepassword_encryptionsetting and the TLS settings inpostgresql.conf, captured with the file's version or change reference. - Logging configuration: The settings that control what the database records, such as
log_connections,log_disconnectionsand pgAudit parameters, with the date they took effect. - Backup and change design: The documented backup schedule, the restore procedure and the migration tooling and approval steps, showing how each control is meant to operate.
- System description support: Diagrams and text describing the database components, their boundaries and the people who administer them, written to match the system description criteria.
Check that the snapshot date, the configuration version and the system description all refer to the same environment and the same day.
A SOC 2 Type 2 report adds an opinion on operating effectiveness over an observation period, so the database evidence must show that controls ran repeatedly across that period. The auditor takes samples from the window and checks each one against the control's description. Evidence volume therefore depends on how often each control runs, and the team needs a collection routine that runs throughout the window rather than one export at the end.
- Recurring access reviews: Signed reviews of database roles and privileged memberships, completed on the cadence the control states, with the reviewer, the date and any removals.
- Log samples: Extracts from PostgreSQL and pgAudit logs chosen across the window, showing that logging stayed on and that entries carried the fields the team defined.
- Change records: Tickets, approvals and migration run logs for schema changes, linking each change to its review and its deployment date.
- Restore records: Dated restore tests with the backup used, the restore result and any issues, performed on the frequency the backup control describes.
- Exception handling: Records of any failed backup, missed review or logging gap, with the investigation, the corrective action and the date it closed.
Ask the auditor early which samples they will draw and how far back they reach, because gaps in any recurring control are the most common reason a Type 2 test finds an exception.
Management prepares the system description, and the auditor evaluates it against the AICPA's 2018 SOC 2 description criteria (DC 200), using the revised implementation guidance issued in 2022. For a database, the description must explain what the PostgreSQL estate is, what data it holds, which services depend on it and how it is administered. Both report types rely on this document, so an inaccurate description undermines the whole examination.
- Scope of components: Each PostgreSQL cluster, replica, pooler and backup target that supports the in-scope services, named the same way the evidence refers to them.
- Data and flows: The categories of data stored, where connections originate and how replication and backups move data between sites.
- Roles of people: Who administers the database, who approves changes and who reviews access, matching the access review records.
- Control descriptions: Plain statements of each control, its owner and its frequency, so that the evidence can be tested against them.
- Subservice organizations: Any hosting provider or managed service that operates part of the database platform, with the controls management relies on from them.
Before the observation window opens, reconcile the description with the actual cluster inventory and the current roles, because the auditor will compare them.
A SOC 2 is an assertion-based examination under AT-C section 205 of the AICPA attestation standards. The service auditor must obtain written representations from management, and management signs a representation letter confirming, among other things, the accuracy of the system description and the completeness of the information provided. For the database team, this means every export and log sample handed to the auditor becomes part of a set that leadership is attesting to, so provenance matters as much as content.
- Completeness of populations: Confirm that the role export, log set or change list covers every database in scope, and state how the population was generated.
- Unaltered extracts: Keep the original query output or log files with hashes or access-controlled storage, so the team can show nothing was edited after collection.
- Known exceptions: Disclose any control failure, missing record or disputed item before the auditor finds it, since the representation letter covers what management knew.
- Responsible signatories: Agree in advance who can confirm database facts for the letter, typically a named administrator and the control owner.
- Report distribution: A Type 2 report on SOC 2 is generally restricted to specified parties, while a SOC 3 report covers the same categories in less detail and is a general use report that can be freely distributed.
Before signing, check that each statement in the representation letter has a traceable source in your evidence set.
Which SOC 2 evidence a PostgreSQL estate produces and how to keep it
A SOC 2 examination tests whether controls operated over a period, so the evidence has to be produced routinely and kept unchanged. The cards below cover the artifacts a self-hosted PostgreSQL estate generates, who creates each one, where it should live, and how to preserve it. No single artifact satisfies a criterion on its own; auditors read them together with your policies and tickets.
Role and privilege inventory exports
A scheduled export of every login role, group membership, and object privilege, taken from the catalog views such as pg_roles and the grants on schemas and tables. It shows who could access what on a given date, which is the starting point for testing logical access criteria in the common criteria series CC6. Generate it with a service account, hash the file, and write it to write-once storage so the population an auditor samples is provably complete. Confirm that shared or default accounts are visible in the export.
Access review sign-offs
Records showing that a named owner reviewed the privilege inventory at a set interval and approved, changed or removed each grant. The reviewer should not be the person who administers the roles. Keep the before and after exports, the reviewer's decision, and the tickets that executed removals. A review that approves everything without evidence of comparison is a common finding, so record the specific grants reviewed and the date each change was made.
pgAudit log extracts and retention settings
Extracts from the audit log produced by the pgAudit extension, showing session and object activity such as DDL, privileged role changes and reads of sensitive tables. Pair each extract with the configuration that defines what is logged, such as the pgaudit.log setting, and the retention policy applied to the log store. Auditors often test whether logs are protected from change and whether administrator activity appears in them, so confirm both before the period starts. Check the logging scope with your own risk owners, since the setting you choose determines what the extract can prove.
Schema migration tickets with approvals
Each schema change should link a change request, the reviewer's approval, the migration file version under source control, and the deployment log showing who ran it and when. This connects change management criteria in CC8 to actual database changes. Store migrations in version control with protected branches, and require that the approver is not the author. Emergency fixes made directly in production are the usual gap, so require that they are recorded and reconciled to the repository afterward.
Backup job records and restore test reports
Backup job logs from base backups and WAL archiving, plus restore test reports that state the backup restored, the target environment, the elapsed time and the result of validation queries. Availability criteria in A1 look for evidence that backups run and that recovery has been tested, not just scheduled. Point-in-time recovery depends on archived WAL, so include archive continuity checks. Record restore timings in the report so that the time to recover can be compared against the targets you have documented.
TLS configuration and certificate inventory
Evidence that client and replication connections require encryption, usually a pg_hba.conf extract with hostssl entries, the ssl settings in postgresql.conf, and a list of certificates with issuer, subject, expiry and the system that holds each private key. It supports the confidentiality and security criteria for data in transit. Export the active settings from a running server, not only the files in source control, and keep the certificate list reviewed on a schedule so expired or unknown certificates are caught.
Configuring PostgreSQL so the controls can be tested
This sequence turns a PostgreSQL estate into one whose access, logging, change and recovery controls can be sampled and evidenced. Each step ends with an artifact an auditor can read, so the control design exists before the observation period starts.
Fix the in-scope system boundary and data flows
Before touching the database, the team lists every PostgreSQL cluster, database, replica, backup target and log destination that stores or processes in-scope customer data, along with the applications, admin paths and pipelines that connect to them. Security, platform engineering and the owner of the system description sign off on the list. The artifact is a boundary diagram and data flow inventory that matches the system description management will give to the auditor. Each later step should cite this inventory, so a database outside it is either brought in or documented as out of scope.
Set authentication in pg_hba.conf with SCRAM
The platform team restricts pg_hba.conf so that each host and database accepts only the users and networks listed in the boundary inventory, and sets password authentication to SCRAM-SHA-256. MD5 password authentication is deprecated in PostgreSQL 18, so existing MD5 roles should be re-keyed during the change window. Where the organization uses a directory or identity provider, the team confirms which authentication method (such as LDAP, GSSAPI or certificate) it will use and documents the reason. The artifact is the version-controlled pg_hba.conf, a reviewed change record and a test log showing that unlisted sources are rejected.
Define group roles with least privilege
Access is granted through group roles such as read-only analyst, application writer and migration operator, with login roles added as members rather than granted privileges directly. Superuser is reserved for break-glass accounts that are locked by default, and application services never connect as a superuser or the owner of the schema. The owner of the access review confirms each grant maps to a documented job need. The artifact is a role catalog, the SQL that creates it under version control, and a query-based export of role memberships that can be re-run at each access review.
Enable pgAudit or core logging and ship logs off host
The team enables pgAudit, or the core logging settings if pgAudit is not approved for the platform, and configures it to record the statement classes that matter for the in-scope system, including role changes, DDL and access to sensitive tables. Confirm the pgAudit version against the PostgreSQL major version in use, since builds are tied to releases. Logs are forwarded to a central store that the database administrators cannot silently edit, and the team tests that a sample login and a sample schema change both appear. The artifact is the logging configuration, a shipping pipeline description and a test entry with its timestamp.
Put schema changes through versioned migrations
Schema changes are written as numbered migration files in the application repository, reviewed by a second person, and applied by a pipeline account rather than by hand. Emergency changes go through the same path with a recorded approval and a follow-up migration. Engineers confirm that direct DDL on production is blocked for normal roles. The artifact is the migration history in version control, the approval record linked to each merge, and the pipeline run log that shows who applied each change and when. Auditors commonly sample this trail to test change management.
Schedule base backups and WAL archiving
The operations team configures base backups and continuous WAL archiving for point-in-time recovery, with the archive stored outside the primary host and access limited to the backup role. Schedules, retention and encryption settings are written down in the backup standard. Confirm the chosen tooling supports the incremental backup and restore workflow you need, since pg_basebackup incremental backups are reconstructed with pg_combinebackup at restore time. The artifact is the backup configuration, the job history and an archive listing that shows continuous coverage over the review period.
Run and document a restore test
A named engineer restores a recent base backup plus archived WAL into a separate environment, recovers to a chosen point in time, and runs integrity checks and row count comparisons against agreed reference values. The start and end times, the target time, the person who approved the test and any defects are recorded. Repeat the test on a schedule written into the control description, because a single test proves only that one restore worked. The artifact is a signed restore test record with its evidence attachments, filed where the auditor can request it.
Enforce TLS for client and replication connections
The team configures the server to accept TLS for client connections, sets pg_hba.conf entries to reject non-TLS connections for in-scope databases, and applies the same requirement to streaming replication and backup connections. Certificates come from the organization's internal authority with a documented renewal owner. Test with a deliberately non-TLS client and confirm it is refused. The artifact is the TLS configuration, the certificate inventory with expiry tracking and a test output showing the rejected connection.
How access, logs, changes and backups feed the evidence pack
The diagram starts with an administrator or application signing in through the identity provider, then reaching PostgreSQL directly or through PgBouncer. The database writes pgAudit and server logs to a separate log store, schema changes pass through a version-controlled pipeline with approval, and base backups and WAL archives go to a separate backup location where restore tests run. Each arrow is a hand-off an auditor may sample, so check that every system stamps its records with dates and that the evidence repository can show who approved each change.
Access, logging, change and backup records converge on one dated evidence repository.
How auditors sample SOC 2 database evidence
Auditors rarely inspect every database event in a period. They pick samples from populations, and the population is the complete list the sample is drawn from. For PostgreSQL, the usual populations are the list of accounts with privileged access, the production schema changes made in the period, the backup jobs and restore tests run in the period, and the log entries for selected security-relevant events. The team should be able to produce each population in full: the role inventory from pg_roles and pg_auth_members with a dated export, the change log tied to migration tool history, the backup catalog with restore test records, and the pgAudit output for the audited window. If a sample is drawn from a list the team cannot show is complete, the auditor has no basis to test it.
Unexplained gaps are where SOC 2 testing usually turns into findings. A missing log segment, a privileged role with no access review sign-off, or a schema change deployed without a linked approval will be treated as an exception unless management can explain it with records. Check that logging stayed on across the period, that a gap in pgAudit or server log output is documented with its cause, and that each change in the sample traces to a request, an approval and a deployment record. Confirm with your audit firm, early in the readiness work, which populations it will use, the period they cover, the sample size approach and how it will treat system-generated events versus manual ones. Agreeing this before the examination window opens avoids rebuilding evidence after the fact.
What PostgreSQL does not cover for a SOC 2 audit
PostgreSQL can produce strong evidence for access, logging, change and recovery controls, but several criteria are met by people, processes and systems around the database. Auditors will ask for those too, and a gap in any of them can weaken a database control that looks sound on its own.
Identity provider and joiner-mover-leaver process
Database roles are only as trustworthy as the process that creates, changes and removes them. Map each PostgreSQL login to a person or service account, and confirm that the identity provider or HR system drives role grants and revocations. Ask who approves a new role, how a transfer removes old privileges, and how a leaver's access is cut off and when. Keep the tickets, approvals and removal timestamps that show the process ran.
Automatic failover tooling
PostgreSQL does not detect a failed primary or promote a standby on its own. That work falls to external failover software, which is itself in scope for availability and change management. Record which tool runs failover, who can trigger it manually, and how each event is logged. Auditors may sample failover runs, so retain the tool's own logs and test records alongside the database's.
PostgreSQL failover docsPolicies, risk assessments and vendor management
Security policies, a documented risk assessment, risk treatment decisions and management of third-party vendors sit outside the database. A PostgreSQL configuration cannot show that the organization reviews risks or that a hosting provider's controls were assessed. Confirm that each database control maps to a written policy owner, a risk entry and, where relevant, a vendor review record for any managed service, backup target or tooling supplier.
The auditor's opinion and report
Only an independent CPA firm can examine the system and issue a SOC 2 report, and the report states the auditor's opinion. Your PostgreSQL evidence supports that examination but does not replace it. Confirm with your auditor which period a Type 2 report covers, which database samples they will select, and who prepares the system description that management provides.
AICPA SOC 2 overviewTrust services categories outside the database
Availability, processing integrity, confidentiality and privacy add criteria only when they are in scope. If your report includes one of these categories and the database does not implement the related controls, such as availability targets, data quality checks or data retention limits, those gaps must be closed elsewhere. Decide the scope early and confirm which category each database control supports.
Log storage, monitoring and alert response
pgAudit and PostgreSQL logs only show value if they are shipped off the host, kept unchanged, watched, and acted on. Confirm where logs are stored, who can alter or delete them, which alerts fire on privileged or failed logins, and how responders record their actions. Sample a full chain from an alert to its ticket and closure, because that chain is what auditors test.
Questions teams ask before hiring help for SOC 2 database controls
What drives the cost and effort of preparing database evidence for SOC 2?
The main drivers are the number of PostgreSQL databases in scope, the number of environments (production, staging, disaster recovery copies), the number of roles and human and service accounts that hold privileges, the volume of audit logs that must be collected and reviewed, and whether controls already exist in writing and in tooling. A team that already has role inventories, a migration pipeline with approvals and tested restores has less to build than a team that must create these from scratch. Cost comes from the people doing the design, configuration and sampling work, and the recurring part is the evidence collection that continues through the observation period. Ask any provider for a quote that lists each database, environment and control area separately, and states which items are one-time setup and which recur.
Can our own team prepare PostgreSQL controls for SOC 2 without a partner?
Yes, many teams do this internally, provided someone owns the work and the evidence follows a schedule. The owner needs to understand the criteria that apply to the database, such as logical access, change management, backup and encryption in transit, and must keep a dated evidence calendar that shows when each access review, backup restore test and migration approval was performed. The usual gap is not the database configuration itself but the consistency of records over time, so a written calendar and a named reviewer for each control matter more than the tooling. A partner is useful when the team lacks capacity, has not run this kind of review before, or needs an outside check of design before the auditor starts sampling.
How long does it take to produce database evidence for a SOC 2 examination?
The duration depends mainly on the observation window that the auditor sets for a Type 2 report and on how many controls already operate as written. A Type 1 report looks at the design of controls as of a date, while a Type 2 report tests operating effectiveness across a period, so the evidence must exist for the whole window, not only at the start. Controls that are new when the window opens need time to produce a history. Ask for a written plan that lists the control areas, the evidence each one produces, the owner, the frequency of each recurring activity and the date by which design work must finish. Do not accept a timeline that is not tied to the auditor's stated period.
What does the engagement need from our team and systems?
The work needs read access to the database hosts and their configuration, including pg_hba.conf, role definitions and the logging settings, plus the ability to inspect pgAudit output. It also needs access to the identity provider so that database logins can be matched to named people and groups, the change pipeline that applies schema migrations and approvals, and the backup tooling with its restore logs. A named contact on your side should approve access requests, confirm which systems are in scope, and sign off on the control descriptions. Access should be granted with the least privilege needed for review, and the client should keep ownership of its own accounts and secrets.
Can DeployOpen prepare evidence that an auditor will accept?
DeployOpen can prepare the systems, controls and evidence that an auditor samples, including role and privilege reviews, pgAudit configuration, migration approval records, restore test records and encryption in transit settings. DeployOpen does not issue SOC 2 reports, attestations or certifications. Those are issued by an independent CPA firm that performs the examination under the AICPA attestation standards. Your auditor decides what evidence is sufficient, so the right first step is to confirm with the auditor which samples and periods they expect before the evidence is prepared.
What do auditors usually sample from a PostgreSQL environment?
Auditors typically select a sample of items from each control and ask for proof that the control operated in the sampled period. For PostgreSQL this often means a set of access reviews with reviewer sign-off, a sample of role grants and their approvals, a sample of schema migrations with their review and deployment records, and a sample of backup jobs and restore tests with their outcomes. They may also ask how logins map to individuals and how encrypted connections are enforced. Confirm the sample sizes and the period with your auditor, because these vary by engagement and by the control's frequency.
Which parts of the database controls are most often missing when teams start?
Teams most often lack a current inventory of database roles and their owners, a record of who approved each privilege, and logs that show who changed the schema or data outside the normal pipeline. Backup jobs may run without any recorded restore test, and encryption in transit may be enforced on some clients but not documented for all of them. A short gap review against the criteria for logical access, change management and availability usually shows which items need design work first. Ask any partner to show how they will identify these gaps before they propose changes to your systems.
How DeployOpen scopes and delivers SOC 2 database controls
DeployOpen plans, implements and documents self-hosted PostgreSQL inside your own infrastructure so the database controls an auditor samples are designed, tested and recorded before the examination period starts. We prepare systems and evidence for your assessment, while independent auditors issue the SOC 2 report.
How we scope
- Engagements are fixed-scope, with the database inventory, systems in scope and deliverables agreed in writing before work starts.
- The written scope names which Trust Services Criteria categories your SOC 2 covers, since security applies to every SOC 2 and the other four are added only when in scope.
- Scope also records which evidence sources your auditor expects, such as role exports, pgAudit logs, migration tickets and restore test records.
How we build
- We configure role hierarchies, privilege reviews and authentication settings so access can be exported and reviewed on a regular schedule.
- We enable pgAudit and log routing so entries capture who acted, what they did and when, and that logs are retained and protected.
- We set up TLS for client and replication connections, a schema migration workflow with review records, and scheduled backups with restore tests.
How we hand over
- You receive a control narrative mapping each database control to the relevant criteria and to the system where its evidence lives.
- You receive runbooks for access reviews, restore testing, migration approvals and log review, with templates for each recurring record.
- You receive a verification report showing that each control was tested in your environment, with findings, fixes and a retest where needed.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers, so controls keep producing evidence through the audit period.
- Retainer work can cover quarterly access review support, restore test cycles and PostgreSQL minor and major upgrade planning.
- Confirm with your auditor which evidence format and sampling periods they expect before the first examination period begins.
Sources and further reading
- AICPA 2017 Trust Services Criteria (revised points of focus, 2022) ↗
- AICPA 2018 SOC 2 Description Criteria (revised implementation guidance, 2022) ↗
- PostgreSQL authentication methods ↗
- Continuous archiving and point-in-time recovery ↗
- Upgrading a PostgreSQL cluster ↗
- AICPA SOC 2: SOC for Service Organizations, Trust Services Criteria ↗

