Skip to main content

Find hostnames and IPv4 addresses in text files and check them against a set of rules

Project description

find-and-check-hosts

PyPI version License Python versions

Searches files for IPs and hostnames and checks them against a rule list to prevent accidentally leaking sensitive information.

Installation

This repo can now be installed with pip:

pip install find-and-check-hosts

Or you can install it manually by following these steps:

  1. Clone this repository
  2. Install the dependencies listed in ./requirements.txt with pip
  3. (Optional) Do a pip install . to add the find-and-check-hosts command to your PATH

Usage

If you did the pip installation, you should be able to just call the installed script:

find-and-check-hosts <arguments>

If you just cloned it, you need to call it by path:

./src/main.py <arguments>

Notable changes

Version 0.1.5

  • Added error status for files that can not be parsed.

Version 0.1.4

  • Added --extensions, --exclude-extensions and --ignore-directories files.

Version 0.1.3

  • Added flags that can be used to check if results were returned (--assert-results and --assert-no-results).
  • Made regexes case insensitive, so that they can find and properly handle domains such as eXampLe.coM.

Version 0.1.2

  • Added a domain filter, that will match a domain and any subdomains. For example domain: example.com will match example.com, my.subdomain.example.com, but not my-example.com or example-com.
  • Allowed the regex, glob and domain fields to also accept a list of values. For example:
    hostname_rules:
    - status: ok
    - domain:
      - example.com
      - example.org
    

Tests

find-and-check-hosts -c src/find_and_check_hosts/example-config.yaml tests/

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

find-and-check-hosts-0.1.5.tar.gz (17.0 kB view hashes)

Uploaded Source

Built Distribution

find_and_check_hosts-0.1.5-py3-none-any.whl (17.6 kB view hashes)

Uploaded Python 3

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