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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file find-and-check-hosts-0.1.5.tar.gz.

File metadata

  • Download URL: find-and-check-hosts-0.1.5.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for find-and-check-hosts-0.1.5.tar.gz
Algorithm Hash digest
SHA256 4caf08b40257b4834a5fe8ab9d4f451af1af52941a8348fd2998b2335fa74680
MD5 cd177b8177a383145ca118b03d333da7
BLAKE2b-256 7991a5cc7b100a99f08bf2ed07dcddb0325d64a36d17b652d9ad542f50d7aac4

See more details on using hashes here.

File details

Details for the file find_and_check_hosts-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for find_and_check_hosts-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 746a6473148c96e5c5c56eda0ccf104d6173d94b7ecaa413adbe22b06583dd45
MD5 bb8610c611f87ad6fe64bb97d92adc9f
BLAKE2b-256 0db1a087affac7d15a7331eef1ea2d7f9f51b90ff57555b6df64381b73c5d8ff

See more details on using hashes here.

Supported by

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