-
Notifications
You must be signed in to change notification settings - Fork 85
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
AF-10: Autocomplete #95
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. A couple changes requested:
- Please add the explanation for updating the intel file to the developers.rst doc.
- Some of the other dropdowns are broken:
- The Tactic ID and Technique ID should only be the TA### and T### numbers, not including the technique name.
One other thing I noticed is that unfocusing the autocomplete list can be tricky. In the interest of shipping this feature, it shouldn't block this PR, but please add an issue to our backlog so we can keep track of this:
- My first attempt to unfocus was to click on the main canvas, but that of course also deselects the currently selected item. Would it be possible to only unfocus the text box?
- I also tried typing escape to dismiss the autocomplete, but
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved pending the item we discussed over the phone...
SonarCloud Quality Gate failed. 1 Bug No Coverage information Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Implements ATT&CK autocomplete features.
Overview:
In order to support this feature, this PR introduces the
suggestions
configuration key toStringProperty
. Now, anyStringProperty
can be configured to suggest zero or more predefined strings to the user. Suggestions are presented to the user when they select an empty text field and are progressively filtered out as text is typed.This PR also introduces an Intelligence File (
builder.config.intel.ts
). This new configuration file drives the application's autocomplete features. This file is generated automatically by a set of scripts which download and organize relevant ATT&CK information into a format the application can leverage.The Intelligence File is imported into the builder's configuration file (
builder.config.ts
) and is used to configure the autocomplete functionality of thetactic_id
andtechnique_id
properties (via the newsuggestions
configuration key).Updating the Intelligence File
Simply invoke
npm run update-intel
to update the Intelligence File.The configured list of sources can be modified at any time from
download_sources.js
Cross-field Autofill
In order to support Autofill (in which one autocompleted field automatically fills out other related fields), this PR introduces the Processor construct. A Processor extends from
DiagramProcessor
. Much like aDiagramPublisher
orDiagramValidator
, the developer must implement their ownDiagramProcessor
and configure it via the main configuration file (builder.config.ts
). Only oneDiagramProcessor
can be registered with the application at a time.A processor's job is to intercept and "process" commands issued, by the interface, to the
Page
. This construct allows anyPageCommand
to be captured, modified, and forwarded according to the needs of the application.For the purposes of the builder,
AttackFlowProcessor
(builder.config.processor.ts
) has been implemented and configured. This processor:SetStringProperty
commands that modify an action'stactic_id
ortechnique_id
properties.tactic_ref
,technique_ref
, etc.)SetStringProperty
for each related property that can be autofilled (using intel from the Intelligence File).SetStringProperty
commands into a singleGroupCommand
.GroupCommand
along (to be executed by the application).All other command types are forwarded along without modification.