Skip to content

docs: correct GitHub App credential lifecycle guidance - #64

Closed
Nickfost wants to merge 25 commits into
mainfrom
docs/fix-github-app-setup-findings
Closed

docs: correct GitHub App credential lifecycle guidance#64
Nickfost wants to merge 25 commits into
mainfrom
docs/fix-github-app-setup-findings

Conversation

@Nickfost

Copy link
Copy Markdown
Member

Summary

Repairs the five unresolved-in-substance documentation findings from #55 without changing runtime behavior:

  • suppresses installation-token stdout in every documented direct verification;
  • separates reviewed-checkout pre-install verification from installed-manager reconciliation;
  • requires new-key activation, controller recreation, and health/convergence checks before old-key revocation;
  • documents GitHub key revocation and exact host PEM removal for rotation and retirement;
  • requires encrypted direct transfer, integrity/permission verification, and management-workstation cleanup.

Adds one small documentation contract to prevent an unredirected github-app-token.sh command from returning.

Historical finding mapping

  1. PR docs: add controller GitHub App setup guide #55 comment 3662186231 → sections 6. Pre-install verification and Key rotation, where both direct token-helper commands end in >/dev/null; scripts/test_quickstart.py enforces this.
  2. PR docs: add controller GitHub App setup guide #55 comment 3662186235Key rotation: activate and verify before revocation followed by Old-key revocation; normal reconciliation, a fresh health check, and installed-ref convergence must all succeed before GitHub revocation.
  3. PR docs: add controller GitHub App setup guide #55 comment 3662186238Controller retirement and PEM removal; uninstall installation access, revoke every GitHub key, uninstall the controller, then explicitly remove preserved host PEM and host identity files.
  4. PR docs: add controller GitHub App setup guide #55 comment 3662186239 → separate Pre-install verification from the reviewed checkout and Post-install remote-reconciliation verification sections.
  5. PR docs: add controller GitHub App setup guide #55 comment 3662186244Generate and transfer the private key; authenticated encrypted transfer writes directly to the final root-owned path, checksum and mode are verified, then workstation copies are removed under the applicable secure-erasure policy.

Validation

  • python3 scripts/test_quickstart.py — PASS
  • local Markdown relative-link check across all *.md — PASS
  • git diff --check — PASS
  • shellcheck scripts/*.sh examples/project/scripts/ci/*.sh templates/config-repository/scripts/*.sh — PASS
  • python3 scripts/scan_committed_secrets.py --commit <head> — PASS
  • python3 scripts/scan_committed_secrets.py --commit-range <base>..<head> — PASS
  • scripts/validate.sh — all Python, policy, capacity, and installer tests passed; local run then stopped at the Docker Compose validation because Docker is not installed in this repository-only session. Draft PR CI is expected to exercise the Docker-backed remainder.

Merge

Draft only. An independent merge-only session must wait for required CI and exact-head Codex review; this implementation session will not merge.

@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

Please review exact head: 163caf78e63d901dbfe6f29be4d2b2f188d3639a.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 163caf78e6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread docs/GITHUB-APP-SETUP.md Outdated
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b63bc0003

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md Outdated
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 62d16099a4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md Outdated
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e32a1046dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread docs/GITHUB-APP-SETUP.md Outdated
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 658eda7c94

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread docs/GITHUB-APP-SETUP.md
Comment thread docs/GITHUB-APP-SETUP.md Outdated
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9801048a2b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 23b00794b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread docs/GITHUB-APP-SETUP.md
Comment thread docs/GITHUB-APP-SETUP.md
Comment thread docs/GITHUB-APP-SETUP.md Outdated
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7eed9e777b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7f54a7d91b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread docs/GITHUB-APP-SETUP.md
Comment thread docs/GITHUB-APP-SETUP.md
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3d4572d75

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread docs/GITHUB-APP-SETUP.md Outdated
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5144ca7c7d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread scripts/test_quickstart.py Outdated
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b760079c9d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread docs/GITHUB-APP-SETUP.md
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d41085c9f2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md
Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread docs/GITHUB-APP-SETUP.md
Comment thread docs/GITHUB-APP-SETUP.md
Comment thread docs/GITHUB-APP-SETUP.md
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bbddb39bc0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md
Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread docs/GITHUB-APP-SETUP.md
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 972f44b85e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread docs/GITHUB-APP-SETUP.md Outdated
Comment thread docs/GITHUB-APP-SETUP.md Outdated
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: df65e90d1d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: df65e90d1d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Nickfost
Nickfost marked this pull request as ready for review July 30, 2026 04:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: df65e90d1d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5bf859235d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/GITHUB-APP-SETUP.md
test -n \"\$dir\" || dir=/;
done;
}
test \"\$(stat -c '%F' -- \"$PEM_DEST\")\" = 'regular file' &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use a locale-independent regular-file check

On a controller whose SSH session uses a translated locale, %F may not produce the literal English text regular file; stat --help describes %F as the “file type in human readable form.” This rejects an otherwise valid manager-backed PEM before checksum verification and prevents installation or rotation. Force LC_ALL=C for this command or use a locale-independent file predicate instead.

AGENTS.md reference: AGENTS.md:L5-L5

Useful? React with 👍 / 👎.

Comment thread docs/GITHUB-APP-SETUP.md
[[ "$replacement_pubkey_sha" =~ ^[0-9a-f]{64}$ ]] || exit 1
if [[ -n "$ACTIVE_PEM" ]]; then
[[ $ACTIVE_PEM =~ ^/[A-Za-z0-9._/-]+$ ]] || exit 1
[[ "$PEM_DEST" != "$ACTIVE_PEM" ]] || exit 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Compare canonical paths before managed import

During a manager-backed rotation, a destination such as /etc/ci-fleet/secrets/../secrets/github-app.pem passes this lexical inequality check even when it resolves to ACTIVE_PEM. The manager import is performed before the controller-side canonicality check at line 130, so it can replace the active material before verification fails. Fresh evidence after the earlier equality and canonicality guards is this remaining post-import ordering; resolve and compare both paths on the controller before invoking the manager import.

AGENTS.md reference: AGENTS.md:L66-L66

Useful? React with 👍 / 👎.

Comment thread docs/GITHUB-APP-SETUP.md
Comment on lines +531 to +532
RESOLVED_LOCAL_PEMS+=("$backing")
[[ "$pem" == "$backing" ]] || RESOLVED_LOCAL_PEMS+=("$pem")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Deduplicate resolved local PEM paths before classification

When LOCAL_PEMS contains the configured backing path plus another retained symlink to that path, resolving each entry appends the configured path twice—once directly and once as the symlink's backing—while the instructions require listing every retained path. The later configured_classifications == 1 check then fails before inventory persistence, uninstall, or PEM removal, blocking retirement. Deduplicate the resolved array or classify the original arrays before adding backing paths.

Useful? React with 👍 / 👎.

@Nickfost

Copy link
Copy Markdown
Member Author

Superseded and intentionally never merged by #65, which was squash-merged as e1bbf59e0c3159ae6982494541d460488af57bf1 after exact-head CI and Codex review passed.

This PR’s 25 commits, 733 added lines, and 60 review threads are useful architectural evidence: security-sensitive credential lifecycle execution should not become an unbounded Markdown shell state machine. Tested provider-specific automation remains tracked by #27. The unresolved threads here are preserved as historical evidence rather than falsely resolved.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants