Bladeren bron

added TLS support for agents; added example CA and cert

tags/v1.3.0^0
Robin Thoni 1 jaar geleden
bovenliggende
commit
1a6c986b58
6 gewijzigde bestanden met toevoegingen van 140 en 3 verwijderingen
  1. 23
    0
      README.md
  2. 5
    0
      zabbix/Dockerfile
  3. 29
    0
      zabbix/certs/zabbix-ca.crt
  4. 28
    0
      zabbix/certs/zabbix-server.crt
  5. 52
    0
      zabbix/certs/zabbix-server.key
  6. 3
    3
      zabbix/zabbix_server.conf

+ 23
- 0
README.md Bestand weergeven

@@ -1 +1,24 @@
1
+# Default username/password
2
+
1 3
 Admin:zabbix
4
+
5
+# TLS
6
+
7
+## Generate CA
8
+
9
+### Generate CA key
10
+openssl genrsa -passout env:CA_PASSWD -aes256 -out zabbix-ca.key 4096
11
+### Generate CA
12
+openssl req -x509 -new -key zabbix-ca.key -sha256 -days 36500 -out zabbix-ca.crt -passin env:CA_PASSWD -subj "/CN=zabbix-server"
13
+
14
+## Generate host cert
15
+
16
+### Set host variable
17
+HOST=zabbix-host.domain.tld
18
+### Generate host key and csr
19
+openssl req -new -newkey rsa:4096 -nodes -keyout "${HOST}.key" -out "${HOST}.csr" -subj "/CN=${HOST}"
20
+### Generate host cert
21
+openssl x509 -req -CA zabbix-ca.crt -CAkey zabbix-ca.key -CAcreateserial -days 36500 -sha256 -passin env:CA_PASSWD -in "${HOST}.csr" -out "${HOST}.crt"
22
+### Remove csr
23
+rm "${HOST}.csr"
24
+

+ 5
- 0
zabbix/Dockerfile Bestand weergeven

@@ -40,6 +40,11 @@ COPY ./vars-files /etc/vars-files
40 40
 
41 41
 COPY ./run.sh /run.sh
42 42
 
