#!/usr/bin/perl -w use strict; my $seculert_qradar_list = "$seculert_dir/seculert.csv"; my $qradar_console = '10.10.1.22'; my $qradar_ssh_key = "$seculert_dir/qr-id_dsa"; my $qradar_ssh_knownhosts = "$seculert_dir/known_hosts"; my $source = 'BAD-IP-Addresses-LABEL'; my $type_description = 'honeypots-for-examnple'; open(FP, ">>$seculert_qradar_list"); for my $line () { my ($hostname, $ip, $something1, $something2) = split(/,/, $line); print OUT "$source $type_description $ip #FF0000 0 90 29\n"; } close(FP); print "Sending to QRadar...\n"; # SSH To QRadar's Console and push out file + trigger update `scp -i $qradar_ssh_key -o UserKnownHostsFile=$qradar_ssh_knownhosts -o StrictHostKeyChecking=no root\@$qradar_console:/store/configservices/staging/globalconfig/remotenet.conf .`; `sed -i -e '/^SECULERT/d' remotenet.conf`; `cat $seculert_qradar_list >> remotenet.conf`; `scp -i $qradar_ssh_key -o UserKnownHostsFile=$qradar_ssh_knownhosts -o StrictHostKeyChecking=no remotenet.conf root\@$qradar_console:/store/configservices/staging/globalconfig/remotenet.conf`; print "Cleaning up...\n"; # Remove our SECULERT list and the newly pushed out qradar conf unlink($seculert_qradar_list); unlink ('remotenet.conf'); print "Deploying in QRadar...(takes time to complete)\n"; # QRadar magic `ssh -i $qradar_ssh_key -o UserKnownHostsFile=$qradar_ssh_knownhosts -o StrictHostKeyChecking=no root\@$qradar_console /opt/qradar/upgrade/util/setup/upgrades/do_deploy.pl`; print "Complete!\n\n";