TheRobotLearns Platform · ProxySQL: from first install to production

Firewall Whitelist, SQL Injection Engine, SPIFFE, and Audit Logs

  • about 12 min read

Learning objectives

  • Map ProxySQL's security feature layers to their enforcement functions.
  • Explain firewall whitelist permit-for-user-and-schema behavior and default denial.
  • Choose whitelist mode OFF, DETECTING, or PROTECTING based on enforcement strictness.
  • Explain libsqlinjection query-fingerprint analysis used to detect SQL injection attacks.
  • Explain SPIFFE ID regex validation of service identity documents.
  • Explain audit logging of connection events and query activity for forensic review.

Why you need security layers

You have to protect database infrastructure while clients and backends still exchange SQL. ProxySQL provides multiple layers of security features for that purpose. Each layer is a named feature, and each named feature applies one security job.

ProxySQL names five layers: Firewall Whitelist, SQL Injection Engine, SSL/TLS Configuration, SPIFFE Authentication, and Audit Logging. The Firewall Whitelist explicitly permits specific queries per user and schema, and it blocks all others. The SQL Injection Engine integrates libsqlinjection to detect potential SQL injection attacks by analysing query fingerprints.

SSL/TLS Configuration encrypts client-to-proxy and proxy-to-backend connections with TLS certificates. ProxySQL supports frontend SSL and backend SSL independently. SPIFFE Authentication authenticates services using SPIFFE Verifiable Identity Documents, called SVIDs, with configurable SPIFFE ID regex matching. Audit Logging logs connection events and query activity for compliance and forensics.

ProxySQL separates these features into layers. A query fingerprint check is one named feature. A whitelist permit rule is another named feature. Takeaway: ProxySQL protects database infrastructure with named layers: whitelist, injection engine, TLS, SPIFFE, and audit.

Control queries with whitelist modes

You allow one query for one user and schema, but you still want every other query to be denied. The Firewall Whitelist gives you that permit-and-deny shape. It explicitly permits specific queries per user and schema, and it blocks all others.

The whitelist feature supports three mode values: OFF, DETECTING, and PROTECTING. These values belong to the same whitelist layer. Each value is a mode setting for that layer. You select one mode value for the whitelist.

For a permitted user and schema, a query that matches the explicit permit is permitted. Queries that are not explicitly permitted are blocked. That default denial is the core behavior of the whitelist. The three mode names are the supported whitelist mode values.

The whitelist is separate from the SQL Injection Engine and from Audit Logging. The whitelist is the named layer that permits specific queries and blocks all others. Takeaway: Whitelist permits named queries per user and schema, blocks all others, and supports OFF, DETECTING, and PROTECTING.

Spot attacks, identities, and audit trails

You need to catch a potential SQL injection attack, verify a service, and review what happened. ProxySQL covers those jobs with three named security layers: SQL Injection Engine, SPIFFE Authentication, and Audit Logging.

The SQL Injection Engine integrates libsqlinjection to detect potential SQL injection attacks. The detection path analyses query fingerprints. The engine is a security feature layer, and it is separate from the Firewall Whitelist.

SPIFFE Authentication authenticates services using SPIFFE Verifiable Identity Documents, called SVIDs. SPIFFE ID regex matching is the configurable identity check. Audit Logging records connection events and query activity. Those records support compliance review and forensic review.

The audit layer is separate from the whitelist permit rule and separate from the injection fingerprint analysis. SSL/TLS Configuration is a separate named layer for encrypted connections. The Firewall Whitelist blocks all queries that are not explicitly permitted. Takeaway: The engine analyses query fingerprints, SPIFFE matches IDs, and audit logs record connection events and query activity.

Security layers in one query

SELECT 'Firewall Whitelist' AS layer, 'query permit rule' AS function
UNION ALL
SELECT 'SQL Injection Engine', 'query fingerprint analysis'
UNION ALL
SELECT 'SSL/TLS Configuration', 'connection encryption'
UNION ALL
SELECT 'SPIFFE Authentication', 'service identity regex'
UNION ALL
SELECT 'Audit Logging', 'connection and query audit';

The SELECT lists the security layer names and gives a short label for each function. It returns five rows: one row for each named layer. The first row is the Firewall Whitelist layer. The second row is the SQL Injection Engine layer. The third row is the SSL/TLS Configuration layer. The fourth row is the SPIFFE Authentication layer. The fifth row is the Audit Logging layer.

Sources

Do more with an account

Firewall Whitelist, SQL Injection Engine, SPIFFE, and Audit Logs — ProxySQL: from first install to production