Skip to content

Instantly share code, notes, and snippets.

@foospidy
Created September 5, 2019 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foospidy/0300b38adffe546f5bef8b35036bff61 to your computer and use it in GitHub Desktop.
Save foospidy/0300b38adffe546f5bef8b35036bff61 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
###################
# Signal Sciences helper script:
# sigsci-revproxy-agents.sh
# For all sites in a corp, print reverse proxy agents.
# Requires:
# - pysigsci (https://pypi.org/project/pysigsci/)
# - jq (https://stedolan.github.io/jq/)
for site in `pysigsci --get corp-sites | jq ".data[] | .name"`;
do
echo $site
site_name=`echo ${site} | tr '"' '\ '`
for module in `pysigsci --get agents --site $site_name | jq ".data[] | \"\(.[\"agent.name\"]),\(.[\"module.type\"])\""`;
do
module=`echo $module | sed -e 's/\"//g'`
if [[ $module == *"revproxy"* ]];
then
echo " $module"
fi
done;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment