So, my question is; Is there a command that will give me each one of the certs with their profiles (and then their servers) that I can put into a text file and start going through each one to see if its still in use or not?
The equiring mind of a desperate F5-er would like to know, or his New Year will be locked in a darkened room running single line commands .. .
how would I get the details off a non-common partition?
do you happen to have virtual server which uses clientssl profile from another partition or clientssl profile that uses certificate from another partition? if yes, it will not be recognized by the one-liner script (below). it is because how the script is built (we are filtering virtual server based on clientssl profile based on certificate in specific partition).
there are 4 folders including root.
root@(bip1a)(cfg-sync In Sync)(Active)(/)(tmos) list sys folder |grep sys
sys folder / {
sys folder Common {
sys folder asgard {
sys folder jotunheim {
each folder except root has its own certificate, clientssl profile and virtual server.
but this jotunheim folder has special virtual server/clientssl profile which refers to certificate in common folder. this virtual server/clientssl profile will not be flagged by the one-liner script below.
root@(bip1a)(cfg-sync In Sync)(Active)(/jotunheim)(tmos) list ltm virtual vs-special profiles
ltm virtual vs-special {
profiles {
/Common/tcp {
context all
}
clientssl-special {
context clientside
}
}
}
root@(bip1a)(cfg-sync In Sync)(Active)(/jotunheim)(tmos) list ltm profile client-ssl clientssl-special cert key
ltm profile client-ssl clientssl-special {
cert /Common/cert-one.crt
key /Common/cert-one.key
}
the one-liner script
[root@bip1a:Active:In Sync] config for p in `tmsh -c "cd /; list sys folder one-line" |awk '{if($3~/^\//) {print $3; next} {print "/" $3}}'`; do echo "===== partition: $p ====="; for i in `tmsh -c "cd $p; list sys file ssl-cert one-line" |awk '{print $4}'`; do echo "----- cert: $i -----"; for j in `tmsh -c "cd $p; list ltm profile client-ssl one-line" |grep $i\ |awk '{print $4}'`; do echo "***** profile: $j *****"; for k in `tmsh -c "cd $p; list ltm virtual one-line" |grep $j\ |awk '{print $3}'`; do echo "..... virtual: $k ....."; echo ""; done; done; done; echo ""; done
===== partition: / =====
===== partition: /Common =====
----- cert: ca-bundle.crt -----
----- cert: cert-one.crt -----
***** profile: clientssl-one *****
..... virtual: vs-one .....
----- cert: default.crt -----
***** profile: clientssl *****
***** profile: clientssl-insecure-compatible *****
***** profile: clientssl-secure *****
***** profile: crypto-server-default-clientssl *****
***** profile: wom-default-clientssl *****
----- cert: f5-irule.crt -----
===== partition: /asgard =====
----- cert: cert-heimdall.crt -----
***** profile: clientssl-heimdall *****
..... virtual: vs-heimdall .....
===== partition: /jotunheim =====
----- cert: loki-cert.crt -----
***** profile: clientssl-loki *****
..... virtual: vs-loki .....
how would I get the details off a non-common partition?
i have another idea which uses icontrol rest and jq. since icontrol rest is not limited to single partition. all virtual servers and clientssl profiles should be recognized even it uses configuration object from another partition.
how would I get the details off a non-common partition?
i have another idea which uses icontrol rest and jq. since icontrol rest is not limited to single partition. all virtual servers and clientssl profiles should be recognized even it uses configuration object from another partition.
Thank you for all of that. So, on the GUI, I navigate to SSL Cert List There I drop down the partition drop-down and not only do I have Common, but I have two other partitions.
Lets call them red and green
Both Red and Green use Common partition/path certs as well as certs individual to their own partition.
You have very kindly helped me previously with the Common certs, and once again, you have scored another goal with this one liner!!
Thank you for all of that. So, on the GUI, I navigate to SSL Cert List There I drop down the partition drop-down and not only do I have Common, but I have two other partitions.
Lets call them red and green
Both Red and Green use Common partition/path certs as well as certs individual to their own partition.
You have very kindly helped me previously with the Common certs, and once again, you have scored another goal with this one liner!!