Created
September 5, 2019 19:38
-
-
Save foospidy/0300b38adffe546f5bef8b35036bff61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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