Custom certificate issuance policies with CEL in OpenBao PKI

CEL programs let an OpenBao PKI role decide which certificates it may issue beyond built-in fields. This page covers how to write, test and own those policies in infrastructure you control.

On this page

When a PKI role needs CEL policies beyond its built-in fields

An internal CA team reaches the limits of its role settings when issuance rules depend on information the role cannot see, such as subject naming patterns tied to an asset inventory, or key constraints that differ by device class. In these cases a Common Expression Language (CEL) program can evaluate each certificate request against a policy the operator writes, and the operator stays responsible for every check that program performs. OpenBao does not validate the policy's intent for you, so a CEL rule that is too permissive will issue certificates just as quickly as a correct one.

This approach suits PKI teams that already maintain their own naming standards, device inventories or approval logic, and that can test policy changes before they reach production mounts. It does not replace the role's built-in fields, which remain the first line of control for allowed domains, key types and TTLs, and it does not replace review of the CA hierarchy, key custody or audit logging. Illustrative example: a team might allow a host certificate only when the requested common name appears in an inventory export it has already reviewed, while the role still caps the maximum TTL. Confirm the exact CEL functions, object fields and the ValidationOutput result shape against the OpenBao release you run, because no CEL reference was supplied for this page, and treat the release notes and the PKI documentation for that version as the source of truth before writing any policy.

Every certificate request passes the operator's CEL program before anything is signed

The diagram starts with a client submitting a CSR or issuance request to a PKI role on the OpenBao cluster. The role's CEL program, written and owned by the operator, evaluates the request and produces a ValidationOutput result. Only an accepted request moves on to signing and storage, and a rejected one never reaches the CA key. Check that the operator-owned policy step is the only gate between the request and the signature, and that the cluster boundary covers every component that touches the issuing key.

The operator-owned CEL step gates every signature inside the OpenBao trust boundary.

How CEL programs and certificate templates fit together

A CEL program in OpenBao PKI is a yes or no decision about one certificate request. It receives the data the request carries, such as the subject and alternative names, together with the values the PKI role supplies, and it returns a verdict that OpenBao uses to allow or refuse issuance. The program sees only what it is given. It does not check your asset inventory, ownership records or identity systems unless that data is passed into the evaluation or the check happens in a system in front of the mount. Design the inputs first, because a policy can only be as strict as the information it can test.

The ValidationOutput object is where that decision is recorded. Each program produces one, and OpenBao reads its result when it evaluates the request, so the expression and the output it reports determine whether a certificate is issued. Certificate templates supply the other side of the comparison. A template fixes the shape of what the role will issue, including fields such as the subject, names and key parameters, and the policy checks the request against those values. A field the template does not define is a field the policy cannot reason about, so an unexpected name or key size can pass unnoticed if no expression tests it.

The operator owns every validation step. The policy decides only among what the request contains and what the role allows, so every field that matters to your security model must be constrained, fixed or tested explicitly. Before you rely on a program, list the fields that identify a workload and its owner, decide which values are acceptable for each, and confirm that each one is either set by the role or checked in the expression. Then review the current OpenBao PKI documentation for the exact object names, function behavior and template syntax in the release you run, since these details can change between versions. Test each program against valid and invalid requests before it reaches production.

Choosing between CEL policy, role constraints and external checks

This table compares three places where an issuance rule can live: standard role parameters, a CEL program on the role, and checks in an external system. Read each row against the rules you must enforce, since the layers differ in what they can see and who keeps them correct. In most deployments the strongest result comes from combining them, with each rule placed where it can be checked reliably.

Decision pointStandard role parametersCEL program on the roleExternal check
What it enforcesAllowed domains, key types and sizes, TTL limits, and whether names may be wildcards or subdomainsLogic over the parsed request, such as combinations of fields, conditional rules, and custom name patternsBusiness approval, inventory membership, ownership of a hostname, or a human sign-off before signing
What it cannot seeRelationships between fields, request context beyond the listed parameters, and anything outside the requestData outside the request unless you add a custom function, and anything the CEL environment does not exposeThe moment of issuance unless the workflow blocks on it, and any request that bypasses the external path
Who maintains itThe PKI team, through role configuration that the built-in options coverThe PKI team, which writes, tests and versions the expression and any custom functionsThe team that owns the external system, such as the identity, CMDB or ticketing team, plus the integration owner
Failure mode to plan forOverly broad parameters that allow more than intended, often introduced when a role is copiedExpressions that evaluate differently than the author expected, so each change needs a test against sample requestsOutages or slow responses in the external system that either block issuance or, if misconfigured, fail open
Best fitBaseline limits that every role should carry, such as an allowed domain suffix and a maximum TTLRules that depend on more than one field or on the shape of the request, where the built-in parameters are not enoughRules that depend on state held outside OpenBao, such as approvals or asset ownership, which must be current at issuance
Evidence an assessor can reviewRole definitions exported and reviewed under change controlThe expression text, its version history, and test results against known requestsApproval records, integration logs, and the configuration that connects the workflow to the PKI role
Typical layeringSet first as the baseline for every roleAdded where a baseline rule needs a condition that parameters cannot expressAdded for rules that need current data, with the PKI role still enforcing the baseline if the check is skipped

