Skip to main content

parsuricata

Parse Suricata rules

Installation

pip install parsuricata

Usage

from parsuricata import parse_rules

source = '''
  alert http $HOME_NET any -> !$HOME_NET any (msg: "hi mum!"; content: "heymum"; http_uri; sid: 1;)
'''

rules = parse_rules(source)
print(rules)
#
# alert http $HOME_NET any -> !$HOME_NET any ( \
#   msg: hi mum!; \
#   content: heymum; \
#   http_uri; \
#   sid: 1; \
# )

rule = rules[0]

print(rule.action)
# alert

print(rule.protocol)
# http

print(rule.src)
# $HOME_NET

print(rule.src_port)
# any

print(rule.direction)
# ->

print(rule.dst)
# !$HOME_NET

print(rule.dst_port)
# any

for option in rule.options:
    print(f'{option.keyword} = {option.settings}')
#
# msg = hi mum!
# content = heymum
# http_uri = None
# sid = 1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parsuricata-0.4.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

parsuricata-0.4.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file parsuricata-0.4.1.tar.gz.

File metadata

  • Download URL: parsuricata-0.4.1.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.12 Linux/5.13.0-52-generic

File hashes

Hashes for parsuricata-0.4.1.tar.gz
Algorithm Hash digest
SHA256 3757f4dac68625642e9a053f3fa8fe008b1f79406a3763c51efd16fa60db09ca
MD5 a0dc73d90be9028281b75a3c240d2440
BLAKE2b-256 299e7e79812e15b634698b527e6b6c88f9ea79dca856588e1ebfbf9568d9e3f6

See more details on using hashes here.

File details

Details for the file parsuricata-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: parsuricata-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.12 Linux/5.13.0-52-generic

File hashes

Hashes for parsuricata-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e6c4c46e2447d7067e67e170823a9a6fc7ae1faa8405333c9fb9c965dc481134
MD5 b1c6b40f22dbf42fbba344a7ccb1a7ae
BLAKE2b-256 96fcdfe0d0458c7c2843ffd1be5da1b4a6b2f790dd5c4a74a97a4a5b73597d02

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 files

0.4.0

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page