Skip to content

Connect a source to the gateway (Enterprise)

Enterprise only. This page is about the Portward gateway that a company runs in its own cloud. If Portward runs it for you, on the web, this page doesn’t apply: see the page for Portward on the web.

Portward reads each source where it is, with a login that can only read, and never writes to it. The gateway turns the values your admin marks as sensitive into tokens before the AI sees them. It records every answer in your cloud.

Each database has its own page with the exact grants to run. Files and business apps each have a page too. Get started, step 8 shows how to connect a source from the chat.

Source, as setup names itPageWhat setup asks for
PostgreSQLPostgreSQLHost, database, a read-only login
MySQLMySQLHost, database, a read-only login
SQL ServerSQL ServerHost, database, a read-only login
OracleOracleHost, service name, the tables’ schema, a read-only user
SnowflakeSnowflakeAccount, warehouse, database, schema, a service user’s key
Google BigQueryGoogle BigQueryProject, dataset, a service account
Amazon RedshiftAmazon RedshiftEndpoint, database, schema, a read-only user or IAM
Databricks SQLDatabricks SQLWorkspace host, SQL warehouse, catalog, schema, a service principal
Amazon S3, Google Cloud Storage, Azure Blob Storage and Data Lake Gen2File storesBucket or container, folder, a read-only key
Microsoft 365 (OneDrive), SharePoint document library, Google DriveFile storesA Microsoft or Google sign-in, and a folder
HubSpot, SalesforceBusiness appsA read-only key or app

Files can be Parquet, CSV or Excel (.xlsx, the first sheet). Google Sheets in Drive also work.

The gateway makes tokens inside each database, so it sends its token key to that database. For that reason, setup connects only to database hosts that the gateway’s operator has allowed in setup_hosts. You change the list here:

These rules apply to the list:

  • A host on a domain that other companies share needs its exact name, never a wildcard. This covers Amazon RDS, Aurora and Redshift endpoints (*.amazonaws.com) and Databricks workspaces. A wildcard there would let anyone’s database on that domain receive your token key.
  • Snowflake needs your account’s host, such as orgname-accountname.snowflakecomputing.com.
  • An S3-compatible or Azure storage endpoint that you type in setup needs its host on the list.
  • Amazon S3, Google Cloud Storage and Azure Blob Storage on their own endpoints, BigQuery, Microsoft 365 and Google Drive need no entry.

When you take a host off the list and restart the gateway, the connections to that host stop.

The gateway connects out to each source. Nothing connects in to the gateway from your sources.

  • AWS. The gateway runs as an ECS task in the VPC and subnets you chose. On the database’s security group, allow the database’s port from the gateway’s security group. The gateway’s group has a description that starts with “Portward gateway”. This works when the database is in the same VPC or a peered one. If the database is reachable only over the internet with an address allow-list, put the gateway in private subnets behind a NAT gateway and allow the NAT gateway’s Elastic IP. The task’s own public IP changes each time the task restarts.
  • Azure. The VM is in portward-vnet (10.40.0.0/24). Peer that network with your database’s network, or allow the VM’s static public IP, portward-ip, in the database server’s firewall.
  • Google Cloud. The machine runs in its own network unless you give a subnetwork. To reach a database by its public address, allow the machine’s external IP. With your own domain, that address is static (<name>-ip). With the relay, it can change when the machine is replaced.
  • Your own server. Allow the server’s address on the database’s firewall.

Every connection to a host that isn’t on the gateway’s own machine uses TLS. The gateway always checks the server’s certificate and host name, and there is no “encrypt but don’t verify” option. The gateway checks the certificate against these, in order:

  1. The server CA certificate pasted in setup’s optional Server CA certificate (PEM) field, if there is one. The gateway trusts only that CA for that connection. Use it for a company CA or Google Cloud SQL’s server CA.
  2. For Amazon RDS and Aurora hosts (*.rds.amazonaws.com), Amazon’s RDS CA bundle for every region. The bundle ships with the gateway. The gateway also trusts the public roots, because RDS Proxy endpoints use public certificates.
  3. The public CA roots, as a browser would.

A pasted CA must be PEM certificates (-----BEGIN CERTIFICATE-----), at most 64 KB and 20 certificates. Setup refuses a paste that holds a private key, and drops any text around the certificates. The gateway never logs the CA.

Each query has a time limit that the source itself enforces. Databases, files and business apps get 5 seconds (timeout_ms in the gateway’s [gateway] settings). Snowflake, BigQuery, Redshift and Databricks get 60 seconds (warehouse_timeout_ms), because a warehouse may queue the query or start up from suspended first. A source in the config file can set its own timeout_ms. Each limit is between 100 ms and 15 minutes.

Setup tests the connection before it saves anything. For a database, it signs in with the login you gave and refuses a login that is an administrator or can change the tables. It then lists the tables the login can read. For every database except PostgreSQL, it also checks that a token computed inside the database matches the gateway’s own. Setup lists tables the login could change, but you can’t expose them to the AI. Each source’s page says exactly what its check tests and what it says when it refuses.