Skip to content

Commit

Permalink
Fail the flow the when detectot type is missing in the log types index (
Browse files Browse the repository at this point in the history
#845)

Signed-off-by: Megha Goyal <[email protected]>
(cherry picked from commit 8d19912)
  • Loading branch information
goyamegh authored and github-actions[bot] committed Mar 11, 2024
1 parent 4f68164 commit 76550ff
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ public void onFailure(Exception e) {
}

public void insertOrphanFindings(String detectorType, Finding finding, float timestampFeature, Map<String, CustomLogType> logTypes) {
if (logTypes.get(detectorType) == null) {
log.error("LogTypes Index is missing the detector type {}", detectorType);
correlateFindingAction.onFailures(new OpenSearchStatusException("LogTypes Index is missing the detector type", RestStatus.INTERNAL_SERVER_ERROR));

Check warning on line 231 in src/main/java/org/opensearch/securityanalytics/correlation/VectorEmbeddingsEngine.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/securityanalytics/correlation/VectorEmbeddingsEngine.java#L230-L231

Added lines #L230 - L231 were not covered by tests
}

Map<String, Object> tags = logTypes.get(detectorType).getTags();
String correlationId = tags.get("correlation_id").toString();

Expand Down

0 comments on commit 76550ff

Please sign in to comment.