suricataparser
Pure python package for parsing and generating Snort/Suricata rules.
Installation
via pip:
pip install suricataparser
via Poetry:
poetry add suricataparser
Project status
Suricataparser completed, api is stable and frozen. If you found a bug, create an issue.
Usage examples
Parse file with rules:
from suricataparser import parse_file
rules = parse_file("suricata.rules")
Parse raw rule:
from suricataparser import parse_rule
rule = parse_rule('alert tcp any any -> any any (sid:1; gid:1;)')
Parse string with many rules:
from suricataparser import parse_rules
rules_object = "..."
rules = parse_rules(rules_object)
View rule properties:
>>> rule.sid
1
>>> rule.action
alert
>>> rule.header
tcp any any -> any any
>>> rule.msg
'"Msg"'
Turn on/off rule:
>>> rule.enabled
True
>>> rule.enabled = False
>>> print(rule)
# alert tcp any any -> any any (msg:"Msg"; sid:1; gid:1;)
Modify options:
>>> rule.add_option("http_uri")
>>> rule.add_option("key", "value")
>>> print(rule)
alert tcp any any -> any any (msg: "Msg"; sid: 1; gid: 1; http_uri; key: value;)
>>> rule.pop_option("key")
>>> print(rule)
alert tcp any any -> any any (msg: "Msg"; sid: 1; gid: 1; http_uri;)
Metadata
Release files for suricataparser 1.0.0
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 |
|---|---|---|---|---|
| suricataparser-1.0.0.tar.gz | 8.1 kB | Without provenance | Details for suricataparser-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| suricataparser-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for suricataparser-1.0.0-py3-none-any.whl |
Total release size: 16.8 kB
Release files / suricataparser-1.0.0.tar.gz
| Download URL | suricataparser-1.0.0.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d293c320c446cb4cefb6a5b9ede271d5e4621bfa82e3d76e111074c06297b7fa
|
|
BLAKE2b-256 checksum How to use checksums |
f0eece1835f4b70da00ac05794b7c50bc247010609d772c0d49621424a3e9a0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.8.14 Linux/5.15.0-50-generic
|
Release files / suricataparser-1.0.0-py3-none-any.whl
| Download URL | suricataparser-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e36d2bdae14d3b7be79d2412a2753a36fc30a2ddd702f357f4e3688a9b011d53
|
|
BLAKE2b-256 checksum How to use checksums |
9dd2065d97b6212fafabc05da7c7d563fcb6fe6a796f1dde0274936b7ad774d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.8.14 Linux/5.15.0-50-generic
|
Security for suricataparser 1.0.0
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.