|
1 | 1 | ---
|
2 |
| -description: Pipeline for processing sample logs |
| 2 | +description: Pipeline for processing Harmony Endpoint Forensics logs |
3 | 3 | processors:
|
4 |
| -- set: |
5 |
| - field: event.ingested |
6 |
| - value: '{{_ingest.timestamp}}' |
| 4 | + - set: |
| 5 | + field: ecs.version |
| 6 | + value: "8.11.0" |
| 7 | + - set: |
| 8 | + field: event.ingested |
| 9 | + value: "{{_ingest.timestamp}}" |
| 10 | + - set: |
| 11 | + field: event.kind |
| 12 | + value: alert |
| 13 | + - rename: |
| 14 | + field: message |
| 15 | + target_field: event.original |
| 16 | + ignore_missing: true |
| 17 | + if: ctx.event?.original == null |
| 18 | + - json: |
| 19 | + field: event.original |
| 20 | + target_field: json |
| 21 | + ignore_failure: true |
| 22 | + - date: |
| 23 | + field: json.time |
| 24 | + target_field: event.created # Issue: When set to "@timestamp", event creation fails. |
| 25 | + formats: |
| 26 | + - strict_date_optional_time_nanos |
| 27 | + ignore_failure: true |
| 28 | + - rename: |
| 29 | + field: json.id |
| 30 | + target_field: event.id |
| 31 | + ignore_missing: true |
| 32 | + ignore_failure: true |
| 33 | + - rename: |
| 34 | + field: json.action |
| 35 | + target_field: event.action |
| 36 | + ignore_missing: true |
| 37 | + ignore_failure: true |
| 38 | + - set: |
| 39 | + field: event.dataset |
| 40 | + value: harmony_endpoint.forensics |
| 41 | + - set: |
| 42 | + field: event.module |
| 43 | + value: harmony_endpoint |
| 44 | + - set: |
| 45 | + field: event.category |
| 46 | + value: malware |
| 47 | + - set: |
| 48 | + field: event.type |
| 49 | + value: info |
| 50 | + - rename: |
| 51 | + field: json.host_type |
| 52 | + target_field: host.type |
| 53 | + ignore_missing: true |
| 54 | + ignore_failure: true |
| 55 | + - rename: |
| 56 | + field: json.src |
| 57 | + target_field: host.ip |
| 58 | + override: true |
| 59 | + ignore_missing: true |
| 60 | + ignore_failure: true |
| 61 | + - rename: |
| 62 | + field: json.src_machine_name |
| 63 | + target_field: host.hostname |
| 64 | + override: true |
| 65 | + ignore_missing: true |
| 66 | + ignore_failure: true |
| 67 | + - set: |
| 68 | + field: host.name |
| 69 | + copy_from: host.hostname |
| 70 | + - join: |
| 71 | + field: json.os_name |
| 72 | + target_field: host.os.name |
| 73 | + separator: ',' |
| 74 | + if: ctx.json?.os_name != null |
| 75 | + ignore_failure: true |
| 76 | + - join: |
| 77 | + field: json.os_version |
| 78 | + target_field: host.os.version |
| 79 | + separator: ',' |
| 80 | + if: ctx.json?.os_version != null |
| 81 | + ignore_failure: true |
| 82 | + - rename: |
| 83 | + field: json.domain |
| 84 | + target_field: user.domain |
| 85 | + ignore_missing: true |
| 86 | + ignore_failure: true |
| 87 | + - rename: |
| 88 | + field: json.src_user_name |
| 89 | + target_field: user.name |
| 90 | + ignore_missing: true |
| 91 | + ignore_failure: true |
| 92 | + - rename: |
| 93 | + field: json.user_sid |
| 94 | + target_field: user.id |
| 95 | + ignore_missing: true |
| 96 | + ignore_failure: true |
| 97 | + - rename: |
| 98 | + field: json.file_type |
| 99 | + target_field: file.type |
| 100 | + if: ctx.json?.file_type != null |
| 101 | + ignore_missing: true |
| 102 | + ignore_failure: true |
| 103 | + - join: |
| 104 | + field: json.file_name |
| 105 | + target_field: file.name |
| 106 | + separator: ',' |
| 107 | + if: ctx.json?.file_name != null |
| 108 | + ignore_failure: true |
| 109 | + - remove: |
| 110 | + field: file.name |
| 111 | + ignore_missing: true |
| 112 | + ignore_failure: true |
| 113 | + if: ctx.file.name == " " |
| 114 | + - rename: |
| 115 | + field: json.file_size |
| 116 | + target_field: file.size |
| 117 | + ignore_missing: true |
| 118 | + ignore_failure: true |
| 119 | + - join: |
| 120 | + field: json.resource |
| 121 | + target_field: file.path |
| 122 | + separator: ',' |
| 123 | + if: ctx.json?.resource != null && !["http emulation", "url reputation"].contains(ctx.json?.protection_type?.toLowerCase()) |
| 124 | + ignore_failure: true |
| 125 | + - join: |
| 126 | + field: json.resource |
| 127 | + target_field: url.original |
| 128 | + separator: ',' |
| 129 | + if: ctx.json?.resource != null && ["http emulation", "url reputation"].contains(ctx.json?.protection_type?.toLowerCase()) |
| 130 | + ignore_failure: true |
| 131 | + - uri_parts: |
| 132 | + field: url.original |
| 133 | + tag: uri_parts_harmony_endpoint_forensics |
| 134 | + ignore_missing: true |
| 135 | + on_failure: |
| 136 | + - append: |
| 137 | + field: error.message |
| 138 | + value: 'Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.on_failure_pipeline}}} failed with message: {{{_ingest.on_failure_message}}}' |
| 139 | + - rename: |
| 140 | + field: json.file_md5 |
| 141 | + target_field: file.hash.md5 |
| 142 | + if: ctx.json?.file_md5 != null |
| 143 | + ignore_missing: true |
| 144 | + ignore_failure: true |
| 145 | + - rename: |
| 146 | + field: json.file_sha1 |
| 147 | + target_field: file.hash.sha1 |
| 148 | + if: ctx.json?.file_sha1 != null |
| 149 | + ignore_missing: true |
| 150 | + ignore_failure: true |
| 151 | + - rename: |
| 152 | + field: json.protection_name |
| 153 | + target_field: rule.name |
| 154 | + ignore_missing: true |
| 155 | + ignore_failure: true |
| 156 | + - rename: |
| 157 | + field: json.protection_type |
| 158 | + target_field: harmony_endpoint.forensics.protection_type |
| 159 | + - rename: |
| 160 | + field: json.attack_status |
| 161 | + target_field: harmony_endpoint.forensics.attack_status |
| 162 | + ignore_missing: true |
| 163 | + ignore_failure: true |
| 164 | + - rename: |
| 165 | + field: json.detected_by |
| 166 | + target_field: harmony_endpoint.forensics.detected_by |
| 167 | + - rename: |
| 168 | + field: json.confidence_level |
| 169 | + target_field: harmony_endpoint.forensics.confidence_level |
| 170 | + - rename: |
| 171 | + field: json.description |
| 172 | + target_field: harmony_endpoint.forensics.description |
| 173 | + - rename: |
| 174 | + field: json.policy_date |
| 175 | + target_field: harmony_endpoint.forensics.policy.date |
| 176 | + - rename: |
| 177 | + field: json.policy_name |
| 178 | + target_field: harmony_endpoint.forensics.policy.name |
| 179 | + - rename: |
| 180 | + field: json.policy_number |
| 181 | + target_field: harmony_endpoint.forensics.policy.number |
| 182 | + - rename: |
| 183 | + field: json.severity |
| 184 | + target_field: harmony_endpoint.forensics.severity |
| 185 | + - rename: |
| 186 | + field: json.service_domain |
| 187 | + target_field: harmony_endpoint.forensics.service_domain |
| 188 | + - rename: |
| 189 | + field: json.packet_capture_unique_id |
| 190 | + target_field: harmony_endpoint.forensics.packet_capture_unique_id |
| 191 | + - rename: |
| 192 | + field: json.suspicious_events |
| 193 | + target_field: harmony_endpoint.forensics.suspicious_events |
| 194 | + if: ctx.json?.suspicious_events != null |
| 195 | + - rename: |
| 196 | + field: json.tenant_id |
| 197 | + target_field: harmony_endpoint.forensics.tenant_id |
| 198 | + - rename: |
| 199 | + field: json.client_name |
| 200 | + target_field: harmony_endpoint.forensics.client.name |
| 201 | + - join: |
| 202 | + field: json.malware_action |
| 203 | + target_field: harmony_endpoint.forensics.malware.action |
| 204 | + separator: ',' |
| 205 | + ignore_failure: true |
| 206 | + if: ctx.json?.malware_action != null |
| 207 | + - remove: |
| 208 | + field: harmony_endpoint.forensics.malware.action |
| 209 | + ignore_missing: true |
| 210 | + ignore_failure: true |
| 211 | + if: ctx.harmony_endpoint?.forensics?.malware?.action == " " |
| 212 | + - join: |
| 213 | + field: json.client_version |
| 214 | + target_field: harmony_endpoint.forensics.client.version |
| 215 | + separator: ',' |
| 216 | + ignore_failure: true |
| 217 | + if: ctx.json?.client_version != null |
| 218 | + - remove: |
| 219 | + field: json |
| 220 | + ignore_missing: true |
| 221 | + ignore_failure: true |
| 222 | + - remove: |
| 223 | + field: message |
| 224 | + if: ctx.event?.original != null |
| 225 | + ignore_missing: true |
| 226 | + ignore_failure: true |
7 | 227 | on_failure:
|
8 |
| -- set: |
9 |
| - field: error.message |
10 |
| - value: '{{ _ingest.on_failure_message }}' |
11 |
| -- remove: |
12 |
| - field: event.installed_products |
13 |
| - ignore_failure: true |
| 228 | + - set: |
| 229 | + field: error.message |
| 230 | + value: "{{ _ingest.on_failure_message }}" |
0 commit comments