fullstaq-ruby / fullstaq-ruby/infra

Restrict server-edition deploy environment to main branch

Open Beginner friendly
#54 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
HCL
Stars
10
Forks
2
PR merge metrics
No merged PRs in 30d

Description

## Problem

The GitHub OIDC workload identity pool provider in `terraform/gcloud_auth.tf` validates `repository_owner` and `environment` claims, but does not restrict by branch. Because deploy permissions are bound to `attribute.repository/fullstaq-ruby/server-edition`, workflows from non-main branches in `fullstaq-ruby/server-edition` can potentially authenticate if they run in the `deploy` environment.

## Proposed Change

Add a `ref` restriction to the deploy pool's attribute condition:

```hcl
attribute_condition = "assertion.repository_owner == 'fullstaq-ruby' && assertion.environment == 'deploy' && assertion.ref == 'refs/heads/main'"
```

## Considerations

Review whether non-main branches ever need deploy access (e.g., release branches). If so, use a prefix match instead of exact match.

Contributor guide

Open the contributing guide

Research direction

Start in terraform/gcloud_auth.tf by locating the GitHub OIDC workload identity pool provider and its deploy attribute condition. Review whether release branches need deploy access, then validate the Terraform configuration; done means non-main branch workflows cannot authenticate to the deploy environment unless an explicitly approved branch policy allows them.

Written by the indexing model from the issue text.

Assessment

Tech stack
gcp, github-actions, terraform
Domain
cloud, infrastructure, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.