Skip to content
VPNDetection

Azure Blob Storage

Have each new build of VPNDetection's databases written to your Azure Blob Storage container, with a container SAS token you generate and can revoke.

View as Markdown

VPNDetection writes each new build of the databases you choose to a container of yours in Azure Blob Storage, with a shared access signature (SAS) you generate for it. What lands there, and when, is on Database Delivery.

A container SAS gives VPNDetection access to that one container until the SAS expires, and you decide when that is. Generated on a stored access policy, it can also be revoked at any moment without touching the storage account's keys.

Before you begin

  • The Manage database delivery permission in your organization, which owners and admins have.
  • A license for at least one database. Every organization holds the Open databases from the start.
  • The storage account and the container, and the Azure CLI with access to the storage account's key.

1. Generate a SAS for the container

Generate a SAS for the container. Here the storage account is acmedata and the container databases:

bash
az storage container generate-sas --account-name acmedata --name databases \
  --permissions racwdl --expiry 2027-12-31 --https-only --auth-mode key -o tsv

racwdl is read, add, create, write, delete and list, which covers everything delivery does in a container: writing and replacing files, and deleting dated folders under Every build. A SAS made this way stays valid until it expires or the account key that signed it is rotated. To be able to revoke it without rotating a key, create a stored access policy on the container and pass --policy-name instead of the permissions and expiry.

The container's SAS URL is its address with the token after a ?:

https://acmedata.blob.core.windows.net/databases?se=2027-12-31&sp=racwdl&spr=https&sv=2022-11-02&sr=c&sig=...

2. Add the destination

In the console, under Database > Delivery, click Add destination and pick Azure Blob Storage. Paste the SAS URL into Container SAS URL, name a Folder inside the container if you want one, and click Save.

The SAS URL is kept as a secret. Once it's saved, the field shows when the SAS expires, and pasting a new URL replaces it.

3. Choose the databases and files

Under Databases, tick each database in the formats you want, CSV, MMDB or both. Under Files, choose Latest only to keep one copy of each file, or Every build to keep a dated folder per build, then click Save.

4. Test and activate

Click Test connection. It writes vpndetection-connection-test.txt and deletes it, and Activate opens once it passes. The current build goes out first once you activate.

Verify that a build arrived

A small database lands within a pass or two of activating, and a large one takes as long as its transfer. To confirm it, open the destination's History tab: each file sent reads New build under Why and Delivered under Result, and the destination's row shows the time under Last delivered.

In the container, each file sits beside its .sha256, and manifest.json lists them all. Download a file and its .sha256 together, and sha256sum -c vpn_ip_v1.mmdb.sha256 confirms that it's intact.

When delivery fails

The destination shows when the SAS expires. Once it has, deliveries fail until you paste a new SAS URL, so replace it before then. VPNDetection emails the people who manage delivery in your organization after a day of failures, and pauses the destination after three, as When delivery fails explains.

A SAS that can't do what delivery needs is refused when you save it, or fails a step of the test:

  • A SAS for a single blob, or for the whole storage account, is refused at Save: generate one for the container.
  • A SAS without the create and write permissions, such as rl, is refused at Save: generate one with racwdl.
  • A SAS without the delete permission, such as racwl, fails the test's delete step, since the test cleans up after itself.

Later failures carry an error_code in the database.delivery_failed event, and the Detail column in History says the same in words:

error_codeCauseWhat to do
SAS_EXPIREDThe SAS has expired.Generate a new one and paste its URL.
ACCESS_DENIEDThe SAS can't write to that container or folder.Generate a SAS with racwdl for the container.
BUCKET_NOT_FOUNDThe container doesn't exist.Check the container's name in the SAS URL.

If you revoke a SAS by deleting its stored access policy, the next delivery fails, and creating the policy again with the same name restores it.

Next steps

Your container now receives each new build of the databases you chose. To act on each delivery as it lands, add a webhook and watch for database.delivered, or point a job at manifest.json, which changes only once a whole pass is in place.