Skip to content

Commit

Permalink
fix remote monitor setup in security-analytics
Browse files Browse the repository at this point in the history
Signed-off-by: Subhobrata Dey <[email protected]>
  • Loading branch information
sbcd90 committed Jun 11, 2024
1 parent cd1880b commit 76560fd
Show file tree
Hide file tree
Showing 19 changed files with 188 additions and 91 deletions.
18 changes: 9 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ buildscript {
opensearch_build += "-SNAPSHOT"
}
common_utils_version = System.getProperty("common_utils.version", opensearch_build)
kotlin_version = '1.6.10'
kotlin_version = '1.8.21'
}

repositories {
Expand Down Expand Up @@ -54,7 +54,7 @@ ext {
noticeFile = rootProject.file('NOTICE')
}

licenseHeaders.enabled = true
licenseHeaders.enabled = false
testingConventions.enabled = false
forbiddenApis.ignoreFailures = true

Expand All @@ -68,7 +68,7 @@ opensearchplugin {
name 'opensearch-security-analytics'
description 'OpenSearch Security Analytics plugin'
classname 'org.opensearch.securityanalytics.SecurityAnalyticsPlugin'
extendedPlugins = ['opensearch-job-scheduler']
extendedPlugins = ['opensearch-job-scheduler', 'opensearch-alerting']
}

javaRestTest {
Expand Down Expand Up @@ -155,13 +155,13 @@ configurations {
dependencies {
javaRestTestImplementation project.sourceSets.main.runtimeClasspath
implementation group: 'org.apache.commons', name: 'commons-lang3', version: "${versions.commonslang}"
implementation "org.antlr:antlr4-runtime:4.10.1"
implementation "com.cronutils:cron-utils:9.1.6"
api "org.opensearch:common-utils:${common_utils_version}@jar"
api "org.opensearch.client:opensearch-rest-client:${opensearch_version}"
implementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"
compileOnly "org.antlr:antlr4-runtime:4.10.1"
compileOnly "com.cronutils:cron-utils:9.1.7"
compileOnly "org.opensearch:common-utils:${common_utils_version}@jar"
compileOnly "org.opensearch.client:opensearch-rest-client:${opensearch_version}"
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"
compileOnly "org.opensearch:opensearch-job-scheduler-spi:${opensearch_build}"
implementation "org.opensearch.alerting:alerting-spi:${opensearch_build}"
compileOnly "org.opensearch.alerting:alerting-spi:${opensearch_build}"
implementation "org.apache.commons:commons-csv:1.10.0"

// Needed for integ tests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
// Generated from Condition.g4 by ANTLR 4.10.1
// Generated from java-escape by ANTLR 4.11.1
package org.opensearch.securityanalytics.rules.condition;

import org.antlr.v4.runtime.ParserRuleContext;
Expand All @@ -14,6 +10,7 @@
* which can be extended to create a listener which only needs to handle a subset
* of the available methods.
*/
@SuppressWarnings("CheckReturnValue")
public class ConditionBaseListener implements ConditionListener {
/**
* {@inheritDoc}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
// Generated from Condition.g4 by ANTLR 4.10.1
// Generated from java-escape by ANTLR 4.11.1
package org.opensearch.securityanalytics.rules.condition;
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;

Expand All @@ -14,6 +10,7 @@
* @param <T> The return type of the visit operation. Use {@link Void} for
* operations with no return type.
*/
@SuppressWarnings("CheckReturnValue")
public class ConditionBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements ConditionVisitor<T> {
/**
* {@inheritDoc}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
// Generated from Condition.g4 by ANTLR 4.10.1
// Generated from java-escape by ANTLR 4.11.1
package org.opensearch.securityanalytics.rules.condition;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
Expand All @@ -13,9 +9,9 @@
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.misc.*;

@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue"})
public class ConditionLexer extends Lexer {
static { RuntimeMetaData.checkVersion("4.10.1", RuntimeMetaData.VERSION); }
static { RuntimeMetaData.checkVersion("4.11.1", RuntimeMetaData.VERSION); }

protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
// Generated from Condition.g4 by ANTLR 4.10.1
// Generated from java-escape by ANTLR 4.11.1
package org.opensearch.securityanalytics.rules.condition;
import org.antlr.v4.runtime.tree.ParseTreeListener;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
// Generated from Condition.g4 by ANTLR 4.10.1
// Generated from java-escape by ANTLR 4.11.1
package org.opensearch.securityanalytics.rules.condition;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
Expand All @@ -13,9 +9,9 @@
import java.util.Iterator;
import java.util.ArrayList;

@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue"})
public class ConditionParser extends Parser {
static { RuntimeMetaData.checkVersion("4.10.1", RuntimeMetaData.VERSION); }
static { RuntimeMetaData.checkVersion("4.11.1", RuntimeMetaData.VERSION); }

protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
Expand Down Expand Up @@ -78,7 +74,7 @@ public Vocabulary getVocabulary() {
}

@Override
public String getGrammarFileName() { return "Condition.g4"; }
public String getGrammarFileName() { return "java-escape"; }

@Override
public String[] getRuleNames() { return ruleNames; }
Expand All @@ -94,6 +90,7 @@ public ConditionParser(TokenStream input) {
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}

@SuppressWarnings("CheckReturnValue")
public static class StartContext extends ParserRuleContext {
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
Expand Down Expand Up @@ -138,6 +135,7 @@ public final StartContext start() throws RecognitionException {
return _localctx;
}

@SuppressWarnings("CheckReturnValue")
public static class ExpressionContext extends ParserRuleContext {
public ExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
Expand All @@ -149,6 +147,7 @@ public void copyFrom(ExpressionContext ctx) {
super.copyFrom(ctx);
}
}
@SuppressWarnings("CheckReturnValue")
public static class OrExpressionContext extends ExpressionContext {
public ExpressionContext left;
public Token operator;
Expand All @@ -175,6 +174,7 @@ public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class IdentOrSelectExpressionContext extends ExpressionContext {
public TerminalNode SELECTOR() { return getToken(ConditionParser.SELECTOR, 0); }
public TerminalNode IDENTIFIER() { return getToken(ConditionParser.IDENTIFIER, 0); }
Expand All @@ -193,6 +193,7 @@ public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class AndExpressionContext extends ExpressionContext {
public ExpressionContext left;
public Token operator;
Expand All @@ -219,6 +220,7 @@ public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class NotExpressionContext extends ExpressionContext {
public TerminalNode NOT() { return getToken(ConditionParser.NOT, 0); }
public ExpressionContext expression() {
Expand All @@ -239,6 +241,7 @@ public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class ParenExpressionContext extends ExpressionContext {
public ExpressionContext inner;
public TerminalNode LPAREN() { return getToken(ConditionParser.LPAREN, 0); }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
// Generated from Condition.g4 by ANTLR 4.10.1
// Generated from java-escape by ANTLR 4.11.1
package org.opensearch.securityanalytics.rules.condition;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
// Generated from Aggregation.g4 by ANTLR 4.10.1
// Generated from java-escape by ANTLR 4.11.1
package org.opensearch.securityanalytics.rules.condition.aggregation;

import org.antlr.v4.runtime.ParserRuleContext;
Expand All @@ -14,6 +10,7 @@
* which can be extended to create a listener which only needs to handle a subset
* of the available methods.
*/
@SuppressWarnings("CheckReturnValue")
public class AggregationBaseListener implements AggregationListener {
/**
* {@inheritDoc}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
// Generated from Aggregation.g4 by ANTLR 4.10.1
// Generated from java-escape by ANTLR 4.11.1
package org.opensearch.securityanalytics.rules.condition.aggregation;
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;

Expand All @@ -14,6 +10,7 @@
* @param <T> The return type of the visit operation. Use {@link Void} for
* operations with no return type.
*/
@SuppressWarnings("CheckReturnValue")
public class AggregationBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements AggregationVisitor<T> {
/**
* {@inheritDoc}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
// Generated from Aggregation.g4 by ANTLR 4.10.1
// Generated from java-escape by ANTLR 4.11.1
package org.opensearch.securityanalytics.rules.condition.aggregation;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
Expand All @@ -13,9 +9,9 @@
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.misc.*;

@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue"})
public class AggregationLexer extends Lexer {
static { RuntimeMetaData.checkVersion("4.10.1", RuntimeMetaData.VERSION); }
static { RuntimeMetaData.checkVersion("4.11.1", RuntimeMetaData.VERSION); }

protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
// Generated from Aggregation.g4 by ANTLR 4.10.1
// Generated from java-escape by ANTLR 4.11.1
package org.opensearch.securityanalytics.rules.condition.aggregation;
import org.antlr.v4.runtime.tree.ParseTreeListener;

Expand Down
Loading

0 comments on commit 76560fd

Please sign in to comment.