snspoliciestocsv
Description
A simple script to extract policies from a Stormshield Network Security device configuration file to CSV
Options
$ python3 snspoliciestocsv.py -h
Usage: snspoliciestocsv.py [options]
Version: 1.11
Options:
-h, --help show this help message and exit
Main parameters:
-i INPUT_FILE, --input-file=INPUT_FILE
Partial or full Stormshield Network security appliance
configuration file. Ex: filter.cfg
-o OUTPUT_FILE, --output-file=OUTPUT_FILE
Output csv file (default ./policies-out.csv)
-s, --skip-header Do not print the csv header
-d DELIMITER, --delimiter=DELIMITER
CSV delimiter (default ";")
Examples
exemple.txt
[Filter]
separator color="000000" comment="Allow VPN A to B" collapse="1"
pass inspection firewall log ipproto vpn-esp proto none from A to B # Créée le 1970-01-01 00:00:01, par Serge (1.2.3.4)
separator color="000000" comment="Block B to C" collapse="1"
block from B to C port ssh # Prenez un chewing-gum EmileCréée le 1970-01-01 00:00:02, par Odile (1.2.3.5)
block from A to G port ssh # àloléCréée le 1970-01-01 00:00:02, par Léon (1.2.3.5)
policies-out.csv
type;log;from;to;ipproto;proto;port;comment;creation_date;user;ip_user
Allow VPN A to B;;;;;;;;;;
pass;log;A;B;vpn-esp;none;; ;1970-01-01 00:00:01;Serge;1.2.3.4
Block B to C;;;;;;;;;;
block;;B;C;;;ssh; Prenez un chewing-gum Emile;1970-01-01 00:00:02;Odile;1.2.3.5
block;;A;G;;;ssh; àlolé;1970-01-01 00:00:02;Léon;1.2.3.5
Dependencies and installation
- Python 3 or superior (sorry but Python 2 is a pain with csv unicode stuff)
- The easiest way to setup everything:
pip install snspoliciestocsvand then directly use$ snspoliciestocsv - Or git clone that repository
Changelog
- version 1.12 - 08/13/2018: Fixing the README layout on PyPI
- version 1.11 - 07/22/2017: Fixing some utf-8 issues, and adding the log column
- version 1.0 - 07/14/2017: Initial commit
Disclaimer and license
- I don't own anything on the Stormshield brand and am not affiliated with organization
- snspoliciestocsv is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- snspoliciestocsv is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU Lesser General Public License for more details: http://www.gnu.org/licenses/
Contact
- Thomas Debize < tdebize at mail d0t com >
Metadata
Release files for snspoliciestocsv 1.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| snspoliciestocsv-1.12.tar.gz | 5.1 kB | Without provenance | Details for snspoliciestocsv-1.12.tar.gz |
Release files / snspoliciestocsv-1.12.tar.gz
| Download URL | snspoliciestocsv-1.12.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
978d57d27e8e20c9028fe2b8fe5e306d4dea5464476949951c6d014c6999b69b
|
|
BLAKE2b-256 checksum How to use checksums |
14385cf32ca87c65c3b5769c2b6143a26f722e8fe846a1640dceb805e3ef4a8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.15
|
Security for snspoliciestocsv 1.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.