Hi,
I have upgraded Heartbeat to 7.17.1. The result is the same. Then, I've changed the config to ssl.verification_mode: certificate
. That also has not changed anything.
---
#heartbeat.config.monitors:
# path: ${path.config}/monitors.d/*.yml
# reload.enabled: true
# reload.period: 5s
# Configure monitors
heartbeat.monitors:
- type: http
id: portal-customer-service
name: portal-customer-service http status
service_name: portal-customer-service
hosts: ["portal:5004/customerapi/health-status"]
schedule: "@every 5s"
ssl.enabled: true
ssl.verification_mode: certificate
I'm starting to think, that GoLang does not recognise the host name if the certificate does not have it in the SAN. Our certificate currently contains the host name only in the CommonName. I had a similar issue with Hashicorp Vault which is also written in GoLang.
2022-03-23T12:11:39.790Z WARN [cfgwarn] tlscommon/config.go:100 DEPRECATED: Treating the CommonName field on X.509 certificates as a host name when no Subject Alternative Names are present is going to be removed. Please update your certificates if needed. Will be removed in version: 8.0.0
Full log output
2022-03-23T12:11:39.777Z INFO instance/beat.go:686 Home path: [/usr/share/heartbeat] Config path: [/etc/heartbeat] Data path: [/var/lib/heartbeat] Logs path: [/var/log/heartbeat] Hostfs Path: [/]
2022-03-23T12:11:39.780Z INFO instance/beat.go:694 Beat ID: e7c95814-bb9a-42ac-af59-9b152d12951f
2022-03-23T12:11:39.783Z INFO [seccomp] seccomp/seccomp.go:124 Syscall filter successfully installed
2022-03-23T12:11:39.785Z INFO [beat] instance/beat.go:1040 Beat info {"system_info": {"beat": {"path": {"config": "/etc/heartbeat", "data": "/var/lib/heartbeat", "home": "/usr/share/heartbeat", "logs": "/var/log/heartbeat"}, "type": "heartbeat", "uuid": "e7c95814-bb9a-42ac-af59-9b152d12951f"}}}
2022-03-23T12:11:39.787Z INFO [beat] instance/beat.go:1049 Build info {"system_info": {"build": {"commit": "1d05ba86138cfc9a5ae5c0acc64a57b8d81678ff", "libbeat": "7.17.1", "time": "2022-02-23T23:44:00.000Z", "version": "7.17.1"}}}
2022-03-23T12:11:39.787Z INFO [beat] instance/beat.go:1052 Go runtime info {"system_info": {"go": {"os":"linux","arch":"amd64","max_procs":4,"version":"go1.17.6"}}}
2022-03-23T12:11:39.788Z INFO [beat] instance/beat.go:1056 Host info {"system_info": {"host": {"architecture":"x86_64","boot_time":"2022-03-15T02:29:47Z","containerized":false,"name":"XXX-useast1-b-portal-app-dev-i1.dev.aws.XXX.lan","ip":["127.0.0.1/8","::1/128","10.191.38.223/24","fe80::81e:93ff:fec2:9b69/64","172.17.0.1/16","172.18.0.1/16","fe80::42:a3ff:fe6c:bc5c/64","fe80::54d1:53ff:fe49:5c9a/64"],"kernel_version":"4.14.268-205.500.amzn2.x86_64","mac":["0a:1e:93:c2:9b:69","02:42:2c:88:fe:1a","02:42:a3:6c:bc:5c","56:d1:53:49:5c:9a"],"os":{"type":"linux","family":"redhat","platform":"amzn","name":"Amazon Linux","version":"2","major":2,"minor":0,"patch":0,"codename":"Karoo"},"timezone":"UTC","timezone_offset_sec":0,"id":"ec248073e7a1a4c17549244489685049"}}}
2022-03-23T12:11:39.788Z INFO [beat] instance/beat.go:1085 Process info {"system_info": {"process": {"capabilities": {"inheritable":null,"permitted":["net_raw"],"effective":["net_raw"],"bounding":["chown","dac_override","dac_read_search","fowner","fsetid","kill","setgid","setuid","setpcap","linux_immutable","net_bind_service","net_broadcast","net_admin","net_raw","XXX_lock","XXX_owner","sys_module","sys_rawio","sys_chroot","sys_ptrace","sys_pacct","sys_admin","sys_boot","sys_nice","sys_resource","sys_time","sys_tty_config","mknod","lease","audit_write","audit_control","setfcap","mac_override","mac_admin","syslog","wake_alarm","block_suspend","audit_read"],"ambient":null}, "cwd": "/", "exe": "/usr/share/heartbeat/bin/heartbeat", "name": "heartbeat", "pid": 9499, "ppid": 1, "seccomp": {"mode":"filter","no_new_privs":true}, "start_time": "2022-03-23T12:11:39.050Z"}}}
2022-03-23T12:11:39.788Z INFO instance/beat.go:328 Setup Beat: heartbeat; Version: 7.17.1
2022-03-23T12:11:39.788Z INFO [index-management] idxmgmt/std.go:184 Set output.elasticsearch.index to 'heartbeat-7.17.1' as ILM is enabled.
2022-03-23T12:11:39.788Z INFO [esclientleg] eslegclient/connection.go:105 elasticsearch url: https://XXXXXXXXXXXXXX.us-east-1.aws.found.io:443
2022-03-23T12:11:39.789Z INFO [publisher] pipeline/module.go:113 Beat name: XXX-useast1-b-portal-app-dev-i1.dev.aws.XXX.lan
2022-03-23T12:11:39.790Z INFO [esclientleg] eslegclient/connection.go:105 elasticsearch url: https://XXXXXXXXXXXXXX.us-east-1.aws.found.io:443
2022-03-23T12:11:39.790Z INFO instance/beat.go:492 heartbeat start running.
2022-03-23T12:11:39.790Z INFO beater/heartbeat.go:85 heartbeat is running! Hit CTRL-C to stop it.
2022-03-23T12:11:39.790Z INFO beater/heartbeat.go:87 Effective user/group ids: 0/0, with groups: []
2022-03-23T12:11:39.791Z INFO [monitoring] log/log.go:142 Starting metrics logging every 30s
2022-03-23T12:11:39.790Z WARN [cfgwarn] tlscommon/config.go:100 DEPRECATED: Treating the CommonName field on X.509 certificates as a host name when no Subject Alternative Names are present is going to be removed. Please update your certificates if needed. Will be removed in version: 8.0.0
2022-03-23T12:11:39.852Z INFO [esclientleg] eslegclient/connection.go:284 Attempting to connect to Elasticsearch version 7.16.1
2022-03-23T12:11:39.863Z INFO [monitoring] elasticsearch/elasticsearch.go:244 Successfully connected to X-Pack Monitoring endpoint.
2022-03-23T12:11:39.863Z INFO [monitoring] elasticsearch/elasticsearch.go:258 Start monitoring stats metrics snapshot loop with period 10s.
2022-03-23T12:11:39.863Z INFO [monitoring] elasticsearch/elasticsearch.go:258 Start monitoring state metrics snapshot loop with period 1m0s.
2022-03-23T12:11:40.820Z INFO [publisher] pipeline/retry.go:219 retryer: send unwait signal to consumer
2022-03-23T12:11:40.820Z INFO [publisher_pipeline_output] pipeline/output.go:143 Connecting to backoff(elasticsearch(https://XXXXXXXXXXXXXX.us-east-1.aws.found.io:443))
2022-03-23T12:11:40.820Z INFO [publisher] pipeline/retry.go:223 done
2022-03-23T12:11:40.833Z INFO [esclientleg] eslegclient/connection.go:284 Attempting to connect to Elasticsearch version 7.16.1
2022-03-23T12:11:40.845Z INFO [esclientleg] eslegclient/connection.go:284 Attempting to connect to Elasticsearch version 7.16.1
2022-03-23T12:11:40.848Z INFO [index-management] idxmgmt/std.go:261 Auto ILM enable success.
2022-03-23T12:11:40.854Z INFO [index-management.ilm] ilm/std.go:170 ILM policy heartbeat exists already.
2022-03-23T12:11:40.854Z INFO [index-management] idxmgmt/std.go:397 Set setup.template.name to '{heartbeat-7.17.1 {now/d}-000001}' as ILM is enabled.
2022-03-23T12:11:40.854Z INFO [index-management] idxmgmt/std.go:402 Set setup.template.pattern to 'heartbeat-7.17.1-*' as ILM is enabled.
2022-03-23T12:11:40.854Z INFO [index-management] idxmgmt/std.go:436 Set settings.index.lifecycle.rollover_alias in template to {heartbeat-7.17.1 {now/d}-000001} as ILM is enabled.
2022-03-23T12:11:40.854Z INFO [index-management] idxmgmt/std.go:440 Set settings.index.lifecycle.name in template to {heartbeat {"policy":{"phases":{"hot":{"actions":{"rollover":{"max_age":"30d","max_size":"50gb"}}}}}}} as ILM is enabled.
2022-03-23T12:11:40.861Z INFO template/load.go:110 Template "heartbeat-7.17.1" already exists and will not be overwritten.
2022-03-23T12:11:40.861Z INFO [index-management] idxmgmt/std.go:297 Loaded index template.
2022-03-23T12:11:40.870Z INFO [index-management.ilm] ilm/std.go:126 Index Alias heartbeat-7.17.1 exists already.
2022-03-23T12:11:40.872Z INFO [publisher_pipeline_output] pipeline/output.go:151 Connection to backoff(elasticsearch(https://XXXXXXXXXXXXXX.us-east-1.aws.found.io:443)) established
2022-03-23T12:11:49.869Z INFO [publisher_pipeline_output] pipeline/output.go:143 Connecting to backoff(monitoring(https://XXXXXXXXXXXXXX.us-east-1.aws.found.io:443))
2022-03-23T12:11:49.869Z INFO [monitoring] pipeline/retry.go:219 retryer: send unwait signal to consumer
2022-03-23T12:11:49.869Z INFO [monitoring] pipeline/retry.go:223 done
2022-03-23T12:11:49.872Z INFO [esclientleg] eslegclient/connection.go:284 Attempting to connect to Elasticsearch version 7.16.1
2022-03-23T12:11:49.876Z INFO [publisher_pipeline_output] pipeline/output.go:151 Connection to backoff(monitoring(https://XXXXXXXXXXXXXX.us-east-1.aws.found.io:443)) established
2022-03-23T12:12:52.137Z INFO [monitoring] log/log.go:193 Uptime: 1m12.534088944s
2022-03-23T12:12:52.137Z INFO [monitoring] log/log.go:160 Stopping metrics logging.
2022-03-23T12:12:52.137Z INFO [monitoring] elasticsearch/elasticsearch.go:266 Stop monitoring stats metrics snapshot loop.
2022-03-23T12:12:52.137Z INFO [monitoring] elasticsearch/elasticsearch.go:266 Stop monitoring state metrics snapshot loop.
2022-03-23T12:12:52.138Z INFO instance/beat.go:498 heartbeat stopped.
Thanks
Les