summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-29 13:22:47 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-29 13:22:47 +0000
commit563115ed7b8bde69384ec816a8e71a821d728f58 (patch)
tree5c53175661a7b7972801aed6161511730eb15072
parent8624b69a2b1dc27f07b8340d18a09b1655bc9609 (diff)
automatic import of python-blacklistreport
-rw-r--r--.gitignore1
-rw-r--r--python-blacklistreport.spec241
-rw-r--r--sources1
3 files changed, 243 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..10b2cc2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/BlacklistReport-0.5.0.tar.gz
diff --git a/python-blacklistreport.spec b/python-blacklistreport.spec
new file mode 100644
index 0000000..fabce28
--- /dev/null
+++ b/python-blacklistreport.spec
@@ -0,0 +1,241 @@
+%global _empty_manifest_terminate_build 0
+Name: python-BlacklistReport
+Version: 0.5.0
+Release: 1
+Summary: Bad Reputation (Blacklisted IP) Incident Reporting.
+License: GPLv3
+URL: https://git.vcjames.io/soc/dailyblacklistreporting
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/e1/1b/4c738917e46f08938411fdf8d67d284318c5dec43a5eacb1f51889f1f398/BlacklistReport-0.5.0.tar.gz
+BuildArch: noarch
+
+Requires: python3-attrs
+Requires: python3-certifi
+Requires: python3-chardet
+Requires: python3-GuardiPy
+Requires: python3-idna
+Requires: python3-inflect
+Requires: python3-jsonschema
+Requires: python3-pyrsistent
+Requires: python3-requests
+Requires: python3-six
+Requires: python3-urllib3
+Requires: python3-setuptools
+Requires: python3-greynoise
+
+%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](https://git.vcjames.io/soc/GuardiPy) instance.
+- `fetch_customer_label` retrieves the GC label corresponding to a given customer.
+- `fetch_incidents` retrieves all **Bad Reputation** incidents from an authenticated [Centra](https://git.vcjames.io/soc/GuardiPy) 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`.
+
+
+
+
+%package -n python3-BlacklistReport
+Summary: Bad Reputation (Blacklisted IP) Incident Reporting.
+Provides: python-BlacklistReport
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-BlacklistReport
+# 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](https://git.vcjames.io/soc/GuardiPy) instance.
+- `fetch_customer_label` retrieves the GC label corresponding to a given customer.
+- `fetch_incidents` retrieves all **Bad Reputation** incidents from an authenticated [Centra](https://git.vcjames.io/soc/GuardiPy) 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`.
+
+
+
+
+%package help
+Summary: Development documents and examples for BlacklistReport
+Provides: python3-BlacklistReport-doc
+%description help
+# 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](https://git.vcjames.io/soc/GuardiPy) instance.
+- `fetch_customer_label` retrieves the GC label corresponding to a given customer.
+- `fetch_incidents` retrieves all **Bad Reputation** incidents from an authenticated [Centra](https://git.vcjames.io/soc/GuardiPy) 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`.
+
+
+
+
+%prep
+%autosetup -n BlacklistReport-0.5.0
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-BlacklistReport -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 29 2023 Python_Bot <Python_Bot@openeuler.org> - 0.5.0-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..2dde0af
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+8e67f307f3008472201367456cb28b4f BlacklistReport-0.5.0.tar.gz