Contents
Changelog
0.4.1 (2026-10-29)
auth.auth_delayfailed with an error whenauth_delaywas loaded.current_setting('auth_delay.milliseconds')returns the value with its unit (500ms), and the cast tointbroke the rule; every report of a server withauth_delayshowed one error instead of a result. The rule now reads the raw value frompg_settings.setting. Tested with PostgreSQL 18 (500→ pass) and 14 (loaded,0→ finding).- The comparison (
-f) matchedpg_hba.conffindings by line number. A line inserted or removed above turned every open finding below it into “fixed” and “new”. The hba rules now return the line’s selector (hba_key: file, type, databases, users, address and netmask — not the method, so a changed method stays the same line; forhba.errorsthe file and the error text), and the comparison matches a rule by it where all its findings in both reports carry one. Lines with the same selector pair first by equal line number, the rest in their order; what is then left on both sides pairs by line number where only the address differs, so a line narrowed in place that still has the finding stays open rather than “fixed” and “new”, while a line replaced by one for other databases or users counts as “fixed” and “new” (forhba.errors, a different error). Reports of 0.4.0 and earlier carry no selector and stay matched by line number. Reports gain two fields on hba findings:hba_keyand, for the rulesapplychanges,hba_file. Tested with PostgreSQL 14, 16 and 18: after inserting a line at position 3, nothing fixed, nothing new, every hba finding still open under its new number. hba.host_without_tlsalso reported lines that an earlierrejectline fully covers. A line behindhostnossl … rejectorhost … rejectcannot be reached without TLS. Covered means: the reject line comes first in evaluation order (rule_numberfrom PostgreSQL 16, which counts included files; the line number before), its databases include the line’s (alldoes not includereplication), its users include the line’s (or areall), and its address isall, the same, or a network of the same family that contains the line’s network. Host names and keywords such assamenetare covered only byallor the identical entry. Tested with PostgreSQL 16 and 18 (with an included file) and 14 against apg_hba.confwith eighteen lines.applytreated lines from included hba files as lines ofpg_hba.conf(PostgreSQL 16 and later). A finding carried only its line number, so the plan aimed at the line with that number in the main file; the check of the expected form or the comparison withpg_hba_file_rulesafterwards would have stopped the run and restored the file (pereditHba/compareHba, not reproduced), so nothing wrong would have stayed in place, butapplycould not run as long as an included file had a finding. Findings now carry their file (hba_file), andapplyleaves out every line it cannot confirm as one ofpg_hba.conf, with a note to change it by hand. Tested with PostgreSQL 16 (dry run): the main file’s line planned, three lines of the included file left out; with 14 the main file’s line planned.hba.superuser_remotecould miss a remote superuser line (found in the review of this release). It took the evaluation order from the line number, also across included files (PostgreSQL 16+), counted arejectfor::/0as covering IPv4 lines and one for0.0.0.0/0as covering IPv6 lines, and countedallin the reject line as coveringreplication, which PostgreSQL never matches withall. It now uses the same order ashba.host_without_tls, arejectfor all addresses of one family covers only lines of that family,alldoes not coverreplication, and arejectfor exactly the same address covers as well. Also tested with PostgreSQL 14 and 18:host replication postgresbehindhost all all 10.0.0.0/8 rejectis reported,host all postgres 10.0.0.0/8behind it is not. Tested with PostgreSQL 16 and 18: a superuser line at line 18 of an included file, evaluated before arejectat line 17 ofpg_hba.confand after ahostnossl … ::/0 reject, is now reported.- Found while preparing the seminar “PostgreSQL Security und Härtung”.
0.4.0 (2026-10-29)
- Security fix — update if you run pg-harden as administrator on Windows. Affected: 0.3.0 to 0.3.2 on Windows. Windows has no
identity switch, and these versions checked the way to a file only once before the run (
realpath) — not when reading or writing, and PHP’srealpathreturns a junction to a volume path (\\?\Volume{…}) unresolved, as a path inside the directory (measured with PHP 8.4.6 on Windows 11, build 26300). An account that owns or may write the server’s data directory (the service account, or a database superuser viaCOPY … TO PROGRAM) or the profile examined byclient --usercould therefore put a junction on that way:applyandrollbackthen created, overwrote or removed files with administrator rights in the directory the junction pointed to. The names are those of the run — the server’sconfig_fileandhba_file, and90-pg-harden.confin the include directory (conf.dorinclude_dir), which may be created or removed as well — but the content is largely the account’s: its own configuration files, lines kept from an existing90-pg-harden.conf, or a backup thatrollback(or the restore after a failed run) copies between two files of the same name — also from a file the account may not read into one it can, or from its own file into another cluster’s (for example apg_hba.confwithtrust).client --user=<account>read files below the profile through it with administrator rights; the report then showed findings from a file the account may not read (places and kinds of finding; no passwords or other secrets are printed).checkread ACLs of the server’s files (log_directory,ssl_key_file,hba_file,ident_file) by path and reported the ACL of the junction’s target as the server’s.
The way it works now is described in the Windows entry below: reads check the final path before and after reading, writes hold every directory on the way open against renaming, and the target file itself from the check until its write is done. Derived from the code of 0.3.2, not reproduced against 0.3.2 separately; the junction cases of
tests/windows-admin-test.ps1andtests/windows-redirect.phpcover 0.4.0. The same code paths exist since 0.3.0. Linux and other Unix systems are not affected by this fix (see 0.3.1 and 0.3.2). - Windows write side: the target file is held as well (found in the review of this release). Between the check of the way and the
write,
applyandrollbackheld only the directories; in the data directory, held withFILE_SHARE_WRITEfor the server, an account with the right to create symbolic links (developer mode orSeCreateSymbolicLinkPrivilege) could rename the target file away and put a symbolic link in its place, or put one at the name of a file about to be created.WindowsPin::verifyTargetnow also opens an existing target file as the entry itself (FILE_FLAG_OPEN_REPARSE_POINT, refused if it is a link or a directory, final path checked), and a new one is made there by the helper (CREATE_NEWon the entry itself, so a link at the name makes it fail instead of being followed); either is held withoutFILE_SHARE_DELETEuntil the write is done, writing stays possible. The handle needsFILE_READ_DATA: one with attribute access only takes no part in the sharing check, and the file could still be renamed (measured). Removing an entry (rollbackof a created file) is not held, since removing a link removes only the link. Test:tests/windows-redirect.php(65 cases; the one with a symbolic link at the name runs only where the account may create one, such as an elevated PowerShell). - Run logs (
apply.html,rollback.html) carry a note on personal data in their header: the confidentiality note adds “Rollennamen können personenbeziehbar sein; nach Abschluss zeitnah löschen.” The run logs carry no legal notice, which is where the report says this. - Command line recut:
-owrites the report,-fcompares with an earlier one (breaking, no aliases). One way to get a report out ofcheckandclientinstead of--format,--outand a separate command: without-othe text report goes to the terminal as before;-o NAME(--output) writesNAME.jsonandNAME.htmland the terminal names the files and the number of findings. A name ending in.json,.html,.htmor.txtwrites only that file; any other dot belongs to the name (-o audit.261028).-f NAME(--file) readsNAME.json(orNAMEif it ends in.json; HTML and text are refused) and adds the comparison (fixed, new, still open, not comparable) —verify --previous=x.jsonis nowcheck -f xorclient -f x; the command decides the mode, a client report given tocheck(or the other way round) is refused. Placeholders as in PostgreSQL’slog_filenameput the start of the run into the name (%Y %y %m %d %H %M %S,%%;-o audit.%y%m%d), no separate switch; an unknown placeholder, a name ending in a directory separator, a name of only dots before the ending or a missing directory fails before the run, and so does an unreadable-freport; the names are fixed there, so a run across midnight writes where it was checked. All files are rendered and written to temporary files before any is put in place; if one cannot be put in place, the message names those already written. Removed:--format,--out,--previous, the commandverify; JSON is no longer printed to the terminal (Text::jsonlost its ASCII mode).-o/-fare refused forplan,apply,rollbackandrules;--scanis refused forcheck;--extra-candidatesapplies tocheck,planandapply. Tests:tests/options-test.php(62 cases, including the names of-o/-f),tests/windows-admin-test.ps1andtests/run-version-matrix.shread the JSON report through-o;examples/generate.shwrites the HTML reports with-oand the comparison as05-compare.*;examples/output/regenerated with this state. Reading the earlier report goes throughFs::read(one handle, regular file only, size byfstat, at most 50 MB) instead of checking and reading the path in separate steps. - HTML run log of
applyandrollbackin the journal:apply --executewritesapply.htmlnext toapply-log.json— outcome (executed, with warnings, failed, aborted), tiles for findings before/after and the comparison, the planned changes with the state of each SQL statement from the journal, what was not done and why, the steps with time and status, the files touched with their backups, the comparison before/after (or why the re-check was impossible) and how to roll back. It is written in afinallyonce the journal exists, so a run that ends with an exception leaves it as well.rollbackwritesrollback.html(complete) orrollback-attempt-<time>.htmlnext to its log. The terminal output stays text and names the file; not being able to write the protocol is reported on stderr and changes neither the run nor its exit code. Same frame as the report (HtmlRenderer::page: CSP by hash, no external resources, everything escaped). - HTML report rebuilt (
check,client, and their comparison): the outline of the text report — header, summary, comparison, findings by severity, errors, rules to review, incomplete, skipped and clean rules, mappings, result, notices — instead of one table sorted by attention. On top a table of contents and an overview (tiles per severity and state, one bar over all rules); a colour per severity and state, a print layout (light, no navigation, rules and table rows kept together, table headers repeated) and dark mode on screen; the comparison as tables (one row per rule with its places) instead of preformatted text; mapping and comparison tables stack on narrow screens. Still one file without external resources and without scripts; the CSP now admits the embedded stylesheet by its SHA-256 hash instead of'unsafe-inline'and addsbase-uri 'none'andform-action 'none'. Every value goes throughText::printableandhtmlspecialchars; class names and anchors come from fixed keys only. Text and HTML share the outline (Report::summary,Verifier::grouped), the text report is byte-identical. Test:tests/html-report-test.php(offline, hostile values, allowlist of elements and attributes, CSP hash). - The comparison and the previous report (a file of unknown origin): an unexpected severity (for example an array) no longer aborts the
run with exit code 2 —
Verifier::comparekeeps only known severities, unknown ones stay empty;meta.modemust be a string like the other header fields (Verifier::isReport), otherwise the report is refused with its message instead of a PHP warning. Dates are read only in the form pg-harden writes (ATOM, optionally with fractions); before, the lenient parser turned values such asnowor a date followed by a NUL into a plausible date in the comparison heading, now they are shown as they are. - Command line as in psql, in addition to the long names:
-h HOST,-p PORT,-U USER,-d DBNAMEand--username. Long forms take the value after=or as the next argument (--host=db1,--host db1; also every other option with a value, such as--output report), short forms as the next argument or attached (-h db1,-hdb1); a value starting with=(-h=db1,--host==db1) is refused.-his the host as in psql; help is--helpor-?and wins wherever it stands. A value given as the next argument never starts with-, so a forgotten value fails instead of swallowing the next option; options without a command are refused (exit code 2) instead of printing the help with exit code 0.-Uand--usernamealways mean the database user and are refused forclient, where--usernames an account of the machine. An option given twice (also as long and short form) is refused. Test:tests/options-test.php(offline, 34 cases). - Windows,
apply,rollback,checkandclient --user=<account>: the write side holds the server’s directories against a swap for a junction, handle-based ACL reading, and redirect checks below the profile and the server’s data directory. Windows has no identity switch (Fs::asOwnerOf/Fs::asReaderOfcannot drop administrator privileges to the service or user account), so a non-administrator who owns or may write the data directory or profile can place junctions there.applyandrollbackon Windows (WindowsPin,ServerFiles::overwrite,create,makeDir,restore,Journal::backup): a persistent PowerShell 5.1 helper (WinHandle, Win32CreateFileWwithFILE_LIST_DIRECTORY | FILE_READ_ATTRIBUTES,FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, withoutFILE_SHARE_DELETE) holds the server’s root directories (data_directoryand the directory ofpostgresql.conf) and every target directory on the way open for the duration of the file phase, from before the first read ofpostgresql.conf. Each handle is verified not to be a reparse point (GetFileInformationByHandle) and its final path (GetFinalPathNameByHandleW) must match the expected path from the root down. While held this way, Windows refuses to rename or delete any pinned directory, so no directory on the way can be renamed away and replaced by a junction between check and write. Every held directory except the data directory is held withoutFILE_SHARE_WRITEas well, which also keeps it from being turned into a junction in place (by design; that conversion itself is not reproduced in the tests). Only the data directory keepsFILE_SHARE_WRITE, because the server renames files there itself (ALTER SYSTEM,current_logfiles) during the file phase; whether it is empty or not was a snapshot and is not the criterion — a change in place is caught by the handle check below. Before and after each file operationWindowsPin::verifyTargethas the helper check on all held handles that every directory is still a plain directory under its final path, and checks the target entry; a change aborts the operation (and the run restores its backups). Newly created directories (conf.d) are added to the active hold without releasing parent handles;restorereleases only the removed directory’s handle right beforermdir. Fail-closed: without an active hold, with a helper that cannot start, has ended or does not answer (30 s, then terminated), or with a path that redirects, nothing is written. Every restore (failed run,Guardafter Ctrl+C,rollback) rebuilds the hold over the server’s directories first; the helper runs in its own process group, so Ctrl+C reaches only PHP. Answers of the helper carry the id of their request.applywrites only below the data directory and the directory ofpostgresql.conf(unchanged), so a journal never names other targets.- ACL reading via the open handle (
GetSecurityInfo+GetFinalPathNameByHandleW): replacesGet-Acl -LiteralPathinWindowsFacts::get/aces,WindowsFacts::strictAcl,WindowsFacts::broadAcesOf(src/Os.php) andClientProbes::windowsFacts/aclProblems(src/Client.php). Each path is opened once; both its final path and its security descriptor are read from that handle, and the ACL is used only if the handle’s final path is not redirected (Fs::windowsRedirected). checkon Windows (LocalServer::detect): readspostmaster.pidin the data directory withFs::readGuarded(..., $dir)using the data directory as base, refusing junctions inside the data directory.client --user=<account>on Windows: a file below the profile is read only if the final path Windows reports for the opened file is exactly the profile plus the remaining names, checked before and after reading (Fs::readGuarded,Fs::windowsRedirected). Reported as “nicht geprüft” instead: a way through a junction or symbolic link, a path that cannot be resolved, one with.., and one that reaches into the profile under another spelling (a short name such asFRANK~1; forward slashes, case and a leading\\?\are compared as mere spelling).- Remaining limits on Windows: on the read side (
check,client --user), content reads check the path before and after reading and verifystat/fstatidentity rather than holding parent directories open withoutFILE_SHARE_DELETE. A hard link is no redirect by its path; Windows 11 lets a non-administrator create one only to a file the account may write. Whether a file exists, its name and its size may still be taken through a redirect. Files outside the profile or data directory are not judged. On the write side a hard link as target file is written as the file it is; the account could only have created it to a file it may write itself. - Strict ACLs for journals, plan directories and
-oreports on Windows (Files::lockDown,Journal::load,WindowsFacts::isStrictlyPrivate):Files::prepareDirandApp::output(-o) restrict the directory or file to the executing account,SYSTEMandAdministrators(icacls) — changed: also an existing empty directory given with--dir(on Linux and other Unix systemschmod 0700on it as well), which on Windows must belong to this account,SYSTEMor the Administrators (an owner keeps the right to change the ACL); a directory of another account is refused before its ACL is touched. An-oreport is written to a new file of this account, restricted while still empty, and then renamed into place (on every platform), so a handle kept open on an existing file of that name never sees the new content. Without the own SID (whoami) nothing is restricted and the run stops.Journal::loadverifies via the open handle that owner and entries leave no other SID access before trusting a journal. checkwithout full rights (all platforms): whenpg_file_settings,pg_hba_file_rulesorpg_tablespacecannot be read,os.config_permissionsandos.tablespace_permissionsnow report “nicht geprüft” instead of passing in silence.- Comparison for client reports and version
0.4.0+: the comparison (now-f) works for bothcheckandclientreports, andVerifier::isReportaccepts reports from0.4.0and later releases. - Tests:
tests/windows-redirect.php(throw-away directories in%TEMP%, no administrator rights needed),tests/catalog-test.php(offline test for the rule catalog, framework mappings andVerifier) andtests/windows-admin-test.ps1(for an elevated PowerShell: creates a temporary local non-administrator account, testsclient --user,checkandapply/rollbackdirectory pinning against junctions in its profile and data directory, and removes the account and itsProfileListentry afterwards; the account never logs on, so Windows creates no profile of its own; ran on Windows 11 on 2026-10-28 and, with the release state, again on 2026-10-29, 17 of 17 cases green).
- Expanded hardening catalog (86 rules), OS/client probes, BSI IT-Grundschutz APP.4.3 and CIS PostgreSQL Benchmark mappings:
- PostgreSQL server rules (
rules/postgresql.json): addedtls.ciphers,hba.weak_options(identover TCP andclientcert=verify-ca),auth.passwordless_or_expired,roles.replication_login,roles.createrole_self_grant(PostgreSQL 16+),db.default_acl_public(CREATEon non-system schemas andALTER DEFAULT PRIVILEGESforPUBLIC),db.rls_policies_inactive(tables with policies inpg_policywhereENABLE ROW LEVEL SECURITYis off, and tables withENABLE ROW LEVEL SECURITYbut no policy inpg_policy),code.fdw_secrets(USER MAPPING FOR PUBLICand cleartext secrets inpg_user_mapping/pg_subscription),code.event_triggers(inventory),log.lock_waitsanddata.crash_safety(fsync,full_page_writes,ignore_checksum_failure,zero_damaged_pages); extendedconf.role_db_overrides,roles.server_file_access(pg_read_all_data,pg_write_all_data) andlog.pgaudit(checks thatpgaudit.logorpgaudit.log_roleis configured when loaded). - Operating system rules and probes (
rules/system.json,src/Os.php): addedos.ssl_cert_expiry(ssl_cert_fileandssl_ca_file),os.tablespace_permissions(custom tablespaces frompg_tablespace), included files frompg_file_settingsandpg_hba_file_rulesinos.config_permissions, and extendedos.service_unitto Windows services (unquotedImagePathwith spaces, secrets in the service’sEnvironmentregistry value, and broad write ACEs on the service registry key). - Client rules and probes (
rules/client.json,src/Client.php): addedclient.psql_history(checks permissions/ACLs and scanspsql_history/.psql_historyforCREATE/ALTER ROLE … PASSWORD, connection URIs with passwords andPGPASSWORD, without printing values). - Framework mappings (
mappings/bsi-app43.json,mappings/iso27001-2022.json,mappings/cis-postgresql.json): a mapping for BSI IT-Grundschutz-Kompendium (Edition 2023) BausteinAPP.4.3 Relationale Datenbanken(identifiers, titles and dropped requirements verified against the official BSI PDF:APP.4.3.A1toAPP.4.3.A25with 17 active requirements —A2,A5,A6,A7,A8,A10,A14andA15are dropped in Edition 2023; it assigns at least one rule to each active requirement — an assignment, not fulfilment; several requirements are organisational and cannot be checked by a tool), a newmappings/cis-postgresql.json(an own grouping along sections 1–7 of the CIS PostgreSQL Benchmark with own short titles — the numbers are not CIS identifiers), and every rule assigned in all three. Identifiers of ISO 27001 and CIS are not yet verified against the originals ("verified": false, reports say so). CIS Benchmarks is a trademark of the Center for Internet Security; pg-harden is not affiliated with, endorsed or certified by CIS. - Corrections from review:
hba.weak_optionsreports only the checked option (never other options of the line such asldapbindpasswd/radiussecret) and no longer countsidenton loopback addresses as network access;roles.replication_loginonly roles that can log in;tls.ciphersalso single weak suites (RC4-SHA,DES-CBC3-SHA…);log.pgauditalso acceptspgaudit.log/pgaudit.log_roleset per role or database;code.event_triggersnames the function with schema and arguments.
- PostgreSQL server rules (
0.3.2 (2026-10-26)
- Security fix — update if you run
checkorclientas root. Affected: 0.3.0 and 0.3.1 on Linux and other Unix systems; reproduced against 0.3.1 in a test container. Both commands change no configuration on the host; the only thing they write is the report (--out). Reports written as root may contain such findings (places, kinds of finding, variable names; no values) — review or regenerate them with 0.3.2. Both commands read files that another account controls, and they read them as root:client --user=<account>: the account could link its.pgpass(or a service file, certificate or script) to a file only root may read — the report then showed findings from root’s file as the account’s own (places and kinds of finding; values are not printed).check: the service account could write any process number intopostmaster.pid; the process probes then read the environment (names of variables containingPASSWORD), the owner and the program file of that other process as root and reported them as the server’s. A FIFO in place ofpostmaster.pidmadecheckhang without end.
The way it works now: such files are read with the identity of the account that controls the way to them (the same walk from
/as for writing). A directory of root that group or others can write — for example/tmp— is not refused for reading: with the sticky bit an existing entry decides by its owner (a file or link of root there is read asnobody, since anybody may have placed a hard link to it), otherwise the file is read asnobody. Every read opens only a regular file, without blocking and within a size limit. The process number counts only when it is the parent of the tool’s own database connection; on Linux both processes must also run as the owner of the data directory and the start time must match the server’s (/proc), on Windows the parent is checked in the process list. Otherwise the process probes report “nicht geprüft”. Windows has no identity switch: whether a junction on the way can redirect a read ofclient --useror a write ofapplythere is examined next. Tests:tests/lab-identity.php(T14) and T15 intests/lab-matrix.sh(forged process number, FIFO); version matrix PostgreSQL 14 to 19rc1, Windows 11 with PostgreSQL 18.
0.3.1 (2026-10-25)
- Security fix — update if you run
applyorrollbackas root. Affected: 0.3.0 on Linux and other Unix systems,apply --executerun as root (rollbackof 0.3.0 could at most remove a file of the same name in such a directory). Windows: not examined yet, see below. The service account (postgres) could make root create90-pg-harden.confin a directory of its choice and own the file afterwards, for example in/etc: by replacingconf.dwith a link between the check and the write, or by changinginclude_dirin apostgresql.confit owns between two reads. A file the service account owns in a directory whose*.conffiles root evaluates (for example/etc/ld.so.conf.d) can give it root rights. Reproduced against 0.3.0 in a test container. Check after updating:find / -name 90-pg-harden.conf 2>/dev/null— examine every hit outside the include directory of your cluster, and check whether that include directory itself is a link. A hit elsewhere means the host may already be compromised: treat it as such (restore or reinstall, change credentials); removing the file alone is not enough. The way it works now: root works on a path itself only while every directory on the way belongs to root and nobody else can write it; from the first directory of another account on, it works with that account’s identity and that account’s own groups (no longer root’s supplementary groups or the group of a directory). It is designed so that a link or renamed directory planted by that account, even between check and write, only reaches what the account could reach anyway — test T14 (tests/lab-identity.php). The reads for a change go the same way (only regular files, size limit).postgresql.confis read once for the change,applycreates at most one directory level, a directory of root on the way that group or others can write is refused, and the identity of every target is settled before the first change. Windows has no identity switch; whether a junction of the service account can redirect a write there has not been examined yet. - Changed by the security fix: the identity now follows the directories on the way, not the owner of the file. A file of root in a
directory of the service account is written in place (owner and group stay) if the service account may write it, and refused otherwise —
the message names the account.
applyandrollbackwere checked on the Debian package layout (PostgreSQL 17,/etc/postgresql/17/mainowned bypostgres). - Fix:
rollbackpiped into a command that closes early (for example| head) could be killed after restoring the files and before finishing: depending on timing before the reload (the server kept running on a configuration that was no longer on disk) or before the SQL way back. Output writes now fail quietly instead of ending the process; wherepcntlis available,SIGPIPEis ignored. Regression test T12 intests/lab-matrix.sh. - Fix: a repeated
rollbackafter an incomplete one was refused (“Das Journal nennt einen Pfad, den apply auf diesem Server nie schreiben würde”), because the first attempt had already removedconf.d. Paths below a removed directory are now compared correctly, and entries the journal created that are already gone count as done. Regression tests T13 and T13b (interrupted after and before the reload). - If a
rollbackof 0.3.0 was interrupted (norollback-log.jsonin the journal): run the samerollback --dir=<journal>again with 0.3.1. It restores the same backups again, reloads and runs all rollback statements of the journal again — those that already ran change nothing, aREVOKEsomeone else made in between is undone as well. It is complete when it reports “Rückweg abgeschlossen” androllback-log.jsonexists in the journal. Measured on PostgreSQL 18 (Debian 13) with a 0.3.0rollbackkilled by| head -1. - Changed: a
rollbackwith files ignores Ctrl+C, Ctrl+\ andTERM/HUPwhile it runs (withpcntl); on Windows it registers the console handlerapplyalready uses for Ctrl+C and Ctrl+Break (not tested on Windows). Other signals such askill -9still end it — then run the same command again.applyalso restores its backups on Ctrl+\ now. - Changed: outside Windows, a
rollbackthat restores files requires the PHP extensionspcntlandposix, like file changes byapply(Debian’sphp-cliincludes both), and refuses to start without them, before changing anything. Withoutposixno journal is accepted. - Reports (
check,verify, text and HTML) are structured: summary first, findings grouped by severity with rule id and places, then rules to review, incomplete, skipped and clean ones. The intended-use and no-warranty notices moved to a closing “Hinweise” block. applyprints planned changes, the rules that still need an approval (collected in one list) and the result steps in sections;rollbackprints its steps. The confirmation prompt ofapplygoes to stderr, so it stays visible when stdout is redirected.- examples/: unedited output of every command against a throw-away PostgreSQL 18 container, recreated with
examples/generate.sh.
0.3.0 (2026-10-24) — first public release
- Commands:
check,plan,verify,client,apply,rollback,rules; 72 rules (61 for the server, 11 for the client machine). - Weak-password check without a login attempt (SCRAM-SHA-256 and md5 verifiers recomputed for a fixed candidate list, optional operator list
with
--extra-candidates, at most 100 terms). - Operating-system rules for Linux and Windows (permissions, service account, TLS keys, socket, package origin or signature).
clientmode: audits the machine you connect from (password files, environment, scripts, cron, systemd, scheduled tasks, client keys).apply/rollbackwith a backup journal, validation by the server (pg_hba_file_rules,pg_file_settings), a new login test after the reload, protection against lockouts,hbafixes (trust/md5/password→scram-sha-256,host→hostssl), and an allowlist for the SQL it runs (exact shapes, the way back must be the exact inverse of the fix).- New rule
db.public_connect(PUBLICwithoutCONNECT) anddb.catalog_visibility(database and role names not readable by everybody), with measured behaviour, limits and a filtered-view recipe in the README. - Tested on PostgreSQL 14, 15, 16, 17, 18 and 19rc1 (Docker, Debian 13): tests/VERSIONSMATRIX.md. The catalog revoke
survives
pg_upgrade(17 → 18, 14 → 19rc1) and apg_dumpallrestore. - Documentation in English (
README.md) and German (README.de.md). The tool’s own output is in German.