-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better STIX Parsing #23
Comments
@FloatingGhost I added sample code but the formatting is not cooperating. Can you help me fix it please? |
Sounds like some very sane ideas! |
o christ on a quadbike that's a lot of edited code I might take a look when I'm feeling more masochistic than usual |
@FloatingGhost lol most of it is just the parsing of the different observable types taken directly from the existing code. |
Nothing with STIX is ever "JUST" It's always rooted to the hellish floor of the so-called standard and is never as simple as it seems. Inevitably there'll be a tendril of this eldritch horror that extends beyond the realm of human comprehension and into STIX world, in which it terminates in the STIXPackage of unimaginable terror |
@alatif113, could you do a pull request for the changes? It does sound like a clean approach indeed. |
@iglocska I'm not very git savvy. Don't really know how to do that. |
Should be simple enough, simply fork the project by clicking the "Fork" button on top, this will create a copy of the repository under your user name on github, so https://github.com/alatif113/MISP-STIX-Converter You already have the code-base sitting locally on your machine, which is what you have modified. Create a commit with all of your changes by simply doing the following:
Repeat it for all of the files that you have modified (to see a list of all files that you've changed just type Once you are done it's time to commit the changes:
Once done, add your own github repository as a remote
Then push your committed changes to your fork:
Once this is done, just go to
and open up a pull request by clicking the "New pull request" button (upper left side, next to the branch name) This should be it! |
@iglocska Ahh I see what you mean. I didn't edit any files directly (I didnt need the MISP to STIX part), but rather created my own 2 files (in the code above) solely for parsing and importing STIX to MISP, heavily using code that already existed within the project to parse the actual observable types. It's just a proof of concept and is missing trivial things such as error checking and logging. |
Ah ok, I see. Any chance you could move that to MISP-STIX-Converter and integrate it directly? Or is it too different from how the converter works? |
@iglocska I think replacing the There would also need to be some agreement on the taxonomy for tags. I use Unfortunately I don't have the time to actually go through and do that (not at the moment at least). Just wanted to bring something to the dev's attention with sample code I utilized for my use case. |
Thanks a lot for the input, we'll keep this issue open until we can get around to implementing it. It indeed looks very promising! |
@iglocska No problem! Got the idea from how many of the SIEMs and commercial threat platforms parse STIX files. |
Well if they parsed MISP everyone's life would be a lot easier :< STIX needs to die. |
It looks like it's here to stay though, so we should make sure that the parser makes as much sense as possible - we'll definitely take a look at this too at some point, @FloatingGhost, to preserve some of your sanity ;)) |
Any updates on this? @iglocska , it seems you approve of the general idea and there is demand for this feature. Any chance of accepting PR's related to this soon? |
@alatif113 I have a Pending PR #40 that addresses some of what you're wanting, care to take a look and comment? This is an important subject for me as well. |
So we don't really maintain this as there is a full-blown STIX 1.x and 2.x import/export in MISP. As the original maintainer is not maintaining this external package anymore, I can merge those. Just let me know if it works for you and I'll merge it. |
@adulau it would be great if you can merge it. But I didn't know about the MISP feature for STIX import, do you know why MISP-Taxii-Server isn't using that? That's the only way to feed MISP with TAXII that I've found, can you point me in the direction of the docs that show how to import STIX directly into MISP The STIX section here: https://pymisp.readthedocs.io/en/latest/tools.html uses pymisp.tools which in turn uses this project. Edit: I figured out the |
Currently every observable is parsed out of a given STIX input and added as an attribute to a MISP event. In many cases this can give undesired results. A better solution would be as follows:
Here's some sample code of my implementation (It was a rush job so there is no logging/error checking in most of it) Simply import the
stix_to_misp.py
file and call thebuild_event
method to create a MISP event. I use my own taxonomy for confidence and TTPs, but those can be changed as needed:stix_parser.py
stix_to_misp.py
The text was updated successfully, but these errors were encountered: