The DroneBL RPC WebService v2
Highly available querying and manipulation of the DroneBL database.
Introduction
The DroneBL RPC WebService is used to connect the DroneBL to other codebases and scripts. Mostly it is used internally to add and remove entries in the database on demand. To use the WebService, you will need an RPCKEY, which you can get by contacting us. Our BOPM reporting service is an example of possible usage of the RPC webservice.
List of tools
As follows are some scripts that employ the RPC2 methods described below. Use these as they are, modify them, or take them apart to see how they work.
- dronebl-tools -- a set of Python scripts to query or report hosts
- DroneBLClient.py -- the Python class from dronebl-tools
- dronereport -- a PHP-cli script for reporting hosts
- dronebl-submit.sh -- a BASH script for reporting hosts
- dronebl.pl -- an irssi script for advanced lookups
Syntax
A request looks something like this, where METHOD and METHOD-PARAMS belong to the list below:
<?xml version="1.0"?>
<request key='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'>
<METHOD METHOD-PARAMS />
</request>
Methods
Once you have acquired an RPCKEY, you can use these methods. Note that some methods may not be available depending on what level of access your RPCKEY has.
add: Adds a new entry to the DroneBL.
- ip (mandatory): The IP of the entry to add.
- type (mandatory): The type of blocking class under which the IP should be listed.
lookup: Looks up an IP or range in DroneBL.
ip (mandatory): The IP or range to lookup. Queries can include wildcards as follows:
- ? -- wildcard meaning any one digit.
(10.0.0.? => 10.0.0.0, 10.0.0.1... 10.0.0.9) - * -- wildcard meaning any number of characters.
(10.0.* => 10.0.0.0, 10.0.0.1... 10.0.255.255) - [n0-n1] -- range from n0 to n1.
(10.0.[92-104].* => 10.0.92.0, 10.0.92.1... 10.0.104.255)
- ? -- wildcard meaning any one digit.
remove: Removes a listing in DroneBL.
- id (mandatory): The listing/incident ID to disable.
Responses
A response looks something like this:
<?xml version="1.0"?>
<response type="success">
METHOD-DATA
</response>
Or this:
<?xml version="1.0"?>
<response type="success" />
Errors look like this:
<?xml version="1.0"?>
<response type="error">
<code>ERROR-CODE</code>
<message>ERROR-MESSAGE</message>
<data>ERROR-DETAILS</data>
</response>
Using RPC2
You will need to sign up for an RPCKEY. This is now a public process, and the RPCKEY will work for RPC1 too, which is a bit easier than RPC2, but less powerful.
We are working on standardizing RPC2 as a DNSBL provider interaction protocol. Hopefully other providers will start supporting it.