Writing and testing a CEL issuance policy in OpenBao

This sequence turns informal certificate issuance rules into a CEL program on a PKI role, tested first in a non-production mount and applied to production only with a tested rollback. The result is a role whose accept and reject decisions match the rules their owners approved, with evidence for each decision.

  1. Inventory issuance rules and their owners

    The PKI owner and the teams that request certificates list every rule the role must enforce, such as permitted domain suffixes, key types, maximum validity, and required subject fields. Each rule gets a named owner who can approve changes and confirm intent. Write the list in a shared document and keep it under version control. The step is done when every rule has an owner and a one-line statement of what a compliant request looks like.

  2. Map each rule to a request field

    For each rule, identify the field the policy can read: the requested common name or SANs, the key type and size, the requested TTL, or metadata supplied by the caller. Confirm in the OpenBao PKI documentation for your release which request and role fields are exposed to the CEL program, and record any rule that has no matching field. Rules without a field either need a different control outside the policy or a change in how requests are made. The step is done when every rule maps to a field or is flagged for a decision.

  3. Write the CEL program in a non-production mount

    The PKI engineer writes the CEL program against the ValidationOutput object in a separate, non-production PKI mount that uses the same release as production. Confirm the mount and role configuration keys, the function list, and the custom function behavior in the docs for that release before writing the program. Keep the program small and reviewable, with one check per rule. The step is done when the program compiles and the role accepts the configuration without errors.

  4. Test accept and reject cases

    The team issues requests against the test role for each approved case and each rejected case, then reviews the ValidationOutput returned for each sample. Include edge cases such as wildcard names, mixed case domains, missing SANs, boundary TTLs, and unexpected key types. Compare every result with the expected decision from the rule inventory. The step is done when all accept and reject cases match expectations, and any mismatch has either a fix or a documented owner decision.

  5. Confirm audit entries for rejected requests

    Using the test environment's audit device, the team checks that each rejected request produces an audit log entry with the decision and the reason the policy returned. The reviewer confirms that the entries contain enough detail for an investigator, and that no certificate material is logged where it should not be. Confirm audit device behavior and log fields in the docs for your release. The step is done when each rejection type appears in the audit log with a clear reason.

  6. Review the policy with rule owners

    The PKI owner walks each rule owner through the CEL program, the test results, and the audit output. Owners sign off in writing that the program implements their rule as intended, and open an issue for any gap. Changes are recorded in version control with the reviewer's name. The step is done when every rule owner has approved the program and every open gap has a recorded decision.

  7. Apply the policy with a tested rollback

    The team applies the program to the production role during an agreed change window, after saving the current role configuration as a backup. They run the same sample requests against production and compare the results with the test outcomes. A rollback procedure, which restores the saved configuration, is rehearsed before the change. The step is done when production results match the test results and the rollback has been confirmed to restore the previous behavior.

  8. Monitor rejections after go-live

    The operations team watches audit logs and certificate request failures for the first period after the change, and compares them with the expected rejection pattern. Unexpected rejections go back to the rule owner before the policy is changed. The team records any policy update through the same test and review steps. The step is done when the monitoring period ends with no unexplained rejections and the policy is handed to routine review.

What custom functions can and cannot reach

A CEL program can only decide on the data and functions it is given. These five components set the boundary of what a PKI role's policy can judge, and each one needs a check in the OpenBao documentation and in your own test suite before a policy goes live.

Request data the program receives

The program evaluates the incoming certificate request, including the subject, names and other attributes the caller supplies. Which fields the program can see, and in what form, depends on the request type and the release you run. Confirm the exact input object in the OpenBao PKI documentation for your version, then write a test request for each field your policy reads, including empty and malformed values. Never assume a field is present.

Certificate template fields

Roles and templates decide which fields the issued certificate can carry, such as validity, key usage and extensions. A program can accept, reject or narrow a request, but the role still sets the baseline. Confirm which fields the program can change and which the role fixes, because a rule that appears to set a value may have no effect on the certificate actually issued. Check each test certificate with openssl x509 to see what was written.

Custom functions the operator adds

CEL programs can call functions beyond the standard library only when the platform registers them. Whether OpenBao offers a registration point for custom functions, and how such functions are declared and versioned, is a question the current documentation must answer before you design around it. Any custom function becomes part of your PKI control surface, so give it a named owner, unit tests and a review step before each upgrade.

External data the policy cannot fetch

Do not expect a policy to call a directory, an asset inventory, a ticketing system or a DNS service during evaluation. Ownership checks, asset lists and approval status must reach the policy through data loaded in advance or through a process outside the PKI mount. Confirm in the documentation that the program has no outbound network access, then design the lookup path and its freshness limits before you write the rule.

State carried between requests

Treat each evaluation as independent. A policy that counts issuances per subject, remembers an earlier request or depends on time-based counters needs a state mechanism, and none should be assumed. Confirm how the program is evaluated for each request and whether any state persists. Enforce rate limits and issuance quotas in a layer you can test, and record each decision in your own logs.

Security responsibilities for CISOs and PKI engineers

Your organization owns the issuance rules, even when the PKI team writes them. OpenBao evaluates the CEL program attached to a role, but it does not decide whether a subject name, key type or validity period is acceptable for your environment. A permissive or incorrect policy produces certificates your organization must answer for, so each rule set needs a named business owner and a documented approval record.

  • Ownership of issuance rules. Name one accountable owner for each class of certificate, such as internal web services or device identities. The owner approves what the role may issue, including allowed names, key types and maximum lifetimes.
  • Separation of duties. The person who writes or edits a CEL program should not be the only person who approves it. Require a second reviewer from security who did not author the change, and record both identities in the change ticket.
  • Evidence for reviewers. Keep the policy source, test results and approval record together so an auditor can see which rule was in force on a given date. Ask the PKI team for an export of the active policy and its version history.
  • Exception handling. Decide in advance who may approve a temporary broader role, how long the exception lasts and how it is removed. Track each exception as an open risk item with an expiry date.

Check that every production role has a named owner, a second approver and a dated record of the policy in force.

How much effort does a CEL issuance policy rollout take?

What drives the effort of a CEL issuance policy rollout?

The effort follows the number of rules, the number of PKI roles they govern, the shape of your existing CA hierarchy and whether an external approval system must be called before issuance. Each rule needs a written intent, a CEL program, positive and negative test certificates and a review by the team that owns the policy. Roles that share one CA and one set of naming conventions are cheaper to cover than roles spread across several mounts or namespaces. Every external approval hook adds integration work, error handling and a second system to test against. Ask any provider to break the estimate down by these four drivers instead of quoting one number.

Can an in-house PKI team write and maintain CEL issuance policies?

Often yes, provided the team already runs OpenBao PKI and has someone comfortable reading CEL and the ValidationOutput object. The harder part is not the syntax but the validation design: deciding which fields are trusted, what the operator must check independently and how a rule fails closed. A common split is for the in-house team to own the rule catalog and approvals while an outside specialist reviews the first set of programs and the test suite. Confirm with your own engineers whether they have time for regression testing each time the rule set changes.

What does the rollout need from our team?

Plan for named rule owners who can state, in plain language, which certificates a role must and must not issue. You also need a pool of test certificate requests covering valid, borderline and clearly invalid cases, plus access to a non-production OpenBao cluster that mirrors the production PKI mount. Production changes should happen in agreed change windows, with a rollback step written down before the change. Security or compliance reviewers should sign off on the rule set, since the operator owns all validation and cannot hand that responsibility to the software.

How does the OpenBao release and our environment change the timeline?

The OpenBao version you run determines which CEL features, functions and PKI behaviors you can rely on, so the first task is to confirm them against the release notes for your exact version. The OpenBao project publishes its releases on GitHub; for example, v2.7.0 was released on September 23, 2026 and v2.7.1 on October 1, 2026. Upgrading a cluster before the rollout adds its own change window and testing. Environments with several clusters, namespaces, HSM-backed keys or external approval systems take longer because each one needs its own test pass. Ask for the timeline to be tied to a named version and environment list.

What recurring work comes after the policies go live?

Policies change when issuance needs change, when a new role is added, when a CA is rotated or when a new OpenBao release alters behavior. Each change needs its test certificates rerun, a review of the rule owner's intent and a record of who approved it. Budget for periodic reviews that compare issued certificates against the rule set, because a policy that passed testing can drift as roles and naming conventions evolve. This recurring work is usually the largest long-term cost, so ask whether a quote covers it as a one-time build or as a support retainer.

