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

Feature Request: Allow specification of Timestamp Precision #9

Open
packet-rat opened this issue Apr 15, 2019 · 18 comments
Open

Feature Request: Allow specification of Timestamp Precision #9

packet-rat opened this issue Apr 15, 2019 · 18 comments

Comments

@packet-rat
Copy link

Allow specification of Timestamp Precision for generated sightings, observered_data, etc. where assertion on the actual time of the event are made.

@StephenOTT
Copy link
Owner

Great idea💡

@StephenOTT
Copy link
Owner

@packet-rat I would like to get a bit more info about the needs.

Is the goal here to have greater precision? Or to have timestamps with 1 and 2 digits for sub-second precision ?

such as .1Z, .10Z, and .100Z ?

@packet-rat
Copy link
Author

packet-rat commented Apr 16, 2019 via email

@StephenOTT
Copy link
Owner

Okay I understand the use case. But what is the precision implementation you need to support? You want to generate sample data with timestamps that are close together based on granularity?

You want subsecond precision beyond 3 digits?

Can you give me a few timestamp examples of the differences in precision you want to generate?

@StephenOTT
Copy link
Owner

@packet-rat support for this in inbound.

The STIX-Java library has a pending update for release that will provide nano-second precision date support. This be released soon in next few days

@StephenOTT
Copy link
Owner

StephenOTT/STIX-Java#94

@StephenOTT
Copy link
Owner

@packet-rat would you expect to want/need to set precisions on a per field basis? Or more of a global precision?

Example if a object has three date fields, would you just want to set "9 digits of precision", or would you want to set precisions for each field?

@packet-rat
Copy link
Author

packet-rat commented Apr 27, 2019 via email

@StephenOTT
Copy link
Owner

So my iteration 1 plan would be:

Make observables configurable with a lower date (what is the oldest date), and make each date field of each observable configurable for precision (number of digits).

So in the rest api, you will provide a probably query params where you can configure each fieldname with digit counts.

Likely will also convert this to supporting a Json body so eventually all fields can be configured in different ways.

The patch that was merged yesterday into STIX-Java now supports fully configurable date precision. So just need to update Faker with this support to provide configs into the date generators.

@StephenOTT
Copy link
Owner

@packet-rat check out the first iteration of support for configurable data generation

https://github.com/StephenOTT/STIX-Faker/tree/0.8.0#observed-data

use the 0.8.0 release.

See the https://github.com/StephenOTT/STIX-Faker/blob/master/src/main/groovy/io/digitalstate/stix/faker/configs/ObservedDataGeneratorConfig.groovy for other configuration fields

@packet-rat
Copy link
Author

packet-rat commented Apr 30, 2019 via email

@StephenOTT
Copy link
Owner

@packet-rat you will have to adjust the various date fields to support the times you want.

Each date field is a Instant. So it will support a ISO 8601 String such as 2019-01-01T12:00:00.000Z

See the https://github.com/StephenOTT/STIX-Faker/blob/master/src/main/groovy/io/digitalstate/stix/faker/configs/ObservedDataGeneratorConfig.groovy for the various instant fields.

as a example:

{
	"propCreatedLowerDate": "2019-01-01T12:00:00.000Z",
	"propCreatedUpperDate": "2019-01-02T12:00:00.000Z",
	"propCreatedProbability": 100,
	"propFirstObservedSubsecondPrecision": 9,
	"propLastObservedSubsecondPrecision": 6,
	"macAddressCoo": {
		"occurrence_probability": 100,
		"occurs_count_lower": 99,
		"occurs_count_upper": 100
	}
}

Like what you want to be editing is a combination of:

  1. propCreatedLowerDate
  2. propCreatedUpperDate
  3. propFirstObservedLowerDate
  4. propFirstObservedUpperDate
  5. propFirstObservedSubsecondPrecision
  6. propLastObservedUpperDate
  7. propLastObservedSubsecondPrecision

Note: The Lower Date on Last Observed is automatically set for you (the last observed LOWER is the First Observed date.

@packet-rat
Copy link
Author

packet-rat commented Apr 30, 2019 via email

@StephenOTT
Copy link
Owner

Let me know how it works out

@StephenOTT
Copy link
Owner

@packet-rat, was just thinking about your use case you raised above: take a look at: https://github.com/StephenOTT/TAXII-springboot-bpmn. The ability to route decisions based on stix data would likely fit nicely with your analysis capabilities. So the analysis is done by your existing worker, and the decision flow and which analysis you want to conduct when / at which step, might be a good fit for you

@StephenOTT
Copy link
Owner

@packet-rat have you had a chance to test?

@packet-rat
Copy link
Author

packet-rat commented May 31, 2019 via email

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

No branches or pull requests

2 participants