Skip to content

Profile matching

Profile matching restricts access to specific Buildkite pipelines using claim-based rules. Match rules evaluate JWT claims from the Buildkite OIDC token against configured patterns, providing fine-grained access control.

Both pipeline profiles and organization profiles support the same matching syntax.

Match rules are optional. Omit the match field entirely to make a profile available to all pipelines.

When present, the match field contains a list of conditions that must all be satisfied (AND logic) for a pipeline to use the profile.

pipeline:
profiles:
- name: "release"
match:
- claim: build_branch
value: "main"
- claim: pipeline_slug
valuePattern: ".*-prod"
permissions: ["contents:write"]

Chinmina Bridge is deliberately unopinionated about the kinds of profiles that are appropriate, as this will vary per organization.

Use value for known strings. This is the fastest match type.

match:
- claim: pipeline_slug
value: "silk-prod" # Matches only "silk-prod"

Use valuePattern for flexible patterns. Supports RE2 regex syntax.

match:
- claim: pipeline_slug
valuePattern: ".*-release" # Matches any pipeline ending in "-release"

Patterns are automatically anchored to match the entire value. Chinmina wraps patterns with \A(?: and )\z around the pattern, forcing full-string matches. This prevents accidental partial matches.

For example:

  1. Pattern prod matches only “prod”, not “not-prod”.
  2. For partial matches: .*-prod matches “silk-prod” and “cotton-prod”.

All conditions must match (AND logic).

match:
- claim: pipeline_slug
valuePattern: "silk-.*"
- claim: build_branch
value: "main"
# Both conditions required

Match rules can evaluate the following JWT claims from the Buildkite OIDC token:

ClaimDescription
pipeline_slugPipeline’s slug
pipeline_idPipeline UUID
build_numberBuild number (as string)
build_branchGit branch name
build_tagGit tag (if present)
build_commitGit commit SHA
cluster_id, cluster_nameCluster identifiers
queue_id, queue_keyQueue identifiers
agent_tag:NAMEDynamic agent tags (e.g., agent_tag:queue)
match:
- claim: pipeline_slug
valuePattern: ".*-release"
match:
- claim: build_branch
value: "main"
match:
- claim: pipeline_slug
valuePattern: "(silk|cotton)-prod"
- claim: build_branch
value: "main"
match:
- claim: cluster_name
value: "production-us-east"
match:
- claim: build_tag
valuePattern: "v[0-9]+\\.[0-9]+\\.[0-9]+" # v1.2.3 format

Pipeline doesn’t match profile conditions.

The HTTP response returns a generic “Forbidden” message. Check audit logs for token.attemptedPatterns to see which condition failed and the error field for detailed information. Verify the pipeline’s claim values match the configured patterns.

Profile returns 404 (unavailable: validation failed)

Section titled “Profile returns 404 (unavailable: validation failed)”

The profile failed validation and was excluded. Common causes:

  • An invalid regex pattern in a match rule.
  • An app naming a GitHub App that is not configured, or that is disabled.
  • An empty app value.

The cause is recorded in the audit entry error field as profile "name" unavailable: <cause>.

It also appears under invalid_profiles in the warning log organization profile: some profiles failed validation and were ignored, or pipeline profile: some profiles failed validation and were ignored for pipeline profiles. The warning is emitted on every refresh while the profile remains invalid.

The caller sees only the generic message.

Correct the profile configuration to fix it. For a disabled app, fix the installation and restart the service; see disabled apps.

Pattern is overly permissive.

Review audit logs to identify unexpected matches. Make the pattern more specific. Patterns are automatically anchored, but .* can still match broadly. Replace .* with more specific patterns when possible.

Invalid RE2 regex syntax.

Consult the RE2 syntax guide for supported patterns. Common issues:

  • Backreferences are not supported
  • Some Perl regex features are unavailable
  • Escape special characters with backslash