Why Proxmox VE API tokens need one owner, one role and one path each
Give each automation tool its own API token, with only the roles it needs on the paths it touches. A shared administrator token used by Terraform, Ansible, the backup job and the monitoring collector gives every one of them full control of the cluster, and when something goes wrong, nobody can say which tool made the change. The Proxmox VE REST API accepts requests from any identity that holds a valid token, so the access model is the only thing standing between a leaked CI variable and your hypervisors. The fix is a design decision you make before the first pipeline runs, not a cleanup project after an incident.
Proxmox VE user management separates the user from the token. A token belongs to a user, can be given its own identifier, and is checked against the same role and path permissions as any other principal. That separation lets you create a dedicated automation user per tool, mint one token per user, and grant each user a role on a specific path such as a pool or a single node. The user management model is where you decide these boundaries, and the Proxmox VE user management wiki is the reference to read before you define them. Confirm in your own environment which token options your installed version exposes, since the interface and field names are version dependent.
This matters most when several tools or people share the same cluster: multi-tool automation, shared CI runners, and audit requirements that ask who changed what. Each tool should have a named owner, a documented role, a list of paths, and an expiry or rotation date that the owner accepts. Before you start, inventory which tools touch the API, which paths each one needs, and which runners can reach the management network. Illustrative example: a monitoring collector that only reads node status should never hold a token that can create virtual machines. Ask your team to confirm that inventory in writing, because an undocumented token is usually the one that gets reused.
Token patterns for each automation tool
Provisioning tools create, clone, configure and sometimes destroy guests, so they need the widest write access of the four. The goal is to grant that write access on the resource pool or storage they actually use, not across the whole datacenter. A typical provider token needs rights to create and clone guests, allocate disk space on named storage, attach networks to named bridges or SDN zones and read node and template status.
- Scope to a pool or path: Put the guests Terraform manages in a resource pool and grant the role on the pool path, for example
/pool/terraform-dev, instead of on/. - Separate storage rights: Grant allocation rights on the specific storage IDs in
/storage/<id>so the token cannot fill or read unrelated datastores. - Limit network rights: Grant bridge or zone use only on the networks the plan requires, so a rogue plan cannot attach guests to management VLANs.
- Avoid Administrator on /: A datacenter-wide administrator token lets a compromised pipeline change users, permissions and host settings.
- Use an expiry and a dedicated user: Bind the token to a service user with a set expiry so a leaked token stops working on a known date.
Before relying on any of this, confirm the privilege names, role contents and path syntax against the installed Proxmox VE version, since the available privileges change between releases.
Ansible playbooks usually configure guests and hosts, or call the API for tasks such as adding a user or updating a firewall group. Many of these tasks run over SSH rather than the API, so the first question is whether the API token is needed at all. Where it is, the token should be limited to the configuration tasks in scope, often a narrower set of rights than provisioning.
- Decide API versus SSH first: Use SSH with a non-root account and sudo rules for host-level changes, and keep API tokens for tasks that genuinely need them.
- Restrict to read and configure rights: Grant configuration privileges on the pools or guests the playbook targets, and leave out guest creation and storage allocation.
- Split by environment: Use one token for staging and another for production, with production scoped to fewer paths.
- Keep secrets out of the repository: Store token values in a vault or the CI secret store, and reference them by variable name only.
- Avoid shared admin credentials: A shared root or administrator token used by many playbooks removes any record of which job made a change.
Confirm which privileges your Ansible collection calls against the installed release, because a playbook that fails with a permission error often needs one specific privilege added rather than a broader role.
Backup tooling mostly reads guest configuration and writes backup archives to a datastore. It rarely needs to create or change guests, so this token should be the most read-heavy of the set. The key right is the ability to back up to a target storage, and the key risk is a token that can also restore over live guests or delete backups.
- Grant backup rights on the target only: Allow the backup privilege on the datastore path that receives archives, for example
/storage/<backup-store>, and nothing on other storage. - Read guest configuration without change rights: Read access on the guests in scope lets the job record configuration without the ability to edit it.
- Keep restore rights separate: Restore and delete privileges should sit with a human operator role, not the automation token, so a stolen token cannot overwrite production.
- Review retention controls: Confirm whether pruning uses the same token and, if so, whether the role permits deletion of old archives.
- Use a short expiry with rotation: Backup schedules are long-lived, so pair the token with a calendar-driven rotation that the backup owner signs off.
Verify the exact backup and datastore privileges against the installed Proxmox VE version, and test a restore with the operator role to confirm the automation token cannot perform it.
Monitoring exporters poll the API for node, guest and storage metrics. They should be read-only by design, and a read-only token is the simplest case to get right. The main risk is not write access but exposure: a monitoring token with broad read rights reveals the full topology, user names and network layout to anyone who obtains it.
- Use a read-only role: Assign the built-in auditor-style role or a custom read-only role on the paths the exporter must see, such as
/nodesand the pool of monitored guests. - Avoid datacenter-wide read on sensitive paths: If the exporter does not need user or permission data, do not grant read rights on access-control paths.
- One token per exporter host: Separate tokens let you revoke one collector without breaking the rest of the monitoring stack.
- Store the token where the exporter runs: Limit file permissions on the exporter configuration so other local accounts cannot read the secret.
- Set an expiry and rotate on a schedule: Monitoring tokens are easy to forget, so attach an expiry that forces a visible renewal.
Confirm the read-only role contents and path names against the version you run, since an exporter that stops reporting after an upgrade often means a privilege was renamed or moved.
Token options and when each fits
This table compares the main token and access choices for Proxmox VE automation across blast radius, operational effort and audit clarity. Read each row as a dial: moving toward the narrower option usually shrinks what a leaked token can reach but adds setup and rotation work. Confirm the exact defaults for privilege separation and expiry in your own Proxmox VE version before you rely on them.
| Option | Trade-off | When it fits |
|---|---|---|
| Privilege-separated token | Token permissions are limited to what is granted to the token itself, so a leaked token reaches less than the user it belongs to. Each grant must be set separately, which adds effort. | Any tool that calls the API unattended, such as Terraform, Ansible, backup jobs or monitoring collectors. |
| Token without privilege separation | The token inherits every permission of its user, so blast radius equals that user's rights. Setup is simpler, but a leaked token is harder to contain. | Short interactive tests in a lab, or cases where the owning user is already a narrow automation account. Confirm the setting before use in production. |
| Short expiry | A token that expires forces periodic renewal, which adds a rotation step and can break jobs if no one plans for it. The exposure window for a leaked token is smaller. | Tools whose secrets are managed by a vault or CI system that can rotate them on a schedule. |
| Long-lived token | No renewal work, but a token copied into a script or pipeline can stay valid for as long as it exists. Review and revocation depend on a manual process. | Rarely justified for production automation. Acceptable only when you have a documented revocation and review process. |
| Path-scoped ACL | The grant covers only the pools, VM IDs, storage or node paths the tool needs. More entries to design and review, but a clear picture of what each tool can change. | Per-team or per-tool access, such as a backup job limited to storage and a Terraform run limited to one pool. |
| Cluster-wide grant | A single broad grant is quick to apply and easy to read. Any token or user holding it can act on every guest and storage target in the cluster. | Only for a tool that must see the whole cluster, such as a monitoring collector that reads state without changing it. |
| Dedicated automation user | Tokens belong to a separate account with no interactive login needed, so audit logs name the automation rather than a person. Requires one more account to manage. | Most automation estates, especially where several tools need different rights and reviewers must trace actions. |
| Tokens on an admin account | The token carries full administrator rights and mixes automated and human activity in the logs. Quickest to start, and the largest blast radius if exposed. | Not recommended for production. Confirm that every such token is removed before a security review. |
How to create and verify scoped API tokens
This sequence creates a dedicated automation user, a minimal custom role, path-scoped permissions and one privilege-separated token per tool, then proves each token can do its job and nothing more. The result is a set of tokens you can document, rotate and revoke without affecting other tools.
Create a dedicated automation user
Create one Proxmox VE user per tool, such as one for Terraform and one for backups, in the realm your administrators already use, or in the built-in Proxmox VE authentication server if that suits your setup. Do not reuse a personal administrator account or the root account. Keep these users out of interactive login groups so they exist only for automation. Confirm the user appears in the datacenter user list, with no group membership that grants broader rights than you intend. The check is a user record per tool with a clear purpose in its comment field.
Define a custom role with minimum privileges
Create a custom role for each tool that contains only the privileges its calls require, for example VM allocation and power control for a provisioning tool, or datastore backup rights for a backup tool. Start from the smallest set you can justify and add privileges only when a failing call shows they are needed. Check the role's privilege list against the API calls your playbooks or configuration make. Confirm the role exists and lists only the privileges you approved, with no administrative or user management rights.
Assign the role to specific ACL paths
Bind each automation user to its role at the narrowest ACL path that covers the resources it manages, such as a resource pool, a single storage, or a node-level path, rather than the root path. Use propagation deliberately, and check the ACL list for unexpected inherited grants from groups or parent paths. Confirm the effective permissions for each user match the design document. The check is an ACL table where every entry names one user, one role and one path you can explain.
Create one privilege-separated token per tool
Create a separate API token for each automation user with privilege separation enabled, so the token carries its own permissions instead of inheriting every right of the user. Set an expiry date that matches your rotation policy, and record it with the token's owner and purpose. Grant the token only the role and paths it needs, and confirm the token's effective permissions are the intersection you intend. The check is a token list where each entry shows privilege separation on, an expiry and a named owner.
Store token secrets in a vault
Copy each token secret once at creation time, because Proxmox VE does not show it again, and store it in your approved secrets manager, such as OpenBao or your enterprise vault. Give each tool read access only to its own secret, and keep secrets out of playbook repositories, shell history and CI variables that are visible to other projects. Confirm the secret is retrievable by the intended tool and not by other tools or people. The check is a vault entry per token with access limited to its consumer.
Test each token against its allowed calls
Run a read-only and a write call for each token against the resources it should manage, using the REST API or the tool itself. Confirm the allowed calls succeed and record the responses. Keep these tests in version control so they can be rerun after any role or ACL change. The check is a passing test result per token for every call on its approved list.
Confirm denied calls fail
Send calls the token should not be able to make, such as creating users, changing ACLs, touching resources outside its pool, or using another tool's storage. Each call should return a permission error, and the error should appear in the Proxmox VE task log. Do this with an expired token as well, to confirm expiry is enforced. The check is a documented denial for every out-of-scope call, which becomes the evidence that least privilege holds.
Run the full test in a non-production cluster first
Apply the users, roles, ACL paths and tokens in a non-production cluster before production, and run the allowed and denied call tests there first. Use your own environment to confirm that the Proxmox VE version you run behaves as documented, because privilege names and API behavior can change between releases. Ask your vendor or partner which version-specific checks they run. Promote the same definitions to production only after both test suites pass in the test cluster.
How Proxmox VE evaluates a token request
A privilege-separated API token has its own ACL entries, and its effective permissions are the intersection of those grants and the permissions its owning user holds on the same path. In practice, a token can never do more than its owner, and it can do less. If a user is granted a role on a path but the token has no ACL entry of its own for that path, the token gets nothing there. Readers should treat the token's ACL list as the real control surface for automation, and check both the user's grants and the token's grants when a call is denied unexpectedly. Token-level separation is set when the token is created, and the exact rules for how the two sets combine are documented in the Proxmox VE user management wiki, which should be the reference when you write your policy.
ACL entries are attached to paths such as /, /pool/<name>, /vms/<vmid> or /storage/<id>, and a grant on a path propagates to the objects beneath it when the propagate flag is set. This means a role granted on / reaches every node, guest, storage and pool in the cluster, including guests created months later. A Terraform token given PVEVMAdmin on the root path can therefore create and destroy any VM in the cluster. To keep the blast radius small, grant roles on the narrowest path that covers the work, such as a resource pool that holds only the guests that tool manages, and confirm with a test token in a non-production cluster that a grant on one pool does not reach guests outside it.
Before you finalize a token design, list every path each tool touches and the role it needs there, then verify the result with the token itself rather than the owning account. Ask your team to confirm the propagation behavior on the Proxmox VE version you run, since path handling and role contents have changed across major releases, and record the check in your change log. Doing this once per tool, and again after each Proxmox VE upgrade, catches the common failure where a token works in a lab with broad access and then fails in production, or where an overly broad grant on the root path goes unnoticed for years.
How tool tokens reach only their ACL paths
The diagram starts with four automation clients on the runner side of a trust boundary: Terraform, Ansible, backup and monitoring. Each one presents its own privilege-separated token to the Proxmox VE API on the management network. The API checks the token, its owning user, the ACL path and the role before it allows or denies the request. Check that every client maps to one token, that each path is as narrow as the task allows, and that denied calls fail visibly.
Each automation tool presents its own token, and the API grants only what that token's ACL path allows.
Security risks in token handling and how to reduce them
API tokens for automation are easy to create and easy to forget. The risks below share one root cause: a credential that is more powerful, more widely shared or longer-lived than the job it serves. Each card names the control and the habit that keeps it working for Proxmox VE tooling.
Secrets stored in CI variables or files
Token secrets often end up in CI/CD variables, plain .env files or Ansible vaults with weak access control. Store each token in a secrets manager or a CI variable marked protected and masked, and limit which pipelines and branches can read it. Check who can read the CI project settings, since those users can usually reveal the secret. Rotate the token when a maintainer with that access leaves.
Token leakage in logs and state
Terraform and OpenTofu state files can hold provider credentials in plain text, and verbose logs or debug output can echo request headers. Keep state in an access-controlled remote backend with encryption, and never commit state to version control. Check pipeline logs for the token header after changing debug settings. Treat any state file copied to a laptop as exposed.
Long-lived tokens outliving their tool
A token created for a migration project often keeps working years after the project and its owner are gone. Set an expiry date on every privilege-separated token, and record the owning tool and team in the token comment. Review the token list on a fixed schedule and delete tokens whose tool no longer runs. An expired token fails closed, which is the behavior you want.
Tokens shared across teams
One token used by Terraform, backups and monitoring means a leak exposes every workflow at once, and a rotation breaks all of them together. Issue one token per tool and per environment, so production and test automation never share a secret. Rotation then affects one workflow at a time. Ask who can request new tokens and require a ticket for each one.
Over-broad path grants
Assigning a broad role at the root path / gives a backup job the same reach as a cluster administrator. Bind each token to the narrowest ACL path and role that its task needs, such as a single pool for a monitoring exporter. Review propagation settings, because a grant at a parent path flows down to every child. Test each token with a read or write it should be denied to confirm the boundary holds.
Missing audit attribution
When every automation action appears under one shared identity, the cluster task log cannot show which tool made a change. Give each tool its own privilege-separated token so every API call names its source. Confirm that task logs and any external log forwarding record the token identity. Without this, an unexpected VM deletion cannot be traced to a pipeline, a person or an attacker.
How to rotate tokens without breaking automation
Rotate a token by creating its replacement first and retiring the old one only after the pipeline has proven the new secret. Give the replacement the same role and the same ACL path as the token it replaces, so the permission set stays fixed while the secret changes. Store the new secret in your secret manager under the existing key name, so the Terraform, Ansible, backup or monitoring job reads it without a code change. Run the job in a test window, starting with a read-only task, and confirm each expected API call succeeds. Then revoke the old token and record the change with the token ID, role, ACL paths, owner, date and the tools that consumed it. Check in the user management documentation how token secrets are shown after creation, because that determines where the secret must be captured.
Schedule rotation well ahead of each expiry date, with enough margin to repair a failed run before the token stops working. Keep a calendar entry per token, assign a named owner, and avoid rotation windows that overlap backups, patching or change freezes. Emergency revocation follows a different path. If a secret may have leaked, revoke the token immediately without waiting for a test window, then issue a replacement and restore the job. Before revoking, note which ACL paths and tools the token reached, so you can scope the review of Proxmox VE logs for actions taken since the suspected exposure. Pre-agree this runbook with the teams that own each automation tool, including who can reach them out of hours, because revocation will stop their jobs.
Limits to confirm before you rely on token scoping
Token scoping only protects you if the role set, the API calls and the realm behave the way your plan assumes. The cards below list what to check on your installed release before you grant any automation tool access, so the scope you document matches what the tool actually needs.
Confirm the Proxmox VE version and role set
Role names, default privileges and the permissions a role carries can change between releases, and Proxmox VE 9 is the current major line in the supplied release history. Run pveum role list on the installed host and compare each role's privileges with the scope you wrote down. Do not assume a role name from an older guide still grants the same rights.
- Current major release line
- Proxmox VE 9.0
Map the API calls each tool makes
Terraform providers, Ansible modules, backup jobs and monitoring exporters often call more endpoints than their documentation lists, and a missing privilege usually shows up as a 403 during a later run. Capture the calls in a test cluster, for example by reviewing the API access log or running the tool once with a narrow token. Record every path and privilege before you finalize the ACL.
Check for rights outside the expected paths
A VM provisioning run may also need access to a storage pool, a disk image path, a network bridge or a resource pool, and those objects sit on different ACL paths than the VM itself. Test each tool against a non-production copy of the scope and note which paths fail. Grant those extra rights only on the specific objects needed, and record the reason.
Review realm configuration for the automation user
The automation identity lives in a specific authentication realm, such as the built-in Proxmox VE realm, Linux PAM, LDAP, Active Directory or OpenID Connect. Confirm which realm the user is in, whether that realm enforces a second factor, and whether a directory change can alter the user's group membership or status. Interactive second-factor rules may not suit a non-interactive service account, so check how your realm handles that case.
User management docsTest token behavior on the installed release
Confirm on your own release how privilege separation, expiry and revocation behave for each token, since the documented options are the starting point, not a guarantee. Create a test token, check that its effective rights match the user-scoped intersection you expect, then revoke it and confirm the next call fails. Repeat this test after each upgrade before you rely on the same rotation procedure.
- Latest release in sources
- Proxmox VE 9.2
Questions teams ask before scoping Proxmox VE API tokens
Does a scoped token model take much more effort than one shared admin token?
Yes, it takes more up-front work, but the ongoing effort is usually small once it is built. A single admin token is quick to create and then gets shared across Terraform, Ansible, backup and monitoring jobs, so nobody can say which tool did what. A scoped model needs each tool's calls listed, a role for each tool, a path-based ACL for each scope, and an expiry and rotation routine. Most of the extra work sits in the first pass, when you find out which API calls each tool actually makes. Ask any partner to show the inventory and role mapping before they quote the build, since that document shows how big the job really is.
Can our own team build least-privilege API tokens without outside help?
Often yes, if you have someone comfortable with Proxmox VE permissions and your automation code. The Proxmox VE user management documentation covers privilege-separated tokens, roles and ACL paths, so the mechanics are documented. The harder parts are knowing which calls each tool makes, testing that a role is neither too narrow nor too broad, and keeping the design consistent as tools change. Teams often struggle when they try to do this on a production cluster. A test cluster lets them iterate safely. If nobody owns the permission model after go-live, drift is likely, so decide who will review it before you start.
What does the work need from our team before scoping starts?
Plan to provide three things: an inventory of the tools that call the API, a person who can make decisions about access, and a test cluster where roles can be tried without risk. The inventory should list each tool, the hosts or pools it touches, and the operations it performs, such as creating guests, reading storage status or running backups. Role design needs the owner of each tool to confirm what it needs. The test cluster should resemble production enough to surface permission errors. Ask the partner to state in writing which of these items they expect you to supply.
How long does a least-privilege token project take?
The duration depends mainly on how many tools and ACL paths you have, and on how many environments need the same model. A small setup with two or three tools on a single cluster is much shorter than a multi-cluster estate with CI pipelines, backup software and monitoring agents. No standard duration applies, so request a timeline in the written scope that lists the tools, clusters and testing steps covered. Ask for the time needed for the test cluster phase, because permission errors often surface there and can extend the schedule.
What drives the cost of a scoped token engagement?
The main drivers are the number of tools, the number of environments, the audit requirements and whether you already run a secrets vault. Each tool adds an inventory, a role and testing. Each extra cluster or environment repeats the work with its own paths and credentials. Audit needs add logging, evidence and review steps. If you already use a vault, token storage and injection may be simpler to design, while a new vault adds scope. Ask for a quote that separates one-time design and build work from any recurring review.
Do Proxmox VE support subscriptions change the token security features?
No. According to the Proxmox VE pricing page, all subscription tiers include the same software features, and the tiers differ in support entitlements and access to the enterprise repository. The software itself can be used without a subscription. Token privilege separation, roles and ACL paths are therefore the same whichever tier you pick. A subscription may matter for ticket volume, response times and production repository access, which affect how quickly you get help, not how the token model works. Confirm the subscription tier separately from the security design.
What does a retainer cover for token rotation and access review?
A retainer is an ongoing agreement for work after go-live, and its exact coverage depends on the written scope. Typical items include rotating tokens on a schedule, reviewing role assignments when tools change, checking that expired tokens are removed, and retesting permissions after Proxmox VE upgrades. Ask which of these are included, how often reviews happen, who receives the evidence, and how urgent requests are handled. Compare the retainer against the work done internally so you know what your team still owns.
Where the official Proxmox VE documentation covers user management
The authoritative reference for how API tokens fit into Proxmox VE access control is the Proxmox VE user management wiki. It covers the authentication realms (Linux PAM, the built-in Proxmox VE authentication server, LDAP, Active Directory and OpenID Connect), how users and groups are defined in each realm, and how a token is tied to a user and its permissions. Read it before writing any ACL, because the token model only makes sense once you know that a token's effective rights are the intersection of the token's own privilege separation setting and the rights of the user it belongs to. Use the wiki to decide which realm your automation accounts should live in, and keep those service accounts out of interactive realms where people log in.
The Proxmox VE administration guide introduction describes the cluster model that determines where a token must be valid. Proxmox VE clusters are multi-master, so every node can perform management tasks and the Proxmox Cluster File System replicates configuration to all nodes. In practice this means a token created on one node is usable against the whole cluster, so a leaked token exposes every node. That is a reason to scope ACL paths deliberately and to set expiry on each token, not only to rely on the cluster boundary.
Confirm the exact token syntax, the pveum commands and the list of predefined roles against the version you run before you copy any example into a Terraform provider, Ansible playbook or backup job. Role names and privilege sets change between releases, and the Proxmox VE 9 series is the current line in the supplied release history, so check the wiki page and your installed pveum role list output together. Record the version and the date you verified each role in your change log, so an auditor or the next engineer can see which definition the automation was built against.
How DeployOpen scopes and delivers API token hardening
DeployOpen plans the Proxmox VE automation access as a written scope: which tools need tokens, which ACL paths and roles each one gets, and how expiry and rotation will work. The work is then built, tested and handed over inside your own infrastructure, with documentation your operations team can run without us.
How we scope
- Inventory every tool that calls the Proxmox VE API, including Terraform or OpenTofu, Ansible, backup and monitoring jobs
- Map each tool to the ACL paths, roles and resource pools it actually needs, and record what it must not reach
- Agree token expiry, rotation cadence and owners for each identity in the written scope before work starts
- Engagements are fixed-scope, with deliverables and timelines agreed in writing; ongoing support is available as a retainer
How we build
- Create privilege-separated API tokens and custom roles in your cluster, following the scope, without reusing administrator credentials
- Test each token against its intended operations and confirm that requests outside its ACL paths are refused
- Store token secrets in your chosen secrets system and wire the tools to read them without plain-text copies in repositories
- Review the cluster's permission and audit logs for each tool to confirm access matches the agreed design
How we hand over
- Deliver a token register listing each identity, its role, ACL paths, expiry date and named owner
- Document the rotation procedure step by step, including how to revoke a token and update the consuming tool
- Walk your platform and security teams through the design and the reasons behind each permission boundary
- Provide a retest checklist your team can repeat after upgrades, new tools or changes to cluster permissions
How we support
- Offer retainer support for token rotation, new automation requests and reviews of permissions as tools change
- Re-verify token scopes after Proxmox VE upgrades so that role definitions and API behavior remain as designed
- Run continuous or periodic testing of the management API under a retainer if your security team asks for it
- Confirm with your team how often reviews happen and who approves new tokens before the handover is signed off

