Skip to content

Commit aaed013

Browse files
committed
minor fixes
1 parent f2ddbd7 commit aaed013

File tree

3 files changed

+50
-10
lines changed
  • x-pack/solutions/security
    • plugins/cloud_security_posture/server/routes/graph
    • test
      • cloud_security_posture_api/es_archives/security_alerts
      • cloud_security_posture_functional/es_archives/security_alerts

3 files changed

+50
-10
lines changed

x-pack/solutions/security/plugins/cloud_security_posture/server/routes/graph/fetch_graph.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,6 @@ export const fetchGraph = async ({
7474
"\\"id\\":\\"", _id, "\\"",
7575
",\\"type\\":\\"", docType, "\\"",
7676
",\\"index\\":\\"", _index, "\\"",
77-
${
78-
// Incase we don't fetch from alerts index, ESQL will complain about missing field's mapping
79-
alertsMappingsIncluded
80-
? `CASE (isAlert, CONCAT(",\\"alert\\":", "{",
81-
"\\"ruleName\\":\\"", kibana.alert.rule.name, "\\"",
82-
"}"), ""),`
83-
: ''
84-
}
85-
"}")
8677
${
8778
// ESQL complains about missing field's mapping when we don't fetch from alerts index
8879
alertsMappingsIncluded
@@ -91,6 +82,7 @@ export const fetchGraph = async ({
9182
"}"), ""),`
9283
: ''
9384
}
85+
"}")
9486
| STATS badge = COUNT(*),
9587
docs = VALUES(docData),
9688
ips = VALUES(related.ip),

x-pack/solutions/security/test/cloud_security_posture_api/es_archives/security_alerts/mappings.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,30 @@
2424
"ignore_malformed": false,
2525
"type": "date"
2626
},
27+
"actor": {
28+
"properties": {
29+
"entity": {
30+
"properties": {
31+
"id": {
32+
"ignore_above": 1024,
33+
"type": "keyword"
34+
}
35+
}
36+
}
37+
}
38+
},
39+
"target": {
40+
"properties": {
41+
"entity": {
42+
"properties": {
43+
"id": {
44+
"ignore_above": 1024,
45+
"type": "keyword"
46+
}
47+
}
48+
}
49+
}
50+
},
2751
"agent": {
2852
"properties": {
2953
"build": {

x-pack/solutions/security/test/cloud_security_posture_functional/es_archives/security_alerts/mappings.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,30 @@
2424
"ignore_malformed": false,
2525
"type": "date"
2626
},
27+
"actor": {
28+
"properties": {
29+
"entity": {
30+
"properties": {
31+
"id": {
32+
"ignore_above": 1024,
33+
"type": "keyword"
34+
}
35+
}
36+
}
37+
}
38+
},
39+
"target": {
40+
"properties": {
41+
"entity": {
42+
"properties": {
43+
"id": {
44+
"ignore_above": 1024,
45+
"type": "keyword"
46+
}
47+
}
48+
}
49+
}
50+
},
2751
"agent": {
2852
"properties": {
2953
"build": {
@@ -8664,4 +8688,4 @@
86648688
}
86658689
}
86668690
}
8667-
}
8691+
}

0 commit comments

Comments
 (0)