Skip to content

ENG-30396: security on, and the PERMS oracle (milestone 28) - #27

Closed
jwiebema1 wants to merge 1 commit into
ENG-30396-sqlancer-m26from
ENG-30396-sqlancer-m28
Closed

jwiebema1 wants to merge 1 commit into
ENG-30396-sqlancer-m26from
ENG-30396-sqlancer-m28

Conversation

@jwiebema1

@jwiebema1 jwiebema1 commented Nov 10, 2026 •

Copy link
Copy Markdown

Milestone 28 of ENG-30396 (tracked in ENG-30581, epic ENG-30580 "SQL Housekeeping"): security on, and the PERMS oracle, which checks what each role may and may not do. Stacked on #26 (milestone 26), which is stacked on #25 to #21 and #20 to #1; review those first. Milestone 27 (SQLancer on Kubernetes) changes nothing here: it is VoltDB/pro#7123 and VoltDB/internal#6402.

The nightly job's 1-node run turns security on once VoltDB/internal#6403 is merged; VoltDB/pro#7124 gives run-jenkins-sqlancer-test.sh the run shape.

Why

Every run so far had security off. With it on, each statement passes VoltDB's permission check first. A statement a role should be refused that runs anyway (or that changes rows before it is refused), or one it should be allowed that fails, is a security bug. No oracle reads results as anyone but the administrator.

What it changes

  • run-sqlancer.sh --security: the deployment enables security with three users:
    • sqlancer, the administrator, whom SQLancer and voltadmin run as;
    • reader, role sqlancer_read, SQLREAD;
    • writer, role sqlancer_write, SQL.
    • It does not mix with the node failure, resize, crash, XDCR and upgrade options.
  • --security true (provider option): the provider creates the two roles once per run, when it first connects.
  • PERMS (oracle/VoltDBPermissionOracle) runs a statement as reader or writer:
    • Queries are allowed to both, and must return the administrator's rows.
    • Changes (INSERT, UPDATE, DELETE) are refused to the reader and allowed to the writer.
    • DDL is refused to both.
    • A procedure that changes or reads a table is created for the check and dropped after it; the reader may call only the one that reads.
    • Every refusal must be a permission error, and must leave every table's row count as it was.
    • At exit it prints how many allowed and refused statements it checked. Without --security it skips every check.
  • The README: a "PERMS" section, the options, the nightly table, the bug table.

Bugs found

Ticket Issue Workaround while --avoid-known-bugs is true
ENG-30627 Ad hoc DDL from a user without ADMIN is compiled before the permission check. DROP TABLE T by a reader, with a procedure reading T, fails with "[SECRET_P]: Failed to plan for statement ... SELECT COUNT(*) FROM T WHERE a = 42 ... object not found: T", disclosing the procedure and its SQL. DDL that compiles gets the permission error. While another catalog update runs, the refusal is "another one is in progress". Also on 16.0.0. Major. Reproduction: voltdb/repros/ENG-30627.sh. PERMS's refused DDL is CREATE TABLE of a new table, which always compiles; "in progress" is retried.

Testing

… 28: permissions)

With --security the deployment enables security with an administrator, whom SQLancer runs as, and the users reader
(role sqlancer_read, SQLREAD) and writer (role sqlancer_write, SQL), whose roles the provider creates. PERMS runs a
query, a change, DDL or a procedure call as one of them: allowed statements must succeed (a query with the
administrator's rows), refused ones must fail with a permission error and leave every table's row count as it was.
Found ENG-30627 (DDL compiled before the permission check, disclosing procedures' SQL), which PERMS avoids and which
has a reproduction in voltdb/repros.
@jwiebema1

Copy link
Copy Markdown
Author

Superseded by #51, which combines every ENG-30396 PR of this repo into one. This PR's branch is kept, and its description still has this milestone's details and lab results.

@jwiebema1 jwiebema1 closed this Nov 18, 2026
@jwiebema1
jwiebema1 deleted the ENG-30396-sqlancer-m28 branch November 25, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant