BradleyA / docker-security-infrastructure

Automate the generation, setup, check, copy site, host and user docker TLS certificates; Setup and manage dockerd configuration for Ubuntu 16.04 Systemd & Ubuntu 14.04 Upstart. Check ssh permissions
MIT License
17 stars 8 forks source link

docker-TLS/check-host-tls.sh - modify output: add user message about cert expires #50

Closed BradleyA closed 5 years ago

BradleyA commented 5 years ago

add user message about cert expires and keep log WARN message $ sudo check-host-tls.sh [sudo] password for uthree: 2019-05-07T17:20:29.206597-05:00 (CDT) three.cptx86.com /usr/local/bin/check-host-tls.sh[24711] 3.213.648 104 root 0:0 [INFO] Started... 2019-05-07T17:20:29.214027-05:00 (CDT) three.cptx86.com /usr/local/bin/check-host-tls.sh[24711] 3.213.648 134 root 0:0 [INFO] Checking TLS certifications and directory permissions.

    Certificate on three.cptx86.com, /etc/docker/certs.d/daemon//ca.pem, is  GOOD  until Dec  5 22:34:44 2020 GMT
2019-05-07T17:20:29.230869-05:00 (CDT) three.cptx86.com /usr/local/bin/check-host-tls.sh[24711] 3.213.648 171 root 0:0 [WARN]  Certificate on three.cptx86.com, /etc/docker/certs.d/daemon//cert.pem,  EXPIRES  on May 31 15:27:33 2019 GMT

    Use script  create-host-tls.sh  to update expired host TLS.

    View dockerd daemon certificate issuer data of the ca.pem file:
    issuer= /C=US/ST=Texas/L=Cedar Park/O=Company Name/OU=IT/CN=two.cptx86.com

    View dockerd daemon certificate issuer data of the cert.pem file:
    issuer= /C=US/ST=Texas/L=Cedar Park/O=Company Name/OU=IT/CN=two.cptx86.com

    Verify that dockerd daemon certificate was issued by the CA:
    /etc/docker/certs.d/daemon/cert.pem: OK

    Verify and correct file permissions.

    Use script create-host-tls.sh to update host TLS if host TLS certificate has expired.

2019-05-07T17:20:29.254263-05:00 (CDT) three.cptx86.com /usr/local/bin/check-host-tls.sh[24711] 3.213.648 227 root 0:0 [INFO]  Operation finished.