When you need Vault access control that reasons about who, where, when, and under what conditions a request is made, Enterprise Sentinel Policies are the centerpiece.
This article walks through EGP/RGP, evaluation order, practical policy examples, and test/rollout strategy from an Ops perspective — also covering the key points you need for the exam.
Vault Enterprise Sentinel Policies layer runtime evaluation on top of standard ACLs. First, ACLs decide the base capabilities (read/write/list/etc.); requests that pass then go through Sentinel, which renders the final verdict using additional conditions such as time of day, token metadata, Identity groups, and parameter contents.
The most commonly used scopes are EGP (Endpoint Governing Policy), which targets an endpoint, and RGP (Role Governing Policy), which targets a specific role's operations. Both come with an enforcement level (advisory / soft-mandatory / hard-mandatory); hard-mandatory always denies on failure.
| Feature | Scope | Evaluation Timing | Primary Use |
|---|---|---|---|
| ACL (standard) | Paths and capabilities | Immediately after request intake | Baseline allow/deny framework |
| Sentinel EGP | Endpoint (path/operation) | Right after ACL passes (before execution) | Conditions on time of day, metadata, Identity, etc. |
| Sentinel RGP | Operations tied to a role | Before the target role's operation executes | Guardrails over input parameters, TTL, and similar values |
Vault request evaluation flow
Creating and updating EGP/RGP (example)
## EGPの例: sys/* 直下操作を厳格化
evn VAULT_ADDR=https://vault.example.com
vault login $TOKEN
vault write sys/policies/egp/egp-sys-guard \
[email protected] \
enforcement_level=hard-mandatory \
paths="sys/*"
## RGPの例: PKI発行ロールのTTL制限
evn VAULT_ADDR=https://vault.example.com
vault write sys/policies/rgp/pki-ttl-guard \
[email protected] \
enforcement_level=soft-mandatory \
paths="pki/issue/*"Sentinel evaluates once a request that matches the target endpoint or role clears ACL. The evaluation can inspect the request path, operation type, and body data, as well as token metadata and the attached Identity entity and groups. This makes it possible to encode operations-aware rules such as 'only this group may issue with this parameter value' or 'block mutating operations outside business hours.'
In practice, the following are the most commonly used inputs. Exact attribute names may shift between versions, but the high-level shape — request (path/operation/data), token (policies/meta), and identity (entity/groups) — is stable.
Scoping EGP paths (example)
# 変更系(create/update/delete)でのみ評価したい場合は、
# ポリシー本体でoperationを条件化するのが確実。
# パスは広めに、操作はSentinel内で絞る構成が保守しやすい。
vault write sys/policies/egp/kv-change-guard \
[email protected] \
enforcement_level=hard-mandatory \
paths="kv/*"The example below permits mutating operations on KV paths under prod (e.g., kv/data/prod/...) only when the request is inside business hours and the token carries the metadata change_window=daytime. Reads are always allowed.
Operationally, you would pair this with a process that issues a token carrying this metadata only after a change advisory board (CAB) approval, for example.
Sentinel (EGP) sample: gate prod KV writes by time of day plus metadata
import "strings"
import "time"
# 営業時間帯(9:00-18:00)
allowed_write_window = rule {
time.hour(time.now()) >= 9 and time.hour(time.now()) < 18
}
# prod配下KVへの変更系操作か
is_prod_kv_write = rule {
strings.has_prefix(request.path, "kv/data/prod/") and
(request.operation == "create" or request.operation == "update" or request.operation == "delete")
}
main = rule {
if is_prod_kv_write {
allowed_write_window and token.meta["change_window"] == "daytime"
} else {
true
}
}Build the foundation with least-privilege ACLs, layer Control Groups on top for multi-party approval of critical operations, and add conditional Sentinel guards above that — this is both safe and realistic. High-risk operations such as issuing root tokens, long-lived PKI certificates, or transit key operations should be guarded with hard-mandatory.
The standard rollout pattern is to start with advisory to observe impact, move to soft-mandatory, and then escalate to hard-mandatory in stages. When using Namespaces, validate thoroughly in lower environments before promoting upward.
Escalating the enforcement level in stages (example)
# まずはadvisoryで導入
vault write sys/policies/egp/kv-change-guard \
[email protected] \
enforcement_level=advisory \
paths="kv/*"
# 振る舞いに問題がなければsoft→hardへ
vault write sys/policies/egp/kv-change-guard \
[email protected] \
enforcement_level=soft-mandatory \
paths="kv/*"
vault write sys/policies/egp/kv-change-guard \
[email protected] \
enforcement_level=hard-mandatory \
paths="kv/*"Sentinel can be unit-tested with its standalone CLI. Prepare mock inputs that mimic Vault's evaluation context (request/token/identity) and use sentinel apply/test to confirm the policy evaluates as expected. On the Vault side, the safe move is to roll out with advisory first and watch hits in the audit log.
Use Sentinel's -trace option to step through each branch and rule truth value when tracing an evaluation failure.
Local verification with mock input (example)
# policy.sentinel(前述の例)をローカルに保存
# mock.json: Vaultの評価コンテキストを簡易に模す
{
"request": {
"path": "kv/data/prod/app1",
"operation": "update",
"data": {"key":"value"}
},
"token": {
"meta": {"change_window":"daytime"}
},
"identity": {
"entity": {"name":"alice"},
"groups": ["devops"]
}
}
# テスト実行(パスは適宜修正)
sentinel apply -trace policy.sentinel -json mock.jsonThe exam frequently tests the division of labor between ACL and Sentinel, what EGP and RGP each apply to, and the differences between enforcement levels and how to use them in practice. Lock in the basics: a request that passes ACL can still be denied by Sentinel, and hard-mandatory is, as a rule, non-overridable.
Be ready for operationally-flavored questions too: the rollout flow (advisory → observe → escalate), using token metadata and Identity-based conditions, and verifying behavior via audit logs.
Checking and deleting policies (operations the exam likes to ask about)
# 作成済みポリシーの確認
vault read sys/policies/egp/kv-change-guard
vault read sys/policies/rgp/pki-ttl-guard
# 削除
vault delete sys/policies/egp/kv-change-guard
vault delete sys/policies/rgp/pki-ttl-guardOps
問題 1
Using Sentinel in Vault Enterprise, you want to enforce that PKI certificate issuance is limited to a specific CN domain and that the TTL is no longer than 24 hours. Which approach is most appropriate?
正解: C
RGP is the right fit for scrutinizing input parameters (CN, TTL) on a role-bound issuance operation. EGP is great for broad path-level control, but role-specific parameter validation is cleaner with RGP. ACLs cannot express parameter-level conditions at all.
Can I use Sentinel on the OSS version of Vault?
No. Sentinel Policies are a Vault Enterprise-only feature. The OSS edition does not include the advanced controls that Sentinel and Control Groups (also Enterprise) provide on top of standard ACLs.
What is the difference between soft-mandatory and hard-mandatory?
Both deny the request when evaluation fails. In practice, soft-mandatory is used during phased rollouts and for guards that may be overridden under controlled conditions, while hard-mandatory is the final, non-negotiable enforcement. Design override and exception handling to match your organization's policy.
Aren't ACLs enough? When does Sentinel actually pay off?
ACLs only express 'who can do what, where' — they cannot reason about runtime context such as time of day, token metadata, Identity attributes, or the contents of input parameters. When you have change-management or compliance requirements (e.g., no changes outside business hours, TTL caps, allowed CN domains), Sentinel is the right way to fill that gap.
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...