Skip to content

Keep PHP CI source and host controls read-only - #349

Draft
rmcdaniel wants to merge 1 commit into
mainfrom
fix/sample-app-php-ci-readonly-source
Draft

rmcdaniel wants to merge 1 commit into
mainfrom
fix/sample-app-php-ci-readonly-source

Conversation

@rmcdaniel

@rmcdaniel rmcdaniel commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

The PHP CI launcher currently exposes its checkout and host-wrapper state read-write to package/application processes. This source change mounts both trees read-only and grants writes only to named application data, caches, dependency directories and PHP scaffold data. Host Python/Rust source and host temporary command inputs retain read-only exposure; PHP uses its own temporary-data directory.

The existing app writes are preserved through specific vendor/cache/storage/.env mounts. Preview tests use disposable public-directory snapshots so their hot-file writes do not expose checkout scripts/assets. Data mount paths must be canonical, non-symlink paths with disjoint source/control roots. The setup script prepares the PHP temporary directory, and the existing TLS fixture uses that declared data location.

Both PHP minors, current caller commands, immutable image binding, credential/environment allowlist, CA/PHAR verification, fixed-APT build inputs and limits are retained. No workflow or shared admission-policy record changes are included.

Source checks: shell syntax, Python AST parsing, seven explicit command-construction contracts using fake Docker/Git commands, public-boundary, whitespace and changed-source credential/private-path scans pass. The contracts construct and inspect arguments in disposable fixture directories; no actual Docker object, PHP/Composer/package/application code or runtime probe ran.

Draft / source-only. Caller CI is skipped. The stopped container-boundary validation and marker replacement probes were not executed, retried, copied or wired into setup. Existing old WIP is retained separately. No package/app/installed/onboarding qualification, replacement caller admission, merge or publication is authorized by these checks or by source review. Those explicit stops and the frozen #339 candidate 2bf6f2a remain.

Refs #344. Independent Security source review passed for exact f069b118886f922e979d865d964ed5179b9bc3dc and this four-file defensive diff. The source review is complete. This PR remains frozen and draft because the existing execution/admission stop still applies. It does not close #344 or establish runtime acceptance.

@rmcdaniel

Copy link
Copy Markdown
Member Author

Security source PASS for exact f069b11, scoped to the four-file stopped-path boundary repair. The repository root and wrapper state are mounted read-only; writable overlays are a closed list of application dependency/cache/storage/environment data, isolated PHP scaffold data and disposable public snapshots. The launcher refuses non-absolute/noncanonical/comma/newline paths, direct and intermediate symlinks, non-directory overlays and source/state containment before Docker; PHP TMPDIR no longer inherits host command-input storage. The wrapper, Git metadata, action verifier and trust inputs remain read-only, while Python/Rust scaffold roots are created but not exposed writable to PHP. The fake-Docker contracts cover the complete mount and environment sets without running a container.

This verdict authorizes no real container or application/TLS execution and does not lift the existing stop. It does not qualify the image, installed dependencies, onboarding candidate or held #344 operation; those gates remain separate.

@rmcdaniel

Copy link
Copy Markdown
Member Author

Security/source review PASS for exact f069b118886f922e979d865d964ed5179b9bc3dc / tree f60156b184f31f88dc58f40cf9bef931e8ec9d6b.

The four-file change establishes the requested host/container boundary:

  • The complete checkout and wrapper state are mounted read-only. The only writable overlays are the closed Laravel/Composer/PHP data set: vendor, bootstrap cache, storage, PHPUnit cache, .env, the PHP scaffold, Composer home, the dedicated PHP temporary directory, and disposable public snapshots needed by the preview test.
  • Root/state and every writable directory must be absolute, canonical, comma/newline-free, non-symlink directories; source and state cannot contain one another. Environment files are separately limited to canonical regular non-symlink files.
  • Python and Rust scaffold directories are created on the host but receive no writable overlay. Ambient host TMPDIR is no longer forwarded; the container gets only TMPDIR=<state>/data/php-tmp.
  • The synthetic TLS fixture now creates its private material under that PHP-only temporary tree, while the CA/action/Git metadata mounts remain read-only and the existing environment allowlist remains closed.

I independently ran the exact-head fake-Docker/import-isolation suite (11/11), shell syntax, Python compilation, and git diff --check. The TLS module loads cleanly and retains its explicit real-image skip in this source-only environment.

This verdict does not authorize or claim a real container, package/app/TLS runtime, marker replacement, onboarding/activation, the frozen #338 candidate, or the stopped #344 operation. Those remain separate gates.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep PHP CI host launchers outside writable container mounts

1 participant