Created
September 21, 2022 13:29
-
-
Save shortstack/c56f66cdef78bce1f748218adf313956 to your computer and use it in GitHub Desktop.
Convert Sigma rule to LimaCharlie rule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import yaml | |
import requests | |
url = "https://sigma.limacharlie.io/convert/rule" | |
files = {'rule': open('sigma_rule.yml', 'rb').read()} | |
headers = { | |
"Content-Type": "application/x-www-form-urlencoded" | |
} | |
response = requests.post(url, data=files, headers=headers) | |
rule = json.loads(response.text) | |
rule_yaml = yaml.safe_load(rule["rule"]) | |
with open("converted_rule.yml", "w") as file: | |
rule_file = yaml.dump(rule_yaml, file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment