Hi Everybody
I have experience issue SSL Certificate is expired. and I don’t know it expire today.
Can we set BIG-IP to email Alert before SSL Certificate expire?
How to do that?
Thank you very much
Hi Everybody
I have experience issue SSL Certificate is expired. and I don’t know it expire today.
Can we set BIG-IP to email Alert before SSL Certificate expire?
How to do that?
Thank you very much
You can use Enterprise Manager for that : 404 Page not found | BIG-IP Documentation
Otherwise : DevCentral - An F5 Technical Community
Our CA automatically e-mails us when certs are approaching expiration. You might want to check into that with yours.
Chris
You might find this useful for manual checks: .
These are all good options, but if you don’t have Enterprise Manager (the BEST option in my opinion) and your CA can’t send you an email, I think there’s nothing better that a script. Take a look at this one:
! /bin/bash
set acceptable threshold in seconds (172800 seconds = 2 days)
threshold=25920000
get today's date
this_date=`date +%s`
(IFS='
'
loop through the stored certificates
output=`tmsh list / sys crypto one-line |grep "sys crypto cert"`
for f in ${output}
do
cert=`echo $f |awk -F" " '{ print $4 }'`
certdate=`expr match "$f" '.*\(expiration.*organization\)' |sed s/expiration// | sed s/organization//`
expires=`date -d $certdate +%s`
if [ $this_date -ge $(($expires - $threshold)) ]
then
expires_when=$(((expires - $this_date) / 60 / 60 / 24))
echo "$cert is about to expire in $expires_when days"
additional processing for expiring certs goes here
fi
done)
This should work for any v11 system. You’ll need to make a few modifications/additions:
Do I need to change " output=tmsh list / sys crypto one-line |grep “sys crypto cert” "? If I using firmware 10.2.4.
The code is actually easier in 10.x because the certs are still stored in the directory.
! /bin/bash
set acceptable threshold in seconds (172800 seconds = 2 days)
threshold=185920000
get today's date
this_date=`date +%s`
set path to certificates
cert_path=/config/ssl/ssl.crt/
for f in $cert_path*.crt
do
this_cert_date_literal=`openssl x509 -in $f -noout -enddate |sed s/notAfter=//`
this_cert_date=`date -d "$this_cert_date_literal" +%s`
if [ $this_date -ge $(($this_cert_date - $threshold)) ]
then
expires_when=$(((this_cert_date - $this_date) / 60 / 60 / 24))
echo "$f is about to expire in $expires_when days"
additional processing for expiring certs goes here
fi
done
i have seen nagios used for this, not sure how it exactly was configured, but it monitored the virtual server and checked the expiration there. might not work in everything environment, but might be an idea.
Tried create a .sh file as per above script in v11 LTM but no output as such.
Tried create a .sh file as per above script in v11 LTM but no output as such.
Create and edit the script:
vi certmonitor.sh
Copy the above code to the script and save it.
Chmod the script to make it executable:
chmod 755 certmonitor.sh
Run it:
./certmonitor.sh
There are two versions of the script above. The first is for 11.x, and the second is for 10.x.
Thanks evryone for the reply!!I was trying chmod 700 then it was not working but with chmod 755 its working.But it gives bundle or chain certificates expiry date.I m running 11.4.1 version may be tmsh list / sys crypto one-line checking cert for the customers in cert_path=/config/ssl/ssl.crt/ is different for 11.4.x version.
Does adding these two alerts to ‘/config/user_alert.conf’ not work anymore?
alert CERT_WILL_EXPIRE "crt will expire on" {
snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.502";
email toaddress="root@example.com"
body="Cert will expire message from BigIP"
}
alert CERT_WILL_EXPIRE "crt expired on" {
snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.503";
email toaddress="root@example.com"
body="Cert expired message from BigIP"
}
Other than there being no more postfix, but thought there was some other way, though I haven’t gotten around to looking. But, its on my list re-implement getting alerts about going standby/active. Seems a pair of vCMPs will periodically oscillate, which was discovered by wonder what we were doing to cause the spikes in CPU utilization…
But for certificate reporting/alerting…I’m now using the certificate report feature of a tweaked version of the “Config Backup for F5” appliance.
My version can be found on github.
Just need to re-train myself to pay attention to the emails occasionally. And, figure out how to get it to send us the backup logs…among other wish list items.
LK
Hello
I’m using the script by v11.x but It’s fault, I think what it’s not working for this line
output=tmsh list / sys crypto one-line |grep “sys crypto cert”
The load balancing used version 11.6 hotfix 4
Could you help me?
If you want a solution which also inspects each individual certificate inside a large bundle, and supports reporting to a remote syslog server, have a look at the discussion here: DevCentral - An F5 Technical Community
Which is dependent on using cron on the F5’s host OS. Now that… instead of applying HFs for the first time ever (went from 9.3.1 to 9.3.1HF6, where HF7 came out a couple months later, but we did HF8 a couple years later…then did annual upgrades into 10.2.3+latest, 10.2.4+latest until HF5, when support got pulled out from under me and I had run into a problem in HF to apply, until we got support reinstated the same day our primary unit failed (I had gotten HF10 applied the month before after finding solution to problem I had run into here on devcentral
Now I’m told that its expected to be done within 30days of its release. (due to PCI.) Not sure if it still requires full change review board and sign off from every single user (and their relatives, pets, friends…), to find a slice of time where everybody is okay with it getting done (usually 2am, Sunday during holiday shutdown between Xmas and New Years…not okay with me, though F5 will have somebody working then even if we didn’t…) But, had been getting annoyed with it happening so frequently…since our configuration backup was also cron driven. Plus there have been reasons other than HFs/upgrades that wipe out cron. And, the use of appliance mode or desire that only remote users have day-to-day access, also complicate things. Was a pain at 2am last Tuesday to retrieve root password from escrow to overcome some problems during upgrades…which seems strange since it wasn’t that long ago when logging in was a regular thing (often only so I can have an terminal window to see the prompt line…) Though probably only used the passwords once or twice since they were last updated. (while its been a couple of years since I used the GPG key’s password that I use for escrow access…which took me a few tries to remember
L