PostgreSQL vs MySQL for SOC 2 and ISO 27001 audits

Neither database carries SOC 2 or ISO 27001 status on its own, because the audit examines how your organization runs the system. The choice turns on which audit logging, access and encryption controls your assessor will accept and which edition and supported versions you can run.

On this page

PostgreSQL vs MySQL for SOC 2 and ISO 27001 audits: which side fits

Neither PostgreSQL nor MySQL is certified for SOC 2 or ISO 27001, and the organization carries the audit either way. A SOC 2 report is issued by a CPA firm, and ISO/IEC 27001 certification is issued by an accredited certification body, so your team has to show how each database supports the controls the assessor tests. If your shortlist holds both engines, the question is which one lets you produce that evidence with the least gap. This page covers only the compliance angle. The general PostgreSQL vs MySQL comparison sits on its own page.

PostgreSQL fits when open-source logging and TLS controls, plus pgAudit, satisfy your assessor. The settings log_connections, log_disconnections and log_statement (where log_statement accepts none, ddl, mod or all) give you a connection and statement trail under the PostgreSQL License. The documentation warns that logged statements can reveal sensitive data and plaintext passwords, so agree the log_statement level with your assessor and restrict who can read the log. In pg_hba.conf, hostssl lines require encrypted connections, and clientcert=verify-ca or verify-full requires client certificates. The pgAudit extension adds session and object audit logging, but its pgAudit repository describes audit logging as best-effort and says superusers cannot be reliably audited. Write down how superuser access is limited and ask whether that gap is acceptable.

MySQL fits when your team already runs it and the budget includes MySQL Enterprise Edition. The MySQL 8.4 manual says the audit_log plugin is included only in Enterprise Edition, and its default log is unencrypted XML, so plan encryption or file protection for that log before the assessor asks. The authentication_webauthn plugin is also Enterprise only, although MySQL supports multifactor authentication with up to three factors. Role-based access control with CREATE ROLE, GRANT and mandatory_roles is available in the server, and the MySQL 8.4 audit log documentation explains the logging options. Ask the vendor for a written quote covering the Enterprise features your evidence needs. If you run MySQL Community Edition, which is GPL licensed, the audit and WebAuthn gaps become compensating controls you must design and document.

What SOC 2 and ISO 27001 ask of a database in scope

Both frameworks audit the database as one component of a larger system. SOC 2 asks whether controls exist and operate over a period, while ISO 27001 asks whether the information security management system covers the database and is audited every calendar year. The five cards below set out the criteria and cycles an assessor will test, and what each one means for PostgreSQL and MySQL.

Common criteria set the floor

The nine common criteria, CC1 to CC9, apply to every SOC 2 report and cover security. For a database, the criteria most of the evidence maps to are CC6, CC7 and CC8, which cover who can log in, how changes to schema, roles and configuration are approved, and how failures are detected. Check that each of these has a named owner, a written procedure and a repeatable set of evidence, whichever engine you choose.

Optional categories add criteria

Availability (A1), confidentiality (C1), processing integrity (PI1) and privacy (P1 to P8) are optional categories. Each one adds criteria only when it is in scope, so a database holding personal data brings in privacy criteria, and one holding confidential customer records may bring in C1. Settle scope before you pick an engine, because the scope decision sets which database settings, retention rules and access reviews need evidence.

AICPA 2017 criteria

Database in the system description

A SOC 2 report opens with a system description, and the 2017 Trust Services Criteria contain 61 criteria, 33 of them common criteria. Name every instance in that description, including replicas, backup targets and reporting copies, because the assessor tests what is listed. A database left outside the boundary can still hold in-scope data, so inventory all PostgreSQL and MySQL instances before the audit period starts and keep that list current.

Type 2 evidence spans the period

A Type 1 report covers the design of controls as of a date. A Type 2 report adds an opinion on how those controls operated over a period, so logs, connection records and access reviews must run across the whole period. Check that log_connections is enabled from the first day, and that MySQL's audit_log plugin is available in your edition, since it ships only in MySQL Enterprise Edition.

AICPA SOC 2 overview

ISO 27001 Annex A controls

Annex A of ISO/IEC 27001:2022 lists 93 controls in four themes, and 34 technological controls sit in clause 8, where database settings usually fall. Map each technological control you claim to a database control such as access rights, cryptography, logging and secure configuration, and record any exclusion in the Statement of Applicability. Certification comes from an accredited certification body, which runs a three-year cycle with at least one audit in every calendar year.

How PostgreSQL and MySQL meet SOC 2 and ISO 27001 logging, access and encryption controls

This table sets the logging, connection, encryption, access, MFA, version and evidence controls that SOC 2 and ISO 27001 assessors ask about against what each database documents. Read each cell as a documented feature, then confirm gaps with the vendor, your identity layer or your hosting team. The main takeaway: PostgreSQL's core logging is built in, but its object audit extension is best-effort, while MySQL's audit log and WebAuthn MFA sit in Enterprise Edition.

RequirementPostgreSQL as documentedMySQL as documented
Audit logging (CC7.2, ISO 27001 A.8.15)Core settings log_connections, log_disconnections and log_statement (none, ddl, mod, all). Docs warn logged statements can reveal sensitive data and plaintext passwords.Audit log plugin ships only in MySQL Enterprise Edition. Default log is unencrypted XML, so restrict file access and ship it to protected storage.
Object and session audit trailpgAudit logs by statement class and by SELECT, INSERT, UPDATE and DELETE. Its README calls logging best-effort and says superusers cannot be reliably audited.Plugin is Enterprise only. Community users must confirm which statements they can capture with their own tooling.
Encrypted connections (ISO 27001 A.8.24)pg_hba.conf hostssl lines require encrypted connections. clientcert=verify-ca or verify-full adds client certificate checks.Encrypted connections documented in the 8.4 reference manual. Confirm certificate and TLS version settings for your build.
Encryption at rest (ISO 27001 A.8.24)Decide the method with your hosting team: volume, filesystem or extension encryption, and who holds the keys.InnoDB tablespace encryption is documented in the 8.4 manual. Confirm key storage, rotation and who can read the keyring with your security team.
Role-based access (ISO 27001 A.5.15)Confirm the role and grant design against your access review and the database documentation.CREATE ROLE and GRANT support role-based access, and mandatory_roles applies roles to all accounts.
Multifactor authentication (ISO 27001 A.8.5)Confirm with the vendor whether the database itself supports MFA. Otherwise enforce it at your identity layer, such as SSO or a bastion host.Multifactor authentication with up to three factors is documented. authentication_webauthn for server-side WebAuthn is Enterprise Edition only.
Supported versions and patch cadenceMinors every three months, five years per major. Version 14's listed end date, November 12, 2026, has passed. Version 18 runs to November 14, 2030.LTS series get 5 years premier and 3 years extended Oracle support. Innovation releases run only until the next Innovation release.
Vendor attestationsAttestations describe your controls and operations. Ask any hosting or support provider for its own SOC 2 or ISO 27001 report.Ask Oracle or any support provider for the report covering the offering you buy, if one exists.
Data locationSet by your hosting. Confirm where data, backups and WAL archives sit, and who can reach them, with your cloud or data center team.Set by your hosting. Confirm where binary logs, backups and audit logs sit, and who can reach them.

What the database project covers and what your team still has to run

Both audits treat the database as one control among many. The cards split the work into what PostgreSQL and MySQL document, what your team configures and runs after go-live, and the recurring evidence both audits will sample.

PostgreSQL license and documented controls

PostgreSQL is released under the PostgreSQL License, a permissive license similar to the BSD and MIT licenses, so the software itself carries no license fee. Its documentation covers connection and statement logging, TLS through hostssl lines and a support window of five years after each major release, and version 14 passed its end date on November 12, 2026. No vendor attestation for the software appears in the documentation, so ask your assessor which evidence they accept for the engine.

