From 479bfa3cce816af82abeef7c9905a4f953d62fda Mon Sep 17 00:00:00 2001 From: Jonatan Castro Date: Wed, 13 Jan 2021 14:53:56 +1100 Subject: [PATCH 1/8] Check audit and admin api --- .circleci/config.yml | 23 +++++++++++++++++++---- hosts_to_check | 2 ++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 68ee70b..499df87 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,16 +1,28 @@ version: 2 jobs: sslcheck: - docker: - - image: circleci/python:3.8.0-node + machine: + image: circleci/classic:latest working_directory: ~/repo steps: - checkout + - run: + name: Connect To Apthletic VPN + command: | + echo "Installing OpenVPN 2.4" + echo "deb http://build.openvpn.net/debian/openvpn/release/2.4 trusty main" > /tmp/openvpn-aptrepo.list + sudo mv /tmp/openvpn-aptrepo.list /etc/apt/sources.list.d/openvpn-aptrepo.list + sudo apt-get update + sudo apt-get install openvpn python3.8 + echo "${VPN_CONF_BASE64}" | base64 -d > /tmp/openvpn.conf + sudo mv /tmp/openvpn.conf /etc/openvpn/vpn.conf + sudo openvpn --daemon --config /etc/openvpn/vpn.conf + echo "OpenVPN Daemon starting" - run: name: Check SSL Certificates command: | .circleci/slack-message.sh "*Checking SSL Certificates*" "#FFF000" - sudo pip install -r requirements.txt + sudo pip3 install -r requirements.txt OUTPUT=$(./ssl_checker.py -f ./hosts_to_check) echo "$OUTPUT" if ! echo "$OUTPUT" | grep "Expired: 0" ; then @@ -22,6 +34,9 @@ jobs: if ! echo "$OUTPUT" | grep "Warning: 0" ; then .circleci/slack-message.sh "*Checked SSL Certificates*: Warnings :warning:" "#FF0000" fi + - run: + name: Stop VPN + command: sudo killall openvpn workflows: version: 2 @@ -31,7 +46,7 @@ workflows: context: github-backup filters: branches: - only: master + only: apthletic/ssl-checker/issues/3 sslcheck-on-schedule: triggers: - schedule: diff --git a/hosts_to_check b/hosts_to_check index 7675849..c94b148 100644 --- a/hosts_to_check +++ b/hosts_to_check @@ -20,6 +20,8 @@ www.rivalbet.com.au apthletic.com apthletic.com.au audit-dashboard.rivalbet.com.au +audit-api.rivalbet.com.au +admin-api.rivalbet.com.au www.apthletic-test.com events.dev.rivalbet.com.au events.prod.rivalbet.com.au \ No newline at end of file From 99c2df2aa034733047a937edcc82ce3e97f636f5 Mon Sep 17 00:00:00 2001 From: Jonatan Castro Date: Wed, 13 Jan 2021 14:56:00 +1100 Subject: [PATCH 2/8] Install python 3 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 499df87..a0d1a08 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ jobs: echo "deb http://build.openvpn.net/debian/openvpn/release/2.4 trusty main" > /tmp/openvpn-aptrepo.list sudo mv /tmp/openvpn-aptrepo.list /etc/apt/sources.list.d/openvpn-aptrepo.list sudo apt-get update - sudo apt-get install openvpn python3.8 + sudo apt-get install openvpn python3 echo "${VPN_CONF_BASE64}" | base64 -d > /tmp/openvpn.conf sudo mv /tmp/openvpn.conf /etc/openvpn/vpn.conf sudo openvpn --daemon --config /etc/openvpn/vpn.conf From 5d7fa0fea3bdd88fe9a21942c45ba2c2bc8b3326 Mon Sep 17 00:00:00 2001 From: Jonatan Castro Date: Wed, 13 Jan 2021 14:57:08 +1100 Subject: [PATCH 3/8] fix pip command --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a0d1a08..fb7a63b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,7 +22,7 @@ jobs: name: Check SSL Certificates command: | .circleci/slack-message.sh "*Checking SSL Certificates*" "#FFF000" - sudo pip3 install -r requirements.txt + sudo pip install -r requirements.txt OUTPUT=$(./ssl_checker.py -f ./hosts_to_check) echo "$OUTPUT" if ! echo "$OUTPUT" | grep "Expired: 0" ; then From 2e3d19559c0f0148af2c6da9dc3f15515d08cec4 Mon Sep 17 00:00:00 2001 From: Jonatan Castro Date: Wed, 13 Jan 2021 14:58:41 +1100 Subject: [PATCH 4/8] Fix shebang --- ssl_checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssl_checker.py b/ssl_checker.py index 76bb246..193aeaf 100755 --- a/ssl_checker.py +++ b/ssl_checker.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python import socket import sys import json From bc979f8a8fd03dfb5bb56cdd90d8b0bee72dc755 Mon Sep 17 00:00:00 2001 From: Jonatan Castro Date: Wed, 13 Jan 2021 15:43:07 +1100 Subject: [PATCH 5/8] Install for user (not sudo) --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fb7a63b..9547973 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,7 +22,7 @@ jobs: name: Check SSL Certificates command: | .circleci/slack-message.sh "*Checking SSL Certificates*" "#FFF000" - sudo pip install -r requirements.txt + pip install -r requirements.txt OUTPUT=$(./ssl_checker.py -f ./hosts_to_check) echo "$OUTPUT" if ! echo "$OUTPUT" | grep "Expired: 0" ; then From 859141f73eb94b08b8475101eede4b2de5a22320 Mon Sep 17 00:00:00 2001 From: Jonatan Castro Date: Wed, 13 Jan 2021 15:59:47 +1100 Subject: [PATCH 6/8] Add port 2002 --- hosts_to_check | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts_to_check b/hosts_to_check index c94b148..5a50acf 100644 --- a/hosts_to_check +++ b/hosts_to_check @@ -20,7 +20,8 @@ www.rivalbet.com.au apthletic.com apthletic.com.au audit-dashboard.rivalbet.com.au -audit-api.rivalbet.com.au +audit-api.rivalbet.com.au:443 +audit-api.rivalbet.com.au:2002 admin-api.rivalbet.com.au www.apthletic-test.com events.dev.rivalbet.com.au From c8b49218aa7ce2d34b7dd43eb5b3254f69817dfc Mon Sep 17 00:00:00 2001 From: Jonatan Castro Date: Wed, 13 Jan 2021 16:01:45 +1100 Subject: [PATCH 7/8] Remove iDRAC cert --- hosts_to_check | 1 - 1 file changed, 1 deletion(-) diff --git a/hosts_to_check b/hosts_to_check index 5a50acf..983a8f0 100644 --- a/hosts_to_check +++ b/hosts_to_check @@ -20,7 +20,6 @@ www.rivalbet.com.au apthletic.com apthletic.com.au audit-dashboard.rivalbet.com.au -audit-api.rivalbet.com.au:443 audit-api.rivalbet.com.au:2002 admin-api.rivalbet.com.au www.apthletic-test.com From 9ab775e40efd03e5ece9e1af760ef4c1cb25602f Mon Sep 17 00:00:00 2001 From: Jonatan Castro Date: Wed, 13 Jan 2021 16:05:08 +1100 Subject: [PATCH 8/8] Run from master --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9547973..308fe25 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,7 +46,7 @@ workflows: context: github-backup filters: branches: - only: apthletic/ssl-checker/issues/3 + only: master sslcheck-on-schedule: triggers: - schedule: