Skip to content

Commit 04517f0

Browse files
authored
Merge pull request #590 from jurgenmehja/4.3
Add possibility to configure single sign on through puppet
2 parents 0bba34c + 8d7df37 commit 04517f0

File tree

4 files changed

+60
-1
lines changed

4 files changed

+60
-1
lines changed

manifests/dashboard.pp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@
1414
$dashboard_server_host = '0.0.0.0',
1515
$dashboard_server_hosts = "https://${indexer_server_ip}:${indexer_server_port}",
1616

17+
# Parameters used for OpenID login
18+
$enable_openid_login = undef,
19+
$opensearch_ssl_verificationMode = undef,
20+
$opensearch_security_openid_connect_url = undef,
21+
$opensearch_security_openid_client_id = undef,
22+
$opensearch_security_openid_client_secret = undef,
23+
$opensearch_security_openid_base_redirect_url = undef,
24+
$opensearch_security_openid_verify_hostnames = undef,
25+
26+
1727
# If the keystore is used, the credentials are not managed by the module (TODO).
1828
# If use_keystore is false, the keystore is deleted, the dashboard use the credentials in the configuration file.
1929
$use_keystore = true,

manifests/indexer.pp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626

2727
# JVM options
2828
$jvm_options_memory = '1g',
29+
30+
# Parameters used for openid login
31+
$openid_connect_url = undef,
2932
) {
3033
if $manage_repos {
3134
include wazuh::repo
@@ -83,6 +86,12 @@
8386
require => Package['wazuh-indexer'],
8487
notify => Service['wazuh-indexer'],
8588
}
89+
90+
file {
91+
'/usr/share/wazuh-indexer/plugins/opensearch-security/securityconfig/config.yml':
92+
content => template('wazuh/opensearch_security_config.yml.erb'),
93+
notify => Service['wazuh-indexer'],
94+
}
8695

8796
file_line { 'Insert line initial size of total heap space':
8897
path => '/etc/wazuh-indexer/jvm.options',
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
_meta:
3+
type: "config"
4+
config_version: 2
5+
config:
6+
dynamic:
7+
http:
8+
anonymous_auth_enabled: false
9+
authc:
10+
basic:
11+
basic_internal_auth_domain:
12+
http_enabled: true
13+
transport_enabled: true
14+
order: 0
15+
http_authenticator:
16+
type: basic
17+
challenge: false
18+
authentication_backend:
19+
type: internal
20+
openid_auth_domain:
21+
http_enabled: true
22+
transport_enabled: true
23+
order: 1
24+
http_authenticator:
25+
type: openid
26+
challenge: false
27+
config:
28+
subject_key: preferred_username
29+
roles_key: roles
30+
openid_connect_url: <%= @openid_connect_url %>
31+
verify_hostnames: false
32+
authentication_backend:
33+
type: noop

templates/wazuh_dashboard_yml.erb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@ opensearch.password: <%= @dashboard_password %>
99
opensearch.requestHeadersWhitelist: ["securitytenant","Authorization"]
1010
opensearch_security.multitenancy.enabled: false
1111
opensearch_security.readonly_mode.roles: ["kibana_read_only"]
12+
<% if @enable_openid_login -%>
13+
opensearch_security.auth.type: <%= @opensearch_security_auth_type %>
14+
opensearch_security.openid.connect_url: <%= @opensearch_security_openid_connect_url %>
15+
opensearch_security.openid.client_id: <%= @opensearch_security_openid_client_id %>
16+
opensearch_security.openid.client_secret: <%= @opensearch_security_openid_client_secret %>
17+
opensearch_security.openid.base_redirect_url: <%= @opensearch_security_openid_base_redirect_url %>
18+
opensearch_security.openid.verify_hostnames: <%= @opensearch_security_openid_verify_hostnames %>
19+
<% end -%>
1220
server.ssl.enabled: true
1321
server.ssl.key: "<%= @dashboard_path_certs %>/dashboard-key.pem"
1422
server.ssl.certificate: "<%= @dashboard_path_certs %>/dashboard.pem"
1523
opensearch.ssl.certificateAuthorities: ["<%= @dashboard_path_certs %>/root-ca.pem"]
1624
uiSettings.overrides.defaultRoute: /app/wazuh
17-

0 commit comments

Comments
 (0)