Tanflow IAM Suite & PAM: identity and privileged access security for the enterprise. Get a Demo →

12 June 2025 · Tanflow Ventures

Controlling SQL Sessions on Production Databases with Tanflow Command Control

Production databases hold the data that breaches expose, yet DBA sessions have long run unwatched. How SQL-level command control in Tanflow PAM blocks DROP statements on production and asks for a business justification before bulk reads.

The commands with the largest consequences in an enterprise are typed at a SQL prompt. A production database holds the customer records, balances and transactions, which are both the substance of the business and the substance of every breach notification. Database administration has nonetheless been the least governed privileged access of all: direct client connections, shared superuser accounts, and no record of queries beyond whatever the database's own logging happened to capture. One mistyped DROP or one unauthorised bulk SELECT is enough to turn a routine Tuesday into a reportable incident.

Harmful SQL looks like everyday SQL

Database sessions resist the usual controls because SQL is the legitimate work. A DBA's job is to run powerful statements, and without context the harmful ones look the same as the necessary ones. DROP TABLE is a disaster on production and housekeeping on staging. A full-table SELECT against the customer table is data theft in one context and an approved migration step in another. Network controls cannot see inside the session. Database-native auditing records events after the fact, in formats that suit DBAs more than investigators. Neither can stop anything.

Many PAM deployments stop at the database host

Many privileged access deployments govern the SSH session to the database host but lose sight of activity once a database client connects, because to them the SQL stream is just traffic. Tanflow's own market comparison lists SQL-level database session control as unavailable in open-source stacks and limited in legacy suites. In most enterprises, then, governance ends at the point where the most sensitive data begins.

How the Tanflow gateway handles SQL sessions

Tanflow PAM carries database sessions natively through its zero-agent gateway. Its coverage of fifteen-plus database CLI and GUI clients includes MySQL, PostgreSQL, MS-SQL and MongoDB sessions, so every control in the chain applies inside the SQL session itself. The DBA authenticates to the portal with MFA, is authorised for the specific database target, and gets a browser-based session with credentials injected from the vault. The work then runs under real-time command inspection, and the session is recorded end to end.

Command Control has four verdicts, and each one fits a different kind of database risk:

  • BLOCK + TERMINATE is for irreversible actions. DROP DATABASE and other destructive statements on production targets are stopped, the session is killed at once and the SOC is alerted.
  • BLOCK + NOTIFY is for actions that are wrong but recoverable. Risky operations outside change windows are stopped, while the session continues and administrators are informed.
  • JUSTIFY is for sensitive reads. Exporting customer tables or accessing payment logs goes ahead only after the user enters a business justification, which is logged with the event at the moment data leaves.
  • ALLOW + WARN is for discouraged legacy patterns that are still permitted. They run with a caution to the user and are flagged in the audit trail.

Policy distinguishes between targets, so production and staging databases can run under different rules: strict where the data is real and permissive where it is not. That keeps the control workable without a growing list of exceptions that would eventually make it meaningless.

Month-end maintenance at a bank

Consider month-end maintenance on a production database at a banking organisation. The DBA's access exists as a Just-in-Time window on Saturday night, following Tanflow's own change-window pattern. Inside the recorded session, routine statements run untouched. A schema change outside the approved script draws a block-and-notify. Exporting an account table for the reconciliation team requires a typed justification, which goes into the log beside the recording. By Monday the change file already holds the evidence the platform generated during the session: the window, the approvals, the replayable session, the command log and the justifications.

Evidence for database access reviews

SQL-level control records who connected to the database, what they asked it for and what the control did about it, which is the kind of evidence data-protection reviews increasingly ask for. Frameworks Tanflow maps against, including PCI DSS, the RBI Cyber Security Framework and ISO 27001, carry expectations for privileged database access that shared DBA accounts have failed for decades. Individual attribution, command-level enforcement and tamper-evident recording together address those expectations. There is a deterrent effect as well: someone who must write a justification before a bulk read is likely to think twice about it.

← All posts

See the platform behind the posts

The Tanflow IAM Suite and PAM run on your infrastructure and go live in 2-4 weeks.