Mar 27, 2026 - For details about updated CVE-2025-53521 (BIG-IP APM vulnerability), refer to K000156741.

Forum Discussion

Re: TMSH Command to list ASM policies not attached to any virtual servers in all partitions

For such tasks I have a script framework for the F5 REST-API named restsh. Unfortunately I can not share it, but this is a snippet to solve your demand:

 

F5_URI="https://<f5-mgmt-ip>"
alias GET="curl -k -s --fail -u "<user>:<pass>"

while read -r POLICY_ID
do
    POLICY_DATA=$(GET "$F5_URI/mgmt/tm/asm/policies/$POLICY_ID?\$select=fullPath,virtualServers,manualVirtualServers")
    POLICY_NAME=$(jq -r ".fullPath" <<< "$POLICY_DATA")
    VIRTUAL_SERVERS=$(jq -r '[.virtualServers.[]?,.manualVirtualServers.[]?] | length' <<< "$POLICY_DATA")
    [ "$VIRTUAL_SERVERS" -eq 0 ] && echo "$POLICY_NAME"
done < <(GET "$F5_URI/mgmt/tm/asm/policies?\$select=name,id" | jq -r '.items[].id')

 

No RepliesBe the first to reply