Skip to content

Instantly share code, notes, and snippets.

@shortstack
Created September 21, 2022 13:29
Show Gist options
  • Save shortstack/c56f66cdef78bce1f748218adf313956 to your computer and use it in GitHub Desktop.
Save shortstack/c56f66cdef78bce1f748218adf313956 to your computer and use it in GitHub Desktop.
Convert Sigma rule to LimaCharlie rule
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