Other clients
sqlite3, mongosh, sqlcmd, clickhouse-client and cqlsh under shellfirm wrap.
sqlite3
shellfirm wrap sqlite3 app.dbshellfirm: protecting sqlite3 (79 checks from database; checking statements ending with ';' on Enter)
DROP TABLE t;
============ RISKY STATEMENT DETECTED (shellfirm wrap:sqlite3) ============
Statement: DROP TABLE t
Check: database:drop_table
Severity: CRITICAL
Description: Dropping a table permanently deletes all of its data.
Escalated to Yes (from Math): severity CRITICAL
[CRITICAL] Type `yes` to continue (Esc or Ctrl-C to discard the statement)- Dot-commands that run files or programs are followed:
.read FILE,.shell …, and.once/.output/.importwith'|cmd'. - SQL on the command line (
sqlite3 app.db "DROP TABLE t") is checked before sqlite3 starts.
mongosh
shellfirm wrap mongosh "mongodb://db.internal/app"shellfirm: protecting mongosh (16 checks from mongodb; checking statements ending with ';' or a complete line on Enter)
db.dropDatabase()
============ RISKY STATEMENT DETECTED (shellfirm wrap:mongosh) ============
Statement: db.dropDatabase()
Check: mongodb:interactive_drop_database
Severity: CRITICAL
Description: Dropping a MongoDB database will permanently delete all its data.
Escalated to Yes (from Math): severity CRITICAL
[CRITICAL] Type `yes` to continue (Esc or Ctrl-C to discard the statement)- A statement is checked at
;or when the line is complete. load(FILE)is followed, andmongosh --evaland script files on the command line are checked before mongosh starts.mongosh -p PASSWORDis stored as-p ***in the audit log.
sqlcmd (SQL Server)
shellfirm wrap sqlcmd -S db.internal -U sasqlcmd runs a batch at GO, so shellfirm checks the batch on a ; or a GO
line. A real session (TRUNCATE TABLE orders, then GO):
shellfirm: protecting sqlcmd (79 checks from database; checking statements ending with ';' or a GO line on Enter)
TRUNCATE TABLE orders
GO
============ RISKY STATEMENT DETECTED (shellfirm wrap:sqlcmd) ============
Statement: TRUNCATE TABLE orders
Check: database:truncate_table
Severity: CRITICAL
Description: Truncating a table permanently deletes all of its rows.
Escalated to Yes (from Math): severity CRITICAL
[CRITICAL] Type `yes` to continue (Esc or Ctrl-C to discard the statement)Declining keeps the session:
shellfirm: statement discarded; your sqlcmd session is still open.!!cmdand:!! cmdlines are checked as shell commands.:r FILEincludes are followed.sqlcmd -Q/-q/-i FILEon the command line are checked before sqlcmd starts. The shell hook andshellfirm checkreadsqlcmd -ifiles the same way.
clickhouse-client and cqlsh
shellfirm wrap clickhouse-client --host ch.internal
shellfirm wrap cqlsh cassandra.internalStatements end at ; and are checked against the database checks.
clickhouse-client -q "…" and cqlsh -e "…" / -f FILE are checked before the
client starts.
Not listed?
Any program can be wrapped with an explicit tool type and delimiter. See Custom tools.