PostgreSQL license page

What your team configures on PostgreSQL

Set log_connections, log_disconnections and log_statement on purpose, since the logging documentation warns that logged statements can expose sensitive data and plaintext passwords. Require hostssl lines in pg_hba.conf and clientcert=verify-full where your assessor expects encrypted, certificate-checked connections. Treat pgAudit as a decision: its README says audit logging is best-effort and superusers cannot be reliably audited, so restrict superuser roles. Your staff carry this work, and each minor release, shipped at least every three months, needs a patch record.

MySQL's side: Community and Enterprise

MySQL Community Server is GPL-licensed and freely downloadable, and Oracle ships it on two tracks: an LTS track, with 8.4.11 LTS and 9.7.2 LTS on the download page, and an Innovation track, where 26.7.0 is supported only until the next Innovation release. The audit log plugin and WebAuthn MFA plugin are included only in Enterprise Edition, so if your assessor expects either control, Oracle's subscription becomes part of the design. Choose the track and confirm its support dates before you build.

MySQL audit log docs

What your team runs on MySQL

Decide whether an Oracle Enterprise subscription is needed for the audit plugin or WebAuthn, and get Oracle's terms in writing before the architecture depends on them. Build access with roles (CREATE ROLE, GRANT) and mandatory_roles, enable MFA of up to three factors, and configure InnoDB data encryption and encrypted connections. The default audit log is unencrypted XML, so restrict its file permissions, encrypt its storage and set its retention. The subscription recurs, so ask Oracle whether its terms change over time.

MySQL roles docs

Shared evidence for both audits

Access reviews, change records, incident response and the written system description look the same on either engine, and both audits sample them. A SOC 2 Type 1 report covers the system description and control design at one date, while a Type 2 adds an opinion on operating effectiveness over a period, so reviews must recur across the whole window. ISO/IEC 27001 certification runs on a three-year cycle with an audit in every calendar year. Your team staffs these reviews, the CPA firm or certification body charges the audit fees, and DeployOpen prepares evidence but issues no reports.

AICPA SOC 2 overview

Where database audit trails fall short for an assessor

For PostgreSQL, the assessor will first ask what the database writes down and who can read it. The settings log_statement (none, ddl, mod or all), log_connections and log_disconnections decide what reaches the server log, and PostgreSQL's logging documentation warns that logged statements might reveal sensitive data and plaintext passwords. A log that captures an ALTER ROLE statement with a password in it is effectively a credential store, so the log directory needs its own access controls, a named owner and a retention rule. The pgAudit repository adds session logging by statement class and object logging for SELECT, INSERT, UPDATE and DELETE, but its README describes audit logging as best-effort and says superusers cannot be reliably audited. Superuser roles therefore need separate handling: limit who holds them, route their use through a documented break-glass procedure and monitor their sessions from a source the superuser cannot edit.

For MySQL, the first check is whether the audit trail exists in your edition. The audit_log plugin is part of MySQL Enterprise Edition only, so a team running MySQL Community Server cannot assume it is available. That team must either license Enterprise or document an alternative and show the assessor that it covers the same events. Where the plugin is in use, its default log is unencrypted XML, so the organization has to protect the file itself: restrict read access to the service account and a small audit group, encrypt the volume that holds it and forward copies to a host the database administrators cannot alter. Confirm the edition and plugin set against the MySQL 8.4 audit log documentation and with Oracle or your licensing contact before you design the evidence pack around them.

Both engines face the same test under a SOC 2 Type 2 report, which covers operating effectiveness over a period, and ISO 27001 surveillance audits sample evidence across the certification cycle. An assessor will expect logs that ran continuously through the whole window, so a log switched off for maintenance, rotated without copies or paused during a privileged session becomes an exception you must explain. Before fieldwork, pull exports from the start, middle and end of the period and confirm they are complete, readable and attributable to a named account. Agree retention for database logs and access records in writing with your auditor, because the period follows from your own policy and from what the auditor accepts.

How audit evidence moves from the database to the assessor

The diagram starts with application and admin clients that reach the database over TLS. Inside the database host, PostgreSQL logging parameters such as log_connections and log_statement write connection and statement records, and pgAudit adds session and object audit records on a best-effort basis. On MySQL, the audit plugin is available only in Enterprise Edition. Logs and role grant and configuration snapshots then feed the organization's review and the evidence package. Check that the log store restricts access, that snapshots are taken on a schedule you can show, and that the package the assessor receives traces back to these sources.

Audit evidence path from database clients to the assessor, with the trust boundary marked.

The SOC 2 and ISO 27001 evidence an assessor asks for from each side

Most PostgreSQL requests are answered with core server settings, catalog exports and logs that you configure and can show. PostgreSQL uses the PostgreSQL License, so none of these items depends on a paid edition, but the work lies in capturing each setting, keeping it under change control and proving it held across the audit period.

  • Connection and TLS settings. Export pg_hba.conf and your TLS settings. hostssl lines show which connections must use encryption, and clientcert=verify-ca or clientcert=verify-full show that client certificates are checked. See the PostgreSQL secure TCP/IP documentation.
  • Logging settings. Export log_connections, log_disconnections and log_statement, which accepts none, ddl, mod or all. Logged statements can expose sensitive data and plaintext passwords, so expect questions on who can read the logs and how long they are kept.
  • Role and grant listings. Produce dated exports of roles, memberships and object privileges, and tie each privilege to an owner in the access review record.
  • pgAudit evidence. pgAudit covers session logging by statement class and object logging for SELECT, INSERT, UPDATE and DELETE. Its README calls audit logging best-effort and says superusers cannot be reliably audited, so ask the assessor whether that limit is acceptable for your scope.
  • Version inventory. PostgreSQL 14 support ended November 12, 2026, while 15 runs to November 11, 2027 and 18 to November 14, 2030. Record each cluster's running version and its upgrade plan.

Agree sample periods and the number of log extracts with the assessor before collecting anything, and confirm that the pgAudit limit is acceptable for the object-level records you plan to show.

Configuring the chosen database for SOC 2 and ISO 27001 evidence

