All posts

IAM in JSON Schema, Explained

Many teams think IAM can be tacked onto any JSON document without a formal schema, but that assumption quickly leads to inconsistent permissions and hidden security gaps. Why teams fall into the unstructured IAM trap In practice, engineers often store permission maps in loose JSON files that grow organically. A developer adds a new action, another adds a resource identifier, and soon the file contains a mixture of camelCase, snake_case, and free‑form strings. Validation is performed only when

Free White Paper

Just-in-Time Access + AWS IAM Policies: The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

Many teams think IAM can be tacked onto any JSON document without a formal schema, but that assumption quickly leads to inconsistent permissions and hidden security gaps.

Why teams fall into the unstructured IAM trap

In practice, engineers often store permission maps in loose JSON files that grow organically. A developer adds a new action, another adds a resource identifier, and soon the file contains a mixture of camelCase, snake_case, and free‑form strings. Validation is performed only when a service crashes or an unexpected privilege escalation is discovered. The result is over‑permissive roles, duplicated entries, and a maintenance burden that scales with the number of services.

Because the JSON is never validated against a contract, a typo such as readr instead of read silently grants no access, while a missing effect field may default to an allow‑all rule in the consuming service. Without a schema, static analysis tools cannot catch these errors, and auditors have no reliable artifact to review.

The real starting state for many organizations

Typical deployments look like this: a shared repository holds a permissions.json file that is edited by multiple engineers. The file is checked into version control, but the CI pipeline does not enforce structural correctness. When a new service is spun up, the ops team copies the file, updates a few entries, and points the service at the same JSON blob. Access decisions are made by the service code itself, which reads the raw JSON at runtime. No gateway sits between the request and the resource, so there is no place to enforce a policy, no audit log of who queried which permission, and no way to mask sensitive identifiers before they leave the service.

In this unsanitized state, the setup determines who can request a change (the Setup layer), but the enforcement never happens. The request travels directly to the target database, Kubernetes API, or SSH daemon, and any mistake in the JSON is executed without review.

What a JSON schema adds – and what it still leaves open

A JSON schema can describe the exact shape of an IAM document: required fields, allowed values for actions, regular‑expression patterns for resource ARNs, and enum constraints for effect types. By validating every change against this schema, teams gain early feedback, prevent malformed policies, and create a single source of truth that can be versioned and reviewed.

However, validation alone does not stop a malicious or accidental request from reaching the target. The schema lives in the repository, but the runtime path still lacks a control point. The request still bypasses any approval workflow, there is no session recording, and no inline masking of sensitive identifiers such as account IDs. In other words, the precondition we fix is structural correctness; the gap that remains is the absence of a data‑path enforcement layer.

Introducing a data‑path gateway for IAM

To close the gap, the enforcement point must sit between the identity that initiates a request and the infrastructure that fulfills it. That gateway can evaluate the incoming request against the JSON schema, apply just‑in‑time approvals, mask sensitive fields in the response, and record the entire session for later replay.

hoop.dev provides exactly that. It is a Layer 7 gateway that proxies connections to databases, Kubernetes clusters, SSH endpoints, and HTTP services. By placing hoop.dev in the data path, every IAM‑related request is forced through a single control surface where policy can be enforced in real time.

Continue reading? Get the full guide.

Just-in-Time Access + AWS IAM Policies: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

How hoop.dev enforces IAM policies defined by JSON schema

When a user authenticates via OIDC or SAML, hoop.dev extracts the identity and group membership. The request then passes through hoop.dev’s policy engine, which references the JSON schema you have published. hoop.dev validates the shape of the request, checks that the requested action matches an allowed enum, and confirms that the resource pattern complies with the defined regular expression.

If the request meets the schema, hoop.dev can either grant immediate access or trigger a just‑in‑time approval workflow. If the request deviates, hoop.dev blocks the command before it reaches the target and logs the denial. For responses that contain sensitive identifiers, hoop.dev applies inline masking so that downstream logs never expose raw values.

Because hoop.dev sits in the data path, it also records each session, enabling replay for forensic analysis. Those recordings become the audit evidence needed to demonstrate compliance with internal policies or external standards.

Practical steps to adopt a schema‑first IAM strategy with hoop.dev

1. Define a JSON schema that captures all required IAM fields for your environment. Store the schema in version control alongside your permission files.

2. Deploy hoop.dev using the getting started guide. The quick‑start Docker Compose file creates a gateway and a network‑resident agent near your resources.

3. Register your IAM JSON document as a protected connection in hoop.dev. The gateway will hold the credential needed to talk to the target service, so users never see secrets.

4. Configure hoop.dev to reference the JSON schema for validation. When a request arrives, hoop.dev validates it, applies any required approval workflow, and records the session.

5. Use the feature documentation to fine‑tune masking rules, approval policies, and session retention settings.

By following these steps, you move from an ad‑hoc, unvalidated IAM model to a disciplined, schema‑driven approach that is enforced at the network edge.

Why the open‑source nature of hoop.dev matters

Because hoop.dev is MIT licensed, you can inspect the policy engine, extend the schema validation logic, or contribute improvements back to the community. The source code lives on GitHub, and the project welcomes pull requests that enhance security or add new connectors.

Explore the repository, read the contribution guidelines, and start shaping the future of runtime IAM enforcement.

FAQ

Do I still need to embed IAM checks in my application code?No. hoop.dev performs the checks at the gateway, so the application can rely on a single source of truth for permission validation.Can hoop.dev work with existing JSON schema tools?Yes. hoop.dev consumes any standard JSON schema, so you can continue using your favorite editors and validators.Is session recording optional?Recording is configurable; you can enable it for high‑risk resources and disable it where it isn’t needed.

Ready to see the code in action? Explore the source on GitHub and start building a schema‑first IAM pipeline today.

Open source

Save the open-source gateway for agent data access

Hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.

Star and save the repo →More posts