#!/usr/bin/perl -w # # CatSanitize2.pl -- remove and other such confidential strings from Catalyst # configurations prior to distribution. # # usage: # # CatSanitize2.pl # # # created on Thursday, October 30, 2003 by Mark Leighty ( mleighty@harfordtechnology.com ) # # Copyright (2003) Harford Technology Corporation With the exception of commercial # resale, lease, license or other commercial transactions, permission is granted to # use, copy, modify, and distribute this software. By exercising this permission you # agree, that this Notice will accompany this software at all times. # # Harford Technology Corporation MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND # CONCERNING THIS SOFTWARE OR USE THEREOF. # #---------------------------- Revision Log ----------------------------------# #$Version = 0.89; # mleighty@harfordtechnology.com # Currently "pre-production" however as features get added and we get some data # it should be functional. #-------------------------- End Revision Log --------------------------------# $ORIGINAL = $ARGV[0]; $SANITIZED = ">$ARGV[0]\.distribution"; open ORIGINAL or die "can't open $ORIGINAL"; open SANITIZED or die "can't open $SANITIZED"; while () { if ( /^set password/ ) { print SANITIZED "set password XxXxXxXxXxXxXxXxXxXxX\n"; } elsif ( /^set enablepass/ ) { print SANITIZED "set enablepass XxXxXxXxXxXxXxXxXxXxX\n"; } elsif ( /^set tacacs server/ ) { print SANITIZED "set tacacs server a.b.c.d\n"; } elsif ( /^set tacacs key/ ) { print SANITIZED "set tacacs key XxXxXxXxXxXxXxXxXxXxX\n"; } elsif ( /^set snmp community/ ) { print SANITIZED "set snmp community read_XXX xXxXxXxXxXxXxXxXxXxX\n"; } elsif ( /^set snmp trap .*able/ ) { print SANITIZED $_; } elsif ( /^set snmp trap/ ) { print SANITIZED "set snmp trap a.b.c.d xXxXxXxXxXxXxXxXxXxX\n"; } else { print SANITIZED $_; } } close ORIGINAL; close SANITIZED; exit