-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapplication.erb
282 lines (232 loc) · 8.83 KB
/
application.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# Secret Key
# The secret key is used to secure cryptographic functions.
# WARNING: If you deploy your application on several servers, make sure to use the same key.
play.http.secret.key = <%= @play_secret_key %>
# Port number for Cortex server.
http.port = <%= @port %>
# Elasticsearch
search {
## Basic configuration
# Index name.
index = <%= @elasticsearch_index %>
# ElasticSearch cluster name.
cluster = <%= @elasticsearch_cluster_name %>
# ElasticSearch instance address.
host = ["<%= @elasticsearch_host_address %>:<%= @elasticsearch_host_port %>"]
## Advanced configuration
# Scroll keepalive.
keepalive = "<%= @elasticsearch_scroll_keepalive %>"
# Scroll page size.
pagesize = <%= @elasticsearch_scroll_pagesize %>
# Number of shards
nbshards = <%= @elasticsearch_shards_count %>
# Number of replicas
nbreplicas = <%= @elasticsearch_replicas_count %>
# Arbitrary settings
settings {
# Maximum number of nested fields
mapping.nested_fields.limit = <%= @elasticsearch_max_nested_fields %>
}
### XPack SSL configuration
# Username for XPack authentication
<% if @elasticsearch_xpack_enabled == true -%>
search.username = "<%= @elasticsearch_xpack_username %>"
# Password for XPack authentication
search.password = "<%= @elasticsearch_xpack_password %>"
<% end -%>
<% if @elasticsearch_ssl_enabled == true -%>
# Enable SSL to connect to ElasticSearch
search.ssl.enabled = "<%= @elasticsearch_ssl_enabled %>"
# Path to certificate authority file
search.ssl.ca = "<%= @elasticsearch_certificate_authority_path %>"
# Path to certificate file
search.ssl.certificate = "<%= @elasticsearch_certificate_path %>"
# Path to key file
search.ssl.key = "<%= @elasticsearch_ssl_key %>"
<% end -%>
<% if @elasticsearch_searchguard_enabled == true -%>
#) ### SearchGuard configuration
# Path to JKS file containing client certificate
search.guard.keyStore.path = "<%= @elasticsearch_searchguard_keystore_path %>"
# Password of the keystore
search.guard.keyStore.password = "<%= @elasticsearch_searchguard_keystore_password %>"
# Path to JKS file containing certificate authorities
search.guard.trustStore.path = "<%= @elasticsearch_searchguard_truststore_path %>"
## Password of the truststore
search.guard.trustStore.password = "<%= @elasticsearch_searchguard_truststore_password %>"
# Enforce hostname verification
search.guard.hostVerification = "<%= @elasticsearch_searchguard_host_verification %>"
# If hostname verification is enabled specify if hostname should be resolved
search.guard.hostVerificationResolveHostname = "<%= @elasticsearch_searchguard_host_verification_resolve_hostname %>"
<% end -%>
}
analyzer {
# Directory that holds analyzers
path = [
"<%= @analyzers_path %>/analyzers"
]
fork-join-executor {
# Min number of threads available for analyze
parallelism-min = <%= @analyzers_min_parallelism %>
# Parallelism (threads) ... ceil(available processors * factor)
parallelism-factor = <%= @analyzers_factor_parallelism %>
# Max number of threads available for analyze
parallelism-max = <%= @analyzers_max_parallelism %>
}
}
<% if @c1fapp_secret_key != "" -%>
C1fApp {
service = "query"
key = "<%= @c1fapp_secret_key %>"
url = "https://www.c1fapp.com/cifapp/api/"
}
<% end -%>
<% if @google_safe_browsing_secret_key != "" -%>
GoogleSafeBrowsing {
key = "<%= @google_safe_browsing_secret_key %>"
}
<% end -%>
<% if @dnsdb_secret_key != "" -%>
DNSDB {
server = "https://api.dnsdb.info"
key = "<%= @dnsdb_secret_key %>"
}
<% end -%>
<% if @joesandbox_secret_key != "" -%>
JoeSandbox {
server = "<%= @joesandbox_server %>"
key = "<%= @joesandbox_secret_key %>"
}
<% end -%>
<% if @misp_secret_key != "" -%>
MISP {
url = "<%= @misp_analyzer_url %>"
certpath = "<%= @misp_analyzer_certpath %>"
name = "<%= @misp_analyzer_name %>"
key = "<%= @misp_secret_key %>"
}
<% end -%>
<% if @otxquery_secret_key != "" -%>
OTXQuery {
key = "<%= @otxquery_secret_key %>"
}
<% end -%>
<% if @passivetotal_secret_key != "" -%>
PassiveTotal {
username = "<%= @passivetotal_username %>"
key = "<%= @passivetotal_secret_key %>"
}
<% end -%>
<% if @phishtank_secret_key != "" -%>
PhishTank {
key = "<%= @phishtank_secret_key %>"
}
<% end -%>
<% if @phishinginitiative_secret_key != "" -%>
PhishingInitiative {
key = "<%= @phishinginitiative_secret_key %>"
}
<% end -%>
<% if @wot_secret_key != "" -%>
WOT {
key = "<%= @wot_secret_key %>"
}
<% end -%>
# Authentication
auth {
# "provider" parameter contains authentication provider. It can be multi-valued (useful for migration)
# available auth types are:
# services.LocalAuthSrv : passwords are stored in user entity (in Elasticsearch). No configuration is required.
# services.OAuth2Srv : requires adding configuration including the client ID, client secret, and the redirect URL.
# ad : use ActiveDirectory to authenticate users. Configuration is under "auth.ad" key
# ldap : use LDAP to authenticate users. Configuration is under "auth.ldap" key
provider = <%= @auth_providers %>
# By default, basic authentication is disabled. You can enable it by setting "method.basic" to true.
method.basic = "<%= @auth_basic_enabled %>"
<% if @auth_active_directory_enabled == true -%>
ad {
# The Windows domain name in DNS format. This parameter is required if you do not use
# 'serverNames' below.
domainFQDN = "<%= @auth_ad_domain_fqdn %>"
# Optionally you can specify the host names of the domain controllers instead of using 'domainFQDN
# above. If this parameter is not set, TheHive uses 'domainFQDN'.
serverNames = "<%= @auth_ad_server_names %>"
# The Windows domain name using short format. This parameter is required.
domainName = "<%= @auth_ad_domain_name %>"
# If 'true', use SSL to connect to the domain controller.
useSSL = "<%= @auth_ad_use_ssl %>"
}
<% end -%>
<% if @auth_ldap_enabled == true -%>
ldap {
# The LDAP server name or address. The port can be specified using the 'host:port'
# syntax. This parameter is required if you don't use 'serverNames' below.
# serverName = "<%= @auth_ldap_servername %>"
# If you have multiple LDAP servers, use the multi-valued setting 'serverNames' instead.
serverNames = "<%= @auth_ldap_servernames %>"
# Account to use to bind to the LDAP server. This parameter is required.
bindDN = "<%= @auth_ldap_account_bind_dn %>"
# Password of the binding account. This parameter is required.
bindPW = "<%= @auth_ldap_account_bind_pw %>"
# Base DN to search users. This parameter is required.
baseDN = "<%= @auth_ldap_account_base_dn %>"
# Filter to search user in the directory server. Please note that {0} is replaced
# by the actual user name. This parameter is required.
filter = "<%= @auth_ldap_filter %>"
# If 'true', use SSL to connect to the LDAP directory server.
useSSL = "<%= @auth_ldap_use_ssl %>"
}
<% end -%>
<% if @auth_oauth2_sso_enabled == true -%>
oauth2 {
# Client ID for OAuth2.
clientId = "<%= @auth_oauth2_client_id %>"
# Client secret for OAuth2.
clientSecret = "<%= @auth_oauth2_secret %>"
# Client redirect URI for OAuth2.
redirectUri = "<%= @auth_oauth2_client_redirect_uri %>"
# Client response type for OAuth2.
responseType = "<%= @auth_oauth2_response_type %>"
# Grant type used for OAuth2.
grantType = "<%= @auth_oauth2_grant_type %>"
# URL of the authorization server.
authorizationUrl = "<%= @auth_oauth2_auth_url %>"
# URL from where to get the access token.
tokenUrl = "<%= @auth_oauth2_token_url %>"
# User URL used for creating the request header.
userUrl = "<%= @auth_oauth2_user_url %>"
# Scope for OAuth2.
scope = "<%= @auth_oauth2_scope %>"
}
sso {
# Name of mapping class from user resource to backend user.
mapper = "<%= @auth_sso_mapper %>"
autocreate = <%= @auth_sso_autocreate %>
defaultRoles = <%= @auth_sso_default_roles %>
autologin = <%= @auth_sso_autologin %>
attributes {
login = "<%= @auth_sso_login %>"
name = "<%= @auth_sso_name %>"
groups = "<%= @auth_sso_groups %>"
}
defaultOrganization = "<%= @auth_sso_organization %>"
groups {
url = "<%= @auth_sso_group_url %>"
mappings {
<% @auth_sso_mappings.each do |auth_sso_mapping| -%>
<%= auth_sso_mapping["auth_sso_mapping_key"] %> = <%= auth_sso_mapping["auth_sso_mapping_permissions"] %>,
<% end -%>
}
}
}
<% end -%>
}
# Maximum time between two requests without requesting authentication
session {
warning = "<%= @session_authentication_warning %>"
inactivity = "<%= @session_authentication_inactivity %>"
}
# Max textual content length
play.http.parser.maxMemoryBuffer = "<%= @http_parser_maxmemorybuffer %>"
# Max file size
play.http.parser.maxDiskBuffer = "<%= @http_parser_maxdiskbuffer %>"