This sequence turns a chosen database into a configuration an assessor can test. Each step names the record it produces, so the system description, ISMS scope and control evidence all point to the same settings. Confirm the scope and retention choices with your auditor, since they decide what the evidence has to cover.

  1. Define every instance, replica and backup

    List each database instance, replica, backup copy and the administrative accounts that manage them, along with the system each one serves and where it runs. Your platform team owns this inventory, and it goes into the SOC 2 system description or the ISO 27001 ISMS scope. Confirm the boundary with your auditor before configuring anything, because a replica left out of scope still holds the same data. The step is done when the inventory is signed off and every later step refers back to these named assets. Evidence: the signed inventory and the scope statement that cites it.

  2. Enforce encrypted connections and connection logging

    On PostgreSQL, limit remote access in pg_hba.conf to hostssl lines, adding clientcert=verify-ca or verify-full where client certificates are part of the design. Set log_connections and log_disconnections, and pick a log_statement level (none, ddl, mod or all) knowing that logged statements can reveal sensitive data and plaintext passwords, as the PostgreSQL logging documentation warns. On MySQL, enable encrypted connections and confirm the setting for the version in use. Evidence: the version-controlled pg_hba.conf, the logging settings and a test showing a non-TLS connection is refused.

  3. Choose and document the audit logging approach

    Decide between pgAudit on PostgreSQL and the MySQL Enterprise audit plugin on MySQL, based on the events your auditor expects to see. pgAudit records session activity by statement class and object activity for SELECT, INSERT, UPDATE and DELETE, but its README says audit logging is best-effort and superusers cannot be reliably audited, so limit superuser use and log it separately. The MySQL audit log documentation states the audit_log plugin ships only in MySQL Enterprise Edition and writes unencrypted XML by default, so plan protection for that file. Record these limits in a signed decision note. Evidence: the decision note and a list of audited events with their known gaps.

  4. Set roles and schedule grant reviews

    Map each application, support and administrative need to a named role, and avoid shared accounts. On MySQL 8.4, the roles documentation covers CREATE ROLE, GRANT and mandatory_roles, which can apply a baseline role to every account. Agree the review cadence with the data owner, and have someone other than the grantee approve each recurring review of who holds which privileges. Evidence: the role matrix, the GRANT statements kept in version control and dated review sign-offs.

  5. Configure MFA where identity design requires

    Where your identity design requires multifactor authentication for database logins, set it up on the database or at the access layer in front of it, and document which one applies. MySQL 8.4 supports multifactor authentication with up to three factors, but the server-side authentication_webauthn plugin is included only in MySQL Enterprise Edition, so a WebAuthn design on Community Server needs a different approach or a license decision. Confirm the PostgreSQL options with your identity provider and test each login path. Evidence: the authentication configuration, the identity design that requires it and test logins showing the second factor is enforced.

  6. Pin supported versions and record patch dates

    Choose a database major version that is still supported on the deployment date, and record it in the asset inventory. PostgreSQL 18 is supported until November 14, 2030, while PostgreSQL 14 reached end of support on November 12, 2026, so a new deployment should not start on 14. PostgreSQL minor releases arrive at least every three months, so set a patch routine and log the date each release is applied. On MySQL, prefer an LTS release such as 8.4 or 9.7, because Innovation releases are supported only until the next Innovation release. Evidence: a version register with patch dates and a change ticket for each upgrade.

  7. Protect log storage and agree retention

    Send database and audit logs off the database host to storage that database administrators cannot quietly edit, limit read access to security and audit roles, and confirm that log integrity is protected. Agree the retention period in writing with your auditor, and make sure it matches the period stated in your policies and system description. Test a retrieval for a sample event to confirm the logs are readable and complete. Evidence: the log storage design, the access list, the written retention period and a sample retrieval record.

What buyers ask before hiring help with a database audit

How much effort does a SOC 2 or ISO 27001 database audit take?

Effort depends mostly on how many database instances, replicas and environments are in scope, how audit logging is set up and how much evidence history already exists. Each of these multiplies the work. Every instance and replica needs its configuration, access controls and logging checked, and every environment that holds production-like data usually needs the same treatment. The logging approach matters a great deal. PostgreSQL's built-in logging settings record connections and statements, while session and object auditing often comes from the pgAudit extension, which its own documentation describes as best-effort. On the MySQL side, the built-in audit log plugin requires MySQL Enterprise Edition, so whether that edition is bought changes the scope of work. Teams with retained access logs and change records need less collection effort than teams starting from nothing. Ask for the effort estimate to list each of these drivers separately.

Can our own team handle the database audit work internally?

Yes, many teams do the work in-house, but it depends on database administration skills and spare capacity for evidence collection. The database side means configuring TLS on connections through pg_hba.conf entries such as hostssl, deciding on client certificate checks, setting logging levels, and reviewing roles and grants. The evidence side means gathering those settings, access reviews and change records in the form the auditor's evidence list asks for, and keeping them current. A team with an experienced database owner and a named compliance evidence owner can often keep the work internal. A useful test is to write down who pulls each control's evidence, how often, and who reviews it. Gaps in that list are where outside help usually fits under a written scope. Confirm the auditor's evidence expectations before the work starts.

How long does a database audit engagement usually take?

