diff --git a/html/index.html b/html/index.html
index 234cad4c..9b340512 100644
--- a/html/index.html
+++ b/html/index.html
@@ -5911,7 +5911,7 @@
-
+
@@ -6287,7 +6287,7 @@
-
+
diff --git a/html/js/components/detection-panel.js b/html/js/components/detection-panel.js
index 72344fa2..3b4b8149 100644
--- a/html/js/components/detection-panel.js
+++ b/html/js/components/detection-panel.js
@@ -125,8 +125,8 @@ components.push({
initParams(params) {
this.showUnreviewedAiSummaries = !!params?.['showUnreviewedAiSummaries'];
},
- ack() {
- this.emit('ack', [this.alertInfo.item, null, false, null, this.alertInfo.groupIndex, true, true]);
+ ack(alreadyAcceptedDialog) {
+ this.emit('ack', [this.alertInfo.item, null, false, null, this.alertInfo.groupIndex, true, alreadyAcceptedDialog]);
},
escalate(e) {
this.emit('chooseCase', [e, this.alertInfo.item, this.alertInfo.groupIndex, true]);
diff --git a/html/js/components/detection-panel.test.js b/html/js/components/detection-panel.test.js
index 3d9d294c..e5c95643 100644
--- a/html/js/components/detection-panel.test.js
+++ b/html/js/components/detection-panel.test.js
@@ -474,7 +474,18 @@ test('deleteOverride', async () => {
});
test('ack emits event', () => {
- comp.ack();
+ comp.ack(false);
+ expect(comp.emit).toHaveBeenCalledWith('ack', [
+ comp.alertInfo.item,
+ null,
+ false,
+ null,
+ comp.alertInfo.groupIndex,
+ true,
+ false
+ ]);
+
+ comp.ack(true);
expect(comp.emit).toHaveBeenCalledWith('ack', [
comp.alertInfo.item,
null,
diff --git a/server/detectionhandler.go b/server/detectionhandler.go
index a586b7df..a5e368f2 100644
--- a/server/detectionhandler.go
+++ b/server/detectionhandler.go
@@ -1198,7 +1198,8 @@ func (h *DetectionHandler) ConvertContent(w http.ResponseWriter, r *http.Request
return
}
- if det.Engine != model.EngineNameElastAlert {
+ if model.EngineName(strings.ToLower(string(det.Engine))) != model.EngineNameElastAlert &&
+ model.SigLanguage(strings.ToLower(string(det.Language))) != model.SigLangSigma {
web.Respond(w, r, http.StatusBadRequest, errors.New("that detection's engine doesn't support conversion"))
return
}
diff --git a/server/detectionshandler_test.go b/server/detectionshandler_test.go
index f14cf42f..832a5c52 100644
--- a/server/detectionshandler_test.go
+++ b/server/detectionshandler_test.go
@@ -3356,6 +3356,24 @@ func TestHandlerConvertContent(t *testing.T) {
handled,
},
},
+ {
+ // when creating a new detection, the engine isn't specified yet, but language is
+ Name: "Good Language",
+ ReqBody: []byte(`{"language": "sigma", "content": "sigma goes here"}`),
+ InitMock: func(srv *Server, ctrl *gomock.Controller) {
+ eng := servermock.NewMockDetectionEngine(ctrl)
+ srv.DetectionEngines[model.EngineNameElastAlert] = eng
+
+ eng.EXPECT().ConvertRule(gomock.Any(), &model.Detection{Content: "sigma goes here", Language: model.SigLangSigma}).Return("converted query", nil)
+ },
+ Code: 200,
+ Response: &ConvertContentResp{
+ Query: "converted query",
+ },
+ Logs: []EntryMatcher{
+ handled,
+ },
+ },
{
Name: "Unknown Error",
ReqBody: []byte(`{"engine": "elastalert", "content": "sigma goes here"}`),