Skip to content

Commit

Permalink
internal datastream auditlog
Browse files Browse the repository at this point in the history
Signed-off-by: tmanninger <[email protected]>
  • Loading branch information
tmanninger committed Sep 24, 2024
1 parent 06113e2 commit 959a685
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,46 @@ public List<Setting<?>> getSettings() {
)
);

// Internal OpenSearch DataStream
settings.add(
Setting.simpleString(
ConfigConstants.SECURITY_AUDIT_CONFIG_DEFAULT_PREFIX + ConfigConstants.SECURITY_AUDIT_OPENSEARCH_DATASTREAM_NAME,
Property.NodeScope,
Property.Filtered
)
);
settings.add(
Setting.boolSetting(
ConfigConstants.SECURITY_AUDIT_CONFIG_DEFAULT_PREFIX + ConfigConstants.SECURITY_AUDIT_OPENSEARCH_DATASTREAM_TEMPLATE_MANAGE,
true,
Property.NodeScope,
Property.Filtered
)
);
settings.add(
Setting.simpleString(
ConfigConstants.SECURITY_AUDIT_CONFIG_DEFAULT_PREFIX + ConfigConstants.SECURITY_AUDIT_OPENSEARCH_DATASTREAM_TEMPLATE_NAME,
Property.NodeScope,
Property.Filtered
)
);
settings.add(
Setting.intSetting(
ConfigConstants.SECURITY_AUDIT_CONFIG_DEFAULT_PREFIX + ConfigConstants.SECURITY_AUDIT_OPENSEARCH_DATASTREAM_TEMPLATE_NUMBER_OF_SHARDS,
1,
Property.NodeScope,
Property.Filtered
)
);
settings.add(
Setting.intSetting(
ConfigConstants.SECURITY_AUDIT_CONFIG_DEFAULT_PREFIX + ConfigConstants.SECURITY_AUDIT_OPENSEARCH_DATASTREAM_TEMPLATE_NUMBER_OF_REPLICAS,
0,
Property.NodeScope,
Property.Filtered
)
);

// External OpenSearch
settings.add(
Setting.listSetting(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ private final AuditLogSink createSink(final String name, final String type, fina
case "internal_opensearch":
sink = new InternalOpenSearchSink(name, settings, settingsPrefix, configPath, clientProvider, threadPool, fallbackSink);
break;
case "internal_opensearch_data_stream":
sink = new InternalOpenSearchDataStreamSink(name, settings, settingsPrefix, configPath, clientProvider, threadPool, fallbackSink);
break;
case "external_opensearch":
try {
sink = new ExternalOpenSearchSink(name, settings, settingsPrefix, configPath, fallbackSink);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ public class ConfigConstants {

public static final String SECURITY_AUDIT_CONFIG_DEFAULT_PREFIX = "plugins.security.audit.config.";

// Internal Opensearch data_stream
public static final String SECURITY_AUDIT_OPENSEARCH_DATASTREAM_NAME = "data_stream.name";
public static final String SECURITY_AUDIT_OPENSEARCH_DATASTREAM_TEMPLATE_MANAGE = "data_stream.template.manage";
public static final String SECURITY_AUDIT_OPENSEARCH_DATASTREAM_TEMPLATE_NAME = "data_stream.template.name";
public static final String SECURITY_AUDIT_OPENSEARCH_DATASTREAM_TEMPLATE_NUMBER_OF_REPLICAS = "data_stream.template.number_of_replicas";
public static final String SECURITY_AUDIT_OPENSEARCH_DATASTREAM_TEMPLATE_NUMBER_OF_SHARDS = "data_stream.template.number_of_shards";

// Internal / External OpenSearch
public static final String SECURITY_AUDIT_OPENSEARCH_INDEX = "index";
public static final String SECURITY_AUDIT_OPENSEARCH_TYPE = "type";
Expand Down

0 comments on commit 959a685

Please sign in to comment.