C H A P T E R 1 |
Framework Functions |
This chapter provides reference information on using, adding, modifying, and removing framework functions. Framework functions provide flexibility for you to change the behavior of the Solaris Security Toolkit software without modifying source code.
Use framework functions to limit the amount of coding that is needed to develop new finish and audit scripts, and to keep common functionality consistent. For example, by using the common logging functions, you can configure the reporting mechanism without needing to develop or alter any additional source code. Similarly, by using this modular code for common functions, bugs and enhancements can be more systematically addressed.
In addition, framework functions support the undo option. For example, using the framework function backup_file in place of a cp or mv command allows that operation to be reversed during an undo run.
This chapter contains the following topics:
The Solaris Security Toolkit software is based on a modular framework that you can combine in various ways to suit your organization's needs. Sometimes, however, the standard features provided by the Solaris Security Toolkit software might not meet your site's needs. You can supplement the standard features by customizing framework functions to enhance and extend the functionality provided by the Solaris Security Toolkit software. The framework functions configure how the Solaris Security Toolkit software runs, define the functions that it uses, and initialize environment variables.
In most cases, you can easily copy standard framework function files and scripts, and then customize the functionality for your use. For example, using the user.run file, you can add, modify, replace, or extend the standard framework functions. The user.run file is similar in purpose to the user.init file, except that you use the user.init file to add or modify environment variables.
In some cases, you might need to develop new framework functions. In this case, use similar framework functions as a guide or template for coding, and be sure to follow the recommendations provided in this book. Development should only be undertaken by users who are familiar with the Solaris Security Toolkit software's design and implementation.
CODE EXAMPLE 1-1 show how Solaris Security Toolkit functionality can be extended by customizing the standard framework. In this example, the mount_filesystems function is modified to enable the developer to mount additional file systems during a JumpStart installation. The mount_filesystems function is copied directly from the driver.funcs script into the user.run file. The modifications to it are in line numbers 8 and 9.
For the sake of simplicity, the variable used to mount the new file system is not converted to Solaris Security Toolkit environment variables. To aid in portability and flexibility, abstract the actual values using environment variables. This approach allows changes to be made consistently, because the software is deployed into environments with different requirements, such as production, quality assurance, and development.
![]() |
Caution - A disadvantage to modifying mount_filesystemsis that when you install updates of the Solaris Security Toolkit software, you might need to modify the mount_filesystemsagain. |
These functions control all logging and reporting functions and are located in the Drivers directory in a file called common_log.funcs. The logging and reporting functions are used in all of the Solaris Security Toolkit software's operational modes; therefore, they are considered common functions. For example, common functions such as logWarning and logError are in this file.
This section describes the following common log functions.
This function displays banner messages. These messages typically precede driver, finish, or audit script run output. Also, banner messages are used at the start and end of a run and are only displayed if the logging verbosity is at least 3. For more information on verbosity levels, see Chapter 6.
Banner messages take two forms. If you pass an empty string to this function, then a single line separator is displayed. This line is often used to force a "break" in the displayed output. If you enter a single string value, then the output is displayed between a pair of single line separators. CODE EXAMPLE 1-2 shows a sample of a banner message.
You can control banner messages through the JASS_LOG_BANNER environment variable. For more information on this environment variable, see Chapter 6.
This function displays debugging messages. This function accepts a single string argument to be displayed as a debugging message. By default, no debugging messages are displayed by the Solaris Security Toolkit software. This functionality is for future use and for you to add debugging log messages to your code. Debugging messages are only displayed if the verbosity is at least 4. For more information about verbosity levels, see Chapter 6.
This function displays error messages. This function accepts a single string value that is displayed as an error message. Error messages are those that contain the string [ERR ].
You can control error messages through the JASS_LOG_ERROR environment variable. For more information on this environment variable, see Chapter 6.
This function displays failure messages. This function accepts a single string value that is displayed as a failure message. Failure messages are those that contain the string [FAIL].
You can control failure messages through the JASS_LOG_FAILURE environment variable. For more information on this environment variable, see Chapter 6.
Use these functions to log messages associated with the success or failure of checks. These functions together report on the results of a file content check. These functions are used primarily with the check_fileContentsExist and check_fileContentsNotExist functions, although they can be used independently if necessary.
You can supply the following arguments to this function:
These functions display either success or failure messages. You can control these messages through the JASS_LOG_FAILURE and JASS_LOG_SUCCESS environment variables. For more information on these environment variables, see Chapter 6.
Use these functions to log messages associated with the success or failure of a check. These functions together report on the results of a file check. These functions are primarily used with the check_fileExists and check_fileNotExists functions, although they can be used independently if necessary.
You can supply the following arguments to this function:
If this argument is passed a null string value, then this function reports the result in the form of a notice using the logNotice function. Otherwise, it reports the result as a failure using the logFailure function.
These functions display either success or failure messages. You can control these messages through the JASS_LOG_FAILURE and JASS_LOG_SUCCESS environment variables. For more information on these environment variables, see Chapter 6.
Use these functions to log messages associated with the success or failure of a check. These functions together report on the results of a file group membership check. These functions are used primarily with the check_fileGroupMatch and check_fileGroupNoMatch functions, although they can be used independently if necessary.
You can supply the following arguments to this function:
These functions display either success or failure messages. You can control these messages through the JASS_LOG_FAILURE and JASS_LOG_SUCCESS environment variables. For more information on these environment variables, see Chapter 6.
Use these functions to log messages associated with the success or failure of a check. These functions together report on the results of a file permissions check. These functions are used primarily with the check_fileModeMatch and check_fileModeNoMatch functions, although they can be used independently if necessary.
You can supply the following arguments to this function:
These functions display either success or failure messages. You can control these messages through the JASS_LOG_FAILURE and JASS_LOG_SUCCESS environment variables. For more information on these environment variables, see Chapter 6.
This function is used by the software to display file not found messages. This function is used throughout the Solaris Security Toolkit code in both hardening and audit runs to provide a standard message when a designated file was not found on the system.
You can supply the following arguments to this function:
If this argument is passed a null string value, then this function reports the result in the form of a notice using the logNotice function. Otherwise, it reports the result as a failure using the logFailure function.
You can control notice and failure messages through the JASS_LOG_NOTICE and JASS_LOG_FAILURE environment variables, respectively. For more information on this environment variable, see Chapter 6.
Use these functions to log the messages associated with the success or failure of a check. These functions report on the results of a file ownership check. These functions are used primarily with the check_fileOwnerMatch and check_fileOwnerNoMatch functions, although they can be used independently if necessary.
You can supply the following arguments to this function:
These functions display either success or failure messages. You can control these messages through the JASS_LOG_FAILURE and JASS_LOG_SUCCESS environment variables. For more information on these environment variables, see Chapter 6.
Use these functions to log the messages associated with the success or failure of a check. These functions report on the results of a file type check. These functions are used primarily with the check_fileTypeMatch and check_fileTypeNoMatch functions, although they can be used independently if necessary.
You can supply the following arguments to this function:
TABLE 1-1 lists the types detected by the software:
These functions display either success or failure messages. You can control these messages through the JASS_LOG_FAILURE and JASS_LOG_SUCCESS environment variables. For more information on these environment variables, see Chapter 6.
This function displays audit finding messages. This function accepts a single string argument to be displayed as a message. The input for this function is processed by the printPrettyPath function prior to display. In addition, if the verbosity level is equal to 2, then optional tags are prepended to the message. The following are the optional tags that you can prepend by this function:
Note - If the finding occurs outside of an audit script, such as within the flow of the driver.run script, then the name of the current driver is used. |
You can use all three output tags collectively or independently. The order of the position in the resulting output line is as they are listed. For more information on this function and verbosity levels, see Chapter 6.
Use this function to generate formatted audit script headers that display information such as the script name, purpose, and rationale for the check. This function accepts a single string value and formats the message that is passed to the function.
These messages are reformatted as follows:
Formatted messages are displayed only when the verbosity level is at least 3. For more information on this function and verbosity levels, see Chapter 6.
Use this function to display an error message when the JASS_DISABLE_MODE environment variable is set to an invalid value. This utility function reports on the state of the JASS_DISABLE_MODE environment variable. This function takes no arguments and generates the following output:
[ERR ] The JASS_DISABLE_MODE parameter has an invalid value: [...] [ERR ] value must either be "script" or "conf". |
For more information on this environment variable, see Chapter 6.
Use this function when either the check_os_revision or check_os_min_revision functions fail their checks. This utility function reports when a function is being called on a version of the Solaris OS for which it does not apply. For example, use this function when there is an attempt to use a Solaris 8 OS script with the Solaris 2.6 OS.
To specify multiple versions, enter a hyphen (-) between versions, for example, "5.6-5.8."
This function displays notice messages. You can control messages through the JASS_LOG_NOTICE environment variable. For more information on this environment variable, see Chapter 6.
Use this function to display any message that you want to display to users. Use this function for messages that do not have any tags associated with them. Similar to the logFormattedMessage function, this function displays an unformatted message. This function accepts a single string value that is displayed as is, with no modification.
Unformatted messages are only displayed if the verbosity level is at least 3. For more information on this function and verbosity levels, see Chapter 6.
Use this function to display notice messages. This function accepts a single string value that is displayed as a notice message. Notice messages are those that contain the string [NOTE].
You can control notice messages through the JASS_LOG_NOTICE environment variable. For more information on this environment variable, see Chapter 6.
Use these functions to log the messages associated with the success or failure of a check. These functions report on the results of a check that determines if a software package is installed. These functions are used primarily with the check_packageExists and check_packageNotExists functions, although they can be used independently if necessary.
You can supply the following arguments to this function:
These functions display either success or failure messages. You can control these messages through the JASS_LOG_FAILURE and JASS_LOG_SUCCESS environment variables. For more information on these environment variables, see Chapter 6.
Use these functions to log the messages associated with the success or failure of a check. These functions report on the results of a check that determines if a software patch is installed. These functions are used primarily with the check_patchExists and check_patchNotExists functions, although they can be used independently if necessary.
You can supply the following arguments to this function:
These functions display either success or failure messages. You can control these messages through the JASS_LOG_FAILURE and JASS_LOG_SUCCESS environment variables. For more information on these environment variables, see Chapter 6.
Use these functions to log the messages associated with the success or failure of a check. These functions report on the results of a check for runtime process arguments. These functions are used primarily with the check_processArgsMatch and check_processArgsNoMatch functions, although they can be used independently if necessary.
You can supply the following arguments to this function:
These functions display either success or failure messages. You can control these messages through the JASS_LOG_FAILURE and JASS_LOG_SUCCESS environment variables. For more information on these environment variables, see Chapter 6.
Use these functions to log the messages associated with the success or failure of a check. These functions report on the results of a check for a process. These functions are used primarily with the check_processExists and check_processNotExists functions, although they can be used independently if necessary.
You can supply the following arguments to this function:
These functions display either success or failure messages. You can control these messages through the JASS_LOG_FAILURE and JASS_LOG_SUCCESS environment variables. For more information on these environment variables, see Chapter 6.
Use this function to log a FAIL message for any process that is not found. This function displays "process not found" messages. This function provides a standard message when a designated process cannot be found on a system.
You can supply the following arguments to this function:
You can control these messages through the JASS_LOG_FAILURE environment variable. For more information on these environment variables, see Chapter 6.
Use these functions to log the messages associated with the success or failure of a check. These functions report on the results of a check that determines if a configuration file exists. These functions are used primarily with the check_serviceConfigExists and check_serviceConfigNotExists functions, although they can be used independently if necessary.
You can supply the following arguments to this function:
These functions display either success or failure messages. You can control these messages through the JASS_LOG_FAILURE and JASS_LOG_SUCCESS environment variables. For more information on these environment variables, see Chapter 6.
Use these functions to log the messages associated with the success or failure of a check. These functions report on the results of a check that determines if a run-control start script exists. These functions are used primarily with the check_startScriptExists and check_startScriptNotExists functions, although they can be used independently if necessary.
You can supply the following arguments to this function:
These functions display either success or failure messages. You can control these messages through the JASS_LOG_FAILURE and JASS_LOG_SUCCESS environment variables. For more information on these environment variables, see Chapter 6.
Use these functions to log the messages associated with the success or failure of a check. These functions report on the results of a check that determines if a run-control stop script exists. These functions are used primarily with the check_stopScriptExists and check_stopScriptNotExists functions, although they can be used independently if necessary.
You can supply the following arguments to this function:
These functions display either success or failure messages. You can control these messages through the JASS_LOG_FAILURE and JASS_LOG_SUCCESS environment variables. For more information on these environment variables, see Chapter 6.
Use this function to display success messages. This function accepts a single string value that is displayed as an audit success message. Success messages are those that contain the string "[PASS]."
You can control success messages through the JASS_LOG_SUCCESS environment variable. For more information on this environment variable, see Chapter 6.
Use this function to display warning messages. This function accepts a single sting value that is displayed as a warning message. Warning messages are those that contain the string "[WARN]."
You can control warning messages through the JASS_LOG_WARNING environment variable. For more information on this environment variable, see Chapter 6.
These functions are for common miscellaneous functions that are used within several areas of the Solaris Security Toolkit software and are not specific to functionality provided by other framework functions (files ending with a .func suffix). These functions are in the Drivers directory in a file called common_misc.funcs. Common utility functions such as isNumeric and printPretty are in this file.
This section describes the common miscellaneous functions.
Use this function to determine if input arguments are positive numbers. It is used throughout the software by helper functions whenever input must be validated to ensure that it consists of a single, positive integer. This function accepts a single string argument and determines if the value is a positive integer. If the value is a positive integer, this function displays a value of 0, otherwise it displays a value of 1.
Use this function to determine if input arguments are positive numbers. This function accepts a single string argument and determines if the value is a positive integer. It logs an error message for each failure. This function is necessary to determine where there may be invalid arguments supplied to a function as a vulnerability value. In all other aspects, this function behaves like its isNumeric counterpart. This function applies only to audit operations.
Use this function to determine if a given input string is set to LOG. This function accepts a single string argument and determines whether the calling function should log its results. If the string evaluated is the string LOG, then this function echoes a value of 1, indicating that the calling function should log its results. If the input string contains any other value, this function echoes a value of 0, indicating that no output is logged by the calling function. This function applies only to audit operations.
Use this function to adjust the score outside of the methods provided by the functions defined in the audit_public.funcs file. This function accepts a positive integer argument representing the value that is added to the current score for an audit script. For example, there might be times when only the audit script can determine a failure. In those cases, use this function to adjust the score, accounting for the failure. If one is not supplied, it logs an error message and does not adjust the score. This function applies only to audit runs.
Use this function to format printed output so that it is easier to read. This function accepts an unformatted input string and processes it. The resulting string is wrapped at 72 characters with each line of output indented by three characters.
Use this function to format path names. This function accepts as input an unformatted path name. This function strips any redundant forward slashes from the input string, then displays the result. If the string is empty, then the keyword "<No Value>" is displayed in its place.
Use this function to remove comments from a file or script. This function accepts as input a list of tokens (script names, file names, and so on) and removes any text that is commented out. This function defines a comment as any substring of text that begins with a "#" (number) symbol and continues to the end of the line.
Use this function to remove redundant "/" (forward slash) characters from a file name. This function accepts as input a single string argument and returns the same value after any duplicate forward slash characters (/) have been removed from the string. This function is used to clean up path names before they are displayed to the user or before they are placed in logs.
Use this function to remove the JASS_ROOT_DIR prefix from the file name. This function accepts as input a single string argument and returns the same value after removing the JASS_ROOT_DIR prefix and replacing it with a single "/" (forward slash) character. This function is used with the add_to_manifest function when storing path names in the JASS manifest file.
These functions are for driver functionality. These functions are in the driver.funcs file, located in the Drivers directory. Functions such as add_pkg and copy_a_file are in this file.
When customizing or creating scripts, use the following functions to perform standard operations.
Use this function to add Solaris OS patches to the system. By default, this function expects that the patches installed are located in the JASS_PATCH_DIR directory. TABLE 1-2 lists the options for this function.
List of patches or name of file containing a list of patches to apply |
Use this function to add Solaris OS packages to the system. By default, this function expects that the packages are located in the JASS_PACKAGE_DIR directory and that these packages are in one of the standard Sun formats, spooled directories or package stream files. This function automatically adds the necessary manifest entries to permit this operation to be reversed during an undo run. During an undo run, packages added using this function are removed from the system. TABLE 1-3 lists the options for this function.
add_pkg -d ${JASS_ROOT_DIR}/${JASS_PACKAGE_DIR}/SUNWjass.pkg SUNWjass |
Use this function to manually insert entries into a manifest file during hardening runs without calling one of the helper functions. This approach is most often done when a command must be executed for the undo operation to complete. Use this option with care to protect the integrity of the system and the Solaris Security Toolkit repository.
The add_to_manifest command uses the following syntax:
This command puts an entry in the JASS_RUN_MANIFEST file in JASS_REPOSITORY/jass-manifest.txt, which is critical to the ability to undo the changes made by a finish script.
Note - Not all of the operations used by the Solaris Security Toolkit support each of these arguments. Also, the meaning of the options for src, dst, and args can differ based on the operation selected, as discussed in TABLE 1-4. |
The operations supported by the add_to_manifest function are listed in TABLE 1-4. This table includes a sample resulting manifest entry after each option.
Use this function to back up an existing file system object. This function backs up the original file using a standard naming convention. The convention appends JASS_SUFFIX to the original file name. This function automatically adds the necessary manifest entries to permit this operation to be reversed during an undo run.
The JASS_SAVE_BACKUP variable specifies if the Solaris Security Toolkit software saves or does not save backup copies of files modified during a run. If this environment variable is set to 0, then this function does not save backup files on the system. If files are not saved, then the run cannot be reversed by using the undo command.
Use this function to detect functionality that exists in multiple releases of the Solaris OS. This function takes only one argument, indicating the minimal OS release version. If the actual release of the OS on the target platform is greater than or equal to the argument, then the function returns 0, otherwise this function returns 1. If an error is encountered, then this function returns 255.
For example, this function can be used as shown in CODE EXAMPLE 1-3.
In this example, the Common Desktop Environment (CDE) was not included in the Solaris OS until version 2.6, and this script checks to ensure that the version is at least 5.6, before attempting to disable the run-control scripts listed.
Use this function to check for a specific OS revision or range of values. This function can take either one or two arguments. If one argument is supplied, then the script returns 0 only if the target operating system revision is the same as the argument, otherwise it returns 1.
Similarly, if two arguments are provided, the target operating system revision must be between the two values inclusively for the result to be 0. In either case, if an error is encountered, this function returns a value of 255.
For example, this function can be used as shown in CODE EXAMPLE 1-4.
In this example, the script disables only its scripts or configuration files, based on the value of JASS_DISABLE_MODE, when the target OS revision is or falls between Solaris OS versions 2.5.1 and 8 inclusively.
Use this function to calculate the checksum for a file. This function takes a single string value that represents the file for which the checksum is being calculated. This function, which uses the Solaris cksum program to calculate the checksum, outputs a value in the format checksum:number of octets.
Use this function to recursively copy the contents of a directory. This function takes two arguments, a source directory name and a destination directory name. This function copies the contents of the source directory to the directory specified by the destination parameter. This function creates the new directory if it does not already exist. This function automatically adds the necessary manifest entries to permit this operation to be reversed during an undo run.
Use this function to copy exactly one regular file. This function takes two arguments: a source file name and a destination file name. This function copies the contents of the source file to the file name specified by the destination parameter. This function automatically adds the necessary manifest entries to permit this operation to be reversed during an undo run.
Use this function to copy a symbolic link to the target platform. This function takes two arguments: a source link name and a destination file name. This function creates a new symbolic link based on the source link specified using the new file name passed as the destination parameter. This function automatically adds the necessary manifest entries to permit this operation to be reversed during an undo run.
Use this function to copy a set of file system objects from the JASS_HOME_DIR/Files directory tree to a target system. This function uses the appropriate copy functions listed previously to ensure that the changes made can be reversed during an undo run. This function is capable of copying regular files, directories, and symbolic links.
This function extends capability by permitting the selective copy of objects based on tags appended to their file names.
The files that are copied by this function are selected by the following criteria:
In this option, the software copies the object only if the name of the target platform matches the tag specified by ${HOST}. This host environment variable uses the same naming format as the JASS_HOSTNAME environment variable.
For example: /etc/issue.jordan
If the software cannot find this file, the software continues to search for the general file (the option described next).
In this option, the software only copies the object if the OS revision of the target platform matches the tag specified by ${OS}. The OS parameter uses the same naming format as the JASS_OS_REVISION environment variable. So, a file to be used only on the Solaris 8 OS is denoted as "filename+5.8".
If the software cannot find this file, the software looks for the file associated with the host name (the option described next).
In this option, the software copies the file to a target system.
Note - When the file length/size is zero, the file is not copied to the system. |
The order of precedence used to match a file is listed. For example, if a host-specific and general file both exist, the host-specific file is used if the name of a target system matches the host name defined by the host-specific file.
Note - The copy_files function silently ignores any objects listed that are not found in the JASS_HOME_DIR/Files directory tree. |
Use this function to create an empty file on a target system. This function uses a combination of the touch, chown, and chmod commands to create an empty file with a specific owner, group, and set of permissions.
Note - This function does not adjust permissions or ownerships on a file that exists. |
This function creates a file with specific permissions.
In this example, a file called testing is created in the /usr/local directory, owned by guppy and group of staff, with permissions 750. This function accepts the options listed in TABLE 1-5.
Use this function to create a unique timestamp value for a given file and for all file backup operations. This function is useful for creating a backup of an already backed-up file when a unique suffix value is needed. The timestamp value created is in the same format as JASS_TIMESTAMP. The resulting timestamp value created by this function is stored in the JASS_SUFFIX environment variable. For more information, see Chapter 6, JASS_TIMESTAMP.
Use this function to disable service configuration files. This function accepts two string values representing the directory name in which the file is located and the service configuration file name. This function disables the service configuration file by prepending a prefix of "_" (underscore) to the file name, thereby preventing its execution.
This example renames a file from /etc/dfs/dfstab to /etc/dfs/_dfstab.JASS.<timestamp>. This function automatically adds the necessary manifest entries to permit this operation to be reversed during an undo run.
Use this function to disable files that cannot be stored in their original directory. For example, the /var/spool/cron/crontabs directory contains individual user crontab files. If a disabled or backed-up copy of a crontab file were stored in the crontabs directory, then the cron service would indicate an error, because there would be no user name that matched the names of the disabled or backed-up files.
To address this issue, this function creates a mirror directory with a .JASS suffix within which to store any of the disabled files. For example, if the file to be disabled is located in the /var/spool/cron/crontabs directory, this function creates a /var/spool/cron/crontabs.JASS directory into which the disabled file is moved.
The file to be disabled, as with the other disable functions, has a suffix of .JASS.<timestamp>. The difference with this function is that the disabled file is not stored in the same directory as the original file.
In this example, the file /var/spool/cron/crontabs/uucp is moved to the
/var/spool/cron/crontabs.JASS directory and renamed as uucp.JASS.<timestamp>. This function automatically adds the necessary manifest entries to permit this operation to be reversed during an undo run.
Use this function to disable the execution of a run-control file. This function accepts two string values representing the directory name in which the script is located and the run-control script name. This function disables the script by prepending a prefix of "_" (underscore) to the file name, thereby preventing its execution by run-control framework. To be executed, a script name must begin with either an S or a K depending on its purpose as a start or kill run-control script. In addition, a suffix of .JASS.<timestamp> is appended to the disabled file.
This example renames a file from /etc/rc2.d/S71rpc to /etc/rc2.d/_S71rpc.JASS.<timestamp>. This function automatically adds the necessary manifest entries to permit this operation to be reversed during an undo run.
Use these functions to determine if a patch is or is not applied to a system. These functions accept a single string value representing the patch number to check.
This value can be specified in one of two ways:
Use this function to create a new directory on a target system. This function accepts a single string value representing the name of the directory to create. This function uses the -p option to mkdir so that no error is reported if the target directory exists. This function automatically adds the necessary manifest entries to permit this operation to be reversed during an undo run.
Use this function to move a file from one name to another. This function requires two entries: a source file name and a destination file name. This function moves, or renames, the source file to the file name specified by the destination parameter. This function automatically adds the necessary manifest entries to permit this operation to be reversed during an undo run.
Use this function to remove Solaris OS packages from a system. The operations performed by this function are final and cannot be reversed during an undo run. The options for this function are listed in TABLE 1-6.
The pkgrm ask file name. By default, the pkgrm ask file, noask_pkgrm, is used if no other file is specified. |
|
Two types of audit functions are in the software: private and public. The functions defined in the audit_private.funcs file are private and not for public use. Never use the private scripts defined in this file. Only use the public scripts defined in the audit_public.funcs file.
The public functions define audit functions used in audit scripts, which are located in JASS_AUDIT_DIR. Functions defined in this file are public and can be freely used in both standard and custom audit scripts. Note that in many cases, the functions defined in this file are stubs that call functions defined in the audit_private.funcs file. These stubs were implemented to allow users to code their scripts to these public interfaces without needing to care if the underlying code will be modified or enhanced in newer releases.
Use these functions as part of audit scripts to assess components of the system's stored and runtime configurations. The following functions are public interfaces to the Solaris Security Toolkit software's audit framework.
When customizing or creating audit scripts, use the following functions to perform standard operations.
Use these functions to determine if a designated file has content matching a supplied search string. These functions search a designated file to match its content with a search string. The search string can be in the form of a regular expression. These functions display a 0 for success, 1 for failure, and 255 for error condition.
You can supply the following arguments to this function:
Use these functions to determine if a file exists on a target system. These functions display a status of 0 for success, 1 for failure, and 255 for any error condition.
You can supply the following arguments to this function:
Use these functions to determine if a file belongs to a group on a target system. These functions display a status of 0 for success, 1 for failure, and 255 for any error condition.
You can supply the following arguments to this function:
Use these functions to determine if a file has the permissions specified on a target system. These functions display a status of 0 for success, 1 for failure, and 255 for any error condition.
You can supply the following arguments to this function:
Use these functions to determine if a file belongs to a specific user on a target system. These functions display a status of 0 for success, 1 for failure, and 255 for any error condition.
You can supply the following arguments to this function:
Use this function to determine if a file template defined by the Solaris Security Toolkit software matches its counterpart installed on a target system. For example, if you were to use this function to check the file template /etc/motd, this function would compare the contents of JASS_FILES_DIR/etc/motd with /etc/motd to determine if they were the same. If they were identical, this function would display 0 for success, 1 for failure, or 255 for any error condition. If you specify more than one file, they all must pass to get a display code of 0.
You can supply the following arguments to this function:
Use these functions to determine if a file system object is a specific object type on a target system. These functions display a 0 for success, 1 for failure, and 255 for any error condition.
You can supply the following arguments to this function:
TABLE 1-7 lists the types detected by the software:
Use this function when a package check should only be performed on a minimized platform. This function is similar to the check_packagesNotExist function, except that its behavior is controlled by the JASS_CHECK_MINIMIZED environment variable. If a target system is not minimized, then the JASS_CHECK_MINIMIZED environment variable should be set to 0. In this case, this function does not perform any of its checks and simply displays a value of 0 with a notice indicating that a check was not run. Otherwise, this function behaves exactly as the check_packageNotExists function and displays a 0 for success, 1 for failure, and 255 for any error condition.
You can supply the following arguments to this function:
Use these functions to determine if a software package is installed on a target system. These functions display a 0 for success, 1 for failure, and 255 for any error condition.
You can supply the following arguments to this function:
Use these functions to determine if a software patch is installed on a target system. These functions display a 0 for success, 1 for failure, and 255 for any error condition.
You can supply the following arguments to this function:
Use these functions to determine if a process is running on the system with specific runtime arguments. These functions display a 0 for success, 1 for failure, and 255 for any error condition.
You can supply the following arguments to this function:
Use these functions to determine if a process is running on a target system. These functions display a 0 for success, 1 for failure, and 255 for any error condition.
You can supply the following arguments to this function:
Use these functions to determine if a service configuration file exists on a target system. These functions display a 0 for success, 1 for failure, and 255 for any error condition.
You can supply the following arguments to this function:
Use these functions to determine if a run-control start script exists on a target system. These functions display a 0 for success, 1 for failure, and 255 for any error condition.
You can supply the following arguments to this function:
Use these functions to determine if a run-control stop script exists on a target system. These functions display a 0 for success, 1 for failure, and 255 for any error condition.
You can supply the following arguments to this function:
Use this function to signal that a check script has completed all of its processing and that a score for the script must be computed. This function is typically the last entry in a check script. If you want to display a message indicating a script's termination, then pass a single string argument to this function.
Use this function to call an audit script. This function is typically the first instruction in an audit script, not including comments or variable declaration. This function defines the name of the script, displays the banners, and resets the score to 0.
You can supply the following arguments to this function:
#-------------------------------------------------------------- # Apache # # Description of Check #-------------------------------------------------------------- |
Copyright © 2004, Sun Microsystems, Inc. All Rights Reserved.