|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: Correlation engine APIs |
| 4 | +parent: API tools |
| 5 | +nav_order: 55 |
| 6 | +--- |
| 7 | + |
| 8 | + |
| 9 | +# Correlation engine APIs |
| 10 | + |
| 11 | +Correlation engine APIs allow you to create new correlation rules, view findings and correlations within a certain time window, and perform other tasks. |
| 12 | + |
| 13 | + |
| 14 | +## Create correlation rules between log types |
| 15 | + |
| 16 | +This API is used to create correlation rules: |
| 17 | + |
| 18 | +```json |
| 19 | +POST /_plugins/_security_analytics/correlation/rules |
| 20 | +``` |
| 21 | + |
| 22 | +### Request fields |
| 23 | + |
| 24 | +| Field | Type | Description | |
| 25 | +| :--- | :--- |:--- | |
| 26 | +| `index` | String | The name of the index used as the log source. | |
| 27 | +| `query` | String | The query used to filter security logs for correlation. | |
| 28 | +| `category` | String | The log type associated with the log source. | |
| 29 | + |
| 30 | +#### Example request |
| 31 | + |
| 32 | +```json |
| 33 | +POST /_plugins/_security_analytics/correlation/rules |
| 34 | +{ |
| 35 | + "correlate": [ |
| 36 | + { |
| 37 | + "index": "vpc_flow", |
| 38 | + "query": "dstaddr:4.5.6.7 or dstaddr:4.5.6.6", |
| 39 | + "category": "network" |
| 40 | + }, |
| 41 | + { |
| 42 | + "index": "windows", |
| 43 | + "query": "winlog.event_data.SubjectDomainName:NTAUTHORI*", |
| 44 | + "category": "windows" |
| 45 | + }, |
| 46 | + { |
| 47 | + "index": "ad_logs", |
| 48 | + "query": "ResultType:50126", |
| 49 | + "category": "ad_ldap" |
| 50 | + }, |
| 51 | + { |
| 52 | + "index": "app_logs", |
| 53 | + "query": "endpoint:/customer_records.txt", |
| 54 | + "category": "others_application" |
| 55 | + } |
| 56 | + ] |
| 57 | +} |
| 58 | +``` |
| 59 | +{% include copy-curl.html %} |
| 60 | + |
| 61 | +#### Example response |
| 62 | + |
| 63 | +```json |
| 64 | +{ |
| 65 | + "_id": "DxKEUIkBpIjg64IK4nXg", |
| 66 | + "_version": 1, |
| 67 | + "rule": { |
| 68 | + "name": null, |
| 69 | + "correlate": [ |
| 70 | + { |
| 71 | + "index": "vpc_flow", |
| 72 | + "query": "dstaddr:4.5.6.7 or dstaddr:4.5.6.6", |
| 73 | + "category": "network" |
| 74 | + }, |
| 75 | + { |
| 76 | + "index": "windows", |
| 77 | + "query": "winlog.event_data.SubjectDomainName:NTAUTHORI*", |
| 78 | + "category": "windows" |
| 79 | + }, |
| 80 | + { |
| 81 | + "index": "ad_logs", |
| 82 | + "query": "ResultType:50126", |
| 83 | + "category": "ad_ldap" |
| 84 | + }, |
| 85 | + { |
| 86 | + "index": "app_logs", |
| 87 | + "query": "endpoint:/customer_records.txt", |
| 88 | + "category": "others_application" |
| 89 | + } |
| 90 | + ] |
| 91 | + } |
| 92 | +} |
| 93 | +``` |
| 94 | + |
| 95 | +### Response fields |
| 96 | + |
| 97 | +| Field | Type | Description | |
| 98 | +| :--- | :--- |:--- | |
| 99 | +| `_id` | String | The Id for the new rule. | |
| 100 | + |
| 101 | + |
| 102 | +## List all findings and their correlations within a time window |
| 103 | + |
| 104 | +This API provides a list of all findings and their correlations within a specified time window: |
| 105 | + |
| 106 | +```json |
| 107 | +GET /_plugins/_security_analytics/correlations?start_timestamp=<start time in milliseconds>&end_timestamp=<end time in milliseconds> |
| 108 | +``` |
| 109 | + |
| 110 | +### Query parameters |
| 111 | + |
| 112 | +| Parameter | Type | Description | |
| 113 | +| :--- | :--- |:--- | |
| 114 | +| `start_timestamp` | Number | Start time for the time window, in milliseconds. | |
| 115 | +| `end_timestamp` | Number | End time for the time window, in milliseconds. | |
| 116 | + |
| 117 | +#### Example request |
| 118 | + |
| 119 | +```json |
| 120 | +GET /_plugins/_security_analytics/correlations?start_timestamp=1689289210000&end_timestamp=1689300010000 |
| 121 | +``` |
| 122 | +{% include copy-curl.html %} |
| 123 | + |
| 124 | +#### Example response |
| 125 | + |
| 126 | +```json |
| 127 | +{ |
| 128 | + "findings": [ |
| 129 | + { |
| 130 | + "finding1": "931de5f0-a276-45d5-9cdb-83e1045a3630", |
| 131 | + "logType1": "network", |
| 132 | + "finding2": "1e6f6a12-83f1-4a38-9bb8-648f196859cc", |
| 133 | + "logType2": "test_windows", |
| 134 | + "rules": [ |
| 135 | + "nqI2TokBgL5wWFPZ6Gfu" |
| 136 | + ] |
| 137 | + } |
| 138 | + ] |
| 139 | +} |
| 140 | +``` |
| 141 | + |
| 142 | +### Response fields |
| 143 | + |
| 144 | +| Field | Type | Description | |
| 145 | +| :--- | :--- |:--- | |
| 146 | +| `finding1` | String | The Id for a first finding in the correlation. | |
| 147 | +| `logType1` | String | The log type associated with the first finding. | |
| 148 | +| `finding2` | String | The Id for a second finding in the correlation. | |
| 149 | +| `logType2` | String | The log type associated with the second finding. | |
| 150 | +| `rules` | Array | A list of correlation rule IDs associated with the correlated findings. | |
| 151 | + |
| 152 | + |
| 153 | +## List correlations for a finding belonging to a log type |
| 154 | + |
| 155 | +This API is used to list correlations for specific findings and the log types associated with them: |
| 156 | + |
| 157 | +```json |
| 158 | +GET /_plugins/_security_analytics/findings/correlate?finding=425dce0b-f5ee-4889-b0c0-7d15669f0871&detector_type=ad_ldap&nearby_findings=20&time_window=10m |
| 159 | +``` |
| 160 | + |
| 161 | +### Query parameters |
| 162 | + |
| 163 | +| Parameter | Type | Description | |
| 164 | +| :--- | :--- |:--- | |
| 165 | +| `finding` | String | The finding ID. | |
| 166 | +| `detector_type` | String | The log type for the detector. | |
| 167 | +| `nearby_findings` | Number | The number of nearby findings with respect to the given finding Id. | |
| 168 | +| `time_window` | String | Sets a time window in which all of the correlations must have occurred together. | |
| 169 | + |
| 170 | + |
| 171 | +#### Example request |
| 172 | + |
| 173 | +```json |
| 174 | +GET /_plugins/_security_analytics/findings/correlate?finding=425dce0b-f5ee-4889-b0c0-7d15669f0871&detector_type=ad_ldap&nearby_findings=20&time_window=10m |
| 175 | +``` |
| 176 | +{% include copy-curl.html %} |
| 177 | + |
| 178 | +#### Example response |
| 179 | + |
| 180 | +```json |
| 181 | +{ |
| 182 | + "findings": [ |
| 183 | + { |
| 184 | + "finding": "5c661104-aaa9-484b-a91f-9cad4ae6d5f5", |
| 185 | + "detector_type": "others_application", |
| 186 | + "score": 0.000015182109564193524 |
| 187 | + }, |
| 188 | + { |
| 189 | + "finding": "2485b623-6573-42f4-a055-9b927e38a65f", |
| 190 | + "detector_type": "ad_ldap", |
| 191 | + "score": 0.000001615897872397909 |
| 192 | + }, |
| 193 | + { |
| 194 | + "finding": "051e00ad-5996-4c41-be20-f992451d1331", |
| 195 | + "detector_type": "windows", |
| 196 | + "score": 0.000016230604160227813 |
| 197 | + }, |
| 198 | + { |
| 199 | + "finding": "f11ca8a3-50d7-4074-a951-51439aa9e67b", |
| 200 | + "detector_type": "s3", |
| 201 | + "score": 0.000001759401811796124 |
| 202 | + }, |
| 203 | + { |
| 204 | + "finding": "9b86980e-5fb7-4c5a-bd1b-879a1e3baf12", |
| 205 | + "detector_type": "network", |
| 206 | + "score": 0.0000016306962606904563 |
| 207 | + }, |
| 208 | + { |
| 209 | + "finding": "e7dea5a1-164f-48f9-880e-4ba33e508713", |
| 210 | + "detector_type": "network", |
| 211 | + "score": 0.00001632626481296029 |
| 212 | + } |
| 213 | + ] |
| 214 | +} |
| 215 | +``` |
| 216 | + |
| 217 | +### Response fields |
| 218 | + |
| 219 | +| Field | Type | Description | |
| 220 | +| :--- | :--- |:--- | |
| 221 | +| `finding` | String | The finding ID. | |
| 222 | +| `detector_type` | String | The log type associated with the finding. | |
| 223 | +| `score` | Number | The correlation score for the correlated finding. The score is based on the proximity of relevant findings in the threat scenario defined by the correlation rule. | |
| 224 | + |
0 commit comments