Skip to main content

The whitelisting tool of the Ultimate Hosts Blacklist project.

Project description

This is the branch which contain the script which we use to whitelist domains or IP into our infrastructure.

Installation

$ pip3 install --user ultimate-hosts-blacklist-whitelist

Complementary whitelist

Our script allow us to link one or more file(s) to the system which will be used in complementary of our whitelist list.

Special markers

If you already used a whitelist list you already know that we generaly only list all domains we want to whitelist one by one.

It’s also possible to do that with our whitelisting system but we can do more.

ALL

The ALL marker will tell the system to escape and regex check againt what follows.

INVALID characters

  • $

    • As we automatically append $ to the end, you should not use this character.

  • \\

    • As we automatically escape the given expression, you should not explicitly escape your regular expression when declaring an ALL marker.

REG

The REG marker will tell the system to explicitly check for the given regex which follows the marker.

RZD

The RZD marker will tell the system to explicitly check for the given string plus all possible TDL.

Understanding what we actually do

If we have the following secondary whitelist list:

facebook.com
ALL .gov
REG face
RZD example

our system will actually :

  • Remove every line which match facebook.com and www.facebook.com

  • Remove everyline which match example.*

  • In complementary convert all lines with ALL ` or :code:`REG to the right format.

  • Check every line again the regular expression.

  • Print or save on screen the results.

The generated regular expression will be in this example:

(\.gov$)|(face)|(example(.*))

NOTE: The :code:`example` group is much longer as we construct the list of TDL based on the Root Zone Database of the IANA and the Public Suffix List project.

Which actually means that we whitelist:

  • all elements/lines which ends with .gov

  • all elements/lines which contain the word face

Contributors

Usage of the script

The sript can be called as uhb-whitelist, uhb_whitelist and ultimate-hosts-blacklist-whitelist.

usage: uhb_whitelist [-h] [-d] [-f FILE] [-o OUTPUT] [-m] [-p PROCESSES] [-v]
                    [-w WHITELIST [WHITELIST ...]] [-wc]

The tool to clean a list or a hosts file with the Ultimate Hosts Blacklist
whitelist list or your own.

optional arguments:
    -h, --help            show this help message and exit
    -d, --debug           Activate the debug mode. This mode will write the
                            whole processes to stdout.
    -f FILE, --file FILE  Read the given file and remove all element to
                            whitelist.
    -o OUTPUT, --output OUTPUT
                            Save the result to the given filename or path.
    -m, --multiprocessing
                            Activate the usage of multiple processes.
    -p PROCESSES, --processes PROCESSES
                            The number of (maximal) processes to use.
    -v, --version         Show the version end exist.
    -w WHITELIST [WHITELIST ...], --whitelist WHITELIST [WHITELIST ...]
                            Read the given file and append its data to the our
                            whitelist list.
    -wc, --without-core   Disable the usage of the Ultimate Hosts Blacklist
                            whitelist list.

Crafted with ♥ by Nissar Chababy (Funilrys)

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

Built Distribution

File details

Details for the file ultimate-hosts-blacklist-whitelist-3.9.0.tar.gz.

File metadata

  • Download URL: ultimate-hosts-blacklist-whitelist-3.9.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for ultimate-hosts-blacklist-whitelist-3.9.0.tar.gz
Algorithm Hash digest
SHA256 975d13be8cf478253eaf339ceeb8c1f70a81eab95a1e501cd95415cec16b0d4d
MD5 29b40d8ed4848a7c67ce47a923762d7c
BLAKE2b-256 0371bf43d31c8614ea6f3321c0e7b36894b14fc816df9229b6eeafd81f4f92af

See more details on using hashes here.

File details

Details for the file ultimate_hosts_blacklist_whitelist-3.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ultimate_hosts_blacklist_whitelist-3.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee5c0068d8444c9a3912982338e80e427f3d8cde3b20c7a42533a2664b33250e
MD5 74541ad6114a7893b248543fe2e82b88
BLAKE2b-256 9cb3d34330928216b26f725fa4cb739cefa0f739a278899d60fb10b888332bdd

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