Skip to content

Commit b1d87b2

Browse files
committed
fix: harden v0.2.0 provisioning and qualify Wolfi PostgreSQL
1 parent ddd3584 commit b1d87b2

66 files changed

Lines changed: 41409 additions & 106 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,18 @@ jobs:
2929
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3030
with:
3131
persist-credentials: false
32-
- run: sudo apt-get update && sudo apt-get install -y podman openssl
32+
- run: sudo apt-get update && sudo apt-get install -y podman openssl skopeo
3333
- run: rustup target add x86_64-unknown-linux-musl
3434
- run: python3 scripts/smoke_probe.py --container
35+
- run: python3 scripts/install_image_tools.py
3536
- run: python3 scripts/stack_qualification.py
37+
- if: always()
38+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
39+
with:
40+
name: fixture-image-sboms
41+
path: .local/image-evidence/*.cdx.json
42+
retention-days: 30
43+
if-no-files-found: error
44+
include-hidden-files: true
3645
- if: always()
3746
run: python3 scripts/stack.py stop

‎.github/workflows/freshness.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ jobs:
1313
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1414
with:
1515
persist-credentials: false
16+
- run: sudo apt-get update && sudo apt-get install -y skopeo
1617
- run: python3 scripts/check_freshness.py

‎CHANGELOG.md‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,22 @@
1111
image identity before container reuse. Add unit and real-service fault tests.
1212
- Retain legacy fixture data; use a separate v02 profile without silent migration.
1313

14-
Pentest NOT RUN. This candidate is committed locally for the maintainer-requested pentest and not tagged.
14+
Pentest remediation (2026-10-03): bind CI installation to the verified archive,
15+
bound child/log/audit resources, add exact-image provenance/vulnerability/SBOM
16+
gates and fsync custody directory mutations. Maintainer approved unsigned-image
17+
exceptions for the two original exact PostgreSQL/Valkey fixture pins. The original
18+
PostgreSQL image's 42 reported HIGH/CRITICAL findings remain blocked and retained
19+
as historical evidence. The authorized replacement builds official PostgreSQL
20+
19beta4 on a signed Wolfi base, removes gosu/compiler/Perl from the runtime, and
21+
binds every scanned archive layer/config to the executed immutable image ID.
22+
All current images scan clean at that threshold without a CVE waiver. Full
23+
remediated service qualification and 12 real PostgreSQL initialization denials
24+
pass. Earlier fixture data is retained separately; GitHub and maintainer retest
25+
remain pending.
26+
27+
Pentest RETEST REQUIRED. The original candidate was committed locally for the
28+
maintainer-requested review; remediation is committed locally at their explicit
29+
request for retest and no tag is authorized.
1530
See [candidate notes](release-notes/v0.2.0.md).
1631

1732
## 0.1.0 — 2026-10-03

‎README.md‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ external network operations are distinct explicit actions.
2525

2626
**Current status:** `v0.1.0` is tagged with accepted pentest and green GitHub
2727
checks. `0.2.0` adds OpenBao-first service provisioning and is a locally committed
28-
candidate awaiting the maintainer's pentest. No workbench, transformation,
28+
candidate with tested review fixes committed locally for maintainer retest.
29+
The authorized minimal Wolfi/PostgreSQL source build passes scans and real service
30+
qualification without a vulnerability waiver; see the
31+
[remediation report](security/pentest/v0.2.0.md). No workbench, transformation,
2932
browser UI, production HTTP server or CyberChef parity is implemented yet.
3033
See the [0.2 scope](docs/releases/v0.2.0-scope.md) and
3134
[0.1 assessment](security/pentest/v0.1.0.md).
@@ -54,16 +57,21 @@ It is disposable test infrastructure and will be replaced by a qualified HTTP
5457
adapter. It is not the planned public API.
5558

5659
```sh
60+
python3 scripts/install_image_tools.py
5761
python3 scripts/stack.py up
5862
python3 scripts/stack.py smoke
5963
python3 scripts/stack.py stop
6064
```
6165

6266
Dependencies run in rootless Podman: PostgreSQL **19 beta 4**, OpenBao **2.7.1**
63-
and Valkey **9.1.2**. The new fixture keeps private custody in ignored `.local/stacks/v02`; legacy
64-
`.local/stack` data is retained separately.
67+
and Valkey **9.1.2**. PostgreSQL is built automatically from pinned official source
68+
on a verified Wolfi base. Private custody lives in ignored `.local/stacks/v02-wolfi-ready`;
69+
earlier `.local/stacks/*` and `.local/stack` data remain separate and retained.
6570
OpenBao is initialized over TLS with declarative audit, KV v2, scoped AppRole
66-
and revoked bootstrap root token. See [local stack](docs/local-stack.md).
71+
and revoked bootstrap root token. Image provenance and exact-digest scans run
72+
before startup. All three current images have zero reported HIGH/CRITICAL
73+
findings. See [local stack](docs/local-stack.md) and the
74+
[image recipe](deploy/podman/postgres/README.md).
6775
The new fixture obtains database/cache passwords from OpenBao before dependent
6876
startup, using separate scoped provisioning/runtime identities and version reuse.
6977
Private password/ACL delivery copies remain until the v0.8 qualification. All project-operated secrets, including initialization/private

‎SECURITY.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
Runasmidja is security-sensitive data-transformation software. Inputs, imported
44
recipes, crypto, rendering, secrets, caching, database access, HTTP/TLS, plugins,
55
workers and supply-chain changes require threat review and executable tests.
6-
The repository has a tagged v0.1.0 foundation and a v0.2.0 candidate; neither is a production service.
6+
The repository has a tagged v0.1.0 foundation and a v0.2.0 remediation candidate;
7+
neither is a production service. Maintainer retest is required. The authorized
8+
Wolfi/PostgreSQL fixture passes scans and actual service qualification; this
9+
does not establish production security or a pentest PASS. See the
10+
[assessment](security/pentest/v0.2.0.md).
711

812
Report vulnerabilities privately through [GitHub private advisories](https://github.com/valkyoth/runasmidja/security/advisories/new).
913
Do not disclose exploitable details in public issues before remediation.

‎deploy/podman/image-policy.json‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"schema": 1,
3+
"platform": "linux/amd64",
4+
"scan_policy": "Reject all HIGH/CRITICAL findings; no ignored IDs or ignore-unfixed filter.",
5+
"openbao": {
6+
"image": "ghcr.io/openbao/openbao@sha256:a36ea8c27f0dcff5757664ad080425f96d3b6b2f33db3e76c4e2d3112fb17005",
7+
"method": "signed-index",
8+
"index": "ghcr.io/openbao/openbao@sha256:6d2b93856e3fcf7b18ad855a0b51eaba474dc8b79cf554379ea32034797d2acf",
9+
"issuer": "https://token.actions.githubusercontent.com",
10+
"identity": "https://github.com/openbao/openbao/.github/workflows/release-images.yml@refs/tags/v2.7.1"
11+
},
12+
"postgres": {
13+
"image": "local:postgres-wolfi",
14+
"method": "local-build",
15+
"approved_by": "project maintainer",
16+
"approved_on": "2026-10-03",
17+
"scope": "public-source disposable Linux/amd64 Wolfi build; trusted local host only",
18+
"recipe": "deploy/podman/postgres/Containerfile",
19+
"reason": "Maintainer authorized own Wolfi/PostgreSQL 19beta4 image; original image retained only as blocked historical evidence."
20+
},
21+
"valkey": {
22+
"image": "docker.io/valkey/valkey@sha256:3b83b0b6a598bb390c8186a408a69949772f439548a81c5ea0ab7ccf102c248d",
23+
"method": "maintainer-exception",
24+
"approved_by": "project maintainer",
25+
"approved_on": "2026-10-03",
26+
"scope": "disposable Linux/amd64 fixture only",
27+
"reason": "Exact official image has no Cosign signature; maintainer explicitly accepted this provenance limitation. Scans/SBOM remain mandatory."
28+
},
29+
"wolfi-base": {
30+
"image": "cgr.dev/chainguard/wolfi-base@sha256:fbcaceb3a1eedec23eb80df9328f9be4a438546836ec15a67df39a104096d44a",
31+
"method": "signed-index",
32+
"index": "cgr.dev/chainguard/wolfi-base@sha256:9c2092b053779e14c82fb50f77b37bcc38b7d2c83972352d5813280f9d035b03",
33+
"issuer": "https://token.actions.githubusercontent.com",
34+
"identity": "https://github.com/chainguard-images/images/.github/workflows/release.yaml@refs/heads/main"
35+
},
36+
"historical_postgres": {
37+
"image": "docker.io/library/postgres@sha256:0f06bb68e8704361a8972fd9916a3bb9e72ff43f025d22a05b1750c6f6db418b",
38+
"method": "maintainer-exception",
39+
"approved_by": "project maintainer",
40+
"approved_on": "2026-10-03",
41+
"scope": "disposable Linux/amd64 fixture only",
42+
"reason": "Exact official image has no Cosign signature; maintainer explicitly accepted this provenance limitation. Scans/SBOM remain mandatory."
43+
}
44+
}

‎deploy/podman/images.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"postgres": "docker.io/library/postgres@sha256:0f06bb68e8704361a8972fd9916a3bb9e72ff43f025d22a05b1750c6f6db418b",
2+
"postgres": "local:postgres-wolfi",
33
"openbao": "ghcr.io/openbao/openbao@sha256:a36ea8c27f0dcff5757664ad080425f96d3b6b2f33db3e76c4e2d3112fb17005",
44
"valkey": "docker.io/valkey/valkey@sha256:3b83b0b6a598bb390c8186a408a69949772f439548a81c5ea0ab7ccf102c248d"
55
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!Containerfile
3+
!entrypoint.sh
4+
!postgresql-19beta4.tar.bz2
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SPDX-License-Identifier: EUPL-1.2
2+
FROM cgr.dev/chainguard/wolfi-base@sha256:fbcaceb3a1eedec23eb80df9328f9be4a438546836ec15a67df39a104096d44a AS build
3+
RUN apk add --no-cache build-base bison flex openssl-dev zlib-dev pkgconf bzip2 perl
4+
COPY postgresql-19beta4.tar.bz2 /tmp/postgresql.tar.bz2
5+
RUN echo '83157ee9c599d03b2f7a3d73ef3a56ec24e0e79cc2b3501a64d1364f56398c86 /tmp/postgresql.tar.bz2' | sha256sum -c - \
6+
&& mkdir /src && tar -xjf /tmp/postgresql.tar.bz2 -C /src --strip-components=1 \
7+
&& cd /src && ./configure --prefix=/usr/local --without-readline --without-icu --with-openssl --with-system-tzdata=/usr/share/zoneinfo \
8+
&& make -s -j4 && make -s DESTDIR=/out install \
9+
&& cd contrib && make -s -j4 && make -s DESTDIR=/out install
10+
FROM cgr.dev/chainguard/wolfi-base@sha256:fbcaceb3a1eedec23eb80df9328f9be4a438546836ec15a67df39a104096d44a
11+
RUN apk add --no-cache libssl3 zlib glibc-locale-posix tzdata \
12+
&& addgroup -g 999 postgres && adduser -u 999 -G postgres -H -D -s /bin/sh postgres \
13+
&& mkdir -p /var/lib/postgresql /var/run/postgresql \
14+
&& chown postgres:postgres /var/lib/postgresql /var/run/postgresql
15+
COPY --from=build /out/usr/local /usr/local
16+
COPY entrypoint.sh /usr/local/bin/runasmidja-postgres
17+
RUN chmod 0755 /usr/local/bin/runasmidja-postgres
18+
ENV PGDATA=/var/lib/postgresql/19/wolfi PGHOST=/var/run/postgresql LANG=C.UTF-8
19+
USER 999:999
20+
EXPOSE 5432
21+
STOPSIGNAL SIGINT
22+
ENTRYPOINT ["/usr/local/bin/runasmidja-postgres"]

‎deploy/podman/postgres/README.md‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# PostgreSQL 19 beta 4 on Wolfi
2+
3+
This is a disposable Linux/amd64 test image built by Runasmidja, not a
4+
Chainguard/OpenSerbia/PostgreSQL-maintained distribution or production claim.
5+
The maintainer authorized the source-build approach on 2026-10-03.
6+
7+
The official [PostgreSQL tarball and checksum](https://www.postgresql.org/ftp/source/v19beta4/)
8+
are pinned in source.lock.json. The Wolfi base is an immutable platform leaf
9+
authorized by its signed index and exact reviewed Chainguard workflow/issuer.
10+
APK verifies repository/package signatures using the base image's bundled keys;
11+
current repository packages are resolved during each rebuild. Builds are not
12+
claimed bit-for-bit reproducible; their final dependency inventories are retained.
13+
14+
The example [postgres-wolfi](https://github.com/openserbia/postgres-wolfi/) at
15+
3f87615e52a712d65e66aea1e49ef7a3d86db808 was reviewed as a design reference.
16+
Its recipe/entrypoint are not copied. Its PostgreSQL 16–18 package approach does
17+
not supply 19 beta 4. Our separate compiler stage builds the official source
18+
and bundled contrib extensions; the runtime has neither compiler, Perl nor gosu.
19+
20+
Only the current fixture is supported: fixed database `runasmidja`, peer local
21+
authentication, SCRAM host authentication, a validated 64-byte lowercase-hex
22+
password file and fixed PGDATA. Password envs, root, symlinks, partial/legacy
23+
data and other database/auth settings are rejected. Initialization runs a
24+
socket-only temporary server, then starts the final server after setup completes.
25+
The image runs UID/GID 999 with a read-only root, no capabilities and mapped
26+
rootless host ownership. The database volume remains writable; socket/temp
27+
directories are bounded namespace-private sticky tmpfs mounts.
28+
`qualification_postgres.py` verifies actual UTF8/C.UTF-8, runtime package absence
29+
and 12 fail-closed startup profiles. Full stack qualification calls it too.
30+
ICU/readline and unqualified optional integrations are outside this profile.
31+
32+
Use `python3 scripts/build_postgres_image.py` to build/scan, or ordinary
33+
`stack.py up` to build a missing image and validate it. The image gate requires
34+
the current recipe fingerprint, local owner-only receipt, immutable image ID,
35+
archive/config/layer SHA-256 binding and a current scan before execution.
36+
No signing secret is created: public-source builds need none. Local receipts
37+
trust the host user; they are not cryptographically authenticated release
38+
provenance. Production signing/build identity retains its later owner.
39+
40+
Weekly freshness checks detect upstream PostgreSQL releases/checksum drift and
41+
new Wolfi base indexes. Review/update pins, rebuild, rescan and requalify before
42+
admission. A new image ID cannot silently replace an existing container.
43+
The old official PostgreSQL pin and data stay retained, with no CVE waiver.
44+
The application component is recorded with its source hash in the runtime SBOM;
45+
Trivy's OS scan does not automatically analyze advisories for compiled C source.
46+
PostgreSQL upstream security/release review remains a separate requirement.
47+
The [security information](https://www.postgresql.org/support/security/),
48+
[19 beta 4 announcement](https://www.postgresql.org/about/news/postgresql-19-beta-4-released-3386/)
49+
and [preceding security update](https://www.postgresql.org/about/news/postgresql-186-1711-1615-1519-1424-and-19-beta-3-released-3365/)
50+
were reviewed on 2026-10-03. This beta fixture does not certify all PostgreSQL
51+
features; the existing beta-to-GA upgrade and production qualification passes
52+
remain required.
53+
54+
The recipe/entrypoint are EUPL-1.2. PostgreSQL remains under its
55+
[PostgreSQL License](https://www.postgresql.org/about/licence/), not EUPL;
56+
Wolfi packages retain their individual SBOM licenses/source notices. Public image
57+
redistribution needs the complete corresponding notices/source obligations and
58+
separate publishing authorization. This task publishes no image or tag.

0 commit comments

Comments
 (0)