Managing Prometheus in a Security-focused Environment Linux - - PowerPoint PPT Presentation
Managing Prometheus in a Security-focused Environment Linux - - PowerPoint PPT Presentation
Managing Prometheus in a Security-focused Environment Linux Monitoring at HUK-COBURG PromCon 2019 | Christian Hoffmann Conways Law? 11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 2 Introduction $ cat
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 2
Conway‘s Law?
$ cat /HUK-COBURG
Introduction
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 3
HUK-COBURG German consumer insurance company Largest car insurance for consumers in Germany 12 million customers 10.000 employees
$ cat /HUK-COBURG/IT
Introduction
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 4
HUK-COBURG IT-related departments … 800 people Not a startup, but lots of teams Highly regulated
$ cat /HUK-COBURG/IT/Linux
Introduction
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 5
HUK-COBURG Linux Platform Development IT-related departments … Internal IaaS provider 900 RHEL servers Two main data centers
$ cat /HUK-COBURG/IT/Linux/Christian Hoffmann
Introduction
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 6
HUK-COBURG Linux Platform Development IT-related departments … One of ten people Joined in 2016 Linux & Open Source enthusiast
$ cat /HUK-COBURG/IT/Linux/Application owners
Introduction
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 7
HUK-COBURG Linux Platform Development IT-related departments … Application owners About 130 people, running:
- Databases
- Web servers
- …
$ cat /HUK-COBURG/IT/Linux/Others
Introduction
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 8
HUK-COBURG Linux Platform Development IT-related departments … Application owners … Operations
Scraping Alerts Graphs Integrations
Overview
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 9
Monitoring
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 10
Close to the target What does close mean?
Placement of Prometheus Instances
Scraping Firewalled zone #40
SMTP? Alertmanager/HTTP?
2
Our setup: One Prometheus per DC
Scraping
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 11
DC 1 DC 2 VMs
20 GiB
RAM
1.2 TiB
disk
1.7 M
series
30 k
samples/s
60s
scrape_interval
2 600
file_sd
1 600
rec rules
200
alert rules
4
cores
# ps –ef | grep agent root 3474 Nov07 00:30:14 /opt/security-scanner/agent root 7182 Nov07 00:05:03 /opt/hardware-monitoring/agent root 1139 Nov07 83:01:37 /opt/license-management/agent root 4100 Nov07 00:20:00 /opt/config-management/agent root 9983 Nov07 01:30:53 /opt/backup-management/agent ...
Scraping: Securing and unifying metrics access
Scraping
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 12
# nmap server1001 PORT STATE SERVICE 22/tcp open ssh Nmap done: 1 IP address (1 host up) scanned in 0.12 seconds
So…
Scraping
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 13
Prometheus server
Introducing sshified
Scraping
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 14
Monitoring target
sshified sshd node_exporter
127.0.0.1:9100 proxy_url: 127.0.0.1:8000 10.1.2.3:22
Exporters
Scraping
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 15
node
textfile runs as root systemd
process
non-systemd procs
multilog blackbox
decentralized
Scraping Alerts Graphs Integrations
Overview
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 16
Monitoring
Alertmanager
Alerts
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 17
Operations Alertmanager
- Routing
- LinuxPlatform.+
- LinuxServer.+
- App.+
- Integrations
- webhook
- Silences
Server inventory Central Event Management
- Dead man’s switch
- Incident creation
- Paging
syslog
Prometheus
Scraping Alerts Graphs Integrations
Overview
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 18
Monitoring
Grafana with basic multi-tenancy
Graphs
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 19
Apache httpd
- mod_ldap
- mod_auth_kerb
Template
- wner_john
- wner_lisa
- wner_*
prometheus-filter-proxy
John
127.0.0.1:8888/owner="john"/api/v1/query?query=up 127.0.0.1:9090/api/v1/query?query=up{owner="john"}
Prometheus
huk-grafana-provisioning.py
Grafana with high availability
Graphs
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 20
Apache httpd prometheus-filter-proxy Prometheus
John 10.1.2.3
Apache httpd prometheus-filter-proxy Prometheus
rsync grafana.sqlite
Scraping Alerts Graphs Integrations
Overview
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 21
Monitoring
hiera
common.yml
role/web.yml
role/db.yml
node/srv1001.yml
Integrating Prometheus into Configuration Management
Integrations
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 22
Deploy & configure exporters Role-specific alerts
- Scrape configs
- Platform alerts
Staging of new Linux patches Roll-out on application servers
Integrating Patch Management into Prometheus
Integrations
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 23
Development Staging Production
Long Term Storage, Downsampling, „Janitor“ Dashboard performance Lots of additional ideas and areas for work
What‘s up next?
Future
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 24
Prometheus and Grafana provide us Sufficient flexibility in a regulated environment, Basic multi-tenancy for our teams, and Helpful integrations into other processes.
Benefits & Takeaways
Summary
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment 25
11/2019 Christian Hoffmann | Managing Prometheus in a Security-focused Environment
Thanks! Any questions?
Christian Hoffmann Linux System Engineer at HUK-COBURG christian.hoffmann2@huk-coburg.de
http://github.com/hoffie/sshified http://github.com/hoffie/prometheus-filter-proxy http://github.com/hoffie/multilog_exporter