netskope/ns.pl

25 lines
958 B
Perl
Raw Normal View History

2022-07-18 17:28:22 +02:00
#!/usr/bin/perl -w
use 5.024;
use strict;
use warnings;
use autodie;
use HTTP::Tiny;
use Cpanel::JSON::XS;
my $NTSKP_TENANT = "https://oss.de.goskope.com";
my $NTSKP_TOKEN = "0cfe04c4237cc33dc7f383af5ddbe2e3";
my $uri = "$NTSKP_TENANT/api/v1/alerts?token=$NTSKP_TOKEN&timeperiod=86400&groupby=application&query=access_method+eq+Client+and+action+eq+block";
#my $uri = "$NTSKP_TENANT/api/v1/report?token=$NTSKP_TOKEN&timeperiod=86400&type=connection&groupby=application&query=app-cci-app-tag+eq+'Under_Review'";
#my $uri = "$NTSKP_TENANT/api/v1/report?token=$NTSKP_TOKEN&timeperiod=86400&type=connection&groupby=application&query=app-cci-app-tag+eq+'Pending_GRC_Review'";
my $response = HTTP::Tiny->new->get($uri);
my $json = Cpanel::JSON::XS->new->utf8->decode($response->{'content'});
my $data = $json->{'data'};
for my $item (@{$data}) {
if (exists($item->{'app'})) {
print ".";
#print $item->{'app'} . ", ";
#say $item->{'sessions'};
}
}
say "";