PostgreSQL 18 FIPS mode in Windows

Started by sutyakabout 2 months ago9 messagesgeneral
Jump to latest
#1sutyak
sutyak@proton.me

I have previously been compiling my own FIPS-compliant PostgreSQL and OpenSSL in Windows for FIPS compliance, but the documentation for 18 makes it sound like it is ready out of the box, and it would certainly be nice to just grab the latest off the shelf installer and use it.

The steps I have already taken are:

- Install PostgreSQL 18.6 windows-x64
- Install OpenSSL 3.5.8 with FIPS Provider 3.1.2
- Enable pgcrypto extension via pgAdmin
- set builtin_crypto_enabled to 'fips'
- Executing SELECT fips_mode(); always returns false.
- Verified FIPS is not being enforced by executing SELECT encode(digest('test', 'md5'), 'hex'); and it always returns a value.

What am I missing? Thank you,

Mark Sutyak

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: sutyak (#1)
Re: PostgreSQL 18 FIPS mode in Windows

sutyak <sutyak@proton.me> writes:

The steps I have already taken are:

- Install PostgreSQL 18.6 windows-x64
- Install OpenSSL 3.5.8 with FIPS Provider 3.1.2
- Enable pgcrypto extension via pgAdmin
- set builtin_crypto_enabled to 'fips'
- Executing SELECT fips_mode(); always returns false.
- Verified FIPS is not being enforced by executing SELECT encode(digest('test', 'md5'), 'hex'); and it always returns a value.

What am I missing? Thank you,

'builtin_crypto_enabled = fips' merely tells pgcrypto to expect
failure of relevant calls. It does not cause OpenSSL to actually
go into FIPS mode. You'd have to consult the OpenSSL docs to
find out how to do that.

regards, tom lane

#3Daniel Gustafsson
daniel@yesql.se
In reply to: Tom Lane (#2)
Re: PostgreSQL 18 FIPS mode in Windows

On 24 Sep 2026, at 22:13, Tom Lane <tgl@sss.pgh.pa.us> wrote:

sutyak <sutyak@proton.me> writes:

The steps I have already taken are:

- Install PostgreSQL 18.6 windows-x64
- Install OpenSSL 3.5.8 with FIPS Provider 3.1.2
- Enable pgcrypto extension via pgAdmin
- set builtin_crypto_enabled to 'fips'
- Executing SELECT fips_mode(); always returns false.
- Verified FIPS is not being enforced by executing SELECT encode(digest('test', 'md5'), 'hex'); and it always returns a value.

What am I missing? Thank you,

'builtin_crypto_enabled = fips' merely tells pgcrypto to expect
failure of relevant calls. It does not cause OpenSSL to actually
go into FIPS mode. You'd have to consult the OpenSSL docs to
find out how to do that.

+1. You need to enable the FIPS provider in openssl.conf and make sure to
disable the legacy provider. The builtin_crypto_enabled setting simply makes
sure to never call non-FIPS certified crypto when OpenSSL is operating in fips
mode, you can also set it to 'off' and disallow non-FIPS certified crypto
regardless.

--
Daniel Gustafsson

#4Joe Conway
mail@joeconway.com
In reply to: Daniel Gustafsson (#3)
Re: PostgreSQL 18 FIPS mode in Windows

On 9/24/26 16:16, Daniel Gustafsson wrote:

On 24 Sep 2026, at 22:13, Tom Lane <tgl@sss.pgh.pa.us> wrote:

sutyak <sutyak@proton.me> writes:

The steps I have already taken are:

- Install PostgreSQL 18.6 windows-x64
- Install OpenSSL 3.5.8 with FIPS Provider 3.1.2
- Enable pgcrypto extension via pgAdmin
- set builtin_crypto_enabled to 'fips'
- Executing SELECT fips_mode(); always returns false.
- Verified FIPS is not being enforced by executing SELECT encode(digest('test', 'md5'), 'hex'); and it always returns a value.

What am I missing? Thank you,

'builtin_crypto_enabled = fips' merely tells pgcrypto to expect
failure of relevant calls. It does not cause OpenSSL to actually
go into FIPS mode. You'd have to consult the OpenSSL docs to
find out how to do that.

+1. You need to enable the FIPS provider in openssl.conf and make sure to
disable the legacy provider. The builtin_crypto_enabled setting simply makes
sure to never call non-FIPS certified crypto when OpenSSL is operating in fips
mode, you can also set it to 'off' and disallow non-FIPS certified crypto
regardless.

Also to be clear, the distributor of the openssl library used must get
their specific bits validated in order to be actually FIPS compliant if
compliance is what you are after.

--
Joe Conway
PostgreSQL Contributors Team
Amazon Web Services: https://aws.amazon.com

#5sutyak
sutyak@proton.me
In reply to: Daniel Gustafsson (#3)
Re: PostgreSQL 18 FIPS mode in Windows

I forgot to mention I did ensure FIPS is the only option enabled in OpenSSL. Verified by running openssl.exe list-providers.

Mark

Sent from Proton Mail for Android.

-------- Original Message --------
On Thursday, 09/24/26 at 16:17 Daniel Gustafsson <daniel@yesql.se> wrote:

On 24 Sep 2026, at 22:13, Tom Lane <tgl@sss.pgh.pa.us> wrote:

sutyak <sutyak@proton.me> writes:

The steps I have already taken are:

- Install PostgreSQL 18.6 windows-x64
- Install OpenSSL 3.5.8 with FIPS Provider 3.1.2
- Enable pgcrypto extension via pgAdmin
- set builtin_crypto_enabled to 'fips'
- Executing SELECT fips_mode(); always returns false.
- Verified FIPS is not being enforced by executing SELECT encode(digest('test', 'md5'), 'hex'); and it always returns a value.

What am I missing? Thank you,

'builtin_crypto_enabled = fips' merely tells pgcrypto to expect
failure of relevant calls. It does not cause OpenSSL to actually
go into FIPS mode. You'd have to consult the OpenSSL docs to
find out how to do that.

+1. You need to enable the FIPS provider in openssl.conf and make sure to
disable the legacy provider. The builtin_crypto_enabled setting simply makes
sure to never call non-FIPS certified crypto when OpenSSL is operating in fips
mode, you can also set it to 'off' and disallow non-FIPS certified crypto
regardless.

--
Daniel Gustafsson

#6Daniel Gustafsson
daniel@yesql.se
In reply to: sutyak (#5)
Re: PostgreSQL 18 FIPS mode in Windows

On 24 Sep 2026, at 22:54, sutyak <sutyak@proton.me> wrote:

I forgot to mention I did ensure FIPS is the only option enabled in OpenSSL. Verified by running openssl.exe list-providers.

Is that using the same configuration as the OpenSSL used by Postgres? Is it
even the same OpenSSL used by Postgres? If you are using the Windows Installer
from EDB I believe they are using a special hardcoded openssldir where the
config must reside.

--
Daniel Gustafsson

#7sutyak
sutyak@proton.me
In reply to: Daniel Gustafsson (#6)
Re: PostgreSQL 18 FIPS mode in Windows

That is something I should have considered. Do you know the default PostgeSQL OpenSSL path? If not I can pull the source and see what it is there.

Mark Sutyak

Sent from Proton Mail for Android.

-------- Original Message --------
On Thursday, 09/24/26 at 17:49 Daniel Gustafsson <daniel@yesql.se> wrote:

On 24 Sep 2026, at 22:54, sutyak <sutyak@proton.me> wrote:

I forgot to mention I did ensure FIPS is the only option enabled in OpenSSL. Verified by running openssl.exe list-providers.

Is that using the same configuration as the OpenSSL used by Postgres? Is it
even the same OpenSSL used by Postgres? If you are using the Windows Installer
from EDB I believe they are using a special hardcoded openssldir where the
config must reside.

--
Daniel Gustafsson

#8Tom Lane
tgl@sss.pgh.pa.us
In reply to: sutyak (#7)
Re: PostgreSQL 18 FIPS mode in Windows

sutyak <sutyak@proton.me> writes:

That is something I should have considered. Do you know the default PostgeSQL OpenSSL path? If not I can pull the source and see what it is there.

AFAIK this question is outside the Postgres source code, and rather is
something to do with the OpenSSL that's bundled in EDB's installer.
You'd have to look at EDB's documentation.

regards, tom lane

#9sutyak
sutyak@proton.me
In reply to: Tom Lane (#8)
Re: PostgreSQL 18 FIPS mode in Windows

Tom, I believe you are correct. Thank you all for the help.

Mark Sutyak

Sent with Proton Mail secure email.

On Thursday, September 24th, 2026 at 6:08 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Show quoted text

sutyak <sutyak@proton.me> writes:

That is something I should have considered. Do you know the default PostgeSQL OpenSSL path? If not I can pull the source and see what it is there.

AFAIK this question is outside the Postgres source code, and rather is
something to do with the OpenSSL that's bundled in EDB's installer.
You'd have to look at EDB's documentation.

regards, tom lane