{"id":13530345,"url":"https://github.com/m-chrome/py-suricataparser","last_synced_at":"2026-01-01T23:01:49.979Z","repository":{"id":43006715,"uuid":"284443452","full_name":"m-chrome/py-suricataparser","owner":"m-chrome","description":"Pure python parser for Snort/Suricata rules.","archived":false,"fork":false,"pushed_at":"2024-03-13T14:30:57.000Z","size":45,"stargazers_count":33,"open_issues_count":2,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-20T02:51:47.554Z","etag":null,"topics":["python3","snort-rules","snort-rules-generate","suricata-rule","suricata-rules"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m-chrome.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-08-02T10:57:52.000Z","updated_at":"2025-06-07T14:17:41.000Z","dependencies_parsed_at":"2024-04-14T14:42:56.932Z","dependency_job_id":"004580f4-644b-4f9f-bbc5-b6232f715124","html_url":"https://github.com/m-chrome/py-suricataparser","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/m-chrome/py-suricataparser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-chrome%2Fpy-suricataparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-chrome%2Fpy-suricataparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-chrome%2Fpy-suricataparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-chrome%2Fpy-suricataparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m-chrome","download_url":"https://codeload.github.com/m-chrome/py-suricataparser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-chrome%2Fpy-suricataparser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28165033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-01T02:00:06.694Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python3","snort-rules","snort-rules-generate","suricata-rule","suricata-rules"],"created_at":"2024-08-01T07:00:48.459Z","updated_at":"2026-01-01T23:01:49.940Z","avatar_url":"https://github.com/m-chrome.png","language":"Python","funding_links":[],"categories":["Programming Libraries and Toolkits"],"sub_categories":[],"readme":"# suricataparser\n\n[![pypi-version](https://img.shields.io/pypi/v/suricataparser?color=gree)](https://pypi.org/project/suricataparser)\n[![py-versions](https://img.shields.io/pypi/pyversions/suricataparser.svg)](https://pypi.org/project/suricataparser)\n[![license](https://img.shields.io/pypi/l/suricataparser.svg)](https://github.com/m-chrome/py-suricataparser/blob/master/LICENSE)\n[![CI](https://github.com/m-chrome/py-suricataparser/actions/workflows/tests.yml/badge.svg)](https://github.com/m-chrome/py-suricataparser/actions)\n\nPure python package for parsing and generating Snort/Suricata rules.\n\n## Installation\n\nvia pip:\n```shell\npip install suricataparser\n```\n\nvia Poetry:\n```shell\npoetry add suricataparser\n```\n\n## Project status\n\nSuricataparser completed, api is stable and frozen. If you found a bug, \ncreate an [issue](https://github.com/m-chrome/py-suricataparser/issues/new).\n\n## Usage examples\n\nParse file with rules:\n\n```python\nfrom suricataparser import parse_file\n\nrules = parse_file(\"suricata.rules\")\n```\n\nParse raw rule:\n\n```python\nfrom suricataparser import parse_rule\n\nrule = parse_rule('alert tcp any any -\u003e any any (sid:1; gid:1;)')\n```\n\nParse string with many rules:\n\n```python\nfrom suricataparser import parse_rules\n\nrules_object = \"...\"\nrules = parse_rules(rules_object)\n```\n\nView rule properties:\n\n```\n\u003e\u003e\u003e rule.sid\n1\n\n\u003e\u003e\u003e rule.action\nalert\n\n\u003e\u003e\u003e rule.header\ntcp any any -\u003e any any\n\n\u003e\u003e\u003e rule.msg\n'\"Msg\"'\n```\n\nTurn on/off rule:\n\n```\n\u003e\u003e\u003e rule.enabled\nTrue\n\n\u003e\u003e\u003e rule.enabled = False\n\u003e\u003e\u003e print(rule)\n# alert tcp any any -\u003e any any (msg:\"Msg\"; sid:1; gid:1;)\n```\n\nModify options:\n\n```\n\u003e\u003e\u003e rule.add_option(\"http_uri\")\n\u003e\u003e\u003e rule.add_option(\"key\", \"value\")\n\u003e\u003e\u003e print(rule)\nalert tcp any any -\u003e any any (msg: \"Msg\"; sid: 1; gid: 1; http_uri; key: value;)\n\n\u003e\u003e\u003e rule.pop_option(\"key\")\n\u003e\u003e\u003e print(rule)\nalert tcp any any -\u003e any any (msg: \"Msg\"; sid: 1; gid: 1; http_uri;)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-chrome%2Fpy-suricataparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm-chrome%2Fpy-suricataparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-chrome%2Fpy-suricataparser/lists"}