application.conf.j2 7.27 KB
Newer Older
Bozidar Proevski's avatar
Bozidar Proevski committed
1
2
3
4
5
6
7
8
# Sample Cortex application.conf file

## SECRET KEY
#
# The secret key is used to secure cryptographic functions.
#
# IMPORTANT: If you deploy your application to several  instances,  make
# sure to use the same key.
9
play.http.secret.key="{{lookup('password', '{{playbook_dir}}/secrets/passwords/cortex_secret_key')}}"
Bozidar Proevski's avatar
Bozidar Proevski committed
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

## ElasticSearch
search {
  # Name of the index
  index = cortex
  # ElasticSearch instance address.
  # For cluster, join address:port with ',': "http://ip1:9200,ip2:9200,ip3:9200"
  #uri = "https://{{groups['odfeescontainers'][0]}}:9200"
  uri = "http://localhost:9200"

  ## Advanced configuration
  # Scroll keepalive.
  #keepalive = 1m
  # Scroll page size.
  #pagesize = 50
  # Number of shards
  #nbshards = 5
  # Number of replicas
  #nbreplicas = 1
  # Arbitrary settings
  #settings {
  #  # Maximum number of nested fields
  #  mapping.nested_fields.limit = 100
  #}

##   ## Authentication configuration
##   search.username = "cortex"
37
##   search.password = "{{lookup('password', '{{playbook_dir}}/secrets/passwords/cortex_odfe')}}"
Bozidar Proevski's avatar
Bozidar Proevski committed
38
39
40
## 
##   ## SSL configuration
##   search.keyStore {
41
##     path = "/etc/cortex/soctools-cortex.p12"
Bozidar Proevski's avatar
Bozidar Proevski committed
42
##     type = "PKCS12" # or PKCS12
43
##     password = "{{lookup('password', '{{playbook_dir}}/secrets/passwords/keystore')}}"
Bozidar Proevski's avatar
Bozidar Proevski committed
44
45
46
47
##   }
##   search.trustStore {
##     path = "/etc/cortex/cacerts.jks"
##     type = "JKS" # or PKCS12
48
##     password = "{{lookup('password', '{{playbook_dir}}/secrets/passwords/truststore')}}"
Bozidar Proevski's avatar
Bozidar Proevski committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
##   }
}

## Cache
#
# If an analyzer is executed against the same observable, the previous report can be returned without re-executing the
# analyzer. The cache is used only if the second job occurs within cache.job (the default is 10 minutes).
cache.job = 10 minutes