43
+COPY ./certs/* /etc/zabbix/certs/
44
+
45
+RUN chown zabbix:zabbix /etc/zabbix/certs/* &&\
46
+    chmod 400 /etc/zabbix/certs/*
47
+
43 48
 EXPOSE 80
44 49
 
45 50
 USER zabbix

+ 29
- 0
zabbix/certs/zabbix-ca.crt Bestand weergeven

@@ -0,0 +1,29 @@
1
+-----BEG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DVR0TAQH/BAUwAwEB/zANBgkqhkiG
18
+9w0BAQsFAAOCAgEAHxkaPKWgG2qulh/ZsTWdwvU/jqv9Tdcj80ln/vnfZCSefBqp
19
+LBB13NeIXXl+u/yL4MhamwwYrZPWYEKP7zemj10BaVVuSoF8OSwriTrxWBUQ3qoR
20
+fFJmGyA180ghJeuPbXgT0JjAJyxUedTuxYPM/1XfPX4mYxfPEtl/Qz1N+0Huaez0
21
+EszRe3BFgvXois/m0MFvuXpms2ptRZOodmC1Bvosx/awfpp+7LLGSP8CYLfE6bOH
22
+Zvhnu/RG5B+Fed+kvDs6Kn4erruRLZL79pbjfvPSB1hrLyhdfVtmYANppgSXOpFb
23
+C2NB0AsfXK3xGVc+cmF93qN4M1JrL8p1RtJyPnt8ptrMvt0mt2zNuXZQReDP1eYv
24
+PVrhIbpwGZ164CNIbBSE1DhOjd0hzIUGRUcWC3/gMBVXbVRpy5yRavhAsy/AxHYM
25
+G2s29D/4hYYAUa3EQxFv4v7jsgxmY5m1kV4SwF/4X1D+mvWDHo9l77382W3Q4uLL
26
+MYWNyBtjyICicRg6lKCgpt99XKE5AzblJTAGpxUhQbVU27/l1dgBTICDj4xXhh5F
27
+jxoN1LrGCBvMqDhZ7umpQWAa+wJb+nK6wq1TnvHYNvXjuFCbctx75rkHKIiT/H3W
28
+hUPoU/jF23LfgLFTctOFFVIX87ixBfQhfwLRk5i9KD6LFFIH9HTPKk6qDzE=
29
+-----END CERTIFICATE-----

+ 28
- 0
zabbix/certs/zabbix-server.crt Bestand weergeven

@@ -0,0 +1,28 @@
1
+-----BEGIN CERTIFICATE-----
2
+MIIErjCCApYCCQDWlhRoK+VAyDANBgkqhkiG9w0BAQsFADAYMRYwFAYDVQQDDA16
3
+YWJiaXgtc2VydmVyMCAXDTE5MDExMTAwMTkxMFoYDzIxMTgxMjE4MDAxOTEwWjAY
4
+MRYwFAYDVQQDDA16YWJiaXgtc2VydmVyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A
5
+M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XjKXTQxPut/b20R+006HcZV8ruERU+71dVTBZ9Bs/2wj458WU2vZGiw+kAgCxD
43
+b8PVnAUbG2Zlbhn3sSBkq2veteLWTze2Gug3dwVDSpNHOn3A7kfPLZozLHJkcJYH
44
+iQtkTGubiXEvEwLvYhA6NKMVpnSC5K7cpiwgXQGfDUVrSgUUAMzvX0b9wCzne7Vh
45
+GeTzHoV6n6ABamfMdUpTnEMKIh/32G3nKM7X9Kx9/UX/JkEXoVuY63KM1SOSWc2s
46
+OrECggEBALMBmlLGYnQM5Xlf4FYwCzfIOCE+SzVzy9eHlmSHWbiMvHi9YGLGfO25
47
+aJnKxf/N6EoR7wb9K+v6GN37Mm7TUgoWkD67P+kAwm9uh3Q2p8eDvh9L+iC/BpOl
48
+0UpXYQzoP/9Ncslx6fWROHDMHAPCioDM8eFdR3KoLBh5MZ8di/K9rWC0pfdWvnNI
49
+6Vp/ETru+VhoG17zIlCoWuj5ui/bKGIc4BLy4gey5Gn5IZ1wNBKbGJP/QCrTA2TT
50
+A+Se+pnwkyOU110NBVl5L1Uni67ECYKUHSP6pUhPgO1Z3Ij1sa8C801yCdi8H7pI
51
+fY1TZMXMVBTw0bNZwSV4lXkSr4e4VOk=
52
+-----END PRIVATE KEY-----

+ 3
- 3
zabbix/zabbix_server.conf Bestand weergeven

@@ -654,7 +654,7 @@ LogSlowQueries=3000
654 654
 #
655 655
 # Mandatory: no
656 656
 # Default:
657
-# TLSCAFile=
657
+TLSCAFile=/etc/zabbix/certs/zabbix-ca.crt
658 658
 
659 659
 ### Option: TLSCRLFile
660 660
 #	Full pathname of a file containing revoked certificates.
@@ -668,11 +668,11 @@ LogSlowQueries=3000
668 668
 #
669 669
 # Mandatory: no
670 670
 # Default:
671
-# TLSCertFile=
671
+TLSCertFile=/etc/zabbix/certs/zabbix-server.crt
672 672
 
673 673
 ### Option: TLSKeyFile
674 674
 #	Full pathname of a file containing the server private key.
675 675
 #
676 676
 # Mandatory: no
677 677
 # Default:
678
-# TLSKeyFile=
678
+TLSKeyFile=/etc/zabbix/certs/zabbix-server.key

Laden…
Annuleren
Opslaan