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

STIX Patterning needs a capability for setting and manipulating variables #73

Open
treyka opened this issue Mar 7, 2018 · 9 comments
Open

Comments

@treyka
Copy link

treyka commented Mar 7, 2018

No description provided.

@johnwunder
Copy link

johnwunder commented Apr 2, 2018

Do you have an elaboration on this? Is it similar to this item? https://github.com/mitre/stix2patterns_translator/wiki/Property-Comparison-Proposal

@ikiril01
Copy link

ikiril01 commented Apr 2, 2018

@johnwunder I think it's the variables/backreferences stuff as we've described here: https://docs.google.com/document/d/15qD9KBQcVcY4FlG9n_VGhqacaeiLlNcQ7zVEjc8I3b4/edit#heading=h.vw8nwfvm4pvm

@treyka
Copy link
Author

treyka commented Apr 4, 2018

@johnwunder What @ikiril01 said...

@gtback
Copy link

gtback commented May 2, 2018

From my comment in a pattern-matcher issue:

For the record, this is also why I'm extremely hesitant to add variables or any other features to the spec. Their meaning may be clear in isolation, but when combined with other features (like how the * and NOT combine in this case), it could lead to ambiguity and misinterpretation.

@treyka
Copy link
Author

treyka commented May 2, 2018

@gtback Given that we are going to add new features to the patterning spec, what would be your recommendation (from an implementer's perspective) as to how to avoid ambiguity?

One approach which I like is to put an optional pattern_version property on the STIX Indicator and use minor release numbers (a la 2.1.1) to allow vetting additions to the patterning spec in code. If you get a STIX 2.1 Indicator, you parse as a stock 2.1 pattern. If the pattern_version property is set and you're not expecting to interact with bleeding-edge patterning additions, you can just log an error and drop the input.

@gtback
Copy link

gtback commented May 2, 2018

First, don't introduce changes that break old patterns. Every valid STIX 2.0 pattern should be a valid STIX 2.1 pattern. I don't expect any problems with this, but want to be explicit.

Second, I'm not talking about ambiguous STIX 2.x content (what versions/features are used in any particular pattern); I'm talking about ambiguity in how different features of the patterning specification interact. For example:

  • Do arithmetic operations that work on timestamps affect how START/STOP or WITHIN clauses work? Maybe not, since START/STOP/WITHIN apply to the timestamp of the observation, while operations might only be allowed to apply to properties of the thing being observed. But this should be explicit.
  • When casting data, does that affect how incompatible data types are handled, especially for comparison operators like <?
  • Does is_null() or a NULL constant work with list elements ([*]), or the IN operator, etc.?

Adding new fields to STIX data types, or even new STIX data types (or adding a new Comparsion operator to patterns), makes a roughly linear addition to complexity (like adding a new element to a list). But adding new features to STIX patterns multiplies the complexity of code that evaluates patterns (like adding a new dimension; every new features must be considered in combination with every other feature, and subset of features).

Most of the pattern spec is devoted to how to express patterns, not how to evaluate them. There are admittedly a lot of statements about evaluating them as well, but they're scattered throughout the spec with no real guidance about how to combine them or how to resolve conflicting information between them (for example, the issue I linked to).


To more directly answer your question, I don't think there should be versions of the patterning spec released between versions of STIX (like 2.1.1). Being able to parse a STIX 2.1 indicator means you should be able to parse a STIX 2.1 pattern. We've already given up on any substantial interoperability guarantees (forward or backward) between STIX 2.0 and STIX 2.1; let's not exacerbate that within STIX 2.1.

@jmgnc
Copy link

jmgnc commented May 8, 2018

@treyka I don't think this is a breaking change.

@jordan2175
Copy link

We talked about this on 2019-06-05 and we need more fleshed out use cases and propose that this be looked at again in 2.2 time frame.

@srrelitz2
Copy link
Contributor

Reach out to OCA about STIX shifter to coordinate cross system interoperability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants