Thursday, April 17, 2008

Bastille tried to use $GLOBAL_BIN{'ping6'} but it does not exist

A colleague of mine was having problem running Bastille to harden his RedHat Linux server. He keeps getting the following error message and cannot find any solution on the web.
ERROR: Bastille tried to use $GLOBAL_BIN{'ping6'} but it does not exist.

I heard about Bastille but have no clue how it works. Anyway, here is how I managed to provide a workaround to avoid the above error message by explicitly define the fullpath of ping6.

bastille is actually a shell script that eventually launch a Perl script to run through the hardening steps. At the beginning of the bastille script, it defines PATH and PERL5LIB. PERL5LIB is the place to explore all the other bastille perl modules (.pm). Search through all the PM files for string "GLOBAL_BIN" and I found the following files that contain the string:, API.PM.sweth and OSX_API.PM

$ which ping6

$ cat /usr/sbin/bastille
export PATH="/bin:/usr/bin:/usr/sbin:$PATH"
export PERL5LIB="$PERL5LIB:/opt/sec_mgmt/bastille/lib:/usr/lib/perl5/site_perl:/usr/lib/Bastille:/usr/lib/perl5/site_perl/5.6.0/i386-linux"

$ cd /usr/lib/Bastille
$ grep GLOBAL_BIN *       %GLOBAL_BIN %GLOBAL_DIR %GLOBAL_FILE    my %map = ("BIN"   => \%GLOBAL_BIN,     # type relates to the map above, type bin will map to GLOBAL_BIN    foreach my $hashref (\%GLOBAL_BIN,\%GLOBAL_DIR,\%GLOBAL_FILE,\%GLOBAL_BFILE,\%GLOBAL_BDIR) {  my %map = ("BIN"   => \%GLOBAL_BIN,    # i.e. Bastille tried to use $GLOBAL_BIN{'cp'} but it does not exist.   %GLOBAL_BIN %GLOBAL_DIR %GLOBAL_FILE %GLOBAL_MISC         $GLOBAL_BIN{$DISTRO_FILE} = $PATH_TEMP;         `$GLOBAL_BIN{"cp"} -p $file $backup_file`;         $return=`$GLOBAL_BIN{"mknod"} $prefix $file $suffix`;    $GLOBAL_BIN{"md5sum"}="/usr/bin/md5sum";

In the, it is likely a PM meant for MacOSX. It also hard-coded the md5sum fullpath in the GLOBAL_BIN associative array. Hey, likely I can do the same for ping6 in the My instinct tells me that is the generic API module and likely to be the entry point for bastille.

I explicitly define the full path of ping6 right after the package definition as shown below. Guess what, bastille runs without any error. I won't say the problem is solved, but at least I provided a workaround.

$ cat
package Bastille::API;


Labels: ,


Post a Comment

<< Home