Repository navigation
Rename the local CA to "Ingot Local CA" and build its image here - #9
Merged
Merged
Conversation
The CA users trust was "Alias Project CA Self Signed CN", from the 2021 ghcr.io/aliasproject/openssl image, whose source is lost. Rebuild it in this repo as Dockerfile.openssl + openssl/entrypoint.sh, published by release.sh as ghcr.io/aliasproject/ingot-openssl:<version> and pinned by config.OpensslImage, like ingot-idle. Overwriting openssl:latest would break the 2.0.0 CLI, which looks for the old file names. The new CA is CN "Ingot Local CA", O "Alias Project", valid for ten years with explicit CA extensions. Leaf certs gain the serverAuth EKU Apple platforms require and drop the aliasproject.ssl email addresses. Generating the CA alone no longer leaves init.test files behind. The CA's names now come from constants in ssl, which also fixes the macOS keychain lookups (they searched for "AliasProjectCASelfSigned", which never matched the cert's name), and the Windows trust check no longer reports the CA as installed when nothing matches.
Review findings on #9: - Without p11-kit, IsCertificateInstalled only checks that /usr/local/share/ca-certificates/ingot-ca.crt exists, which is where the old Alias Project CA was installed, so an upgraded Debian/Ubuntu machine reported the new CA as trusted. Install it as ingot-local-ca.crt instead. - The entrypoint generated each of key, csr and crt only when that file was missing, so a missing key with a leftover csr/crt gave a crt that didn't match the new key. A new key now drops both. - The Caddyfile's pki name now comes from ssl.CAName.
Member
Author
Review round 1 (fresh-context reviewer,
|
| Finding | Outcome |
|---|---|
P2: ingot-openssl:2.0.0 doesn't exist, so a build before the next release can't pull it |
Declined (code). Version pinning is deliberate and works the same way as ingot-idle: release.sh pushes the image before publishing. Added to Rollout, along with making the new package public after its first push. |
P2: the Debian fallback trust check only tests ingot-ca.crt, the old CA's path |
Fixed in c42226e. The CA is now installed as ingot-local-ca.crt. |
P2: no migration leaves two CAs in use at once, and cert repair won't reissue old project certs |
Declined (code). Skipping migration is deliberate, since the maintainer is the only user. The manual steps are now in the PR description's Rollout section. |
| P3: a missing key with a leftover csr/crt produces a crt that doesn't match the key | Fixed in c42226e. Reproduced before the fix (key and crt mismatch) and confirmed fixed after. |
P3: raw exec.Command("docker", …) in GenerateCertificate |
Declined. It predates this PR, which only changed the image string. |
P3: the Caddyfile hardcodes name "Ingot Local CA" |
Fixed in c42226e. It now uses ssl.CAName, and the entrypoint has a comment pointing to the Go constants. |
| Unconfirmed: Caddy may keep an intermediate signed by the old root | Will be checked during the maintainer's migration (s_client), and Caddy's stored intermediate cleared there. Added to Rollout. |
Review round 2 on #9: - A regenerated CA left every existing <project>.test.crt in place, signed by the CA that no longer exists, and nothing reissued them. The entrypoint now reissues a crt that fails to verify against the CA or expires within 30 days; `ingot start` runs it every time, so this also renews certs before their 825 days run out. - Caddy skips `caddy reload` when the config text is unchanged, which is the case after a reissue, so it kept serving the old cert. Reload with --force. - "CA certificate not found" pointed at `ingot cert install`, which can't create the CA; `ingot global start` does. - Drop RemoveProjectSSL's comment about stale csrs, which the previous commit made untrue, and update the entrypoint's header.
Member
Author
Review round 2 (fresh-context reviewer, focus on c42226e)Confirmed holding:
No P1 or P2 findings.
|
Review round 3 on #9: a reissue re-signed the existing csr, so certs migrated from the old image kept emailAddress=<domain>@aliasproject.ssl in their subject. Drop the csr with the crt so both are rebuilt from the kept key.
Member
Author
Review round 3 (final; fresh-context reviewer, focus on f344fca)Confirmed holding, tested in throwaway containers:
This closes the loop after three rounds. The latest fix is a one-line change to the reissue branch, and I tested it directly instead of running another review round. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Ingot is going public, and the root CA it asks users to trust was named "Alias Project CA Self Signed CN". That name comes from the 2021
ghcr.io/aliasproject/opensslimage, whose source no longer exists. A root CA named after the tool makes it clear what installed it and that it's for local use.What changed
Dockerfile.opensslandopenssl/entrypoint.sh.scripts/release.shpushes it asghcr.io/aliasproject/ingot-openssl:<version>for amd64 and arm64, and the CLI pins that tag throughconfig.OpensslImage, the same wayingot-idleworks.openssl:latestis left alone, because the 2.0.0 CLI looks for the old file names.IngotLocalCA.pem/.key. It's valid for ten years and declares its CA extensions explicitly. It has no path-length limit, because Caddy's on-demand issuer signs through an intermediate it creates.serverAuthextended key usage that Apple platforms require, stay at 825 days, and lose the@aliasproject.sslemail addresses.init.testfiles behind.ssl.CACertFile,ssl.CAKeyFileandssl.CAName.AliasProjectCASelfSigned, which isn't part of the old certificate's name, so they never matched.ingot-local-ca.crt. The trust check there only checks that the file exists, and the old CA was installed asingot-ca.crt.ingot startruns the image every time, so certificates are now renewed before their 825 days run out.--force. Caddy skips a reload when the config text is unchanged, and a reissued certificate keeps the same paths, so without it Caddy kept serving the old certificate.ingot global start, which creates the CA, instead ofingot cert install, which can't.Testing
go build ./...,GOOS=windows go build ./cmd,go vet ./...andgo test ./...all pass.openssl verifyagainst it, and running the image again changed nothing. The arm64 image'sopensslbinary is aarch64.mcr.microsoft.com/powershell, using strings in place of theCert:drive.ingotrun against the real stack, because it needs the release image, and anything on macOS or Windows.Rollout
release.shpushesingot-openssl:<version>. Until a release exists, a build of this branch has no image to pull: the pin works the same way asingot-idle's. The new GHCR package starts out private, so make it public right after the first push.ingot global restart. It generates the new CA beside the old one, and rewrites the base Caddyfile so Caddy's pki root points at it.pki/authorities/ingotintermediate so it re-signs under the new root.ingot cert installto trust the new CA.ingot startin each project. The old project certificates don't verify against the new CA, so they're reissued and Caddy reloads them.cert repairalone won't reissue them, because it only fills in missing files.AliasProjectCASelfSigned.*fromingot_certs.openssl s_client -connect nothing.test:443 -showcerts.