Skip to content

Commit

Permalink
Added ability to disable OpenSearch audit logs (#3215)
Browse files Browse the repository at this point in the history
* Added ability to disable OpenSearch audit logs
  • Loading branch information
seriva authored Jul 14, 2022
1 parent 0830d9a commit 0340be3
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ plugins.security.nodes_dn:
{% endfor %}
{% endif %}

plugins.security.audit.type: internal_opensearch
{% if specification.opensearch_security.audit.type is defined and specification.opensearch_security.audit.type|length %}
plugins.security.audit.type: {{ specification.opensearch_security.audit.type }}
{% endif %}
plugins.security.enable_snapshot_restore_privilege: true
plugins.security.check_snapshot_restore_write_privileges: true
plugins.security.restapi.roles_enabled: ["all_access", "security_rest_api_access"]
Expand Down
1 change: 1 addition & 0 deletions docs/changelogs/CHANGELOG-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [#3131](https://github.com/epiphany-platform/epiphany/issues/3131) - Optimize Grafana dashboards downloading
- [#3116](https://github.com/epiphany-platform/epiphany/issues/3116) - Optimize files downloading
- [#3106](https://github.com/epiphany-platform/epiphany/issues/3106) - Add image-registry configuration reading
- [#3140](https://github.com/epiphany-platform/epiphany/issues/3140) - Allow to disable OpenSearch audit logs

### Fixed

Expand Down
1 change: 1 addition & 0 deletions docs/home/HOWTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
- [Centralized logging setup](./howto/LOGGING.md#centralized-logging-setup)
- [How to add multiline support for Filebeat logs](./howto/LOGGING.md#how-to-add-multiline-support-for-filebeat-logs)
- [How to deploy Filebeat as Daemonset in K8s](./howto/LOGGING.md#how-to-deploy-filebeat-as-daemonset-in-k8s)
- [Audit logs](./howto/LOGGING.md#audit-logs)

- [Maintenance](./howto/MAINTENANCE.md)
- [Verification of service state](./howto/MAINTENANCE.md#verification-of-service-state)
Expand Down
15 changes: 15 additions & 0 deletions docs/home/howto/LOGGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,18 @@ Notice: Setting `specification.kibana.dashboards.enabled` to `true` not providin

---
<sup>[1] More information about migrating from Elasticsearch & Kibana to OpenSearch & OpenSearch Dashboards can be found [here](./UPGRADE.md#migration-from-open-distro-for-elasticsearch--kibana-to-opensearch-and-opensearch-dashboards).</sup>

## Audit logs

There is an [option](https://opensearch.org/docs/latest/security-plugin/audit-logs/) to enable
OpenSearch audit logs which is switched on in Epiphany by default using the following configuration part:

```yaml
kind: configuration/logging
specification:
opensearch_security:
audit:
type: internal_opensearch
```

Use the empty string value to switch audit logging off.
4 changes: 3 additions & 1 deletion schema/common/defaults/configuration/logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ specification:
- readall
- snapshotrestore
# - logstash
# - kibanaservers
# - kibanaserver
paths:
opensearch_home: /usr/share/opensearch
opensearch_conf_dir: /usr/share/opensearch/config
Expand All @@ -27,6 +27,8 @@ specification:
jvm_options:
Xmx: 1g
opensearch_security:
audit:
type: internal_opensearch # https://opensearch.org/docs/latest/security-plugin/audit-logs
ssl:
transport:
enforce_hostname_verification: true
2 changes: 2 additions & 0 deletions schema/common/defaults/configuration/opensearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ specification:
jvm_options:
Xmx: 1g
opensearch_security:
audit:
type: internal_opensearch # https://opensearch.org/docs/latest/security-plugin/audit-logs
ssl:
transport:
enforce_hostname_verification: true
24 changes: 20 additions & 4 deletions schema/common/validation/configuration/logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ type: object
properties:
cluster_name:
type: string
opensearch_os_user:
type: string
opensearch_os_group:
type: string
admin_password:
type: string
kibanaserver_password:
Expand All @@ -18,15 +22,22 @@ properties:
type: boolean
demo_users_to_remove:
type: array
items: {}
items:
type: string
paths:
type: object
properties:
data:
opensearch_home:
type: string
opensearch_conf_dir:
type: string
opensearch_log_dir:
type: string
repo:
opensearch_snapshots_dir:
type: string
logs:
opensearch_data_dir:
type: string
opensearch_perftop_dir:
type: string
jvm_options:
type: object
Expand All @@ -36,6 +47,11 @@ properties:
opensearch_security:
type: object
properties:
audit:
type: object
properties:
type:
type: string
ssl:
type: object
properties:
Expand Down
6 changes: 6 additions & 0 deletions schema/common/validation/configuration/opensearch.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
"$id": "#/specification"
title: "opensearch schema"
description: "OpenSearch specification schema"
Expand Down Expand Up @@ -46,6 +47,11 @@ properties:
opensearch_security:
type: object
properties:
audit:
type: object
properties:
type:
type: string
ssl:
type: object
properties:
Expand Down

0 comments on commit 0340be3

Please sign in to comment.