python client for gglsbl-rest service
This is a simple python client wrapper for the gglsbl-rest service.
Installation
pip install gglsbl-rest-client
The gglsbl-rest-client CLI script
When installed, a commannd line script named 'gglsbl-rest-client' is supplied that can be used to query your gglsbl-rest service. The default configuration file assumes you have the service running on local host. If you do not, the script checks the following locations for config files and overrides previous entries:
/<local-dir>/etc/config.ini/etc/gglsbl-rest/config.ini~/<current-user>/.config/gglsbl-rest.ini
$ gglsbl-rest-client.py -h
usage: gglsbl-rest-client.py [-h] [-d] [-rh REMOTE_HOST] [-p PORT] [-cs]
[-l LOOKUP_URL] [--ignore-proxy]
A client for querying MLSec gglsbl-rest Services
(https://github.com/mlsecproject)
optional arguments:
-h, --help show this help message and exit
-d, --debug set logging to DEBUG
-rh REMOTE_HOST, --remote-host REMOTE_HOST
the hostname or IP address where the service is
listening. Default is localhost.
-p PORT, --port PORT the port the service is listening on. Default: 5000
-cs, --check-status Check the status of the service
-l LOOKUP_URL, --lookup-url LOOKUP_URL
the url to lookup
--ignore-proxy ignore system proxy. On by default.
Examples
URL Lookup
$ gglsbl-rest-client.py -l 'http://testsafebrowsing.appspot.com/apiv4/ANY_PLATFORM/SOCIAL_ENGINEERING/URL/'
{'matches': [{'platform': 'ANY_PLATFORM',
'threat': 'SOCIAL_ENGINEERING',
'threat_entry': 'URL'},
{'platform': 'WINDOWS',
'threat': 'SOCIAL_ENGINEERING',
'threat_entry': 'URL'},
{'platform': 'LINUX',
'threat': 'SOCIAL_ENGINEERING',
'threat_entry': 'URL'},
{'platform': 'OSX',
'threat': 'SOCIAL_ENGINEERING',
'threat_entry': 'URL'},
{'platform': 'ALL_PLATFORMS',
'threat': 'SOCIAL_ENGINEERING',
'threat_entry': 'URL'},
{'platform': 'CHROME',
'threat': 'SOCIAL_ENGINEERING',
'threat_entry': 'URL'}],
'url': 'http://testsafebrowsing.appspot.com/apiv4/ANY_PLATFORM/SOCIAL_ENGINEERING/URL/'}
Status Check
$ gglsbl-rest-client.py -cs
{'alternatives': [{'active': True,
'ctime': '2019-10-01T18:15:44+0000',
'mtime': '2019-10-01T18:15:44+0000',
'name': '/home/gglsbl/db/sqlite.db',
'size': 1389404160}],
'environment': 'prod'}
OR
$ gglsbl-rest-client.py
No arguments specified. Printing client info and service status.
GGLSBL_Rest_Service_Client
Lookup URL: http://127.0.0.1:5000/gglsbl/lookup/
Status URL: http://127.0.0.1:5000/gglsbl/status
GGLSBL Service status:
{'alternatives': [{'active': True,
'ctime': '2019-10-01T18:15:44+0000',
'mtime': '2019-10-01T18:15:44+0000',
'name': '/home/gglsbl/db/sqlite.db',
'size': 1389404160}],
'environment': 'prod'}
Metadata
Release files for gglsbl-rest-client 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gglsbl-rest-client-1.0.1.tar.gz | 6.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gglsbl_rest_client-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.6 kB
Release files / gglsbl-rest-client-1.0.1.tar.gz
| Download URL | gglsbl-rest-client-1.0.1.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94af29f7c4b85359577d1159ad00d1a194ed4630add27c487cad7eb92bb255f6
|
|
BLAKE2b-256 checksum How to use checksums |
dc8789901230ffc1d256ccf37532f1f8fbcebcbdd6bc6d32c33ce054b87b906d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.7
|
Release files / gglsbl_rest_client-1.0.1-py3-none-any.whl
| Download URL | gglsbl_rest_client-1.0.1-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc186bb0de20033d1668401d1e66a8c02a9b4b940d65fc5196828410ff863cc4
|
|
BLAKE2b-256 checksum How to use checksums |
e0e78dfa2f145f43245c4d0e690edfecab27f07cd9123cd65a938cf956d0c1f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.7
|