Skip to content

Commit

Permalink
Optionally compact cidr ranges to make file sizes smaller
Browse files Browse the repository at this point in the history
This closes #8 by implementing a method for getting compacted ranges. Combining the results of the 4 cloud providers herein, we see an order of magnitude in line count reduction.
  • Loading branch information
0xdade committed Aug 5, 2020
1 parent d01050d commit ccffe01
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 99 deletions.
13 changes: 13 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[flake8]
# W503 - line break before binary operator
# E402 - module level import not at top of file
# E203 - whitespace before ':'

ignore = E402, W503, E203
max-line-length = 160
exclude =
# Ignore contents of pycache directories
__pycache__,
# Ignore dependencies in virtual environments
venv,
.venv
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ beautifulsoup4 = "~=4.8.2"
dnspython = "~=1.16.0"
requests = "~=2.22.0"
Jinja2 = "~=2.11.1"
netaddr = "*"

[requires]
python_version = "3.8"
186 changes: 97 additions & 89 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ docker run --rm -v $(pwd):/app/output sephiroth -s nginx -t gcp
Sephiroth provides a built in help menu through the use of Python's argparse library. It tells you which commands are required, as well as other options.

```bash
sephiroth on  master [!?] on 🐳 v19.03.8 via sephiroth via 🐍 3.8.3
sephiroth on  master [!] on 🐳 v19.03.12 via sephiroth via 🐍 3.8.3
➜ sephiroth --help
usage: Sephiroth [-h] -s {nginx,apache,iptables,ip6tables} -t
{aws,azure,gcp,asn,file,oci,tor} [-a ASN] [-f FILENAME]
[-r REDIR_TARGET] [-p] [--no-ipv6] [-V]
usage: Sephiroth [-h] -s {nginx,apache,iptables,ip6tables} -t {aws,azure,gcp,asn,file,oci,tor} [-a ASN] [-f FILENAME] [-r REDIR_TARGET] [-p] [--no-ipv6] [--compacted] [-V]

Sephiroth is made to help block clouds.

Expand All @@ -60,12 +58,11 @@ optional arguments:
-r REDIR_TARGET, --redir REDIR_TARGET
Place to redirect requests to. (apache)
-p, --proxy Using PROXY Protocol? (nginx)
--no-ipv6 Exclude ipv6 addresses from the block list where
applicable
--no-ipv6 Exclude ipv6 addresses from the block list where applicable
--compacted Compact neighboring cidr ranges. This produces smaller file sizes but loses detail about each range.
-V, --version show program's version number and exit
For more information, assistance, or to submit a pull request, please visit
https://github.com/0xdade/sephiroth.
For more information, assistance, or to submit a pull request, please visit https://github.com/0xdade/sephiroth.
```
## Example
Expand Down
Loading

0 comments on commit ccffe01

Please sign in to comment.