Skip to content

policy: add admin actions for cluster encryption - #307

Open
aead wants to merge 1 commit into
mainfrom
encryption-at-rest
Open

aead wants to merge 1 commit into
mainfrom
encryption-at-rest

Conversation

@aead

@aead aead commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

AIStor is adding cluster encryption of data at rest. Its admin API needs actions that a policy can allow or deny.

Add five cluster-wide admin actions, all AIStor extensions:

  • admin:ClusterEncryptionEnable and admin:ClusterEncryptionDisable turn encryption of new writes on and off.
  • admin:ClusterEncryptionRotateKey adds a version to the drive key.
  • admin:ClusterEncryptionStatus reads the cluster encryption status, the encryption of an object version, and the status of the job that encrypts existing data.
  • admin:ClusterEncryptionRewrite starts, stops, pauses and resumes that job.

The actions take no resource. admin:* and admin:ClusterEncryption* match them.

Built-in policies grant them as follows:

  • consoleAdmin: all five, through admin:*.
  • infraAdmin: Status and Rewrite.
  • securityAuditAdmin: Status.
  • No other built-in policy grants any of them.

Enable, Disable and RotateKey stay with consoleAdmin because they change how data is protected. Status is read-only, so the audit role gets it. Rewrite is the long-running job that infraAdmin already manages for other background work.

Summary by CodeRabbit

  • New Features
    • Added administrative controls for enabling or disabling encryption on new writes, rotating the drive key, checking encryption and rewrite-job status, and managing existing-data rewrite jobs.
    • Updated built-in administrator policies to grant appropriate access to encryption status and rewrite actions.

@aead aead self-assigned this Nov 25, 2026
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 659141b7-512e-4ba9-a407-99b0b923b5bf
Commits

Reviewing files that changed from the base of the PR and between 35a8f1e and 0b0c172.

Files selected for processing: 3

  • policy/admin-action.go
  • policy/admin-action_test.go
  • policy/constants.go

No actionable comments were generated in the recent review.

Walkthrough

The policy package adds five cluster-encryption admin actions, registers them as supported actions, and updates selected built-in policies to grant status and rewrite access. Tests cover action validity, policy parsing, built-in policy grants, and wildcard matching.

Changes: Cluster Encryption Admin Actions

Layer / File(s) Summary
Define and register actions
policy/admin-action.go
Five cluster-encryption actions cover enabling or disabling encryption of new writes, rotating the drive key, checking encryption and rewrite-job status, and controlling the existing-data rewrite job. The actions are added to SupportedAdminActions.
Grant and test policy access
policy/constants.go, policy/admin-action_test.go
infraAdmin grants status and rewrite access. securityAuditAdmin grants status access. Tests cover action validity, policy parsing, selected policy grants, and wildcard allow and deny behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: harshavardhana, rraulinio, varun0630

Merge Risk: Minimal · previous review 35a8f

This change adds cluster-encryption admin actions and grants status and rewrite access to selected built-in policies. No merge-blocking risk was found in the supplied changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "policy: add admin actions for cluster encryption" matches the main change. The PR adds five cluster-wide encryption admin policy actions (Enable, Disable, RotateKey, Status, Rewrite) and up…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "policy: add admin actions for cluster encryption" matches the main change. The PR adds five cluster-wide encryption admin policy actions (Enable, Disable, RotateKey, Status, Rewrite) and updates the built-in infraAdmin and securityAuditAdmin policies. The title is concise, specific, and follows the repository's package-prefix style.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the action list,
Five new names are neatly placed.
Status, rewrite, keys, and writes,
Policy tests inspect their rights.
The audit grant shines in the night,
Then hops away beneath moonlight.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 24163fcc-dc76-4266-854e-77573c115c11
Commits

Reviewing files that changed from the base of the PR and between e87292b and 35a8f1e.

Files selected for processing: 3

  • policy/admin-action.go
  • policy/admin-action_test.go
  • policy/constants.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

AIStor is adding cluster encryption of data at rest. Its admin API needs
actions that a policy can allow or deny.

Add five cluster-wide admin actions, all AIStor extensions:

- admin:ClusterEncryptionEnable and admin:ClusterEncryptionDisable turn
  encryption of new writes on and off.
- admin:ClusterEncryptionRotateKey adds a version to the drive key.
- admin:ClusterEncryptionStatus reads the cluster encryption status, the
  encryption of an object version, and the status of the job that
  encrypts existing data.
- admin:ClusterEncryptionRewrite starts, stops, pauses and resumes that
  job.

The actions take no resource. admin:* and admin:ClusterEncryption* match
them.

Built-in policies grant them as follows:

- consoleAdmin: all five, through admin:*.
- infraAdmin: Status and Rewrite.
- securityAuditAdmin: Status.
- No other built-in policy grants any of them.

Enable, Disable and RotateKey stay with consoleAdmin because they change
how data is protected. Status is read-only, so the audit role gets it.
Rewrite is the long-running job that infraAdmin already manages for
other background work.

Signed-off-by: Andreas Auernhammer <git@aead.dev>
@aead
aead force-pushed the encryption-at-rest branch from 35a8f1e to 0b0c172 Compare November 25, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant