The API token that could do too much
The weekly operations dashboard has an ordinary job. It shows which remote sites have been checked, which maintenance tasks are overdue, and which jobs need attention from a human. During a routine review, someone notices that the dashboard's connection to the maintenance platform uses a credential with full administrator privileges. The dashboard has no button for deleting a site or changing an account. Its developers say it only reads information. Yet the credential could instruct the service to perform those actions if the dashboard were altered, compromised, or simply given a new feature without adequate review.
That is the danger of an API token that can do more than its program is supposed to do. The interface displayed to a user is not the same thing as the authority held by the software behind it. A read-only screen can be supported by a powerful service identity. If the identity can modify or delete resources, the system's true risk is determined by that permission, not by how harmless its buttons appear. The question for the automation team is how much authority the integration needs to complete its approved work, and how to make that boundary enforceable.
A token is a way for a client to present proof that a trusted issuer has granted it certain access. In a common pattern, the client includes a bearer access token with a web request, and the service verifies it before processing the request. Whoever obtains that bearer token may be able to use it for the permissions it conveys until the token expires or is otherwise invalidated. The token is therefore a credential, not a harmless piece of connection metadata. Protecting its value is necessary, but protecting its scope is a separate task.
For further study, the Bare Metal Cyber Wiki material on API token scope design is useful here. Read it with the dashboard case in mind: a credential may be safely stored and still grant excessive authority. The design question is which resource and action permissions the program should possess before anyone attempts to use them.
The dashboard originally borrowed the administrator credential from a provisioning workflow. That workflow created new maintenance sites, installed monitoring connections, and occasionally retired old accounts. The dashboard only needed to list sites and read maintenance status. Reusing the same credential spared the team some setup work, but it joined two different trust decisions. Now any failure in the reporting component had the potential to become a provisioning or deletion incident. The teams shared a credential because their systems talked to the same service, not because their business responsibilities were the same.
The first repair is to give the dashboard an identity of its own. Instead of a human administrator's reusable token, the integration can use a dedicated application identity with permissions chosen for its reporting function, where the platform supports that model. A separate provisioning identity retains only the approved write operations it requires. This separation improves both security and investigation. A read made by the dashboard should be attributable to the dashboard, and a change to a site should not appear to come from an identity that was designed solely for reporting.
Authentication answers who or what is calling. Authorization answers what that caller may do. Those questions are related but not interchangeable. A service might validate the signature of a token, confirm that it has not expired, and still reject the request because the token lacks the required permission. A client can also possess a valid token for a different service; the intended audience must be checked where that token model applies. Accepting a token simply because it looks correctly formed would leave the service vulnerable to credentials issued for another purpose.
Permissions are often described as scopes or roles. A reporting scope might allow reading maintenance sites. A provisioning role might allow creating or editing them. Different platforms model these grants differently, and the details matter. A scope name is not proof that a caller can access every object in an organization. Nor is a general read permission proof that it may retrieve every sensitive field. A responsible service evaluates the granted permission together with the particular target resource and the applicable business policy.
Suppose the dashboard serves three regional maintenance teams. A technician assigned to the west region should not receive full details about the east region simply by changing a site identifier in a request. The service must check whether that identity is permitted to read that specific site. This is sometimes called object-level authorization. A token can be valid and have a useful read scope while the requested object is still outside the caller's approved boundary. Relying only on the client to hide unauthorized site numbers is not sufficient. The server has to enforce the restriction.
Some services authorize at an even finer level. The dashboard may be allowed to see whether a maintenance job is overdue but not the private contact information of every employee assigned to it. That is a property-level decision. A broad endpoint that returns everything and depends on the dashboard to ignore sensitive fields creates unnecessary exposure. If the service supports carefully scoped queries or field permissions, the integration should request and receive only the information its purpose requires. If it cannot limit the data, the team needs an additional trusted service boundary rather than assuming unseen fields are harmless.
You may encounter a different identity arrangement when automation acts for a signed-in employee. In a delegated model, the client receives access associated with that user and the permission the user or administrator has approved. A background application may instead have its own application permissions without any person signed in. These models are not interchangeable. A nightly inventory task cannot depend on a particular employee remaining logged in, while an action that a user is expressly choosing may need that user's context and business authority. Granting application-wide rights just to avoid handling delegated permissions could expand the impact of a software defect.
Even inside a single integration, not all operations need the same trust. The dashboard needs to read sites and statuses. A remediation workflow may be permitted to acknowledge a maintenance ticket. Another process can retire a site only after approval. Those should be separate capabilities with separate evidence requirements. If the API groups all three functions behind one broad administrator role, the organization may need an intermediate service that exposes a narrower approved operation and holds the more powerful credential behind stronger controls.
In that design, the dashboard asks the intermediary for a limited report. The intermediary checks the caller, decides which region and fields it may receive, and asks the underlying platform for only the necessary information. If a site-retirement workflow needs privileged access, it uses a different path with a separate approval and audit record. This adds a component to maintain, so it should solve a real authority problem rather than simply disguise a privileged token in another location. The control must actually narrow what the less-trusted caller can cause to happen.
The distinction becomes clear when a developer proposes storing the administrator token in a secure secret vault. That is good for protecting the token at rest and controlling which workloads can retrieve it. It does not make the token's broad permissions appropriate. If the dashboard can retrieve the secret and invoke administrative operations, the dashboard still has those powers. Storage controls and authorization design address different failure modes. Both need attention, and neither can be used as evidence that the other is complete.
Likewise, a short expiration time reduces how long a stolen token may remain useful, but it does not reduce what the token can do while valid. A token that can delete every maintenance site for ten minutes may be more dangerous than a read-only token valid for several hours. Token lifetime, allowed actions, accessible objects, and the ability to revoke access are separate controls. They have to be chosen in proportion to the work being performed and the damage a mistake could cause.
For a practical review exercise, the AutoOps+ Cyber Challenge practice associated with Bare Metal Cyber can help you compare two integrations that have the same successful connection but different permissions. Try deciding what each identity should be unable to do. Good access design is easier to verify when you name the forbidden operations as clearly as the allowed ones.
Look at the service request itself. Many web APIs expect the access token in a request header, sent over a properly validated encrypted connection. Placing a bearer token in an ordinary request address is risky because addresses are often captured in logs, diagnostics, browser history, or intermediaries. A token also should not be copied into error messages or pasted into a support ticket. When someone needs to diagnose a failed request, a request identifier, timestamp, target identity, and sanitized permission information are more appropriate evidence than the credential value.
In the dashboard case, the team changes the credential handling so the workload receives its token through an approved secret or managed-identity mechanism rather than a shared file embedded in the application package. Access to that credential is restricted to the reporting service. The token is never displayed to the browser user. A user may be allowed to see a report without receiving the credential that the server uses to construct it. That separation is essential, because a credential placed in a downloadable web client cannot be treated as a secret from the people who run that client.
A secure integration also plans for credential changes. The service identity needs an owner, a process for renewal or rotation, and a way to revoke access after an incident. Rotating a token without preparing dependent workloads can produce an outage. Leaving an old credential usable indefinitely after a rotation defeats the containment benefit. The team should know which processes depend on each identity, how to update them, and what evidence confirms the previous credential is no longer accepted.
Audit records help, but only if identities are distinguishable. When five services share one administrator token, a change recorded under that token may not reveal which service caused it. Distinct identities allow investigators to connect an operation to a workload and an approved function. The audit should capture the relevant target and the authorization decision while avoiding unnecessary sensitive data. An account's broad ability to perform an action is not the same as proof that a particular use was justified.
The team must also distinguish an authentication problem from an authorization problem during troubleshooting. A response that the client is unauthenticated may reflect an expired or invalid token, a wrong audience, or missing authentication. A response that the client is forbidden may mean its identity is accepted but not allowed to perform the operation. Some services conceal resource existence and may answer differently for security reasons, so a single response never tells the whole story. Testing with a more powerful token can help diagnose a permissions issue in a controlled environment, but permanently changing the production service to run as an administrator would convert a troubleshooting shortcut into an enduring risk.
When the reporting identity is ready, the team tests more than whether the dashboard still loads. It verifies that the identity can read the approved maintenance statuses and cannot change a site, retire a connector, or retrieve another region's private records. These negative checks make the least-privilege claim concrete. They also catch a server that validates the token's general read scope but fails to enforce authorization for individual objects. A well-scoped token is one control; correct server-side enforcement remains another.
A common objection is that future features might need additional access. That is a reason to review permissions when the feature is approved, not to grant everything in advance. If the dashboard later gains a ticket-acknowledgment function, the team can decide whether it belongs in the same service identity, a new operation, or an independently authorized workflow. That change should carry evidence of who can acknowledge which ticket and under what conditions. Future convenience is not a sufficient justification for current unrestricted authority.
There is a related operational risk when a credential is too narrow for an actual approved task. A maintenance workflow may fail because it can read a site but cannot update a required field. The correct response is to identify the minimal missing permission, confirm the exact resource boundary, and revise the identity through the approval process. A team should neither assume every permission error is a security attack nor treat failures as permission to elevate the account indiscriminately. Least privilege is a practical engineering discipline, not a promise that no permissions will ever need adjustment.
By the end of the review, the dashboard has its own read-focused identity, the provisioning workflow uses a separate identity, and privileged actions are constrained to the services that actually need them. The team documents the expected audience, permissions, resource boundaries, lifetime, rotation owner, and negative tests for each credential. It also checks the platform's own access controls, because a carefully configured client does not compensate for a server that lets any authorized token edit every customer or site.
The larger lesson is that an integration carries authority even when nobody is watching its screen. To judge an API token, look beyond whether the connection works and whether the secret is hidden. Establish whose identity it represents, which service will accept it, which actions it can request, which resources and fields it can reach, and how those limits are enforced. A reporting dashboard should never inherit the power to dismantle the infrastructure it is supposed to describe.