Skip to content

Commit

Permalink
Add signing verification behaviour and fix windows config option
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfeidau committed Sep 12, 2024
1 parent f58dba1 commit 76e1201
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions packer/linux/conf/bin/bk-install-elastic-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ disconnect-after-job=${BUILDKITE_TERMINATE_INSTANCE_AFTER_JOB}
tracing-backend=${BUILDKITE_AGENT_TRACING_BACKEND}
cancel-grace-period=${BUILDKITE_AGENT_CANCEL_GRACE_PERIOD}
signing-aws-kms-key=${BUILDKITE_AGENT_SIGNING_KMS_KEY}
verification-failure-behavior=${BUILDKITE_AGENT_SIGNING_FAILURE_BEHAVIOR}
EOF

if [[ "${BUILDKITE_ENV_FILE_URL}" != "" ]]; then
Expand Down
3 changes: 2 additions & 1 deletion packer/windows/conf/bin/bk-install-elastic-stack.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ shell=powershell
disconnect-after-idle-timeout=${Env:BUILDKITE_SCALE_IN_IDLE_PERIOD}
disconnect-after-job=${Env:BUILDKITE_TERMINATE_INSTANCE_AFTER_JOB}
tracing-backend=${Env:BUILDKITE_AGENT_TRACING_BACKEND}
signing-jwks-key-id=${Env:BUILDKITE_AGENT_SIGNING_KMS_KEY}
signing-aws-kms-key=${Env:BUILDKITE_AGENT_SIGNING_KMS_KEY}
verification-failure-behavior=${Env:BUILDKITE_AGENT_SIGNING_FAILURE_BEHAVIOR}
"@
$OFS=" "

Expand Down
10 changes: 10 additions & 0 deletions templates/aws-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,14 @@ Parameters:
- "verify"
Default: "sign-and-verify"

PipelineSigningVerificationFailureBehavior:
Type: String
Description: The behavior when a job is received without a valid verifiable signature (without a signature, with an invalid signature, or with a signature that fails verification)
AllowedValues:
- "block"
- "warn"
Default: "block"

Rules:
HasToken:
Assertions:
Expand Down Expand Up @@ -1323,6 +1331,7 @@ Resources:
$Env:BUILDKITE_AGENT_ENABLE_GIT_MIRRORS="${BuildkiteAgentEnableGitMirrors}"
$Env:BUILDKITE_ELASTIC_BOOTSTRAP_SCRIPT="${BootstrapScriptUrl}"
$Env:BUILDKITE_AGENT_SIGNING_KMS_KEY="${PipelineSigningKMSKey}"
$Env:BUILDKITE_AGENT_SIGNING_FAILURE_BEHAVIOR="${PipelineSigningVerificationFailureBehavior}"
$Env:BUILDKITE_ENV_FILE_URL="${AgentEnvFileUrl}"
$Env:BUILDKITE_AUTHORIZED_USERS_URL="${AuthorizedUsersUrl}"
$Env:BUILDKITE_ECR_POLICY="${ECRAccessPolicy}"
Expand Down Expand Up @@ -1382,6 +1391,7 @@ Resources:
BUILDKITE_AGENT_RELEASE="${BuildkiteAgentRelease}" \
BUILDKITE_AGENT_CANCEL_GRACE_PERIOD="${BuildkiteAgentCancelGracePeriod}" \
BUILDKITE_AGENT_SIGNING_KMS_KEY="${PipelineSigningKMSKey}" \
BUILDKITE_AGENT_SIGNING_FAILURE_BEHAVIOR="${PipelineSigningVerificationFailureBehavior}" \
BUILDKITE_QUEUE="${BuildkiteQueue}" \
BUILDKITE_AGENT_ENABLE_GIT_MIRRORS="${BuildkiteAgentEnableGitMirrors}" \
BUILDKITE_ELASTIC_BOOTSTRAP_SCRIPT="${BootstrapScriptUrl}" \
Expand Down

0 comments on commit 76e1201

Please sign in to comment.