The Simplest Way to Make Json Rpc and Pulumi Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Using json rpc and pulumi together lets teams manage remote call services with code. Pulumi sets up the servers and permissions, while JSON RPC handles lightweight app messages. Teams use this pair to build fast internal services and blockchain nodes. Pulumi writes the cloud state and sets up network rules for every server. Then JSON RPC sends small, structured commands between those apps over the network. This workflow keeps server changes in version control while keeping message traffic fast.

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Using json rpc and pulumi together lets teams manage remote call services with code. Pulumi sets up the servers and permissions, while JSON RPC handles lightweight app messages.

Teams use this pair to build fast internal services and blockchain nodes. Pulumi writes the cloud state and sets up network rules for every server. Then JSON RPC sends small, structured commands between those apps over the network. This workflow keeps server changes in version control while keeping message traffic fast.

How json rpc and pulumi handle permissions and data flow

When you run json rpc and pulumi, each tool works at a different stage. Pulumi runs during deployment to create cloud resources, roles, and secret keys. It talks to your cloud provider API using an identity role or token. Once the servers start, Pulumi finishes its job and steps out of the way.

Next, the JSON RPC client and server start talking over HTTP or sockets. The protocol itself does not include a built-in login method or permission rule. Instead, it relies on the transport layer for security, like TLS and headers. Pulumi sets up those TLS certificates, firewall rules, and identity roles ahead of time.

During a call, the client sends a JSON message with a method name. The server checks the request headers against the rules that Pulumi put in place. If the key or token matches, the server runs the method and replies. Data flows straight between the client app and the server without touching Pulumi.

Common failure modes and how to scope roles

Many teams fail by using one broad service account for all Pulumi runs. If that key leaks, an attacker can change every server and network rule. Another common mistake is putting static API keys directly inside Pulumi state files. If you do not encrypt that state, anyone with read rights can steal keys.

On the JSON RPC side, teams often leave endpoints open on internal networks. Because JSON RPC uses a single URL for all methods, firewall rules cannot filter commands. A client that can reach the port can often call admin methods too. Also, unlogged requests make it hard to see who ran a sensitive command.

JSON Web Tokens (JWT) + Pulumi Policy as Code: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix this, give each Pulumi stack its own narrow cloud role. Use short-lived identity tokens from your CI runner instead of long-lived keys. Store all secret values in a dedicated secret store, not in plain text.

For JSON RPC, split public read methods from private admin methods onto separate ports. Use Pulumi to lock down the admin port to specific source IP addresses. Require strong token checks on every request before the server parses the JSON body.

Logging and auditing across both tools

Good logs help you track both server changes and runtime method calls. Pulumi keeps a record of who ran an update and what resources changed. You should send these deployment logs to a central log store for review.

For JSON RPC, you must log the method name and caller identity yourself. Standard web logs only show a POST request to a single path. Make sure your app logs the RPC method and request ID on every call. Mask sensitive fields like emails, phone numbers, card numbers, or national IDs in logs. Masking rewrites matched fields in results so raw secrets do not sit in storage.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Does Pulumi process JSON RPC traffic at runtime?

No, Pulumi only runs when you deploy or update your cloud resources. After the servers are up, JSON RPC traffic flows directly between your apps.

How should we store secrets for JSON RPC endpoints in Pulumi?

Always mark secret values as encrypted in your Pulumi state or use a cloud KMS. Pass those secrets to your JSON RPC servers as runtime variables, not plain files.

Why are JSON RPC calls hard to restrict with standard firewalls?

JSON RPC sends every command to the same URL path using HTTP POST. Standard network firewalls see the port and path, but not the method inside the body.

The query runs. The emails stay hidden.