ROUA for Redis

A read-only Redis user with ACLs that actually stop writes.

An ACL user that can run read commands on your key patterns only, with no KEYS, CONFIG, MONITOR, EVAL or pub/sub, and only a password hash in the script. Works with Valkey too.

  • 9 databases
  • Runs entirely in your browser
  • No sign-up, no tracking, no network requests
  • Free and open source

The usual way, and what it misses

ACL SETUSER readonly on >password ~* +@read
  • ~* is every key, including sessions and tokens.
  • +@read includes KEYS, which can stall a production server.
  • The password is in plaintext, and the default user may still be open with nopass.
  • Redis users never expire.

What the ROUA scripts do instead

  • %R~ read-only key permissions on the patterns you list, and no channels.
  • -@all +@read +@connection, then removes @write, @dangerous, @admin, @scripting and @pubsub.
  • Stores the SHA-256 of the password (#hash), never the password.
  • The audit uses ACL DRYRUN to prove SET, DEL, FLUSHALL, CONFIG, KEYS, EVAL and PUBLISH are refused, and flags an open default user. Tested on Redis 7.2, 7.4 and Valkey 8.

Limits to know

  • Redis has no user expiry: schedule revoke.redis.
  • Key patterns apply to every logical database.

Create a read-only Redis account Audit an existing Redis user

Know Redis well? Something here wrong, missing or worth adding? Tell us about Redis or share an idea.

Most “read-only” accounts aren’t.

Hidden write paths

A role it inherits, a table it owns, a procedure it can run, a default grant: any one of them turns “read-only” into read-write.

Secrets in plain sight

Password hashes, API tokens, card numbers and MFA seeds sit in ordinary columns that a plain SELECT can read.

Never switched off

The demo ends, the contractor leaves, the agent is retired. The account stays, and forgotten accounts are where breaches start.

What every ROUA guarantees, on every database

  1. No write path of any kind. No writes, no schema changes, no procedures, no ownership, no roles that could add them.
  2. Never reads secrets. Secret-looking columns are hidden automatically; you add anything the detector misses.
  3. An owner and an expiry. Every account names who is accountable and switches itself off on a date.
  4. Instant revoke. One script locks the account and ends its open sessions.
  5. Checked before handover. An audit script proves all of the above. Run it any time, on any account.

Create a read-only account

Pick your database, describe the account, and download the scripts. Your password never leaves this page.

1. Choose your database

2. Describe the account

Account

Database
Your schema (optional, recommended)

Not sure what your tables are called, or want to be certain nothing is missed? Run this read-only script, paste its output, and pick tables from a list. You will see exactly what the account can read before you generate anything. Nothing leaves this page.

1. Get the discovery script

          

Scope

Limits and network
Sign-in

Your scripts appear here.

You get a setup script, an audit script that proves the account is read-only, a revoke script, and a clean-up script.

Check an account you already have

Is your “readonly” user actually read-only? Get an audit script for any existing account. It only reads, so it is safe to run on production.

Account to check

Choose a database and an account name, then Get the audit script.

It checks for write privileges, inherited roles, ownership, secret columns, missing expiry and more, with one PASS, WARN or FAIL line per check.

Supported databases

Full: complete toolkit with the roua CLI, masking and live verification. Tested: every change runs the generated scripts against the real engine in CI, logs in as the account and proves writes fail. Preview: built from the vendor’s documentation and not yet run against a live service; review before use, and tell us what breaks.

DatabaseSupportVersionsLevelsHow ROUA works thereAlso covers
PostgreSQL
Full13 to 17L0–L5Full ROUA: levels L0 to L5 with masking, CLI apply, audit and live verify.Amazon RDS and Aurora, Google Cloud SQL and AlloyDB, Azure Database, Supabase, Neon, Crunchy, Timescale
MySQL
Tested in CI8.0, 8.4, 9L1, L2Per-table and per-column SELECT computed at setup, caching_sha2 verifier, locked by a scheduled event at expiry.Amazon RDS and Aurora MySQL, Google Cloud SQL, Azure Database for MySQL, Percona Server
MariaDB
Tested in CI10.6, 10.11, 11.4L1, L2Per-table and per-column SELECT computed at setup, password hash only, locked by a scheduled event at expiry.Amazon RDS for MariaDB, SkySQL
SQL Server
Tested in CI2022 (tested), 2017+, Azure SQLL0, L1, L2Login with a hashed password, per-object SELECT, column DENY for secrets, database-wide DENY on every write.Azure SQL Database and Managed Instance, Amazon RDS for SQL Server
Oracle Database
Tested in CI23ai (tested), 19cL1, L2READ (not SELECT, so no row locks) per table, a dedicated profile, and a scheduler job that locks the account at expiry.Oracle Autonomous Database, Amazon RDS for Oracle, Exadata
MongoDB
Tested in CI6.0, 7.0, 8.0L0, L1, L2A custom role with find on chosen collections only (no readAnyDatabase), SCRAM-SHA-256 and optional client IP restriction.MongoDB Atlas (use the Atlas notes), Percona Server for MongoDB
Redis
Tested in CI7.2, 7.4, Valkey 8L1, L2An ACL user limited to read commands on your key patterns, no dangerous or admin commands, no pub/sub, hashed password.Valkey, Amazon ElastiCache and MemoryDB (RBAC), Azure Cache for Redis, Redis Cloud
Snowflake
PreviewcurrentL0, L1, L2A dedicated role with point-in-time SELECT (no future grants), key-pair login, no secondary roles, and DAYS_TO_EXPIRY.
Google BigQuery
PreviewcurrentL0, L1, L2A service account with table-level Data Viewer, and query rights that expire through an IAM condition.

Giving an AI agent database access

Three steps

  1. Create a ROUA above with the AI agent profile. Leave out tables the agent has no business seeing.
  2. Put its connection string in the agent’s environment or MCP server configuration, never in a prompt or a repository.
  3. Let the agent explore, query and explain. If it tries to change anything, the database refuses.
{
  "mcpServers": {
    "database": {
      "command": "your-database-mcp-server",
      "env": { "DATABASE_URL": "postgres://roua_agent_docs:@db.internal/appdb" }
    }
  }
}

Know the limits

  • Read-only is not “nothing leaves”. Anything the account can read, the agent can repeat. Scope it to what the agent should know.
  • Expensive queries are still possible. Use the connection and time limits, and a small warehouse on cloud warehouses.
  • Applications need their own guard. For demo and app-review accounts that click through your app, pair ROUA with ROUA-App, which blocks writes at the API.

Who uses read-only accounts

AI agents

Text-to-SQL, coding agents and MCP servers that learn your schema and answer questions.

App review

Store and marketplace reviewers who must try every feature without touching real data.

Demos and training

Sales demos and workshops on synthetic data, with accounts that expire after the event.

Auditors

Internal and external auditors who need to see, never to change, with masked personal data.

Vendor support

Short-lived access for a support session, revoked the moment it ends.

BI and analytics

Dashboards and analysts reading aggregates, with limits that keep costs predictable.

Profiles and levels

Profiles: why the account exists

ProfileMax lifetime
AI agent agent90 days
Demo demo30 days
App review review45 days
Auditor audit30 days
Support support7 days
Training training14 days
Analytics analytics180 days
Custom custom365 days

Levels: what it can see

LevelCan read
L0 MetadataStructure only: schemas, tables, columns, types. No rows.
L1 PublicOnly objects you list as public (catalogs, reference tables).
L2 OperationalBusiness tables minus your deny-list and all secret columns.
L3 AnalyticalOnly aggregate views you list. No base tables.
L4 MaskedAll in-scope tables through generated masked views. No base tables.
L5 Full (break-glass)All in-scope data unmasked, still never secrets. Max 24 hours, two approvers.

All levels are available on PostgreSQL. SQL Server, MongoDB, Snowflake and BigQuery also offer L0; the other databases offer L1 (only what you list) and L2 (everything in scope minus exclusions and secrets). See the Levels column above.

Questions

Is it safe to type a password into this page?

Yes. The page is a single file that runs entirely in your browser. Its security policy forbids every network request, so nothing you type can be sent anywhere. You can save the page and use it offline. Where the database accepts it, the scripts contain only a password hash (PostgreSQL, MySQL, MariaDB, SQL Server, Redis), never the password.

Why not just use GRANT SELECT ON *.*, db_datareader or a built-in read role?

Built-in read roles cover every table, including tables created next year, and they include tables full of secrets. They also leave whatever else the account inherited untouched. ROUA starts from nothing, grants read per table as it exists today, hides secret columns, denies writes explicitly where the database supports it, and adds an expiry.

What if my database doesn't have the tables or columns I expect, or changes later?

The scripts look at your real database when they run, not when they are generated. Under "Your schema", paste the output of the read-only discovery script to pick tables from a list and preview exactly what the account will read. The preview flags missing schemas, misspelled table names and hidden-column entries that match nothing, and blocks scopes that would read nothing. Setup checks again on the server: it refuses an empty scope and reports names that do not exist. Tables created later stay closed. On PostgreSQL, MySQL, MariaDB and SQL Server, grants are per column, so a column added later (even a secret one) stays hidden until you run setup again. On other databases, the audit catches secret-looking columns that became readable.

What happens when the account expires?

PostgreSQL: the password stops working (VALID UNTIL), and roua expire ends open sessions. MySQL and MariaDB: a scheduled event locks the account and ends its sessions. SQL Server: an Agent job disables the login. Oracle: a scheduler job locks the account. Snowflake: DAYS_TO_EXPIRY. BigQuery: query rights end through an IAM condition. MongoDB and Redis have no scheduler, so you schedule the revoke script; the audit flags it if you forget.

Does it work with managed databases?

Yes, as long as you have an administrator account: Amazon RDS and Aurora, Google Cloud SQL and AlloyDB, Azure SQL and Azure Database, Supabase, Neon, Oracle Autonomous Database and others. Each database in the table above lists the services it covers. Some checks that need superuser (such as reading pg_hba.conf) report a warning instead.

Does read-only stop data from leaving?

No, and nothing that can read can promise that. Read-only means the account cannot change or destroy anything. Decide what it may see with the scope, the exclusions and, on PostgreSQL, masking.

Can I use this in automation?

Yes. On PostgreSQL, the roua CLI plans, applies, verifies and revokes accounts from a roua.yaml file (npx @roua-dev/cli audit --role readonly), also as a Docker image (ghcr.io/promisegithub/roua). The GitHub Action fails a build when an account stops being read-only. AI agents can use the ROUA MCP server. For other databases, the generated scripts are plain files you can keep in version control and run in a pipeline.

Who is behind ROUA?

The term ROUA (Read-Only User Account) was coined by Promise Okoroji. ROUA is an open standard (draft 0.1) with Apache-2.0 tools. Reviews of the spec, bug reports and attempts to break the audit are very welcome on GitHub.