Skip to main content

This is a simple python client wrapper for the [gglsbl-rest](https://github.com/mlsecproject/gglsbl-rest) service.

Project description

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'}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gglsbl-rest-client-1.0.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

gglsbl_rest_client-1.0.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file gglsbl-rest-client-1.0.1.tar.gz.

File metadata

  • Download URL: gglsbl-rest-client-1.0.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for gglsbl-rest-client-1.0.1.tar.gz
Algorithm Hash digest
SHA256 94af29f7c4b85359577d1159ad00d1a194ed4630add27c487cad7eb92bb255f6
MD5 023569db5c36892c21bb5ea4af2376c6
BLAKE2b-256 dc8789901230ffc1d256ccf37532f1f8fbcebcbdd6bc6d32c33ce054b87b906d

See more details on using hashes here.

File details

Details for the file gglsbl_rest_client-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: gglsbl_rest_client-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for gglsbl_rest_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bc186bb0de20033d1668401d1e66a8c02a9b4b940d65fc5196828410ff863cc4
MD5 332509582d1a4aee2d0c414b4950ee8f
BLAKE2b-256 e0e78dfa2f145f43245c4d0e690edfecab27f07cd9123cd65a938cf956d0c1f0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page