hashicorp / hashicorp/consul

acl binding-rule update overwrites bind-type

Open
#22,228 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
1d 18h
Merged PRs (30d)
39

Description

#### Overview of the Issue

- When calling `consul acl binding-rule update -id 2804494b-b348-9d1a-57ac-40b9a2d1363c` the `-bind-type` gets set to `service`, even if it was previously set to `role`

#### Reproduction Steps

It doesn't really matter what the `method` and `bind-name` are, so just take anything that you have available.

- `consul acl binding-rule create -bind-type=role -bind-name="test" -method=nomad -selector='"nomad_service" in value'`
- `consul acl binding-rule list` (this correctly shows `BindType: role`)
- `consul acl binding-rule update -id aaaaaaaaaaaa -selector='"nomad_service" in value and value.nomad_service==test'`
- `consul acl binding-rule list` (this now shows `BindType: service`, which is not good, because we hadn't specified it in our update and thus it should retain the old value)

### Consul info for both Client and Server
Consul v1.20.4
Revision 9e308779
Build Date 2025-02-20T12:49:28Z
Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)

### Operating system and Environment details
Ubuntu 22.04.5 LTS (Jammy Jellyfish) on amd64

### Log Fragments
Not applicable.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the `consul acl binding-rule create`, `update`, and `list` commands shown in the report, then trace the ACL binding-rule update entry point. Done means updating only the selector preserves the existing `BindType: role` instead of changing it to `service`.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
authorization, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.