Skip to content

Commit

Permalink
[frontend] Clean up entity-type filter in Correlation Graphs
Browse files Browse the repository at this point in the history
The "entity_*" options shouldn't show up as an option in the Correlation
Knowledge graphs. Additionally, an Analysis Report Correlation Graph
shouldn't allow the Report or Reported-in options in the entity-type
filter, either.
  • Loading branch information
ckane committed May 28, 2024
1 parent 3eb75c4 commit 0081692
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,10 @@ class GroupingKnowledgeCorrelationComponent extends Component {
const selectedEntities = [...this.selectedLinks, ...this.selectedNodes];
const sortByLabel = R.sortBy(R.compose(R.toLower, R.prop('tlabel')));
const stixCoreObjectsTypes = R.pipe(
R.filter((n) => n.node.entity_type
&& n.node.entity_type.length > 1
&& n.node.entity_type[0] != n.node.entity_type[0].toLowerCase()
),
R.map((n) => R.assoc(
'tlabel',
t(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,10 @@ class ReportKnowledgeCorrelationComponent extends Component {
const selectedEntities = [...this.selectedLinks, ...this.selectedNodes];
const sortByLabel = R.sortBy(R.compose(R.toLower, R.prop('tlabel')));
const stixCoreObjectsTypes = R.pipe(
R.filter((n) => n.node.entity_type
&& n.node.entity_type.length > 1
&& n.node.entity_type[0] != n.node.entity_type[0].toLowerCase()
),
R.map((n) => R.assoc(
'tlabel',
t(
Expand All @@ -858,7 +862,6 @@ class ReportKnowledgeCorrelationComponent extends Component {
sortByLabel,
R.map((n) => n.node.entity_type),
R.filter((n) => n && n.length > 0),
R.concat(['Report', 'reported-in']),
R.uniq,
)(report.objects.edges);
const markedBy = R.uniqBy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,10 @@ class IncidentKnowledgeCorrelationComponent extends Component {
const selectedEntities = [...this.selectedLinks, ...this.selectedNodes];
const sortByLabel = R.sortBy(R.compose(R.toLower, R.prop('tlabel')));
const stixCoreObjectsTypes = R.pipe(
R.filter((n) => n.node.entity_type
&& n.node.entity_type.length > 1
&& n.node.entity_type[0] != n.node.entity_type[0].toLowerCase()
),
R.map((n) => R.assoc(
'tlabel',
t(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,10 @@ class CaseRfiKnowledgeCorrelationComponent extends Component {
const selectedEntities = [...this.selectedLinks, ...this.selectedNodes];
const sortByLabel = R.sortBy(R.compose(R.toLower, R.prop('tlabel')));
const stixCoreObjectsTypes = R.pipe(
R.filter((n) => n.node.entity_type
&& n.node.entity_type.length > 1
&& n.node.entity_type[0] != n.node.entity_type[0].toLowerCase()
),
R.map((n) => R.assoc(
'tlabel',
t(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,10 @@ class CaseRftKnowledgeCorrelationComponent extends Component {
const selectedEntities = [...this.selectedLinks, ...this.selectedNodes];
const sortByLabel = R.sortBy(R.compose(R.toLower, R.prop('tlabel')));
const stixCoreObjectsTypes = R.pipe(
R.filter((n) => n.node.entity_type
&& n.node.entity_type.length > 1
&& n.node.entity_type[0] != n.node.entity_type[0].toLowerCase()
),
R.map((n) => R.assoc(
'tlabel',
t(
Expand Down

0 comments on commit 0081692

Please sign in to comment.