Skip to content

Instantly share code, notes, and snippets.

@diegoparrilla
Created April 16, 2020 17:08
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 diegoparrilla/c64dfdd7245a9f5740c753915e437ccb to your computer and use it in GitHub Desktop.
Save diegoparrilla/c64dfdd7245a9f5740c753915e437ccb to your computer and use it in GitHub Desktop.
Google Spreadsheet custom function to get the full ip report from Auth0 Signals/Apility
function SIGNALSFULLIP(input) {
var response = UrlFetchApp.fetch("https://signals.api.auth0.com/ip/" + input + "?token=YOUR_API_TOKEN");
// Parse the JSON reply
var json = response.getContentText();
var data = JSON.parse(json);
var score = data['fullip']['score'];
var blacklists = data['fullip']['badip']['blacklists'].join(',');
var as = data['fullip']['geo']['as']['name'];
var asnum = data['fullip']['geo']['as']['asn'];
var country = data['fullip']['geo']['country'];
var history_score = data['fullip']['history']['score'];
array = [];
array.push(score);
array.push(blacklists);
array.push(country);
array.push('AS' + asnum + ' - ' + as);
array.push(history_score);
Logger.log(score);
Logger.log(blacklists);
Logger.log(country);
Logger.log('AS' + asnum + ' - ' + as);
Logger.log(history_score);
return [array];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment