Content Analyzers
Tollgate includes intelligent analyzers that inspect tool arguments to determine risk level. This enables dynamic policy decisions based on what an operation actually does.Available Analyzers
| Analyzer | Use Case | Inspects |
|---|---|---|
sql | Database operations | SQL statements |
filesystem | File system access | File paths |
shell | Command execution | Shell commands |
SQL Analyzer
Parses SQL statements to classify operations by risk:Risk Classification
| Risk Level | SQL Operations |
|---|---|
read | SELECT statements |
write | INSERT statements |
destructive | UPDATE/DELETE with WHERE clause, ALTER |
dangerous | DROP TABLE, TRUNCATE, DELETE without WHERE, GRANT/REVOKE |
Detection Examples
DoS Protection
The SQL analyzer detects resource-exhaustion patterns:WITH RECURSIVE- Can cause infinite loopspg_sleep(),SLEEP()- Denial of servicegenerate_series(1, 1000000000)- Memory exhaustionCROSS JOINwithoutLIMIT- Cartesian explosionUNION SELECT- Common injection pattern
Filesystem Analyzer
Analyzes file paths to determine risk:Risk Classification
| Risk Level | Operations |
|---|---|
read | Read operations on any path |
write | Write to normal directories |
destructive | Write to config files, dotfiles |
dangerous | Write to system directories (/etc, /usr) |
Path Detection
Shell Analyzer
Analyzes shell commands for dangerous patterns:Risk Classification
| Risk Level | Commands | |
|---|---|---|
safe | echo, pwd, date | |
read | ls, cat, grep, find | |
write | cp, mv, mkdir, touch | |
destructive | rm, rmdir | |
dangerous | rm -rf, sudo, chmod 777, `curl | sh` |