Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified security-analytics-commons-1.0.0.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public STIX2IOC(
String feedName,
Long version
) {
super(StringUtils.isBlank(id) ? UUID.randomUUID().toString() : id, name, type, value, severity, created, modified, description, labels, specVersion, feedId, feedName);
super(StringUtils.isBlank(id) ? UUID.randomUUID().toString() : id, name, type.toString(), value, severity, created, modified, description, labels, specVersion, feedId, feedName);
this.version = version;
validate();
}
Expand All @@ -68,7 +68,7 @@ public STIX2IOC(STIX2 ioc, String feedId, String feedName) {
this(
ioc.getId(),
ioc.getName(),
ioc.getType(),
new IOCType(ioc.getType()),
ioc.getValue(),
ioc.getSeverity(),
ioc.getCreated(),
Expand Down Expand Up @@ -305,8 +305,8 @@ public static STIX2IOC parse(XContentParser xcp, String id, Long version) throws
public void validate() throws IllegalArgumentException {
if (super.getType() == null) {
throw new IllegalArgumentException(String.format("[%s] is required.", TYPE_FIELD));
} else if (!IOCType.supportedType(super.getType().toString())) {
logger.debug("Unsupported IOCType: {}", super.getType().toString());
} else if (!IOCType.supportedType(super.getType())) {
logger.debug("Unsupported IOCType: {}", super.getType());
throw new IllegalArgumentException(String.format("[%s] is not supported.", TYPE_FIELD));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public STIX2IOCDto(STIX2IOC ioc) {
this(
ioc.getId(),
ioc.getName(),
ioc.getType(),
new IOCType(ioc.getType()),
ioc.getValue(),
ioc.getSeverity(),
ioc.getCreated(),
Expand Down
Loading