How to Configure Cats Mask Data Preparation

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up cats mask data preparation to scrub sensitive fields before testing APIs. This setup replaces live values in test payloads with safe dummy data. Teams often pull real payloads to test how an app handles traffic. If you do not mask those records, private user details leak into logs. Good rules rewrite matched fields in results before the test run starts. You can redact emails, phone numbers, card numbers, and national IDs during preparation. This keeps your test suites safe while keep

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.

You set up cats mask data preparation to scrub sensitive fields before testing APIs. This setup replaces live values in test payloads with safe dummy data.

Teams often pull real payloads to test how an app handles traffic. If you do not mask those records, private user details leak into logs. Good rules rewrite matched fields in results before the test run starts. You can redact emails, phone numbers, card numbers, and national IDs during preparation. This keeps your test suites safe while keeping data shapes valid.

How cats mask data preparation works in practice

The cats mask data preparation step runs before your fuzzing or testing job starts. It reads raw input files or sample payloads from your source storage. Then it applies pattern rules to find sensitive strings inside those files. When a rule finds a match, it swaps the real value with a fake one.

This setup affects automated test runners, build jobs, and developers who read test logs. You should set safe defaults for every data job you run. Start by turning on redaction for all known personal data patterns. Make sure your rules replace card numbers and emails with valid format strings. If an API expects a ten-digit phone number, the fake string must match that format. Otherwise, the schema check will fail before the real test even runs.

You should also scope the storage roles for the preparation job. Give the worker role permission to read raw samples only from a staging bucket. Write the scrubbed output to a separate clean folder for the test tool. Never give the test runner role permission to read the raw staging folder. This split keeps a faulty test job from pulling unmasked records by mistake.

How to check your rules and close session gaps

Before you run a full test suite, check your masked output files by hand. Pick a small batch of prepared payloads and scan them for missed patterns. Look for edge cases where emails or national IDs sit inside nested text fields. Standard key matching can miss sensitive strings hidden inside free-form notes. You can add pattern rules that scan full strings to catch those cases.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Next, check your audit logs to confirm who ran the preparation job. Every read against the raw sample store should show a clear user or job role. If a shared key runs the job, you cannot tell which person started it. Swap shared keys for short-lived role sessions tied to a specific team member.

Static file preparation has clear limits once a live database session starts. Preparing static JSON files protects your API fuzzing runs, but engineers still query live data. When a developer logs into a production database to debug an error, file rules do not help. Once the database checks the role at login, every query returns raw rows. A single broad query can pull thousands of real card numbers onto a local laptop. Static preparation also cannot stop an engineer from running a bad update command. To protect live data during fixing, you need controls that work inside the active session.

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

What fields should we scrub during test data setup?

You should scrub emails, phone numbers, card numbers, and national IDs first. Masking rewrites matched fields in results so test logs do not store raw values.

Why do API tests fail after we mask payload values?

Tests fail when the dummy text breaks the format rules of the target API. Make sure your masking rule outputs valid shapes, like a valid email format.

Does static file preparation protect live database queries?

No, static preparation only scrubs the batch files you feed into test tools. Live database sessions still return unmasked rows unless you filter results on the fly.

The query runs. The emails stay hidden.