9a16a82396a49a9e117b5ad619d7679d0ae997cd
[clamp.git] / src / main / docker / elasticsearch / config / sg / sg_config.yml
1 # This is the main Search Guard configuration file where authentication 
2 # and authorization is defined.
3
4 # You need to configure at least one authentication domain in the authc of this file.
5 # An authentication domain is responsible for extracting the user credentials from 
6 # the request and for validating them against an authentication backend like Active Directory for example. 
7 #
8 # If more than one authentication domain is configured the first one which succeeds wins. 
9 # If all authentication domains fail then the request is unauthenticated.
10 # In this case an exception is thrown and/or the HTTP status is set to 401.
11
12 # After authentication authorization (authz) will be applied. There can be zero or more authorizers which collect
13 # the roles from a given backend for the authenticated user.
14 #
15 # Both, authc and auth can be enabled/disabled separately for REST and TRANSPORT layer. Default is true for both.
16 #        http_enabled: true
17 #        transport_enabled: true
18 #
19 # 5.x Migration: "enabled: true/false" will also be respected currently but only to provide backward compatibility.
20 #
21 # For HTTP it is possible to allow anonymous authentication. If that is the case then the HTTP authenticators try to
22 # find user credentials in the HTTP request. If credentials are found then the user gets regularly authenticated.
23 # If none can be found the user will be authenticated as an "anonymous" user. This user has always the username "sg_anonymous"
24 # and one role named "sg_anonymous_backendrole". 
25 # If you enable anonymous authentication all HTTP authenticators will not challenge.
26
27 #
28 # Note: If you define more than one HTTP authenticators make sure to put non-challenging authenticators like "proxy" or "clientcert"
29 # first and the challenging one last. 
30 # Because it's not possible to challenge a client with two different authentication methods (for example
31 # Kerberos and Basic) only one can have the challenge flag set to true. You can cope with this situation
32 # by using pre-authentication, e.g. sending a HTTP Basic authentication header in the request.
33 #
34 # Default value of the challenge flag is true.
35
36 #
37 # HTTP
38 #   basic (challenging)
39 #   proxy (not challenging, needs xff)
40 #   clientcert (not challenging, needs https)
41 #   host (not challenging) #DEPRECATED, will be removed in a future version.
42 #                           host based authentication is configurable in sg_roles_mapping
43
44 # Authc
45 #   internal
46 #   noop
47
48 # Authz
49 #   noop
50 #
51 # Some SearchGuard functionality is licensed under Apache-2.0, while other functionality is non-free;
52 # see https://github.com/floragunncom/search-guard. The functionality enabled in this configuration
53 # file only include those that are licensed under Apache-2.0. Please use care and review SearchGuard's
54 # license details before enabling any additional features here.
55
56
57 searchguard:
58   dynamic:
59     # Set filtered_alias_mode to 'disallow' to forbid more than 2 filtered aliases per index
60     # Set filtered_alias_mode to 'warn' to allow more than 2 filtered aliases per index but warns about it (default)
61     # Set filtered_alias_mode to 'nowarn' to allow more than 2 filtered aliases per index silently
62     #filtered_alias_mode: warn
63     #kibana:
64       # see https://github.com/floragunncom/search-guard-docs/blob/master/multitenancy.md
65       # To make this work you need to install https://github.com/floragunncom/search-guard-module-kibana-multitenancy/wiki
66       #multitenancy_enabled: true
67       #server_username: kibanaserver
68       #index: '.kibana'
69       #do_not_fail_on_forbidden: false
70     http:
71       anonymous_auth_enabled: false
72       xff:
73         enabled: false
74         internalProxies: '192\.168\.0\.10|192\.168\.0\.11' # regex pattern
75         #internalProxies: '.*' # trust all internal proxies, regex pattern
76         remoteIpHeader:  'x-forwarded-for'
77         proxiesHeader:   'x-forwarded-by'
78         #trustedProxies: '.*' # trust all external proxies, regex pattern
79         ###### see https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html for regex help
80         ###### more information about XFF https://en.wikipedia.org/wiki/X-Forwarded-For
81         ###### and here https://tools.ietf.org/html/rfc7239
82         ###### and https://tomcat.apache.org/tomcat-8.0-doc/config/valve.html#Remote_IP_Valve
83     authc:
84       basic_internal_auth_domain: 
85         http_enabled: true
86         transport_enabled: true
87         order: 4
88         http_authenticator:
89           type: basic
90           challenge: true
91         authentication_backend:
92           type: intern
93       proxy_auth_domain:
94         http_enabled: false
95         transport_enabled: false
96         order: 3
97         http_authenticator:
98           type: proxy
99           challenge: false
100           config:
101             user_header: "x-proxy-user"
102             roles_header: "x-proxy-roles"
103         authentication_backend:
104           type: noop
105       jwt_auth_domain:
106         http_enabled: false
107         transport_enabled: false
108         order: 0
109         http_authenticator:
110           type: jwt
111           challenge: false
112           config:
113             signing_key: "base64 encoded HMAC key or public RSA/ECDSA pem key"
114             jwt_header: "Authorization"
115             jwt_url_parameter: null
116             roles_key: null
117             subject_key: null
118         authentication_backend:
119           type: noop
120       clientcert_auth_domain:
121         http_enabled: false
122         transport_enabled: false
123         order: 2
124         http_authenticator:
125           type: clientcert
126           config:
127             username_attribute: cn #optional, if omitted DN becomes username
128           challenge: false
129         authentication_backend:
130           type: noop
131     authz:    
132 #    auth_failure_listeners:
133 #      ip_rate_limiting:
134 #        type: ip
135 #        allowed_tries: 10
136 #        time_window_seconds: 3600
137 #        block_expiry_seconds: 600
138 #        max_blocked_clients: 100000
139 #        max_tracked_clients: 100000
140 #      internal_authentication_backend_limiting:
141 #        type: username
142 #        authentication_backend: intern        
143 #        allowed_tries: 10
144 #        time_window_seconds: 3600
145 #        block_expiry_seconds: 600
146 #        max_blocked_clients: 100000
147 #        max_tracked_clients: 100000
148