Skip to content
This repository was archived by the owner on Aug 16, 2022. It is now read-only.

Commit 357d519

Browse files
authored
Merge pull request #457 from keithhc2/od-security-roles-mapping
Added configuration for Beats and root CA authentication to Python script
2 parents e9845d3 + 35f4218 commit 357d519

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

docs/security/configuration/client-auth.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ You can now assign your certificate's common name (CN) to a role. For this step,
4545

4646
After deciding which role you want to map your certificate's CN to, you can use [Kibana](../../access-control/users-roles#map-users-to-roles), [`roles_mapping.yml`](../yaml/#roles_mappingyml), or the [REST API](../../access-control/api/#create-role-mapping) to map your certificate's CN to the role. The following example uses the `REST API` to map the common name `CLIENT1` to the role `readall`.
4747

48-
#### Sample request
48+
**Sample request**
4949

5050
```json
5151
PUT _opendistro/_security/api/rolesmapping/readall
@@ -56,7 +56,7 @@ PUT _opendistro/_security/api/rolesmapping/readall
5656
}
5757
```
5858

59-
#### Sample response
59+
**Sample response**
6060

6161
```json
6262
{
@@ -78,10 +78,30 @@ headers = {
7878
}
7979
cert_file_path = "/full/path/to/client-cert.pem"
8080
key_file_path = "/full/path/to/client-cert-key.pem"
81+
root_ca_path = "/full/path/to/root-ca.pem"
8182
8283
# Send the request.
8384
path = 'movies/_doc/3'
8485
url = base_url + path
85-
response = requests.get(url, cert = (cert_file_path, key_file_path), verify=False)
86+
response = requests.get(url, cert = (cert_file_path, key_file_path), verify=root_ca_path)
8687
print(response.text)
8788
```
89+
90+
## Configuring Beats
91+
92+
You can also configure your Beats so that it uses a client certificate for authentication with Elasticsearch. Afterwards, it can start sending output to Elasticsearch.
93+
94+
This output configuration specifies which settings you need for client certificate authentication:
95+
96+
```yml
97+
output.elasticsearch:
98+
enabled: true
99+
# Array of hosts to connect to.
100+
hosts: ["localhost:9200"]
101+
# Protocol - either `http` (default) or `https`.
102+
protocol: "https"
103+
ssl.certificate_authorities: ["/full/path/to/CA.pem"]
104+
ssl.verification_mode: certificate
105+
ssl.certificate: "/full/path/to/client-cert.pem"
106+
ssl.key: "/full/path/to/to/client-cert-key.pem"
107+
```

0 commit comments

Comments
 (0)