Skip to content

Commit 4311208

Browse files
authored
Implement basic TLS/SSL features (#179)
* Configured Elasticsearch to work with SSL * Disable Xpack on Kibana and Ingestor nodes * Implement SSL OPS file * Unlink elasticsearch_config job from remote ES cluster and run it against colocated one * Unbound upload-kibana-objects from ES remote cluster * Fix scale-to-one-az ops file * Unbound curator from remote ES cluster and make it use colocated one * Move ls-router to separate OPS file * Disable post-start across all instances * Change dn * Disable post-start on Kibana also * Put admin cert to data node * Re-organize post-start * Add README * Split ssl/tls * Upload blobs * Fixup upon review
1 parent 6bef8a7 commit 4311208

File tree

24 files changed

+385
-191
lines changed

24 files changed

+385
-191
lines changed

README.md

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
11
# Logsearch
22

3-
A scalable stack of [Elasticsearch](http://www.elasticsearch.org/overview/elasticsearch/),
4-
[Logstash](http://www.elasticsearch.org/overview/logstash/), and
5-
[Kibana](http://www.elasticsearch.org/overview/kibana/) for your
6-
own [BOSH](http://docs.cloudfoundry.org/bosh/)-managed infrastructure.
3+
A scalable stack of [Elasticsearch](https://www.elastic.co/elasticsearch), [Logstash](https://www.elastic.co/logstash), and [Kibana](https://www.elastic.co/kibana) for your own [BOSH](https://bosh.io/docs)-managed infrastructure.
4+
5+
![logsearch-scheme](docs/img/logsearch.png)
76

87
## BREAKING CHANGES
98

10-
Logsearch < v23.0.0 was based on Elasticsearch 1.x and Kibana 3.
9+
### Logsearch v211 is based on Elastic stack version 7
10+
In v211.1.0 basic cluster security features were implemented using [Securiry](https://opendistro.github.io/for-elasticsearch-docs/docs/install/plugins/) plugin from OpenDistro Elasticsearch implementation. For better handling of these features, a following changes was made:
1111

12-
Logsearch > v200 is based on Elasticsearch 2.x and Kibana 4.
12+
- Additional Elasticsearch job has been colocated on **Maintenance** instance. This allows secure communication over localhost for all singletons also colocated there (all singletons have been unlinked from any remote Elasticsearch cluster, and bound to local one).
13+
- Since using of Ls-rounter instance is not mandatory - it was moved to separate [ops-file](deployment/operations/enable-router.yml).
14+
- Secure Elasticsearch node-to-node communication has been implemented using [enable-tls](deployment/operations/enable-tls.yml) ops-file.
15+
- Secure ingesting logs is implemented using [enable-ssl](deployment/operations/enable-ssl.yml) ops-file.
1316

14-
- There is NO upgrade path from Elasticsearch 1.x to 2.x. Sorry :(
17+
### Logsearch v210 is based on Elastic stack version 6
1518

16-
Logsearch > v204.0.0 is based on Elastic stack version 5.
19+
- Elasticsearch 6.x can use indices created in Elasticsearch 5.x, but not those created in Elasticsearch 2.x or before.
20+
- **Important**: After upgrading running 5.x cluster to 6.x all existing indicies will be available for reading data. However, writing to these indicies is not possible. In order to write data immediatelly after upgrade you have to [change index naming convention](https://github.com/cloudfoundry-community/logsearch-boshrelease/commit/2f83b41ee14dbe3141e21cc0c40df340d50e0169). As long as index names are usually based on current date, this change can be safely reverted in a day or so.
1721

22+
### Logsearch v204 is based on Elastic stack version 5.
1823
- For upgrade procedure from Elasticsearch 2.x please refer to [v205.0.0 release notes](https://github.com/cloudfoundry-community/logsearch-boshrelease/releases/tag/v205.0.0#component-updates).
1924

20-
Logsearch > v210.0.0 is based on Elastic stack version 6.
21-
22-
- Elasticsearch 6.x can use indices created in Elasticsearch 5.x, but not those created in Elasticsearch 2.x or before.
23-
- **Important**: After upgrading running 5.x cluster to 6.x all existing indicies will be available for reading data. However, writing to these indicies is not possible. In order to write data immediatelly after upgrade you have to [change index naming convention](https://github.com/cloudfoundry-community/logsearch-boshrelease/commit/2f83b41ee14dbe3141e21cc0c40df340d50e0169). As long as index names are usually based on current date, this change can be safely reverted in a day or so.
25+
### Logsearch v200 is based on Elasticsearch 2.x and Kibana 4.
26+
- There is NO upgrade path from Elasticsearch 1.x to 2.x. Sorry :(
2427

28+
### Logsearch < v23 was based on Elasticsearch 1.x and Kibana 3.
2529

2630
## Getting Started
2731

28-
This repo contains Logsearch Core; which deploys an ELK cluster that can receive and parse logs via syslog
29-
that contain JSON.
32+
This repo contains Logsearch Core; which deploys an ELK cluster that can receive and parse logs via syslog that contain JSON.
3033

3134
Most users will want to combine Logsearch Core with a Logsearch Addon to customise their cluster for a
3235
particular type of logs. Its likely you want to be following an Addon installation guides - see below
@@ -36,7 +39,7 @@ for a list of the common Addons:
3639

3740

3841
## Installing Logsearch Core
39-
42+
4043
Before starting deployment, make sure your BOSH environment is ready, and all `BOSH_` evironment variables are set. We suggest you to use [BBL](https://github.com/cloudfoundry/bosh-bootloader) tool to spin up the BOSH environment.
4144

4245
```
@@ -45,7 +48,7 @@ $ bosh -d logsearch deploy logsearch-deployment.yml
4548
```
4649
## Common customisations:
4750

48-
0. Adding new parsing rules:
51+
Adding new parsing rules:
4952

5053
logstash_parser:
5154
filters: |
@@ -63,21 +66,6 @@ $ bosh -d logsearch deploy logsearch-deployment.yml
6366

6467
## Known issues
6568

66-
#### VMs lose connectivity to each other after VM recreation (eg. instance type upgrade)
67-
68-
While this issue is not specific to this boshrelease, it is worth noting.
69-
70-
On certain IAAS'es, (AWS confirmed), the bosh-agent fails to flush the ARP cache of the VMs in the deployment which, in rare cases, results in VMs not being able to communicate with each other after some of them has been recreated. The symptoms of when this happens are varied depending on the affected VMs. It could be anything from HAproxy reporting it couldn't find any backends (eg. Kibana) or the parsers failing to connect to the queue.
71-
72-
To prevent stale ARP entries, set the `director.flush_arp` property of your BOSH deployment to `true`.
73-
74-
The issue, if occurs, should fix itself as the kernel updates incomplete ARP entries, which **should** happen within minutes
75-
76-
This can also be done manually if an immediate manual fix is preferred. This should be done on the VMs that are trying to talk to the VM that has been recreated.
77-
78-
```
79-
arp -d $recreated_vm_ip
80-
```
8169

8270
## License
8371

config/blobs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ curator/vendor/voluptuous-0.11.5-py2.py3-none-any.whl:
5656
sha: b5c82285df0610464a9332c567cf8bd06b8786f6
5757
elasticsearch/elasticsearch-7.6.1-linux-x86_64.tar.gz:
5858
size: 296454172
59+
object_id: a7447f2a-1772-4892-508e-43e5029c54ba
5960
sha: sha256:25583ddd44a99437958f7f9410cd9746c8230b367d570cdf69e96824a583748a
6061
haproxy/haproxy-1.7.5.tar.gz:
6162
size: 1743979
@@ -67,9 +68,11 @@ haproxy/pcre-8.40.tar.gz:
6768
sha: 10384eb3d411794cc15f55b9d837d3f69e35391e
6869
kibana/kibana-7.6.1-linux-x86_64.tar.gz:
6970
size: 249498863
71+
object_id: df54821e-9deb-4c08-4f02-6f160dec5913
7072
sha: sha256:da636529511e707bbbc621dc131ff2ed18f50fe0df30821c375d16c5ba4248f6
7173
logstash/logstash-7.6.1.tar.gz:
7274
size: 172679481
75+
object_id: 8f5d650d-58a2-4774-566a-519d8e085ae5
7376
sha: sha256:6b16f3158829ad820463c7f3ca4cfec433d12d0eafa25be203c92d12ca91da10
7477
logstash/logstash-filter-alter-3.0.2.zip:
7578
size: 7425

deployment/logsearch-deployment.yml

Lines changed: 16 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ instance_groups:
3535
elasticsearch:
3636
node:
3737
allow_master: true
38-
config_options:
38+
config_options: &xpack-options
3939
xpack.monitoring.enabled: false
4040
xpack.graph.enabled: false
4141
xpack.ml.enabled: false
@@ -47,6 +47,7 @@ instance_groups:
4747
- z1
4848
instances: 1
4949
vm_type: medium
50+
persistent_disk_type: 5GB
5051
stemcell: default
5152
update:
5253
serial: true
@@ -55,10 +56,15 @@ instance_groups:
5556
jobs:
5657
- name: bpm
5758
release: bpm
58-
- name: elasticsearch_config
59+
- name: elasticsearch
5960
release: logsearch
6061
consumes:
6162
elasticsearch: {from: elasticsearch_master}
63+
properties:
64+
elasticsearch:
65+
config_options: *xpack-options
66+
- name: elasticsearch_config
67+
release: logsearch
6268
properties:
6369
elasticsearch_config:
6470
index_prefix: logs-
@@ -68,8 +74,6 @@ instance_groups:
6874
- index-mappings: /var/vcap/jobs/elasticsearch_config/index-templates/index-mappings.json
6975
- name: curator
7076
release: logsearch
71-
consumes:
72-
elasticsearch: {from: elasticsearch_master}
7377
- name: smoke_tests
7478
release: logsearch
7579
consumes:
@@ -101,12 +105,7 @@ instance_groups:
101105
elasticsearch:
102106
node:
103107
allow_data: true
104-
config_options:
105-
xpack.monitoring.enabled: false
106-
xpack.graph.enabled: false
107-
xpack.ml.enabled: false
108-
xpack.security.enabled: false
109-
xpack.watcher.enabled: false
108+
config_options: *xpack-options
110109

111110
- name: kibana
112111
azs:
@@ -124,6 +123,9 @@ instance_groups:
124123
release: logsearch
125124
consumes:
126125
elasticsearch: {from: elasticsearch_master}
126+
properties:
127+
elasticsearch:
128+
config_options: *xpack-options
127129
- name: kibana
128130
release: logsearch
129131
provides:
@@ -136,12 +138,7 @@ instance_groups:
136138
timeout: 500
137139
env:
138140
- NODE_ENV: production
139-
config_options:
140-
xpack.monitoring.enabled: false
141-
xpack.graph.enabled: false
142-
xpack.ml.enabled: false
143-
xpack.security.enabled: false
144-
xpack.watcher.enabled: false
141+
config_options: *xpack-options
145142

146143
- name: ingestor
147144
azs:
@@ -160,6 +157,9 @@ instance_groups:
160157
release: logsearch
161158
consumes:
162159
elasticsearch: {from: elasticsearch_master}
160+
properties:
161+
elasticsearch:
162+
config_options: *xpack-options
163163
- name: ingestor_syslog
164164
release: logsearch
165165
consumes:
@@ -175,25 +175,6 @@ instance_groups:
175175
deployment_dictionary:
176176
- /var/vcap/packages/logsearch-config/deployment_lookup.yml
177177

178-
- name: ls-router
179-
azs:
180-
- z1
181-
instances: 1
182-
vm_type: medium
183-
stemcell: default
184-
networks:
185-
- name: default
186-
jobs:
187-
- name: bpm
188-
release: bpm
189-
- name: haproxy
190-
release: logsearch
191-
consumes:
192-
elasticsearch: {from: elasticsearch_master}
193-
ingestor: {from: ingestor_link}
194-
kibana: {from: kibana_link}
195-
syslog_forwarder: nil
196-
197178
releases:
198179
- name: logsearch
199180
url: https://s3.amazonaws.com/logsearch/logsearch-211.0.3.tgz

deployment/operations/cloudfoundry.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
release: logsearch-for-cloudfoundry
2121
consumes:
2222
cloud_controller: {from: cloud_controller, deployment: cf}
23-
elasticsearch: {from: elasticsearch_master}
2423
properties:
2524
cloudfoundry:
2625
user: admin
@@ -105,7 +104,7 @@
105104
skip_ssl_validation: true
106105

107106
- type: replace
108-
path: /instance_groups/name=ls-router/jobs/-
107+
path: /instance_groups/name=kibana/jobs/-
109108
value:
110109
name: route_registrar
111110
release: routing
@@ -117,7 +116,7 @@
117116
route_registrar:
118117
routes:
119118
- name: kibana
120-
port: 80
119+
port: 5601
121120
registration_interval: 60s
122121
uris:
123122
- "logs.((system_domain))"

deployment/operations/disable-post-start.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,23 @@
88
path: /instance_groups/name=elasticsearch_data/jobs/name=elasticsearch/properties/elasticsearch/health?
99
value:
1010
disable_post_start: true
11+
12+
- type: replace
13+
path: /instance_groups/name=maintenance/jobs/name=elasticsearch/properties/elasticsearch/health?
14+
value:
15+
disable_post_start: true
16+
17+
- type: replace
18+
path: /instance_groups/name=ingestor/jobs/name=elasticsearch/properties/elasticsearch/health?
19+
value:
20+
disable_post_start: true
21+
22+
- type: replace
23+
path: /instance_groups/name=kibana/jobs/name=elasticsearch/properties/elasticsearch/health?
24+
value:
25+
disable_post_start: true
26+
27+
- type: replace
28+
path: /instance_groups/name=kibana/jobs/name=kibana/properties/kibana/health?
29+
value:
30+
disable_post_start: true
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
- type: replace
3+
path: /instance_groups/name=ls-router?
4+
value:
5+
name: ls-router
6+
azs:
7+
- z1
8+
instances: 1
9+
vm_type: medium
10+
stemcell: default
11+
networks:
12+
- name: default
13+
jobs:
14+
- name: bpm
15+
release: bpm
16+
- name: haproxy
17+
release: logsearch
18+
consumes:
19+
elasticsearch: {from: elasticsearch_master}
20+
ingestor: {from: ingestor_link}
21+
kibana: {from: kibana_link}
22+
syslog_forwarder: nil
23+
24+
# Uncomment following to relocate route-registrar to ls-router
25+
# Make sure then this OPS file comes after cloudfoundry.yml
26+
27+
# - type: remove
28+
# path: /instance_groups/name=kibana/jobs/name=route_registrar
29+
30+
# - type: replace
31+
# path: /instance_groups/name=ls-router/jobs/-
32+
# value:
33+
# name: route_registrar
34+
# release: routing
35+
# consumes:
36+
# nats:
37+
# from: nats
38+
# deployment: cf
39+
# properties:
40+
# route_registrar:
41+
# routes:
42+
# - name: kibana
43+
# port: 80
44+
# registration_interval: 60s
45+
# uris:
46+
# - "logs.((system_domain))"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
# ingestor
3+
- type: replace
4+
path: /instance_groups/name=ingestor/jobs/name=ingestor_syslog/properties?/logstash_ingestor?/syslog_tls?
5+
value:
6+
port: 6514
7+
ssl_cert: ((haproxy-ssl.certificate))
8+
ssl_key: ((haproxy-ssl.private_key))
9+
skip_ssl_validation: false

0 commit comments

Comments
 (0)