Connect AnomalyArmor to any PostgreSQL-compatible database. This guide covers self-hosted PostgreSQL as well as managed services like Amazon RDS, Aurora, and Supabase.Documentation Index
Fetch the complete documentation index at: https://docs.anomalyarmor.ai/llms.txt
Use this file to discover all available pages before exploring further.
Supported Versions & Platforms
| Platform | Minimum Version | Notes |
|---|---|---|
| PostgreSQL | 12+ | Self-hosted or any cloud |
| Amazon RDS | 12+ | All instance classes |
| Amazon Aurora | PostgreSQL 12+ | Cluster and serverless |
| Supabase | Any | Direct connection or pooler |
| Google Cloud SQL | 12+ | Public or private IP |
| Azure Database | 12+ | Single server or flexible |
| Heroku Postgres | Any | Requires SSL |
Connection Settings
| Field | Description | Example |
|---|---|---|
| Connection Name | Friendly identifier | Production PostgreSQL |
| Host | Hostname or IP address | db.example.com |
| Port | Database port | 5432 |
| Database | Database name | myapp_production |
| Username | Database user | anomalyarmor |
| Password | User password | •••••••• |
| SSL Mode | SSL configuration | require |
SSL Mode Options
SSL (Secure Sockets Layer) encrypts the connection between AnomalyArmor and your database, preventing eavesdropping on sensitive data like credentials and query results. Why use SSL?- Security: Encrypts all data in transit, protecting against network sniffing
- Compliance: Required for SOC2, HIPAA, PCI-DSS, and other security standards
- Cloud providers: Most managed databases (RDS, Aurora, Cloud SQL) require or strongly recommend SSL
- Local development databases on
localhost - Databases on a private network with no external access
- Testing environments with non-sensitive data
Choosing an SSL Mode
| Mode | Security Level | Description |
|---|---|---|
disable | None | No encryption. Data sent in plain text. |
allow | Low | Uses SSL only if server requires it. |
prefer | Medium | Tries SSL first, falls back to unencrypted if unavailable. |
require | High | Always uses SSL, but doesn’t verify the server certificate. |
verify-ca | Higher | Uses SSL and verifies the server certificate is signed by a trusted CA. |
verify-full | Highest | Uses SSL, verifies CA, and confirms the server hostname matches the certificate. |
Recommendations by Environment
| Environment | Recommended Mode | Reason |
|---|---|---|
| Local development | prefer or disable | Convenience for local testing |
| Cloud databases (RDS, Aurora, Cloud SQL) | require | SSL is available; certificate verification often not needed |
| Production with compliance | verify-ca or verify-full | Maximum security for sensitive data |
| Heroku, Supabase | require | These platforms require SSL |
SSH Tunnel (Bastion Host)
For databases behind firewalls, AnomalyArmor supports SSH tunnel connections through a bastion host. This is common in enterprise environments where databases are not directly accessible from the internet.When to Use SSH Tunnel
- Database is in a private subnet with no public IP
- Firewall rules prevent direct connections
- Security policy requires bastion host access
SSH Tunnel Settings
Enable SSH Tunnel in the connection form to reveal these fields:| Field | Description | Example |
|---|---|---|
| SSH Host | Bastion server hostname | bastion.example.com |
| SSH Port | SSH port (usually 22) | 22 |
| SSH Username | SSH user on bastion | ec2-user |
| Authentication Method | Key or Password | Key |
| SSH Private Key | PEM-formatted private key | -----BEGIN RSA PRIVATE KEY-----... |
| Key Passphrase (Optional) | For encrypted keys | •••••••• |
| SSH Password | If using password auth | •••••••• |
Key-Based Authentication (Recommended)
-
Generate an SSH key pair (or use existing):
-
Add the public key to the bastion host’s
~/.ssh/authorized_keys - In AnomalyArmor, paste the contents of the private key file or click Upload Key File
Password Authentication
If your bastion host uses password authentication:- Set Authentication Method to
Password - Enter the SSH password
Connection Flow with SSH Tunnel
- AnomalyArmor connects to your bastion host via SSH
- An encrypted tunnel is established to your database
- Database traffic flows securely through the tunnel
- The tunnel closes automatically after each operation
Creating a Read-Only User
Create a dedicated user with minimal permissions.Verifying Permissions
Test that the user can access metadata:Provider-Specific Instructions
- Amazon RDS
- Amazon Aurora
- Supabase
- Self-Hosted
- Google Cloud SQL
Amazon RDS PostgreSQL
Connection Details:- Host: Your RDS endpoint (e.g.,
mydb.abc123.us-east-1.rds.amazonaws.com) - Port:
5432(default) - SSL Mode:
require
- Go to AWS Console → RDS → Your Instance → Security Groups
- Edit inbound rules
- Add rule:
- Type:
PostgreSQL - Port:
5432 - Source: AnomalyArmor IPs (see Settings → Security)
- Type:
- Ensure
rds.force_ssl = 1 - Download RDS CA certificate bundle
RDS instances in private subnets require NAT Gateway or VPC peering for AnomalyArmor access. Contact us for Enterprise VPC peering options.
Connection Pooling Considerations
If you use a connection pooler (PgBouncer, Pgpool):PgBouncer
- Transaction mode: Works with AnomalyArmor
- Session mode: Recommended for best compatibility
- Statement mode: May have issues with complex queries
Connection Limits
AnomalyArmor uses 1-2 connections during discovery. If you’re near your connection limit:- Use a read replica for monitoring
- Schedule discovery during off-peak hours
- Increase
max_connectionsif possible
What We Query
AnomalyArmor runs these types of queries:Troubleshooting
Connection refused
Connection refused
Causes:
- Firewall blocking the connection
- Wrong hostname or port
- Database not running
- Verify AnomalyArmor IPs are allowlisted
- Check security group rules (for RDS/Aurora)
- Test connectivity:
nc -zv hostname 5432 - Verify database is accepting connections
Password authentication failed
Password authentication failed
Causes:
- Wrong password
- User doesn’t exist
- pg_hba.conf not configured
- Verify password (copy-paste to avoid typos)
- Confirm user exists:
SELECT usename FROM pg_user; - Check pg_hba.conf allows the connection method
- Try resetting the password
SSL connection required
SSL connection required
Causes:
- Database requires SSL but connection uses
disable - Wrong SSL mode for the server
- Set SSL Mode to
require - For RDS/Aurora/Supabase: SSL is required
- For self-hosted: Enable SSL or allow non-SSL (not recommended)
Permission denied for relation
Permission denied for relation
Causes:
- User lacks SELECT permission
- Schema permission missing
No tables found in discovery
No tables found in discovery
Causes:
- User can’t see tables in information_schema
- Schema filter excluding all schemas
- Test as the user:
SELECT * FROM information_schema.tables LIMIT 5; - Check schema filter settings in AnomalyArmor
- Verify tables exist in the expected schemas
SSH tunnel connection failed
SSH tunnel connection failed
Causes:
- Invalid SSH credentials
- Bastion host not reachable
- SSH port blocked
- Test SSH connection manually:
ssh -i key.pem user@bastion.example.com - Verify SSH host and port are correct
- Check that AnomalyArmor IPs can reach the bastion host
- Ensure the SSH user has permission to forward connections
SSH authentication failed
SSH authentication failed
Causes:
- Invalid private key format
- Wrong passphrase for encrypted key
- Public key not added to bastion
- Verify key is in PEM format (starts with
-----BEGIN) - For encrypted keys, ensure passphrase is correct
- Check
~/.ssh/authorized_keyson bastion includes your public key - Verify SSH user exists on the bastion host
Common Questions
Which PostgreSQL-compatible services does AnomalyArmor support?
PostgreSQL 12+ self-hosted, Amazon RDS, Amazon Aurora (cluster and serverless), Supabase, Google Cloud SQL, Azure Database for PostgreSQL (single and flexible server), and Heroku Postgres. Any managed PostgreSQL that exposes the wire protocol on a network-reachable port works.What SSL Mode should I use for RDS or Aurora?
require is the right default - it encrypts traffic without pinning certificates. Use verify-ca or verify-full if your compliance program requires CA validation; you’ll need to upload the RDS/Aurora CA bundle in connection settings. Never use disable for managed cloud databases.
My PostgreSQL is only reachable through a bastion host. Can AnomalyArmor still connect?
Yes. Enable SSH tunnel mode on the connection, provide the bastion’s host, port, user, and an SSH key, and AnomalyArmor tunnels to your PostgreSQL through it. The bastion needs outbound access to your database on port 5432.Does AnomalyArmor support PostgreSQL logical replication or CDC?
Not for primary monitoring. AnomalyArmor monitors viainformation_schema and bounded aggregates on a schedule - it does not read the WAL or consume replication slots. For freshness, it uses MAX(timestamp_column), which works without replication.
How do I give AnomalyArmor access to future tables without re-granting permissions?
UseALTER DEFAULT PRIVILEGES so new tables created in the monitored schema automatically grant SELECT to the AnomalyArmor user:
GRANT SELECT ON ALL TABLES the first time.
Next Steps
Run Discovery
Scan your PostgreSQL database
Set Up Alerts
Get notified of schema changes
