Skip to content

github_runner::register: wait 600 s for the SSM-delivered registration token (SEC-46) - #309

Merged
infrahouse8 merged 2 commits into
mainfrom
issue-308-ssm-token-wait-600
Dec 3, 2026
Merged

infrahouse8 merged 2 commits into
mainfrom
issue-308-ssm-token-wait-600

Conversation

@akuzminsky

Copy link
Copy Markdown
Member

Closes #308

What changed and why

On the ssm path, profile::github_runner::register waited 300 seconds for the registration token, counted from when Puppet reaches the register_runner exec. Puppet can reach the exec before the registration Lambda of terraform-aws-actions-runner has asked the instance for its key, and the Lambda's worst case from the launch hook firing to delivery is about 490 seconds. In that case the receiver gives up first, fails the Puppet run, and the instance sits until the bootstrap hook's 1200 seconds run out.

In modules/profile/manifests/github_runner/register.pp, in all three trees (modules/, environments/sandbox/modules/, environments/development/modules/):

  • $token_wait = 300 → $token_wait = 600, matching the 600 seconds the Lambda enforces from the hook firing (RECEIVER_WAIT_SECONDS in terraform-aws-actions-runner#123), after which it mints nothing and abandons the instance.
  • register_runner exec on the ssm path: timeout => 420 → timeout => 720, the wait plus config.sh, still inside the bootstrap hook's 1200 seconds.
  • Class doc: the toolkit now waits up to 600 seconds, with the reason (Puppet may start the wait before the Lambda's key request; the Lambda delivers within 600 seconds of the hook firing or abandons the instance).
  • The comment above $token_wait no longer calls it the toolkit's own default; it says the toolkit's default is 300 and why this one is longer.
  • The secret path is unchanged.
  • debian/changelog bumped once, to 0.1.0-1build339.

In the usual case nothing changes: the token is already on the instance when Puppet reaches the exec, and the toolkit picks it up at once. 600 is how long it waits before giving up, not a delay.

How it was tested

  • The three copies of register.pp are identical (diff shows no differences).
  • puppet-lint --fail-on-warnings (puppet-lint 5.1.1) passes on the three changed files.
  • puppet parser validate (Puppet 8.10.0) passes on the three changed files.
  • CI builds the .deb on this PR.

Note: running puppet-lint --fail-on-warnings over whole module directories with puppet-lint 5.1.1 reports space_before_arrow warnings in base.pp, elastic/prometheus.pp and teleport/packages.pp. Those files are not touched here and the warnings are on main as well; this PR leaves them alone.

Decisions the issue left open

  • decided: the class doc also says that usually the token is already there and the toolkit picks it up at once, so a reader doesn't take 600 seconds as a delay.
  • decided: the comment above $token_wait names the toolkit's default (300) and points to the class doc for the reason, instead of repeating the reason there.
  • decided: the changelog entry is written by hand in exactly the format make bumpversion (dch -R) produces (0.1.0-1build339, root <packager@infrahouse.com>), in its own commit, so there is one bump for the PR.
  • decided: the comment on the exec ("The timeout covers the wait and config.sh, inside the bootstrap lifecycle hook's 1200 seconds") is kept as is, since it still holds at 720.

Generated by Claude Code

On the ssm path the receiver waited 300 seconds, counted from when
Puppet reaches the exec. Puppet can get there before the registration
Lambda has asked the instance for its key, and the Lambda's worst case
from the launch hook firing to delivery is about 490 seconds, so the
receiver could give up first, fail the Puppet run, and leave the
instance to be replaced after the bootstrap hook's 1200 seconds.

Wait 600 seconds, matching the window the Lambda enforces from the
hook firing, and raise the exec timeout to 720 to cover the wait plus
config.sh, still inside the 1200-second hook. Update the class doc and
the comment that called 300 the toolkit's own default; the toolkit's
default stays 300. The secret path is unchanged. Same change in all
three trees.

Refs #308

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GsX4wbUDt43kCwZnrCgRJQ
One version bump for the token-wait change, in the format
`make bumpversion` produces.

Refs #308

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GsX4wbUDt43kCwZnrCgRJQ

Copy link
Copy Markdown
Member Author

Ready for review: 3cd3398

First round. The change from #308 in all three trees: $token_wait = 600, timeout => 720 on the ssm path, the class doc and the $token_wait comment updated, the secret path unchanged, and one changelog bump to 0.1.0-1build339. The open decisions are listed in the PR description.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Approved 3cd3398

Checked at this commit, against #308 ("Suggested solution" and "Done when") and the repository's CLAUDE.md:

  • modules/profile/manifests/github_runner/register.pp is byte-identical in modules/, environments/sandbox/modules/ and environments/development/modules/ (same SHA-256).
  • On the ssm path, $token_wait = 600 and the register_runner exec has timeout => 720 (600 s of waiting plus 120 s for config.sh, inside the bootstrap hook's 1200 s). The secret path is untouched by the diff.
  • The class doc says 600 seconds and gives the reason: Puppet may start the wait before the Lambda asks for the key, and the Lambda delivers within 600 seconds of the launch hook firing or abandons the instance. The comment above $token_wait no longer calls it the toolkit's own default and states that the default is 300.
  • No other file in the repository refers to the old 300-second wait or the 420-second timeout; README.md and CLAUDE.md need no change.
  • debian/changelog is bumped once across the PR, 0.1.0-1build338 to 0.1.0-1build339, in the existing format; main has not moved since the branch point.
  • puppet-lint --fail-on-warnings (5.1.1) and puppet parser validate (Puppet 8.10.0) pass on the three changed files.
  • CI is green: test (noble) builds puppet-code_0.1.0-1build339_all.deb, and vulnerability-check / osv-scan passes.
  • The PR body says "Closes github_runner::register: wait 600 s for the SSM-delivered registration token (SEC-46) #308", so merging closes the issue. Nothing from the issue is left as a TODO.

Decisions let stand:

  • decided: the class doc adds that the token is usually already there and is picked up at once. Sound: it is the issue's own point that 600 is a ceiling, not a delay.
  • decided: the $token_wait comment names the toolkit default (300) and points to the class doc for the reason. Sound: the reason is stated once.
  • decided: the changelog entry is written by hand in the dch -R format in its own commit. Sound: one bump, same format as the existing entries, and CI builds that version.
  • decided: the exec comment about the timeout covering the wait and config.sh within the hook's 1200 seconds is kept. Sound: it still holds at 720.

Generated by Claude Code

@infrahouse8
infrahouse8 merged commit 189a4c8 into main Dec 3, 2026
2 checks passed
@infrahouse8
infrahouse8 deleted the issue-308-ssm-token-wait-600 branch December 3, 2026 15:20
akuzminsky added a commit to infrahouse/terraform-aws-actions-runner that referenced this pull request Dec 3, 2026
….1.0-1build339 (SEC-46)

build339 (infrahouse/puppet-code#309) waits 600 seconds for the SSM-delivered
token, as Step 1 asks; build338 takes the SSM path but waits only 300.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

github_runner::register: wait 600 s for the SSM-delivered registration token (SEC-46)

3 participants