RGP (Role Governing Policy) is a type of Sentinel policy in Vault Enterprise that imposes additional governance (conditions such as time of day or network) on tokens issued from a specific authentication role.
The standard practice is to define functional permissions with ACL policies and narrow them down by context with EGP/RGP. This article summarizes how to think about RGP from an Ops perspective, implementation steps, comparison points, and key tips for exam preparation.
RGP (Role Governing Policy) is a Vault Enterprise-only feature that applies policies written in the Sentinel language at the authentication-role level. Once ACL defines "what can be done," RGP is a complementary layer that narrows down "when, from where, and under what conditions it is allowed." RGP does not expand permissions; it denies requests that do not meet the conditions.
RGP applies to roles defined on each authentication method such as AppRole, Kubernetes, and AWS. It is evaluated against requests from tokens issued by the target role. This allows you to separate governance per subject with different characteristics, such as humans vs. machines or CI vs. production apps.
Vault access control is layered. ACL defines basic permissions (read/write/list, etc.) at the path level. EGP attaches context conditions to endpoints (paths), and RGP attaches conditions to tokens originating from an authentication role. In operations, it is safer to define "what can be done" with ACL and narrow down "when/where/who is allowed" with EGP/RGP.
On certification exams, questions that ask "which layer should constrain it" based on use cases are common. The standard approach is to separate conditions that depend on the subject (role) — such as time of day or source network — into RGP, and conditions that depend on the path into EGP.
| Layer | Scope / Binding | Typical Use | Permission Nature |
|---|---|---|---|
| ACL | Secret path / namespace | Basic read/write/list/deny | Defines permissions (foundation) |
| EGP | Endpoint (path / path prefix) | Controls path operations by time / request attributes | Narrows permissions (deny only) |
| RGP | Authentication role (AppRole/K8s/AWS, etc.) | Attaches conditions based on the subject (role) | Narrows permissions (deny only) |
Multi-layer governance in a Vault request (conceptual diagram)
RGP is evaluated against requests from tokens issued by the specified authentication role. It does not apply to unauthenticated endpoints or tokens unrelated to the target role. If the evaluation result is deny, the operation is denied even if ACL allows it.
Operationally, making roles too coarse widens RGP's blast radius and increases unintended denials. Splitting them too finely bloats role management. Designing roles and RGPs together per boundary (human/machine, CI/production, Prod/Non-Prod) makes impact easier to predict.
Requirements like the following are well-suited to per-role control with RGP. Implement "when/where/who" conditions that are hard to express via ACL, tailored to the nature of each role.
Time- and network-dependent requirements tend to have optimal conditions that vary by environment (prod/staging) and subject characteristics (human/machine), so combining role separation with RGP is effective.
As an example, add a governance rule of "writes only allowed weekdays 9:00 to 18:00" to a human-facing Kubernetes role. Assume ACL already grants the necessary capabilities (read/write, etc.), and use RGP to deny writes outside the allowed time window.
RGP can be configured with enforcement_level as soft-mandatory (allow with a warning on violation) or hard-mandatory (deny on violation). For phased rollout, observe the impact under soft, confirm there are no issues, and then switch to hard — this is the practical approach.
Defining and applying an RGP (example: writes only during business hours)
# 1) Sentinel policy (office-hours.sentinel)
import "time"
main = rule {
# Current time (be aware of server timezone / UTC)
t = time.now()
# Allow only weekdays from 09:00 to 18:00
weekday = t.weekday
in_office_hours = t.hour >= 9 && t.hour < 18
is_weekday = weekday >= 1 && weekday <= 5 # 1=Mon ... 5=Fri
# Narrow to write operations only (this policy does not deny reads, etc.)
write_ops = ["create", "update", "patch"]
is_write = rule { request.operation in write_ops }
# For writes, the time window must be satisfied.
# Non-write operations (read/list, etc.) are not denied by this RGP.
(is_write and (is_weekday and in_office_hours)) or (!is_write)
}
# 2) Create the RGP (Enterprise only)
# Example: apply with hard-mandatory. Soft is recommended first.
vault write sys/policies/rgp/office-hours \
[email protected] \
enforcement_level=hard-mandatory \
roles="auth/kubernetes/role/human-ops"
# 3) Verify
# Authenticate with the target role and attempt a write outside business hours - it will be denied
# During the allowed window, ACL-permitted operations succeed
# Confirm the RGP-driven deny in audit logsRemember that RGP is "context control on tokens originating from a role." EGP is per-path, and ACL provides base permissions. Exams test your ability to quickly tell "what to constrain — subject or path?" from the use case.
Phased introduction (soft-mandatory to hard-mandatory), understanding the blast radius (inventory target roles), and verification in audit logs (confirm deny reasons) are Ops fundamentals. Watch out: forgetting to update RGP targets when consolidating/renaming roles easily causes unexpected denies.
Ops
問題 1
In Vault Enterprise, you want to prohibit secret writes outside business hours on weekdays for tokens issued by the Kubernetes "human-ops" role, without affecting other roles. Which is the most appropriate approach?
正解: A
Subject-dependent (authentication-role-based) time-window control is best handled by RGP. Limiting it to the human-ops role and applying it as hard-mandatory ensures denials without affecting other roles. EGP is path-driven and impacts all roles. Dynamically updating ACL has high operational burden and risk, and is not recommended. Applying broadly and then excluding roles is also not safe.
Can I use RGP in the open source version of Vault?
No. RGP (and Sentinel-integrated governance policies including EGP) are Vault Enterprise features. They are not available in the OSS version.
How can I safely evaluate the impact of an RGP?
Applying enforcement_level as soft-mandatory lets requests pass through even when conditions are violated, while warnings are recorded. The recommended approach is to review audit logs to understand the impact, confirm there are no issues, and then switch to hard-mandatory.
Should I design RGP or EGP first?
First design least-privilege via ACL, then use EGP for strong boundary conditions tied to paths (network, time, etc.) and RGP for conditions tied to the subject (role). There is no absolute answer on ordering, but the design principle is to separate roles by "what is being constrained — path or subject."
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Vault Core Concepts: Sealed/Unsealed, Auth, Secrets (2026)
Vault fundamentals — sealed/unsealed state, auth methods, se...
Vault Operations Professional (VOP-003): Complete Guide (2026)
Pass the Vault Operations Professional exam — enterprise pat...
Vault Path-Based Routing: API URL Structure (2026)
How Vault's path-based routing works — mount points, sub-pat...
Vault Tokens: Auth Token Mechanics (2026)
Token fundamentals — service vs. batch tokens, accessor, ren...
Vault Token Types: Service, Batch, Periodic (2026)
Service vs. batch tokens compared — performance, ACL behavio...