Skip to content

Commit

Permalink
fix threat intel feed parser
Browse files Browse the repository at this point in the history
Signed-off-by: Surya Sashank Nistala <[email protected]>
  • Loading branch information
eirsep committed Oct 25, 2023
1 parent ae666de commit 040556c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM opensearchstaging/opensearch:2.11.0
ADD build/distributions/opensearch-security-analytics-2.11.0.0-SNAPSHOT.zip /tmp/
RUN if [ -d /usr/share/opensearch/plugins/opensearch-security-analytics ]; then /usr/share/opensearch/bin/opensearch-plugin remove opensearch-security-analytics; fi
RUN /usr/share/opensearch/bin/opensearch-plugin install --batch file:/tmp/opensearch-security-analytics-2.11.0.0-SNAPSHOT.zip
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public static ThreatIntelFeedData parse(XContentParser xcp, String id, Long vers
String iocValue = null;
String feedId = null;
Instant timestamp = null;
xcp.nextToken();
XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, xcp.currentToken(), xcp);
while (xcp.nextToken() != XContentParser.Token.END_OBJECT) {
String fieldName = xcp.currentName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public static List<ThreatIntelFeedData> getTifdList(SearchResponse searchRespons
xContentRegistry,
LoggingDeprecationHandler.INSTANCE, hit.getSourceAsString()
);
xcp.nextToken();
list.add(ThreatIntelFeedData.parse(xcp, hit.getId(), hit.getVersion()));
} catch (Exception e) {
log.error(() -> new ParameterizedMessage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

public class WriteableTests extends OpenSearchTestCase {

public void testDetectorAsStream() throws IOException {
public void testDetectorAsStrea() throws IOException {
Detector detector = randomDetector(List.of());
detector.setInputs(List.of(new DetectorInput("", List.of(), List.of(), List.of())));
BytesStreamOutput out = new BytesStreamOutput();
Expand Down

0 comments on commit 040556c

Please sign in to comment.