Skip to main content

Bad Reputation (Blacklisted IP) Incident Reporting.

Project description

Daily Blacklisted IP Reporting

Document Bad Reputation incidents in GuardiCore Centra (GC).

Howto

Primary use cases of the BlacklistReport package are displayed in main.py.

main.py shows, through use of environment variables SAVE_HTML and SAVE_PLAINTEXT, the following use cases:

  • Save an html report to an html file.
  • Save a plaintext report to a text file.

BlacklistReport.generate_blacklist_report

  • generate_blacklist_report generates a blacklisted IP report in both html and plaintext formats.
  • Omitting use cases in which intermediate data must be collected, generate_blacklist_report is the only function call required to generate a blacklist report.

Classes

  • BlacklistReport is responsible for high-level data collection & formatting.
  • BlacklistEntry defines the outline for entries in a blacklist report.
  • IpEntry inner class of BlacklistEntry; defines the structure of IP entries.
  • ThreatData singleton-esque class for fetching threat intel summaries.

BlacklistReport

  • Initialization: Instantiating a BlacklistReport object requires an authenticated Centra instance.
  • fetch_customer_label retrieves the GC label corresponding to a given customer.
  • fetch_incidents retrieves all Bad Reputation incidents from an authenticated Centra instance.
  • build_report instantiates a BlacklistEntry object for each incident retrieved in fetch_incidents.
  • build_report_str creates a string (HTML or plaintext) representation of a `BlacklistReport' object.

BlacklistEntry

  • Note: Besides the src, destinations, and ports properties, all properties of BlacklistEntry are READ-ONLY
  • add_destination appends destination ip addresses to a BlacklistEntry object's (unique) destination list.
  • add_ports appends destination ports to a BlacklistEntry object's (unique) port list.

IpEntry

  • Note: IpEntry is an inner class of BlacklistEntry. Furthermore, all properties of IpEntry are READ-ONLY

ThreatData

  • Note: This class has no constructor, and has a single class variable: OPSWAT_KEY
  • set_opswat_key sets the class variable OPSWAT_KEY to the provided key

Logging

  • A default logging configuration has been defined in BlacklistReport.__init__.py.
  • By default, log messages are recorded in a top-level file called dailyblacklistreporting.log.

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

BlacklistReport-0.5.0.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

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

BlacklistReport-0.5.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file BlacklistReport-0.5.0.tar.gz.

File metadata

  • Download URL: BlacklistReport-0.5.0.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for BlacklistReport-0.5.0.tar.gz
Algorithm Hash digest
SHA256 03652a52887af88c2be4274f64fd11627e06091980ef1b86cef098440ce295de
MD5 8e67f307f3008472201367456cb28b4f
BLAKE2b-256 e11b4c738917e46f08938411fdf8d67d284318c5dec43a5eacb1f51889f1f398

See more details on using hashes here.

File details

Details for the file BlacklistReport-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: BlacklistReport-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for BlacklistReport-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2444cf58f26da0ac0a3ed3b986518721d23c674c73d4e84da9820b8b576424cf
MD5 63ff0fe5478a9345972603e66185d628
BLAKE2b-256 4292dcce5b66043ad94bbcef8b818bc4867323d3de2192a96a15e0903409203f

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