"Fossies" - the Fresh Open Source Software Archive

Member "lynis/include/helper_show" (21 Apr 2019, 22213 Bytes) of package /linux/misc/lynis-2.7.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "helper_show": 2.7.3_vs_2.7.4.

    1 #!/bin/sh
    2 
    3 #################################################################################
    4 #
    5 #   Lynis
    6 # ------------------
    7 #
    8 # Copyright 2007-2013, Michael Boelen
    9 # Copyright 2007-2019, CISOfy
   10 #
   11 # Website  : https://cisofy.com
   12 # Blog     : http://linux-audit.com
   13 # GitHub   : https://github.com/CISOfy/lynis
   14 #
   15 # Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
   16 # welcome to redistribute it under the terms of the GNU General Public License.
   17 # See LICENSE file for usage of this software.
   18 #
   19 ######################################################################
   20 #
   21 # Helper program to share details
   22 #
   23 ######################################################################
   24 #
   25 # How to use:
   26 # ------------
   27 # Run: lynis show <option>
   28 #
   29 ######################################################################
   30 
   31 COMMANDS="audit configure show update upload-only"
   32 HELPERS="audit configure show update"
   33 OPTIONS="--auditor\n--cronjob (--cron)\n--debug\n--developer\n--help (-h)\n--license-key\n--log-file\n--manpage (--man)\n--no-colors\n--no-log\n--pentest\n--profile\n--plugin-dir\n--quick (-Q)\n--quiet (-q)\n--report-file\n--reverse-colors\n--skip-plugins\n--tests\n--tests-from-category\n--tests-from-group\n--upload\n--verbose\n--version (-V)\n--wait\n--warnings-only"
   34 
   35 SHOW_ARGS="categories changelog commands dbdir details environment eol groups help hostids includedir language license logfile man options os pidfile plugindir profiles release releasedate report settings tests version workdir"
   36 SHOW_HELP="lynis show ${BROWN}categories${NORMAL}              (display test categories)
   37 lynis show ${BROWN}changelog${NORMAL} ${GRAY}[version]${NORMAL}     (release details)
   38 lynis show ${BROWN}commands${NORMAL}                (all available commands)
   39 lynis show ${BROWN}dbdir${NORMAL}                   (database directory)
   40 lynis show ${BROWN}details${NORMAL}                 (display test details from log file)
   41 lynis show ${BROWN}environment${NORMAL}             (hardware, virtual machine, or container type)
   42 lynis show ${BROWN}eol${NORMAL}                     (OS end-of-life status)
   43 lynis show ${BROWN}groups${NORMAL}                  (test groups)
   44 lynis show ${BROWN}help${NORMAL}                    (detailed information about arguments)
   45 lynis show ${BROWN}hostids${NORMAL}                 (unique IDs for this system)
   46 lynis show ${BROWN}includedir${NORMAL}              (include directory for tests and functions)
   47 lynis show ${BROWN}language${NORMAL}                (configured or detected language)
   48 lynis show ${BROWN}license${NORMAL}                 (license details)
   49 lynis show ${BROWN}logfile${NORMAL}                 (location of logfile)
   50 lynis show ${BROWN}man${NORMAL}                     (show help)
   51 lynis show ${BROWN}options${NORMAL}                 (available flags and options)
   52 lynis show ${BROWN}os${NORMAL}                      (operating system and version)
   53 lynis show ${BROWN}pidfile${NORMAL}                 (active file to stored process ID)
   54 lynis show ${BROWN}plugindir${NORMAL}               (directory with plugins)
   55 lynis show ${BROWN}profiles${NORMAL}                (discovered profiles)
   56 lynis show ${BROWN}release${NORMAL}                 (version)
   57 lynis show ${BROWN}releasedate${NORMAL}             (date of release)
   58 lynis show ${BROWN}report${NORMAL}                  (location of report data)
   59 lynis show ${BROWN}settings${NORMAL}                (display configured settings, ${WHITE}options:${NORMAL} ${CYAN}--brief --nocolors${NORMAL})
   60 lynis show ${BROWN}tests${NORMAL} ${GRAY}[test]${NORMAL}            (display information about one or more tests)
   61 lynis show ${BROWN}tests skipped${NORMAL}           (which tests to skip according profile)
   62 lynis show ${BROWN}version${NORMAL}                 (${PROGRAM_NAME} version)
   63 lynis show ${BROWN}workdir${NORMAL}                 (work directory)"
   64 
   65 AUDIT_ARGS="( dockerfile | system )"
   66 AUDIT_HELP="
   67   ${WHITE}lynis audit <target>${NORMAL}
   68 
   69   ${CYAN}audit dockerfile ${BROWN}<file>${NORMAL}
   70 
   71   Perform security audit on a Docker build file
   72   ${GRAY}Example:${NORMAL}
   73     lynis audit dockerfile Dockerfile
   74 
   75 
   76   ${CYAN}audit system ${GRAY}[options]${NORMAL}
   77 
   78   Perform security system audit
   79 
   80   ${GRAY}Examples:${NORMAL}
   81     lynis audit system
   82     lynis audit system --cronjob
   83     lynis audit system --profile developer.prf
   84     lynis audit system --quick
   85 
   86 
   87   ${CYAN}audit system remote ${BROWN}<target> ${GRAY}[options]${NORMAL}
   88 
   89   Perform security system audit on a remote target
   90 
   91   ${GRAY}Examples:${NORMAL}
   92     lynis audit system remote 192.168.1.100
   93     lynis audit system remote 192.168.1.100 --no-colors
   94 
   95 "
   96 
   97 GENERATE_ARGS="( --save )"
   98 GENERATE_HELP="
   99   Generate random value for hostid and hostid2
  100   ${WHITE}lynis generate hostids${NORMAL}
  101 
  102   Generate and save values
  103   ${WHITE}lynis generate hostids --save${NORMAL}
  104 
  105 "
  106 
  107 
  108 UPDATE_ARGS="check info"
  109 UPDATE_HELP="
  110   ${CYAN}update info${NORMAL}
  111 
  112   Check version information
  113 
  114 "
  115 
  116 UPLOAD_ONLY_HELP="
  117   ${CYAN}update-only${NORMAL}
  118 
  119   Perform just a data upload
  120 
  121 "
  122 
  123 SHOW_SETTINGS_ARGS="--brief --configured-only --nocolors"
  124 SHOW_TESTS_ARGS="skipped"
  125 
  126 COMMANDS_AUDIT_SYSTEM_USAGE="Usage: lynis audit system"
  127 COMMANDS_AUDIT_SYSTEM_FUNCTION="Function: performs a security audit of the system"
  128 
  129 if [ $# -gt 0 ]; then
  130     case $1 in
  131         "categories")
  132             ViewCategories
  133             ;;
  134         "changelog")
  135             # Allow providing a version
  136             if [ $# -gt 1 ]; then
  137                 shift; SEARCH_VERSION="$1"
  138             fi
  139             PROGRAM_NAME_LOWER=$( echo ${PROGRAM_NAME} | tr '[:upper:]' '[:lower:]')
  140             CHANGELOG_PATHS="/usr/share/doc/${PROGRAM_NAME} /usr/share/doc/${PROGRAM_NAME}-${PROGRAM_VERSION} /usr/share/doc/${PROGRAM_NAME_LOWER} ."
  141             CHANGELOG=""
  142             if [ -z "${SEARCH_VERSION}" ]; then SEARCH_VERSION="${PROGRAM_VERSION}"; fi
  143             STARTED=0
  144             for FILEPATH in ${CHANGELOG_PATHS}; do
  145                 if [ -f ${FILEPATH}/CHANGELOG.md ]; then
  146                     CHANGELOG="${FILEPATH}/CHANGELOG.md"
  147                 # Check also for gzipped changelog
  148                 elif [ -f ${FILEPATH}/changelog.gz ]; then
  149                     ZCAT=$(which zcat 2> /dev/null | grep -v "no [^ ]* in ")
  150                     if [ ! -z "${ZCAT}" ]; then
  151                         CreateTempFile
  152                         CHANGELOG="${TEMP_FILE}"
  153                         LogText "Result: found gzipped changelog in ${FILEPATH}"
  154                         LogText "Action: Creating temporary file to store text"
  155                         ${ZCAT} ${FILEPATH}/changelog.gz > ${CHANGELOG}
  156                     else
  157                         DisplayError "Could not find zcat utility to use on gzipped changelog"
  158                     fi
  159                 fi
  160                 if [ ! -z "${CHANGELOG}" ]; then LogText "Result: found changelog file: ${CHANGELOG}"; break; fi
  161             done
  162             if [ ! -z "${CHANGELOG}" ]; then
  163                 SEARCH=$(egrep "^${PROGRAM_NAME} ${SEARCH_VERSION}" ${CHANGELOG})
  164                 if [ $? -eq 0 ]; then
  165                     while read -r LINE; do
  166                         if [ ${STARTED} -eq 0 ]; then
  167                             SEARCH=$(echo ${LINE} | egrep "^${PROGRAM_NAME} ${SEARCH_VERSION}")
  168                             if [ $? -eq 0 ]; then STARTED=1; ${ECHOCMD} "${BOLD}${LINE}${NORMAL}"; fi
  169                         else
  170                             # Stop if we find the next Lynis version
  171                             SEARCH=$(echo ${LINE} | egrep "^${PROGRAM_NAME} [0-9]\.[0-9]\.[0-9]")
  172                             if [ $? -eq 0 ]; then
  173                                 break
  174                             else
  175                                 ${ECHOCMD} "${LINE}"
  176                             fi
  177                         fi
  178                     done < ${CHANGELOG}
  179                 else
  180                     DisplayError "Could not find this version in the changelog"
  181                     ${ECHOCMD} ""
  182                     ${ECHOCMD} "${HEADER}Usage:${NORMAL}"
  183                     ${ECHOCMD} "$0 lynis show changelog [version]"
  184                     ${ECHOCMD} ""
  185                     ${ECHOCMD} "${HEADER}${PROGRAM_NAME} versions:${NORMAL}"
  186                     SEARCH=$(egrep "^Lynis [0-9]\.[0-9]\.[0-9] " ${CHANGELOG} | awk '{print $2}' | sort -n)
  187                     ${ECHOCMD} ${SEARCH}
  188                     ExitFatal
  189                 fi
  190             else
  191                 DisplayError "Could not find the changelog file (searched in ${CHANGELOG_PATHS})"
  192                 ExitFatal
  193             fi
  194             ;;
  195         "commands")
  196             if [ $# -eq 1 ]; then
  197                 ${ECHOCMD} "\n${WHITE}Commands:${NORMAL}"
  198                 for ITEM in ${COMMANDS}; do
  199                     ${ECHOCMD} "lynis ${CYAN}${ITEM}${NORMAL}"
  200                 done
  201                 ${ECHOCMD} ""
  202             else
  203                 shift
  204                 if [ $# -eq 1 ]; then
  205                     case $1 in
  206                         "audit") ${ECHOCMD} "${AUDIT_HELP}" ;;
  207                         "show") ${ECHOCMD} "${SHOW_HELP}" ;;
  208                         "update") ${ECHOCMD} "No help available yet" ;;
  209                         *) DisplayError "Unknown argument for 'commands'"
  210                     esac
  211                 else
  212                     shift
  213                     case $1 in
  214                         "dockerfile")
  215                             ${ECHOCMD} "Usage: lynis audit dockerfile <file>"
  216                         ;;
  217                         "system")
  218                             ${ECHOCMD} "${COMMANDS_AUDIT_SYSTEM_USAGE}\n${COMMANDS_AUDIT_SYSTEM_FUNCTION}\n"
  219                         ;;
  220                         *)
  221                             DisplayError "Unknown argument '$1' for commands"
  222                         ;;
  223                     esac
  224                 fi
  225             fi
  226             ;;
  227         "dbdir")
  228             ${ECHOCMD} "${DBDIR}"
  229             ;;
  230         "details")
  231             if [ -z "${LOGFILE}" ]; then DisplayError "Could not find log file to parse"; fi
  232             if [ $# -eq 1 ]; then
  233                 DisplayError "This command needs a test ID (e.g. CORE-1000) to search for. This command is used after a scan (lynis audit system). Run 'lynis show tests' to see all available tests."
  234             else
  235                 shift
  236                 if [ $# -eq 1 ]; then
  237                     TESTID="$1"
  238                     awk -v search="Performing test ID $TESTID" '$0 ~ search {++f;p=1}p&&f==1;/===---/{p=0}' ${LOGFILE}
  239                 fi
  240             fi
  241             ;;
  242         "environment")
  243             if [ -z "${CONTAINER_TYPE}" ]; then
  244                 ${ECHOCMD} "container=0"
  245             else
  246                 ${ECHOCMD} "container=1"
  247                 ${ECHOCMD} "container-type=${CONTAINER_TYPE}"
  248             fi
  249             if [ ${ISVIRTUALMACHINE} -eq 1 ]; then
  250                 ${ECHOCMD} "virtual-machine=1"
  251                 ${ECHOCMD} "virtual-machine-type=${VMTYPE}"
  252             else
  253                 ${ECHOCMD} "hardware=1"
  254                 ${ECHOCMD} "virtual-machine=0"
  255             fi
  256             ;;
  257         "eol")
  258             if [ ${EOL} -eq 0 ]; then
  259                 ${ECHOCMD} "OS end-of-life: No"
  260             elif [ ${EOL} -eq 1 ]; then
  261                 ${ECHOCMD} "OS end-of-life: Yes"
  262             elif [ ${EOL} -eq 255 ]; then
  263                 ${ECHOCMD} "OS end-of-life: Not tested"
  264             else
  265                 ${ECHOCMD} "OS end-of-life: Unknown"
  266             fi
  267             ;;
  268         "groups")
  269             ViewGroups
  270             ;;
  271         "help" | "--help" | "-h")
  272             if [ $# -eq 1 ]; then
  273                 ${ECHOCMD} "${PROGRAM_NAME} ${PROGRAM_VERSION} - Help"
  274                 ${ECHOCMD} "=========================="
  275                 ${ECHOCMD} ""
  276                 ${ECHOCMD} "${WHITE}Commands${NORMAL}:"
  277                 for ITEM in ${COMMANDS}; do
  278                     ${ECHOCMD} "${CYAN}${ITEM}${NORMAL}"
  279                 done
  280                 ${ECHOCMD} ""
  281                 ${ECHOCMD} "Use 'lynis show help ${CYAN}<command>${NORMAL}' to see details"
  282                 ${ECHOCMD} ""; ${ECHOCMD} ""
  283                 ${ECHOCMD} "${WHITE}Options${NORMAL}:\n${GRAY}${OPTIONS}${NORMAL}"
  284             else
  285                 shift
  286                 case $1 in
  287                    "audit") ${ECHOCMD} "${AUDIT_HELP}" ;;
  288                    "generate") ${ECHOCMD} "${GENERATE_HELP}" ;;
  289                    "show") ${ECHOCMD} "${SHOW_HELP}" ;;
  290                    "update") ${ECHOCMD} "${UPDATE_HELP}" ;;
  291                    "upload-only") ${ECHOCMD} "${UPLOAD_ONLY_HELP}" ;;
  292                    "?") ${ECHOCMD} "${SHOW_ARGS}" ;;
  293                    *) ${ECHOCMD} "Unknown argument provided for lynis show help" ;;
  294                 esac
  295             fi
  296             ;;
  297         "helpers")              for ITEM in ${HELPERS}; do ${ECHOCMD} ${ITEM}; done ;;
  298         "hostids" | "hostid")
  299             ${ECHOCMD} "hostid=${HOSTID}"
  300             ${ECHOCMD} "hostid2=${HOSTID2}"
  301             ${ECHOCMD} "machineid=${MACHINEID}"
  302             ;;
  303         "includedir")
  304             ${ECHOCMD} "${INCLUDEDIR}"
  305             ;;
  306         "language")             ${ECHOCMD} "${LANGUAGE}" ;;
  307         "license")              ${ECHOCMD} "${PROGRAM_LICENSE}" ;;
  308         "logfile")              ${ECHOCMD} "${LOGFILE}" ;;
  309         "man")                  ${ECHOCMD} "Use ./lynis --man or man lynis" ;;
  310         "options")              ${ECHOCMD} "${OPTIONS}" ;;
  311         "os")
  312                                 ${ECHOCMD} "OS=${OS}"
  313                                 ${ECHOCMD} "OS_NAME=${OS_NAME}"
  314                                 ${ECHOCMD} "OS_FULLNAME=${OS_FULLNAME}"
  315                                 ${ECHOCMD} "OS_VERSION=${OS_VERSION}"
  316         ;;
  317         "pidfile")              ${ECHOCMD} "${PIDFILE}" ;;
  318         "profile" | "profiles") for ITEM in ${PROFILES}; do ${ECHOCMD} ${ITEM}; done ;;
  319         "profiledir")           ${ECHOCMD} "${PROFILEDIR}" ;;
  320         "plugindir")            ${ECHOCMD} "${PLUGINDIR}" ;;
  321         "release")              ${ECHOCMD} "${PROGRAM_VERSION}-${PROGRAM_RELEASE_TYPE}" ;;
  322         "releasedate")          ${ECHOCMD} "${PROGRAM_RELEASE_DATE}" ;;
  323         "report")               ${ECHOCMD} "${REPORTFILE}" ;;
  324         "settings")
  325             BRIEF_OUTPUT=0
  326             COLORED_OUTPUT=1
  327             CONFIGURED_ONLY_OUTPUT=0
  328             while [ $# -gt 1 ]; do
  329                 shift
  330                 case $1 in
  331                    "--brief" | "--br") BRIEF_OUTPUT=1 ;;
  332                    "--configured-only" | "--co") CONFIGURED_ONLY_OUTPUT=1 ;;
  333                    "--nocolors" | "--no-colors" | "--nc") COLORED_OUTPUT=0; COLORS=0 ;;
  334                    *)
  335                        ${ECHOCMD} "${RED}Error${NORMAL}: Invalid argument provided to 'lynis show settings'\n\n"
  336                        ${ECHOCMD} "Suggestions:"
  337                        for ITEM in ${SHOW_SETTINGS_ARGS}; do ${ECHOCMD} "lynis show settings ${ITEM}"; done
  338                        ExitFatal
  339                    ;;
  340                 esac
  341             done
  342             if [ ${COLORED_OUTPUT} -eq 0 ]; then RemoveColors; fi
  343             # Sort all settings and display them
  344             SETTINGS=$(sort ${SETTINGS_FILE} | sed 's/ /:space:/g')
  345             for LINE in ${SETTINGS}; do
  346                 SETTING=$(echo ${LINE} | awk -F';' '{print $1}')
  347                 VALUE=$(echo ${LINE} | awk -F';' '{print $2}')
  348                 DESCRIPTION=$(echo ${LINE} | awk -F';' '{print $3}' | sed 's/:space:/ /g')
  349                 if [ -z "${VALUE}" -a ${CONFIGURED_ONLY_OUTPUT} -eq 0 ]; then VALUE="${GRAY}[not configured]${NORMAL}"; fi
  350                 if [ ! -z "${VALUE}" ]; then
  351                     if [ ${BRIEF_OUTPUT} -eq 0 ]; then ${ECHOCMD} "${GRAY}# ${DESCRIPTION}${NORMAL}"; fi
  352                     ${ECHOCMD} "${WHITE}${SETTING}${NORMAL}=${CYAN}${VALUE}${NORMAL}"
  353                     if [ ${BRIEF_OUTPUT} -eq 0 ]; then ${ECHOCMD} ""; fi
  354                 fi
  355             done
  356             if [ ${BRIEF_OUTPUT} -eq 0 -a ${CONFIGURED_ONLY_OUTPUT} -eq 0 -a ${COLORED_OUTPUT} -eq 1 ]; then
  357                 if [ ${COLORS} -eq 1 ]; then
  358                     ${ECHOCMD} "# Add --brief to hide descriptions, --configured-only to show configured items only, or --nocolors to remove colors"
  359                 else
  360                     ${ECHOCMD} "# Add --brief to hide descriptions, --configured-only to show configured items only"
  361                 fi
  362             fi
  363 
  364             ;;
  365         "tests")
  366             if [ $# -gt 1 ]; then
  367                 shift
  368                 case $1 in
  369                     "skipped")
  370                         if [ -z "${SKIP_TESTS}" ]; then
  371                             ${ECHOCMD} "# ${CYAN}No tests are skipped (according profile)${NORMAL}"
  372                         else
  373                             ${ECHOCMD} "# Skipped tests (according profile)"
  374                             ${ECHOCMD} "${SKIP_TESTS}"
  375                         fi
  376                     ;;
  377                     *)
  378                         if [ -f ${DBDIR}/tests.db ]; then
  379                             SEARCH="$1"
  380                             FIND=$(grep "^${SEARCH}" ${DBDIR}/tests.db | sed "s/ /:space:/g")
  381                             if [ -z "${FIND}" ]; then
  382                                 ${ECHOCMD} "${WARNING}Error${NORMAL}: ${BOLD}Could not find this test in the database${NORMAL}\n\n"
  383                                 ExitFatal
  384                             else
  385                                 for ITEM in ${FIND}; do
  386                                     TEST_DESCRIPTION=$(echo ${ITEM} | sed "s/:space:/ /g" | awk -F: '{print $6}')
  387                                     TEST=$(echo ${ITEM} | awk -F: '{print $1}')
  388                                     TEST_TYPE=$(echo ${ITEM} | awk -F: '{print $2}')
  389                                     TEST_CATEGORY=$(echo ${ITEM} | awk -F: '{print $3}')
  390                                     TEST_GROUP=$(echo ${ITEM} | awk -F: '{print $4}')
  391                                     TEST_OS=$(echo ${ITEM} | awk -F: '{print $5}')
  392                                     TEST_SKIPPED=0
  393                                     ${ECHOCMD} "${CYAN}${TEST}${NORMAL}"
  394                                     ${ECHOCMD} "==================================="
  395                                     ${ECHOCMD} ""
  396                                     ${ECHOCMD} "${WHITE}Type:${NORMAL} ${TEST_TYPE}"
  397                                     ${ECHOCMD} ""
  398                                     ${ECHOCMD} "${WHITE}Description:${NORMAL}"
  399                                     ${ECHOCMD} "${TEST_DESCRIPTION}"
  400                                     ${ECHOCMD} ""
  401                                     ${ECHOCMD} "${WHITE}Category:${NORMAL} ${TEST_CATEGORY}, ${WHITE}Group:${NORMAL} ${TEST_GROUP}"
  402                                     ${ECHOCMD} ""
  403                                     ${ECHOCMD} "${WHITE}Test Execution:${NORMAL}"
  404                                     if [ "${TEST_OS}" = "" ]; then
  405                                         ${ECHOCMD} "  Operating System:    ${GREEN}Yes${NORMAL} (all systems)"
  406                                     elif [ "${TEST_OS}" = "${OS}" ]; then
  407                                         ${ECHOCMD} "  Operating System:    ${GREEN}Yes${NORMAL} (${TEST_OS} only)"
  408                                     else
  409                                         ${ECHOCMD} "  Operating System:    ${RED}No${NORMAL} (${TEST_OS} only)"
  410                                         TEST_SKIPPED=1
  411                                     fi
  412                                     if [ -z "${SKIP_TESTS}" ]; then
  413                                         ${ECHOCMD} "  Profile:             ${GREEN}Yes${NORMAL} (not configured)"
  414                                     else
  415                                         FIND=$(echo ${SKIP_TESTS} | egrep "${TEST}")
  416                                         if [ -z "${FIND}" ]; then
  417                                             ${ECHOCMD} "  Profile:             ${GREEN}Yes${NORMAL} (test not marked to be skipped)"
  418                                         else
  419                                             ${ECHOCMD} "  Profile:             ${RED}No${NORMAL} (marked test as to be skipped)"
  420                                             TEST_SKIPPED=1
  421                                         fi
  422                                     fi
  423                                     if [ ${TEST_SKIPPED} -eq 1 ]; then ${ECHOCMD} ""; ${ECHOCMD} "  This test will NOT be performed on this system"; fi
  424 
  425                                     ${ECHOCMD} ""
  426                                     ${ECHOCMD} ""
  427 
  428                                 done
  429                             fi
  430                         else
  431                             ShowError "Can not find tests database"
  432                             ${ECHOCMD} "The changelog might not be installed on your system. Details can be found at ${PROGRAM_SOURCE}."
  433                             ExitFatal
  434                         fi
  435                     ;;
  436                 esac
  437             else
  438                 if [ -f ${DBDIR}/tests.db ]; then
  439                     ${ECHOCMD} "# Test       OS         Description"
  440                     ${ECHOCMD} "# ======================================================================================"
  441                     awk -F: '{ if ($1 !~ /^#/) printf("%-10s %-10s %s (%s)\n",$1,$5,$6,$3)}' ${DBDIR}/tests.db
  442                 else
  443                     ShowError "Can not find tests database"
  444                     ${ECHOCMD} "The changelog might not be installed on your system. Details can be found at ${PROGRAM_SOURCE}."
  445                     ExitFatal
  446                 fi
  447             fi
  448             ;;
  449         "version")              ${ECHOCMD} "${PROGRAM_VERSION}" ;;
  450         "workdir")              ${ECHOCMD} "${WORKDIR}" ;;
  451         "?")                    ${ECHOCMD} "${SHOW_ARGS}" ;;
  452         *)                      ${ECHOCMD} "Unknown argument '${RED}$1${NORMAL}' for lynis show" ;;
  453     esac
  454 else
  455     ${ECHOCMD} "\n  ${WHITE}Provide an additional argument${NORMAL}\n\n"
  456     for ITEM in ${SHOW_ARGS}; do
  457         ${ECHOCMD} "    lynis show ${BROWN}${ITEM}${NORMAL}"
  458     done
  459     ${ECHOCMD} "\n"
  460     ${ECHOCMD} ""
  461     ${ECHOCMD} "Extended help about the show command can be provided with: $0 show commands show"
  462 fi
  463 
  464 
  465 ExitClean
  466 
  467 # More additions:
  468 # - categories
  469 # - workdir
  470 
  471 # The End