Overview
An API to the Dovecot Anti-Abuse Shield to prevent brute-force and abuse of mail systems
Version information
Version : 2.0
Contact information
Contact : Dovecot Oy
License information
License : GPL2
License URL : http://github.com/PowerDNS/weakforced/master/LICENSE
URI scheme
Host : doesnotexist.dovecot.fi
BasePath : /
Schemes : HTTP
Consumes
-
application/json
Produces
-
application/json
Paths
POST /?command=addBLEntry
Description
“Add a blacklist entry for an IP and/or login“
Parameters
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Body |
“addBLEntry” |
Provide IP and/or login |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
“addBLEntry response" |
|
default |
unexpected error |
Produces
-
application/json
Example HTTP request
Request body
{
"ip" : "127.0.0.1",
"expire" : 3600,
"reason" : "“Too many bad passwords”"
}
Example HTTP response
Response default
{
"status" : "failure",
"reason" : "Unauthorized"
}
POST /?command=allow
Description
Query whether a login should be allowed
Parameters
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Body |
LoginTupleAllow |
Login Tuple for allow command |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
“allow response" |
|
default |
unexpected error |
Produces
-
application/json
Example HTTP request
Request body
{
"login" : "joe.bloggs",
"remote" : "192.168.1.2",
"pwhash" : "cc04",
"success" : true,
"attrs" : {
"foo" : "bar"
}
}
Example HTTP response
Response default
{
"status" : "failure",
"reason" : "Unauthorized"
}
POST /?command=delBLEntry
Description
“Delete a blacklist entry for an IP and/or login“
Parameters
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Body |
“delBLEntry” |
Provide IP and/or login |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
“delBLEntry response" |
|
default |
unexpected error |
Produces
-
application/json
Example HTTP request
Request body
{
"ip" : "127.0.0.1"
}
Example HTTP response
Response default
{
"status" : "failure",
"reason" : "Unauthorized"
}
GET /?command=getBL
Description
Get the list of all blacklisted IPs and/or Logins
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
getBL response |
|
default |
unexpected error |
Produces
-
application/json
Example HTTP response
Response default
{
"status" : "failure",
"reason" : "Unauthorized"
}
POST /?command=getDBStats
Description
Get the db stats for an IP and/or login
Parameters
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Body |
GetDBStats |
Provide IP and/or login |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
getDBStats response |
|
default |
unexpected error |
Produces
-
application/json
Example HTTP request
Request body
{
"ip" : "127.0.0.1"
}
Example HTTP response
Response default
{
"status" : "failure",
"reason" : "Unauthorized"
}
GET /?command=ping
Description
Ping the server to ensure it is operational
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
ping response |
|
default |
unexpected error |
Produces
-
application/json
Example HTTP response
Response default
{
"status" : "failure",
"reason" : "Unauthorized"
}
POST /?command=report
Description
Creates a new report about a login (successful or unsuccessful)
Parameters
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Body |
LoginTupleReport |
Login Tuple for report command |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
report response |
|
default |
unexpected error |
Produces
-
application/json
Example HTTP request
Request body
{
"login" : "joe.bloggs",
"remote" : "192.168.1.2",
"pwhash" : "cc04",
"success" : true
}
Example HTTP response
Response default
{
"status" : "failure",
"reason" : "Unauthorized"
}
POST /?command=reset
Description
Reset the stats and any blacklist entry for an IP and/or login
Parameters
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Body |
Reset |
Provide IP and/or login |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
reset response |
|
default |
unexpected error |
Produces
-
application/json
Example HTTP request
Request body
{
"ip" : "127.0.0.1"
}
Example HTTP response
Response default
{
"status" : "failure",
"reason" : "Unauthorized"
}
Definitions
AddBLEntryParams
Name | Description | Schema |
---|---|---|
expire_secs |
integer |
|
ip |
string |
|
login |
string |
|
reason |
string |
BLEntry
Type : < BLEntry_inner > array
BLEntry_inner
Name | Description | Schema |
---|---|---|
expiration |
string |
|
key_name |
string |
|
reason |
string |
BLResponse
Name | Description | Schema |
---|---|---|
bl_entries |
< BLArray > array |
DBStatsEntry
Name | Description | Schema |
---|---|---|
db_name |
DBStatsFields
Name | Description | Schema |
---|---|---|
field_name |
integer |
DBStatsResponse
Name | Description | Schema |
---|---|---|
blacklisted |
boolean |
|
key_name |
string |
|
stats |
DelBLEntryParams
Name | Description | Schema |
---|---|---|
ip |
string |
|
login |
string |
Error
Name | Description | Schema |
---|---|---|
reason |
string |
|
status |
string |
LTAttrs
Name | Description | Schema |
---|---|---|
attr_name multi_value |
< string > array |
|
attr_name_single_value |
string |
LoginTupleAllow
Name | Description | Schema |
---|---|---|
attrs |
||
login |
string |
|
pwhash |
string |
|
remote |
string |
LoginTupleReport
Name | Description | Schema |
---|---|---|
attrs |
||
login |
string |
|
policy_reject |
boolean |
|
pwhash |
string |
|
remote |
string |
|
success |
boolean |
ResetStatsParams
Name | Description | Schema |
---|---|---|
ip |
string |
|
login |
string |
inline_response_200
Name | Description | Schema |
---|---|---|
status |
string |
inline_response_200_1
Name | Description | Schema |
---|---|---|
msg |
string |
|
r_attrs |
||
status |
integer |
inline_response_200_1_r_attrs
Name | Description | Schema |
---|---|---|
attr_name |
string |