Skip to content

server: keep auth applier when an alarm is raised - #22386

Open
vivekpatani wants to merge 1 commit into
etcd-io:release-3.5from
vivekpatani:fix/alarm-preserve-auth-applier
Open

server: keep auth applier when an alarm is raised#22386
vivekpatani wants to merge 1 commit into
etcd-io:release-3.5from
vivekpatani:fix/alarm-preserve-auth-applier

Conversation

@vivekpatani

@vivekpatani vivekpatani commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

etcd uses a chain of appliers to apply each request. The auth applier is the first item in the chain. It checks permissions.

When the database becomes full, etcd sets the NOSPACE alarm. The alarm handler then builds a new chain. The new chain is not correct. It does not contain the auth applier.

While the alarm is active, etcd does not check permissions for these operations:

  • AuthDisable, AuthEnable, and all user and role operations
  • DeleteRange
  • LeaseRevoke

A user needs write permission for only one key prefix. The user writes data to that prefix until the database is full. This makes the alarm active. The user can then stop authentication for the cluster.

Note:

  • Read operations are safe. Read operations do not use this chain.
  • The same problem is not present in 3.6 and later versions.

Steps to reproduce

  1. Start a cluster with one member.
  2. Add a user with the name tenant. Give the user a role. The role gives read and write permission for the keys from /tenant/ to /tenant0.
  3. Add the root user. Then enable authentication.
  4. As the root user, write the key /secret/key.
  5. Set --quota-backend-bytes to a small value. Then restart the member.
  6. As the tenant user, do these three operations:
    • read /secret/key
    • delete /secret/key
    • AuthDisable
  7. As the tenant user, write 8 KB of data to the key /tenant/fill. Repeat this step until etcd shows the error database space exceeded.
  8. Do step 6 again.

Result: In step 6, etcd refuses all three operations. In step 8, etcd refuses the read operation, but etcd permits the delete operation and the AuthDisable operation.

Expected result: etcd refuses all three operations in step 8.

Signed-off-by: vivekpatani <9080894+vivekpatani@users.noreply.github.com>
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vivekpatani
Once this PR has been reviewed and has the lgtm label, please assign wenjiaswe for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow

Copy link
Copy Markdown

@vivekpatani: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-etcd-integration-2-cpu-arm64 ad758c2 link true /test pull-etcd-integration-2-cpu-arm64
pull-etcd-integration-4-cpu-arm64 ad758c2 link true /test pull-etcd-integration-4-cpu-arm64
pull-etcd-integration-4-cpu-amd64 ad758c2 link true /test pull-etcd-integration-4-cpu-amd64
pull-etcd-integration-1-cpu-amd64 ad758c2 link true /test pull-etcd-integration-1-cpu-amd64

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant