66import json
77import subprocess
88
9- from walkoff_app_sdk .app_base import AppBase
9+ # from walkoff_app_sdk.app_base import AppBase
10+ from shuffle_sdk import AppBase
1011
1112# Make file sample with namespace yara:
1213## curl http://localhost:5001/api/v1/files/create -H "Authorization: Bearer 09627dcb-7e2a-4843-819b-417d268ff840" -d '{"filename": "HelloWorld.yml", "org_id": "11f67b76-6051-4425-b0d6-be23daac6d12", "workflow_id": "global", "namespace": "sigma"}'
1516# 2. Add a way to choose the rule and the target platform for it
1617# 3. Add the possibility of translating rules back and forth
1718
18- # 4. Make it so you can start with Mitre Att&ck techniques
19+ # 4. Make it so you can start with Mitre Att&ck techniques
1920# and automatically get the right rules set up with your tools :O
2021class Sigma (AppBase ):
2122 __version__ = "1.0.0"
@@ -52,19 +53,19 @@ def get_searches(self, engine, backend, shuffle_namespace):
5253 self .logger .info (f"Dir: { os .listdir (basedir )} " )
5354
5455 rule = shuffle_namespace
55- #filename = "file.yaml"
56+ #filename = "file.yaml"
5657 #with open(filename, "w+") as tmp:
5758 # tmp.write(rule)
58-
59+
5960 code = "sigmac --target=%s" % engine
6061 #if len(backend) > 0:
6162 if backend :
6263 if "list" in backend :
6364 code += "--list"
6465 else :
6566 code += " -c %s" % backend
66-
67- code += " rules/*"
67+
68+ code += " rules/*"
6869 self .logger .info ("Code: " , code )
6970 print (code )
7071 print ()
@@ -83,13 +84,13 @@ def get_searches(self, engine, backend, shuffle_namespace):
8384 else :
8485 print ("FAILED to run bash: " , stdout [1 ])
8586 item = stdout [1 ]
86-
87+
8788 try :
8889 ret = item .decode ("utf-8" )
8990 return ret
9091 except Exception :
9192 return item
92-
93+
9394 return item
9495
9596if __name__ == "__main__" :
0 commit comments