Checks the Linux supported release
3.1.1.005-GEN000100.bash
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | #!/bin/bash # Copyright (C) 2011 simonalsa # http://www.simonalsa.com # Author Simon Alonso Sanchez <simonalsa@simonalsa.com> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Security Technical Implementation Guide (STIG) # Security Readiness Review (SRR) # Tested in GNU/Linux Debian distribution # STIG|SRR definition NUMBER="3.1.1.005" LABEL="GEN000100" # Section: SECTION="Linux overview and site information" # Process: PROCESS="Operating system" # Description: DESCRIPTION="Checks the Linux supported release" # Include global preferences if [ -e $PWD/preferences.cfg ]; then source $PWD/preferences.cfg else echo -e "Can not include the global preferences at $PWD/preferences.cfg \r" exit fi # Include local preferences if [ -e $PWD/$NUMBER-$LABEL.prefs ]; then source $PWD/$NUMBER-$LABEL.prefs else echo -e "Can not include the local preferences at $PWD/$NUMBER-$LABEL.prefs \r" exit fi # Section.Description echo -e "STIG|SRR definition \r" echo -e "\t Number: $NUMBER \r" echo -e "\t Label: $LABEL \r" echo -e "\t Section: $SECTION \r" echo -e "\t Process: $PROCESS \r" echo -e "\t Description: $DESCRIPTION \r" echo -e "\r" # Perform if [ -x $CMD_LSB_RELEASE ]; then CMD=$($CMD_LSB_RELEASE -d -s) if [ $? -eq 0 ]; then echo -e "Linux LSB release: \r" echo -e "\t $CMD \r" else echo -e "Can not locate the Linux LSB release \r" fi else echo -e "Can not locate the $CMD_LSB_RELEASE in the filesystem \r" exit fi if [ -x $CMD_UNAME ]; then CMD=$($CMD_UNAME) if [ $? -eq 0 ]; then KERNEL_NAME=$($CMD_UNAME --kernel-name) KERNEL_RELEASE=$($CMD_UNAME --kernel-release) KERNEL_VERSION=$($CMD_UNAME --kernel-version) KERNEL_MACHINE=$($CMD_UNAME --machine) KERNEL_PROCESSOR=$($CMD_UNAME --processor) KERNEL_HARDWARE=$($CMD_UNAME --hardware-platform) KERNEL_OS=$($CMD_UNAME --operating-system) echo -e "Kernel release: \r" echo -e "\t Name: $KERNEL_NAME \r" echo -e "\t Release: $KERNEL_RELEASE \r" echo -e "\t Version: $KERNEL_VERSION \r" echo -e "\t Machine: $KERNEL_MACHINE \r" echo -e "\t Processor: $KERNEL_PROCESSOR \r" echo -e "\t Hardware: $KERNEL_HARDWARE \r" echo -e "\t Operating system: $KERNEL_OS \r" else echo -e "Can not locate the Linux Kernel release \r" fi else echo -e "Can not locate the $CMD_UNAME in the filesystem \r" exit fi echo -e "\r" |
3.1.1.005-GEN000100.bash
1 | # Nothing |
Sample output
simonalsa@Desktop-01:~/$ bash 3.1.1.005-GEN000100.bash
STIG|SRR definition
Number: 3.1.1.005
Label: GEN000100
Section: Linux overview and site information
Process: Operating system
Description: Checks the Linux supported release
Linux LSB release:
Debian GNU/Linux 6.0.3 (squeeze)
Kernel release:
Name: Linux
Release: 2.6.32-5-amd64
Version: #1 SMP Thu Nov 3 03:41:26 UTC 2011
Machine: x86_64
Processor: unknown
Hardware: unknown
Operating system: GNU/Linux


