[ti_opencti] OpenCTI integration - #7385
Conversation
💔 Build Failed
Expand to view the summary
Build stats
Test stats 🧪
Steps errors
Expand to view the steps failures
|
🌐 Coverage report
|
ebeahan
left a comment
There was a problem hiding this comment.
Great work! I added some nits as a scanned your progress so far.
For the list of remaining items under To Do, let's talk to @jamiehynds if there are items/features we can descope in this initial version. For example, maybe we don't need to support additional auth methods, likemTLS certificate and OAuth2, up front.
|
/test |
|
/test |
|
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
|
@jsoriano I suspect the "run all the things" testing here is because of the change to links_table.yml. This is a similar situation to what I saw when I changed the pr template. Should we be doing a full test of all packages when this file changes? (I can see that we should do a check to make sure the change has not broken any generated docs). |
Yes, it looks like a check would be enough, or we could try to make the pipeline smarter and detect what packages are using each link. Could you please open an issue to improve the situation? Though this file doesn't change frequently. |
jsoriano
left a comment
There was a problem hiding this comment.
Change in CODEOWNERS and links table looks good to me.
|
The test failure here is unrelated; due to sql_input. This is being tested because of the change in the links_table.yml file. This is #8077. |
…t conflicts with the 'SEI Integration Dashboard styling guide' recommendation 'Only use filters on visualizations panels, not dashboards'.
This reverts commit 9a90cdaa084c15cf54a81c29e08a5c02954220ea.
…observable processing.
taylor-swanson
left a comment
There was a problem hiding this comment.
Just a couple of typos to fix, but otherwise LGTM
|
@chrisberkhout anything else you need here or is this ready to merge and release? |
|
@ebeahan All feedback addressed and tests for this integration are passing. I think this is good to go. It looks like I can't override and merge without tests passing, but if someone else can that would be good. |
|
Package ti_opencti - 0.1.0 containing this change is available at https://epr.elastic.co/search?package=ti_opencti |
|
a pleasant surprise to see this pop up, nice work @chrisberkhout ! |
* Initial commit of ti_opencti.
* Fix cel program, add sys test, show vars.
* Note about CEL encode_json() workaround.
* Update graphql query.
* Add some initial field config.
* Older start to ingest pipeline.
* Basic ingest pipeline.
* A working pipeline.
* Basic mappings done, for indicator and observables and each observable type.
* Delete obsolete system test data.
* Update CODEOWNERS.
* Add responses for system test.
* Add pipeline tests.
* Fixes to make tests run without error.
* Rename pipeline test files to have test- prefix.
* Rename input.yml.hbs to cel.yml.hbs.
* Tidy whitespace.
* Move state section with GraphQL query to the end.
* Switch to dynamic ECS mappings.
* Override expected values for some ECS fields, so validation passes during system tests.
* Remove not necessary and not allowed expected_values fields.
* Match threat.indicator.confidence value to ECS expectations (Med->Medium).
* Remove LICENSE.txt, to fall back to the default at the repo root.
* Replace placeholder logo with OpenCTI logo.
* Correct ecs.version field value.
* Add a link to the GraphQL schema.
* Remove commented-out fields from GraphQL query.
* Update pipeline tests expected results for correct ecs.version.
* For ECS, remove any subnet mask from IP values arriving in CIDR notation.
* Add descriptions for opencti fields.
* Update package manifest format version.
* Fill out draft PR number in changelog.
* Expanded GraphQL API info comment.
* Update field types for opencti fields.
* Move additional hash fields to ECS file since they're nested under the ECS threat fields.
* Fix related.hash to be one array, not separated out by hash algorithm.
* Move opencti.* field definitions to their own file.
* Tolerate URLs that can't be parsed. e.g. '127.0.0.1:8080/path/'.
* Extract file extensions from file names.
* Don't extract a drive_letter or directory from a directory path.
* Revert "Replace placeholder logo with OpenCTI logo."
This reverts commit 7e27677d4b6ecb43601fe1ed0c7dec0b71baac06.
* Replace placeholder logo with OpenCTI logo (this time as an SVG).
* Remove config variable preserve_duplicate_custom_fields.
* Update some fields.
* Combine and test kill chain fields.
* Merge opencti.observable.process.startup_info into one object, index as flattened.
* Clean up createdBy after renaming the fields it contains.
* Don't keep description if it's empty or null.
* Clean up related.* lists properly.
* Set threat.indicator.reference using _conf.url.
* Clean up temporary variable usage: put them at the root with a _tmp prefix.
* Tidy.
* Handle preserve_original_event in the CEL expression.
* Fix tags in pipeline tests.
* Rename placeholder screenshot.
* Tidy up manifest.yml files, options and option handling.
* Remove the workout for CEL's encode_json() on nested data, since the fix is in 8.9.0.
* Improve CEL program.
* Fix formatting.
* Fix mix up of handlebars vs CEL variables.
* Bring back the CEL encode_json() workaround.
* Remove the CEL encode_json() workaround.
* Remove handlebars template logic from CEL expression.
* Include generated sample event.
* README.
* Set the threat.indicator.url.full field.
* Allow Kibana 8.9.0 (also 8.9.0 is the minimum beats for CEL encode_json() fix).
* Add pipeline step to set ecs-indicator-detail tag.
* Set value for threat.feed.dashboard_id.
* Bring back expected_values overrides for threat.indicator.{name,type}, since they're now needed.
* Add dashboards.
* Add screenshots (wide versions).
* Screenshots - narrow versions.
* Screenshot of the "Add Integration" page on Fleet added.
* New expected_values workaround.
* README: ECS fields doc.
* Map created to event.created and leave @timestamp to receive its default value.
* Clean up timestamp documentation.
* Update dashboards to use logs-* and bring back controls.
* Improve URL for linking to OpenCTI documentation.
* README: Additional info about data models and approach to mapping.
* Populate threat.indicator.url.* fields for domain-name and hostname indicator types.
* Mark as secret the vars for api_key, oauth2 and ssl.
* Version bump.
* Update package manifest.yml to format_version 3.0.0.
* Ignore error 'expected filter in dashboard: no filter found', since it conflicts with the 'SEI Integration Dashboard styling guide' recommendation 'Only use filters on visualizations panels, not dashboards'.
* Avoid failing pipeline benchmarks due to missing _conf.url field.
* Revert "Mark as secret the vars for api_key, oauth2 and ssl."
This reverts commit 9a90cdaa084c15cf54a81c29e08a5c02954220ea.
* ECS 8.10
* Relocate redact config.
* Use triple curly brackets to access field values in template snippets.
* Single-quote string to avoid escaping.
* Improved failure handler.
* Don't keep empty hash fields.
* Remove unused ad-hoc data views from dashboards.
* Switch opencti field definitions to be nested rather than flattened.
* Fix field type for hash group.
* Do clean up observable fieldsets and observable itself at the end of observable processing.
* Comment on which validation is excluded.
* Fix typos.
Proposed commit message
Background
OpenCTI integration development notes has some some background information about OpenCTI and the approach taken with this integration.
OpenCTI Mappings is a spreadsheet with field-level notes.
Status
What's working
This version is ready for final review and then release.
Since the demo timestamp mapping has been changed. The current mappings of the various timestamps are described in the README. The motivations for the change were to show incoming data at recent
@timestampvalues for a more intuitive user experience, and to build visualizations onlogs-*rather than ad-hoc data views to avoid issues with persistent visualization errors and controls not working.Potential future enhancements
Infosec have said that, in general, observables will be present. For the demo.opencti.io data, only about 0.17% of indicators have a STIX pattern but no observables.
How to test this PR locally
Build and install the integration as usual:
With a free account on the OpenCTI public demo instance you can get an API key (in the UI under Profile > API access) that will work as a bearer token as long as you're logged in. The OpenCTI demo instance has about 1.2 million indicators. The API token and base URL are the only setting required when adding a policy.
Making dashboard changes
If dashboards need to be updated, it may be necessary to downgrade to version 8.7.1 of the stack and export them from there, to avoid failing with the error "packages with dashboards exported since Kibana 8.8.0 may not be installed till 8.10.0, please export the dashboard/s from a different version". To make the integration work on 8.7.1, some further changes are necessary:
Changes necessary to run on 8.7.1
Checklist
changelog.ymlfile.Related issues
Screenshots
Please see the screenshots in the integration.