## Authentication
auth {
	# "provider" parameter contains the authentication provider(s). It can be multi-valued, which is useful
	# for migration.
	# The available auth types are:
	# - services.LocalAuthSrv : passwords are stored in the user entity within ElasticSearch). No
	#   configuration are required.
	# - ad : use ActiveDirectory to authenticate users. The associated configuration shall be done in
	#   the "ad" section below.
	# - ldap : use LDAP to authenticate users. The associated configuration shall be done in the
	#   "ldap" section below.
Arne Øslebø's avatar
Arne Øslebø committed
69
	provider = [local,oauth2]
Bozidar Proevski's avatar
Bozidar Proevski committed
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

	ad {
		# The Windows domain name in DNS format. This parameter is required if you do not use
		# 'serverNames' below.
		#domainFQDN = "mydomain.local"

		# 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 = [ad1.mydomain.local, ad2.mydomain.local]

		# The Windows domain name using short format. This parameter is required.
		#domainName = "MYDOMAIN"

		# If 'true', use SSL to connect to the domain controller.
		#useSSL = 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 = "ldap.mydomain.local:389"

		# If you have multiple LDAP servers, use the multi-valued setting 'serverNames' instead.
		#serverNames = [ldap1.mydomain.local, ldap2.mydomain.local]

		# Account to use to bind to the LDAP server. This parameter is required.
		#bindDN = "cn=thehive,ou=services,dc=mydomain,dc=local"

		# Password of the binding account. This parameter is required.
		#bindPW = "***secret*password***"

		# Base DN to search users. This parameter is required.
		#baseDN = "ou=users,dc=mydomain,dc=local"

		# Filter to search user in the directory server. Please note that {0} is replaced
		# by the actual user name. This parameter is required.
		#filter = "(cn={0})"

		# If 'true', use SSL to connect to the LDAP directory server.
		#useSSL = true
	}
Arne Øslebø's avatar
Arne Øslebø committed
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
  oauth2 {
    # URL of the authorization server
    clientId = "soctools-cortex"
    clientSecret = {{cortexsecret.value}}
    redirectUri = "https://{{soctoolsproxy}}:9001/api/ssoLogin"
    responseType = "code"
    grantType = "authorization_code"

    # URL from where to get the access token
    authorizationUrl = "https://{{soctoolsproxy}}:12443/auth/realms/{{openid_realm}}/protocol/openid-connect/auth"
    authorizationHeader = "Bearer"
    tokenUrl = "https://{{soctoolsproxy}}:12443/auth/realms/{{openid_realm}}/protocol/openid-connect/token"
    

    # The endpoint from which to obtain user details using the OAuth token, after successful login
    userUrl = "https://{{soctoolsproxy}}:12443/auth/realms/{{openid_realm}}/protocol/openid-connect/userinfo"
    scope = "profile"
    userIdField = "email"
    #userUrl = "https://auth-site.com/api/User"
    #scope = ["openid profile"]
  }

  ws.ssl.trustManager {
    stores = [
      {
        type = "JKS" // JKS or PEM
        path = "cacerts.jks"
        password = "{{lookup('password', '{{playbook_dir}}/secrets/passwords/truststore')}}"
      }
    ]
  }


  # Single-Sign On
  sso {
    # Autocreate user in database?
    autocreate = true

    # Autoupdate its profile and roles?
    autoupdate = true

    # Autologin user using SSO?
    autologin = true

    # Name of mapping class from user resource to backend user ('simple' or 'group')
    #mapper = group
    #mapper = simple
    #attributes {
    #  login = "user"
    #  name = "name"
    #  groups = "groups"
    #  organization = "org"
    #}
#    defaultRoles = ["read", "write", "admin"]
#    defaultOrganization = "uninett.no"
    #defaultRoles = ["read"]
    #defaultOrganization = "csirt"
    #groups {
    #  # URL to retreive groups (leave empty if you are using OIDC)
    #  #url = "https://auth-site.com/api/Groups"
    #  # Group mappings, you can have multiple roles for each group: they are merged
    #  mappings {
    #    admin-profile-name = ["admin"]
    #    editor-profile-name = ["write"]
    #    reader-profile-name = ["read"]
    #  }
    #}

    mapper = simple
    attributes {
      login = "user"
      name = "name"
      roles = "roles"
      organization = "org"
    }
    defaultRoles = ["read", "analyze"]
    defaultOrganization = "uninett.no"
  }
Bozidar Proevski's avatar
Bozidar Proevski committed
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
}

## ANALYZERS
#
analyzer {
  # analyzer location
  # url can be point to:
  # - directory where analyzers are installed
  # - json file containing the list of analyzer descriptions
  urls = [
    #"https://dl.bintray.com/thehive-project/cortexneurons/analyzers.json"
    "/opt/Cortex-Analyzers/analyzers"
  ]

  # Sane defaults. Do not change unless you know what you are doing.
  fork-join-executor {
    # Min number of threads available for analysis.
    parallelism-min = 2
    # Parallelism (threads) ... ceil(available processors * factor).
    parallelism-factor = 2.0
    # Max number of threads available for analysis.
    parallelism-max = 4
  }
}

# RESPONDERS
#
responder {
  # responder location (same format as analyzer.urls)
  urls = [
    #"https://dl.bintray.com/thehive-project/cortexneurons/reponders.json"
    "/opt/Cortex-Analyzers/responders"
  ]

  # Sane defaults. Do not change unless you know what you are doing.
  fork-join-executor {
    # Min number of threads available for analysis.
    parallelism-min = 2
    # Parallelism (threads) ... ceil(available processors * factor).
    parallelism-factor = 2.0
    # Max number of threads available for analysis.
    parallelism-max = 4
  }
}

# It's the end my friend. Happy hunting!