Skip to content
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

check the pattern parsing #7

Open
priamai opened this issue Mar 14, 2023 · 3 comments
Open

check the pattern parsing #7

priamai opened this issue Mar 14, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@priamai
Copy link
Contributor

priamai commented Mar 14, 2023

Hello @brettforbes, I discovered that we can already leverage the ANTLR parsing engine.
Look into this code in particular the last part:

https://github.com/os-threat/Stix-ORM/blob/patterns/test/test_patterns.py

For example:
pattern = TreePattern("[domain-name:value = 'http://xyz.com/download']")

Produces a dict tree:

pattern:
  observation:
    objects: {domain-name}
    join:
    qualifiers:
    expressions:
      - comparison:
          object: domain-name
          path: [value]
          negated:
          operator: '='
          value: http://xyz.com/download

Will this be enough to produce the queries?

@priamai priamai added the enhancement New feature or request label Mar 14, 2023
@brettforbes
Copy link
Collaborator

lets talk at kanban, might be

@priamai
Copy link
Contributor Author

priamai commented Mar 14, 2023

I will put some examples for domains, url and IP address as queries strings.

@priamai
Copy link
Contributor Author

priamai commented Mar 14, 2023

Hello, I made a simplified example here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants