An offboarded contractor still has a service‑account token baked into a JSON payload that a CI job reads every night. The pipeline runs, the token authenticates to a cloud API, and a handful of resources keep being created long after the contractor left. The same pattern shows up when a generic CI service account is copied across dozens of micro‑service definitions, each stored as a JSON schema file. The result is service account sprawl: a growing, unmanaged set of credentials that no one can track, rotate, or audit.
JSON schema is the contract that tells a program which fields are required, their types, and any validation rules. Because the schema lives alongside the data, it becomes the natural place to embed governance signals that limit how service accounts are expressed, stored, and consumed.
Why JSON schema can hide service account sprawl
Developers often treat a service‑account field as just another string property. The schema declares a type of string and moves on, allowing any value, including hard‑coded secrets, to pass validation. When dozens of repositories share the same schema, the same oversight spreads. The problem compounds because:
- Schema files are version‑controlled, so old versions linger in branches and forks.
- Automated generators copy the schema into new services without reviewing the credential fields.
- CI pipelines read the schema directly, trusting that the data it describes is safe.
Without explicit constraints, the schema offers no guard against accidental exposure, and the organization loses visibility into how many service accounts exist, where they are used, and whether they follow a rotation policy.
Embedding governance in the schema
To turn JSON schema into a control point, add declarative rules that describe the intended lifecycle of a service‑account property. Examples include:
- Mark the field with a format identifier such as "service‑account‑id" and require an accompanying metadata object that records the issuing team, creation date, and expiration.
- Limit the field to references that point at a central credential store instead of raw secrets by using an enumeration of allowed reference patterns.
- Apply a pattern constraint that rejects plain‑text tokens, forcing callers to provide a token reference.
- Define a custom annotation like "approval‑required" set to true, which downstream tooling can read to trigger a human review before the value is accepted.
These schema extensions do not change runtime behavior on their own, but they give any downstream enforcement layer a precise, machine‑readable policy to act on. When a CI job attempts to load a configuration that violates the rules, the job can fail fast, preventing the creation of an unauthorized service account.
hoop.dev as the enforcement point
Even with a well‑crafted schema, enforcement must happen where the data actually flows, between the identity that initiates a request and the infrastructure that consumes the service account. hoop.dev sits in that data path as a Layer 7 gateway. When a request passes through hoop.dev, it can:
