So this was a human error on my side. I was reading the json output incorrectly. Apologies for crying wolf
On the plus side I was able to create a script that produces the desired output.
DISCLAIMER: My bash skills are mediocre at best. Your miles may vary:
#!/bin/bash
host="<OMITTED>"
baseurl="https://$host/web_api"
SID=`curl -k --silent --header "Content-Type: application/json" --request POST \
--data '{
"user":"<OMITTED>" ,
"password":"<OMITTED>"
}' \
$baseurl/login | grep sid | awk '{print $3}' | sed 's/"//g' | sed 's/,//g'`
curl -k --silent --header "Content-Type: application/json" --header "X-chkp-sid: $SID" --request POST \
--data '{
"offset" : 0,
"limit" : 500,
"name" : "<OMITTED>"
}' \
$baseurl/show-access-rulebase | egrep "^ \"uid\"|rule-number|enabled" | grep -B2 enabled |
awk '/rule-number/||NR==1{printf $0; next}{printf "\n"$0}' | awk '/enabled/||NR==1{printf $0; next}{printf "\n"$0}' | awk '{print $3,$6,$9}' | sed 's\"\\g; s\ \\g'
The output is a CSV file that looks like this:
uid,rule#,true/false
This first two fields are self explanatory and the third field is whether or not the rule is enabled. I can then grep that file for "false" and read the UID into another script that deletes the disabled rules. Thanks for the help!