|
1 | 1 | [role="xpack"]
|
2 |
| -[float] |
3 | 2 | [[forwarding-audit-logfiles]]
|
4 |
| -==== Forwarding audit logs to a remote cluster |
| 3 | +=== Forwarding audit logs to a remote cluster |
5 | 4 |
|
6 |
| -To index audit events to a remote Elasticsearch cluster, you configure |
7 |
| -the following `xpack.security.audit.index.client` settings: |
| 5 | +When you are auditing security events, you can optionally store the logs in an |
| 6 | +{es} index on a remote cluster. The logs are sent to the remote cluster by |
| 7 | +using the {javaclient}/transport-client.html[transport client]. |
8 | 8 |
|
9 |
| -* `xpack.security.audit.index.client.hosts` |
10 |
| -* `xpack.security.audit.index.client.cluster.name` |
11 |
| -* `xpack.security.audit.index.client.xpack.security.user` |
| 9 | +. Configure auditing such that the logs are stored in {es} rolling indices. |
| 10 | +See <<audit-index>>. |
| 11 | + |
| 12 | +. Establish a connection to the remote cluster by configuring the following |
| 13 | +`xpack.security.audit.index.client` settings: |
| 14 | ++ |
| 15 | +-- |
| 16 | +[source, yaml] |
| 17 | +-------------------------------------------------- |
| 18 | +xpack.security.audit.index.client.hosts: 192.168.0.1, 192.168.0.2 <1> |
| 19 | +xpack.security.audit.index.client.cluster.name: logging-prod <2> |
| 20 | +xpack.security.audit.index.client.xpack.security.user: myuser:mypassword <3> |
| 21 | +-------------------------------------------------- |
| 22 | +<1> A list of hosts in the remote cluster. If you are not using the default |
| 23 | +value for the `transport.tcp.port` setting on the remote cluster, you must |
| 24 | +specify the appropriate port number (prefixed by a colon) after each host. |
| 25 | +<2> The remote cluster name. |
| 26 | +<3> A valid user and password, which must have authority to create the |
| 27 | +`.security-audit` index on the remote cluster. |
12 | 28 |
|
13 | 29 | For more information about these settings, see
|
14 |
| -{ref}/auditing-settings.html#remote-audit-settings[Remote Audit Log Indexing Configuration Settings]. |
| 30 | +{ref}/auditing-settings.html#remote-audit-settings[Remote audit log indexing configuration settings]. |
| 31 | + |
| 32 | +-- |
| 33 | + |
| 34 | +. If the remote cluster has Transport Layer Security (TLS/SSL) enabled, you |
| 35 | +must specify extra security settings: |
15 | 36 |
|
16 |
| -You can pass additional settings to the remote client by specifying them in the |
17 |
| -`xpack.security.audit.index.client` namespace. For example, to allow the remote |
18 |
| -client to discover all of the nodes in the remote cluster you can specify the |
19 |
| -`client.transport.sniff` setting: |
| 37 | +.. {ref}/configuring-tls.html#node-certificates[Generate a node certificate on |
| 38 | +the remote cluster], then copy that certificate to the client. |
20 | 39 |
|
| 40 | +.. Enable TLS and specify the information required to access the node certificate. |
| 41 | + |
| 42 | +*** If the signed certificate is in PKCS#12 format, add the following information |
| 43 | +to the `elasticsearch.yml` file: |
| 44 | ++ |
| 45 | +-- |
21 | 46 | [source,yaml]
|
22 |
| ----------------------------- |
23 |
| -xpack.security.audit.index.client.transport.sniff: true |
24 |
| ----------------------------- |
| 47 | +----------------------------------------------------------- |
| 48 | +xpack.security.audit.index.client.xpack.security.transport.ssl.enabled: true |
| 49 | +xpack.security.audit.index.client.xpack.ssl.keystore.path: certs/remote-elastic-certificates.p12 |
| 50 | +xpack.security.audit.index.client.xpack.ssl.truststore.path: certs/remote-elastic-certificates.p12 |
| 51 | +----------------------------------------------------------- |
| 52 | + |
| 53 | +For more information about these settings, see |
| 54 | +{ref}/security-settings.html#auditing-tls-ssl-settings[Auditing TLS settings]. |
| 55 | +-- |
| 56 | + |
| 57 | +*** If the certificate is in PEM format, add the following information to the |
| 58 | +`elasticsearch.yml` file: |
| 59 | ++ |
| 60 | +-- |
| 61 | +[source, yaml] |
| 62 | +-------------------------------------------------- |
| 63 | +xpack.security.audit.index.client.xpack.security.transport.ssl.enabled: true |
| 64 | +xpack.security.audit.index.client.xpack.ssl.key: /home/es/config/audit-client.key |
| 65 | +xpack.security.audit.index.client.xpack.ssl.certificate: /home/es/config/audit-client.crt |
| 66 | +xpack.security.audit.index.client.xpack.ssl.certificate_authorities: [ "/home/es/config/remote-ca.crt" ] |
| 67 | +-------------------------------------------------- |
| 68 | + |
| 69 | +For more information about these settings, see |
| 70 | +{ref}/security-settings.html#auditing-tls-ssl-settings[Auditing TLS settings]. |
| 71 | +-- |
| 72 | + |
| 73 | +.. If you secured the certificate with a password, add the password to |
| 74 | +your {es} keystore: |
| 75 | + |
| 76 | +*** If the signed certificate is in PKCS#12 format, use the following commands: |
| 77 | ++ |
| 78 | +-- |
| 79 | +[source,shell] |
| 80 | +----------------------------------------------------------- |
| 81 | +bin/elasticsearch-keystore add xpack.security.audit.index.client.xpack.ssl.keystore.secure_password |
| 82 | +
|
| 83 | +bin/elasticsearch-keystore add xpack.security.audit.index.client.xpack.ssl.truststore.secure_password |
| 84 | +----------------------------------------------------------- |
| 85 | +-- |
| 86 | + |
| 87 | +*** If the certificate is in PEM format, use the following commands: |
| 88 | ++ |
| 89 | +-- |
| 90 | +[source,shell] |
| 91 | +----------------------------------------------------------- |
| 92 | +bin/elasticsearch-keystore add xpack.security.audit.index.client.xpack.ssl.secure_key_passphrase |
| 93 | +----------------------------------------------------------- |
| 94 | +-- |
| 95 | + |
| 96 | +. Restart {es}. |
| 97 | + |
| 98 | +When these steps are complete, your audit logs are stored in {es} rolling |
| 99 | +indices on the remote cluster. |
0 commit comments