2017-07-27 17:40:14 -04:00
|
|
|
integTestCluster {
|
2017-08-30 17:22:46 -04:00
|
|
|
// Setup auditing so we can use it in some tests
|
2017-08-15 14:19:28 -04:00
|
|
|
setting 'xpack.security.audit.enabled', 'true'
|
2017-08-30 17:22:46 -04:00
|
|
|
setting 'xpack.security.audit.outputs', '[logfile, index]'
|
2017-08-15 14:19:28 -04:00
|
|
|
// Only log the events we need so we don't have as much to sort through
|
|
|
|
setting 'xpack.security.audit.index.events.include', '[access_denied, access_granted]'
|
|
|
|
// Try and speed up audit logging without overwelming it
|
|
|
|
setting 'xpack.security.audit.index.flush_interval', '250ms'
|
|
|
|
setting 'xpack.security.audit.index.settings.index.number_of_shards', '1'
|
|
|
|
setting 'xpack.security.audit.index.settings.index.refresh_interval', '250ms'
|
2017-08-30 17:22:46 -04:00
|
|
|
// Setup roles used by tests
|
2017-07-27 17:40:14 -04:00
|
|
|
extraConfigFile 'x-pack/roles.yml', 'roles.yml'
|
2017-08-30 17:22:46 -04:00
|
|
|
/* Setup the one admin user that we run the tests as.
|
|
|
|
* Tests use "run as" to get different users. */
|
2017-07-27 17:40:14 -04:00
|
|
|
setupCommand 'setupUser#test_admin',
|
|
|
|
'bin/x-pack/users', 'useradd', 'test_admin', '-p', 'x-pack-test-password', '-r', 'superuser'
|
2017-08-30 17:22:46 -04:00
|
|
|
// Override the wait condition to work properly with security
|
2017-07-27 17:40:14 -04:00
|
|
|
waitCondition = { node, ant ->
|
|
|
|
File tmpFile = new File(node.cwd, 'wait.success')
|
|
|
|
ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=>=${numNodes}&wait_for_status=yellow",
|
|
|
|
dest: tmpFile.toString(),
|
|
|
|
username: 'test_admin',
|
|
|
|
password: 'x-pack-test-password',
|
|
|
|
ignoreerrors: true,
|
|
|
|
retries: 10)
|
|
|
|
return tmpFile.exists()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-30 17:22:46 -04:00
|
|
|
run {
|
2017-08-15 14:19:28 -04:00
|
|
|
// Enabled audit logging so we can test it
|
|
|
|
setting 'xpack.security.audit.enabled', 'true'
|
2017-08-30 17:22:46 -04:00
|
|
|
setting 'xpack.security.audit.outputs', '[logfile, index]'
|
2017-08-15 14:19:28 -04:00
|
|
|
// Only log the events we need so we don't have as much to sort through
|
|
|
|
setting 'xpack.security.audit.index.events.include', '[access_denied, access_granted]'
|
|
|
|
// Try and speed up the logging process without overwelming it
|
|
|
|
setting 'xpack.security.audit.index.flush_interval', '250ms'
|
|
|
|
setting 'xpack.security.audit.index.settings.index.number_of_shards', '1'
|
|
|
|
setting 'xpack.security.audit.index.settings.index.refresh_interval', '250ms'
|
2017-08-30 17:22:46 -04:00
|
|
|
// Setup roles used by tests
|
2017-07-27 17:40:14 -04:00
|
|
|
extraConfigFile 'x-pack/roles.yml', 'roles.yml'
|
2017-08-30 17:22:46 -04:00
|
|
|
/* Setup the one admin user that we run the tests as.
|
|
|
|
* Tests use "run as" to get different users. */
|
2017-07-27 17:40:14 -04:00
|
|
|
setupCommand 'setupUser#test_admin',
|
|
|
|
'bin/x-pack/users', 'useradd', 'test_admin', '-p', 'x-pack-test-password', '-r', 'superuser'
|
2017-08-30 17:22:46 -04:00
|
|
|
// Override the wait condition to work properly with security
|
2017-07-27 17:40:14 -04:00
|
|
|
waitCondition = { node, ant ->
|
|
|
|
File tmpFile = new File(node.cwd, 'wait.success')
|
|
|
|
ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=>=${numNodes}&wait_for_status=yellow",
|
|
|
|
dest: tmpFile.toString(),
|
|
|
|
username: 'test_admin',
|
|
|
|
password: 'x-pack-test-password',
|
|
|
|
ignoreerrors: true,
|
|
|
|
retries: 10)
|
|
|
|
return tmpFile.exists()
|
|
|
|
}
|
|
|
|
}
|