Skip to content

Commit

Permalink
address pr comment
Browse files Browse the repository at this point in the history
  • Loading branch information
efd6 committed Mar 2, 2025
1 parent fe4622e commit df11fca
Showing 1 changed file with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,24 +290,22 @@ processors:
source: >
String mapping = params[ctx.ti_crowdstrike.ioc.type];
if (mapping != null) {
ctx.threat.indicator.type = mapping;
// IP values are handled below to allow conversion checks.
if (ctx.ti_crowdstrike.ioc.type == 'domain') {
ctx.threat.indicator.url = ctx.threat.indicator.url ?: [:];
ctx.threat.indicator.url.domain = ctx.ti_crowdstrike?.ioc.value;
} else if (ctx.ti_crowdstrike.ioc.type == 'md5') {
ctx.threat.indicator.file = ctx.threat.indicator.file ?: [:];
ctx.threat.indicator.file.hash = ctx.threat.indicator.file.hash ?: [:];
ctx.threat.indicator.type = mapping;
// IP values are handled below to allow conversion checks.
if (ctx.ti_crowdstrike.ioc.type == 'domain') {
ctx.threat.indicator.url = ctx.threat.indicator.url ?: [:];
ctx.threat.indicator.url.domain = ctx.ti_crowdstrike?.ioc.value;
} else if (mapping == 'file') {
ctx.threat.indicator.file = ctx.threat.indicator.file ?: [:];
ctx.threat.indicator.file.hash = ctx.threat.indicator.file.hash ?: [:];
if (ctx.ti_crowdstrike.ioc.type == 'md5') {
ctx.threat.indicator.file.hash.md5 = ctx.ti_crowdstrike?.ioc.value;
} else if (ctx.ti_crowdstrike.ioc.type == 'sha256') {
ctx.threat.indicator.file = ctx.threat.indicator.file ?: [:];
ctx.threat.indicator.file.hash = ctx.threat.indicator.file.hash ?: [:];
ctx.threat.indicator.file.hash.sha256 = ctx.ti_crowdstrike?.ioc.value;
} else if (ctx.ti_crowdstrike.ioc.type == 'sha1') {
ctx.threat.indicator.file = ctx.threat.indicator.file ?: [:];
ctx.threat.indicator.file.hash = ctx.threat.indicator.file.hash ?: [:];
ctx.threat.indicator.file.hash.sha1 = ctx.ti_crowdstrike?.ioc.value;
}
}
}
on_failure:
- append:
Expand Down

0 comments on commit df11fca

Please sign in to comment.