No duration is published because each engagement is fixed-scope, and its scope, deliverables and timelines are agreed in writing before work starts. The length follows the same drivers as effort: the number of database instances, replicas and environments, the audit logging approach, whether Enterprise Edition features are part of the design, and how much evidence history already exists. The audit period also sets a clock. Evidence has to cover the months the auditor selects, and gaps in earlier months are hard to reconstruct later. Ask the partner to map each phase to a written deliverable, and to list what the client must provide and by when, such as system access, named control owners and the auditor's evidence list. Those dependencies, more than the testing itself, often decide the calendar.

Does DeployOpen issue a SOC 2 report or ISO 27001 certificate?

No. DeployOpen does not issue audit reports, attestations or certifications. A SOC 2 report comes from an independent auditor, and an ISO/IEC 27001 certificate comes from an accredited certification body. DeployOpen prepares the systems, controls and evidence those parties review, including database configuration, logging, access control and evidence packs. The SOC 2 report type also matters: a Type 1 covers control design as of a date, while a Type 2 adds an opinion on operating effectiveness over a period. For ISO 27001, the certification body audits the management system, and database controls are one input among many. Ask any partner to confirm in writing which evidence it prepares and which steps the auditor or certification body performs. For background on the report types, see the AICPA's SOC 2 overview.

What should a quote for database audit help include?

Start from a written scope, because a quote follows from it. The quote should list the systems in scope: each database instance, its replicas, each environment and the platform it runs on. It should state the PostgreSQL or MySQL versions in use, since the version decides which hardening and upgrade work is needed. It should name the audit period and the evidence list the auditor has issued, so each deliverable maps to a specific request. It should separate one-time work, such as configuration, logging setup and evidence design, from recurring work, such as evidence collection each cycle, retests and any retainer for ongoing support. Finally, it should say whether any Enterprise licensing is included and who buys it. DeployOpen publishes no price list, so the written scope and the quote arrive together.

Does the written scope include any Enterprise licensing costs?

Only if the written scope says so. DeployOpen publishes no price list, and an Enterprise license is a separate purchase that the client makes. Some controls depend on paid editions. In MySQL 8.4, the audit_log plugin is included only in MySQL Enterprise Edition, and its default log is unencrypted XML, so log protection has to be designed in. The server-side authentication_webauthn plugin is also Enterprise only. PostgreSQL's pgAudit extension documents best-effort audit logging, and superusers cannot be reliably audited, so the design must account for that gap whichever database you choose. Ask that the quote state whether it covers buying the license, the vendor's support fees, or only the configuration work, and show which control each paid feature supports.

How DeployOpen prepares your database for SOC 2 and ISO 27001 evidence

DeployOpen plans, builds, documents and hands over the database layer for SOC 2 and ISO 27001 audits inside your own infrastructure. The work starts from a written scope that names the engine, the controls it must support and the evidence your assessor will ask for. Whichever engine you choose, you receive configuration you can review, test and show to an auditor. The independent auditor issues the report; DeployOpen prepares the evidence for it.

How we scope

  • Scope is agreed in writing before work starts, naming the database engine, its versions and the environments it covers.
  • Map each control your auditor tests to a specific setting, log source or access process in the database.
  • Confirm with your auditor which SOC 2 criteria and ISO 27001 Annex A controls apply to this database.

How we build

  • Configure hostssl connections and client certificates on PostgreSQL, or the equivalent encrypted connection options on MySQL.
  • Set logging levels deliberately, since logged statements can expose sensitive data and plaintext passwords.
  • Add pgAudit on PostgreSQL, and on MySQL confirm the audit plugin's edition terms before relying on it.

How we hand over

  • Written runbooks for backups, role changes, patching and log review, with each step mapped to the control it supports.
  • Evidence pack of configuration files, role grants, log samples and change records, stored in a location you control.
  • A limitation note stating what pgAudit cannot reliably capture and which compensating controls you will need to add.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Minor PostgreSQL releases never change the storage format, so patch runbooks cover executable replacement and restarts.
  • PostgreSQL 14 reached its end of support on November 12, 2026, so older clusters need an upgrade plan.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.