What should a quote for a CEL policy rollout list?

A written quote should list the in-scope PKI mounts and roles, the number of rules and their owners, the external systems involved, the OpenBao version and environments covered, and the test cases you will receive. It should name the deliverables, such as the CEL programs, the test suite, runbooks and the handover session, and state what is excluded, such as CA rotation or ACME setup. Ask how retesting after changes is priced and whether ongoing maintenance is a separate retainer. DeployOpen works from a written scope with agreed deliverables and timelines, and does not publish a price list, so the quote follows from that scope.

Who is responsible if a CEL rule wrongly allows an issuance?

The organization running the PKI remains responsible, because OpenBao evaluates the rules but does not decide what your policy should be. A rule that is too permissive or misreads a field will issue the certificate it was written to allow. This is why rule intent must be reviewed by people who understand your trust model, and why tests should include negative cases. A provider can help design and test the rules, but accountability for the issuance policy stays with your team and your auditors.

Limits to confirm in your OpenBao environment

A CEL issuance policy is only as dependable as the release, code path and data it runs against. The items below are the points to confirm with the project documentation and your own tests before you write policy logic, since each one can change what a role actually permits.

CEL functions and output fields

Confirm which CEL functions, helper libraries and ValidationOutput fields exist in the exact release you run. The v2.7.1 release was published on October 1, 2026, and earlier minor lines may expose a different set. A policy written against one release can fail or evaluate differently on another, so test each program on the version in production and on the version you plan to upgrade to.

Release notes

Coverage across issuance paths

Determine whether the policy is evaluated for every route that issues a certificate, including direct API issuance, CSR signing and ACME orders. If one path bypasses the program or applies a different role configuration, a certificate can be issued that your policy was meant to block. Test each path with a certificate that should be rejected.

Performance under complex programs

Each issuance evaluates the CEL program, so long expressions, large lists or repeated parsing of certificate fields add latency to every request. Measure issuance time with your expected rate and with the program you intend to deploy, especially if ACME clients renew many certificates at once. Ask the project whether evaluation cost is documented for the release you run.

Effect on existing certificates

Changing a policy does not automatically revoke or re-check certificates already issued. Confirm how a tightened program affects renewals, re-issuance from the same key and the certificates that remain valid until expiry. Document which teams own the decision to revoke, and test the renewal path before you change production rules.

Error reporting to clients

Check what a rejected request returns to the caller and what appears in the server audit log. Clients need enough detail to correct a CSR or request, but the message should not expose internal policy logic. Verify the error text for ACME clients as well, since they may display or retry failures differently from direct API callers.

Data the policy cannot evaluate

A program can only judge fields that are present in the request and exposed to CEL. Confirm which subject, SAN, key and extension fields are visible to the evaluation, and whether data that lives outside the request, such as directory group membership or an asset inventory, can be reached at all. Where it cannot, plan a separate control and record that gap as a known limit.

How DeployOpen scopes and delivers CEL issuance policies

DeployOpen plans, builds, tests and documents CEL issuance policies for OpenBao PKI roles inside your own infrastructure. The work starts from a written scope that names each role, its allowed identities and the evidence your security and compliance teams need to review.

How we scope

  • Inventory every PKI role and the certificate types, names and key types each one must issue.
  • Write down which CEL checks the operator owns, including subject, SAN, lifetime and key rules.
  • Agree the written scope, deliverables and timeline before any policy code reaches your cluster.
  • Define which test cases count as acceptance, including rejected requests and edge-case names.

How we build

  • Write CEL programs against the documented ValidationOutput object and the role templates you chose.
  • Add custom functions only where a documented built-in cannot express a rule your policy needs.
  • Test each program with allowed and denied certificate requests in a non-production mount first.
  • Keep policy files in version control so every change has a reviewer and a recorded history.

How we hand over

  • Deliver a policy document mapping each rule to the business or security requirement it enforces.
  • Provide the test suite and the exact commands used to run it, so your team can repeat it.
  • Train operators on how to add rules, review denials and roll back a faulty program safely.
  • Record which validation remains in your hands, since the operator owns all issuance decisions.

How we support

  • Offer ongoing support and upgrades as a retainer when your OpenBao release line changes.
  • Retest policies after upgrades, since CEL behavior tied to a version should be confirmed.
  • Review policy changes requested by application teams before they reach production.
  • Confirm with your own team what recurring testing and review cadence your audit process expects.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.