Select any two versions of this STIG to compare the individual requirements
Select any old version/release of this STIG to view the previous requirements
Determine whether the system documentation specifies limits on the number of concurrent DBMS sessions per account by type of user. If it does not, assume a limit of 10 for database administrators and 2 for all other users. The DB2 CONNECT_PROC configuration parameter allows the input of a two-part connect procedure name that will implicitly be executed every time an application connects to the database. Find the value of CONNECT_PROC by running the following command: $db2 get db cfg If the value of CONNECT_PROC is null (i.e., not set), this is a finding. If the value of CONNECT_PROC is set, run the following command to review the DDL for the connect procedure: DB2> SELECT text FROM SYSCAT.ROUTINES WHERE ROUTINENAME=<MY_CONNECT> If the connect procedure does not restrict the user sessions as per organization guidelines, this is a finding.
Create the stored procedure per organization guidelines to restrict the number of concurrent sessions using the CREATE or REPLACE procedure: DB2> CREATE or REPLACE PROCEDURE <DBINST1.MY_CONNECT> (Example below.) Update the database CONNECT_PROC parameter to set to the procedure created in previous step: $db2 update db cfg using CONNECT_PROC db2inst1.my_connect Grant execute to the public to connect the procedure. DB2> GRANT EXECUTE ON procedure <schema>.MY_CONNECT_MAIN TO PUBLIC Note: This is an example. Modify and test to comply with organization policy. CREATE OR REPLACE PROCEDURE db2inst1.my_connect_main() BEGIN DECLARE vcount integer; DECLARE vcount_admin integer; SELECT COUNT(*) INTO vcount FROM table(mon_get_connection(NULL, NULL, 0)) WHERE session_auth_id = session_user and application_handle != mon_get_application_handle(); SELECT COUNT(*) INTO vcount_admin FROM table (sysproc.auth_list_authorities_for_authid(session_user,'U')) as t WHERE authority in ('SYSMON','SYSADM','DBADM','SECADM','SYSCTRL','SYSMAINT')and (d_user='Y' OR d_group='Y' OR d_public='Y' OR role_user='Y' or role_group='Y' or role_public='Y' or d_role='Y'); IF (vcount_admin > 0 AND vcount > 5) THEN SIGNAL SQLSTATE '42502' SET MESSAGE_TEXT='Connection refused. More than 5 connections not allowed for admin!'; ELSEIF (vcount > 3 AND vcount_admin = 0) THEN SIGNAL SQLSTATE '42502' SET MESSAGE_TEXT='Connection refused. More than 3 connections not allowed!'; END IF; END @ Note: @ sign in above statement is statement terminator, using db2 –t option, statement terminator can be changed DB2> GRANT EXECUTE ON PROCEDURE db2inst1.my_connect_main TO PUBLIC $db2 UPDATE DB CFG USING CONNECT_PROC db2inst1. my_connect_main
The default name and location for the IBM LDAP security plug-in configuration file is: On UNIX/LINUX: INSTHOME/sqllib/cfg/IBMLDAPSecurity.ini On Windows: %DB2PATH%\cfg\IBMLDAPSecurity.ini If the IBMLDAPSecurity.ini file does not exist in the default location and environment variable DB2LDAPSecurityConfig is not set, this is a finding. If the environment variable DB2LDAPSecurityConfig is set and file does not exist in DB2LDAPSecurityConfig location, this is a finding. Find the value of SRVCON_PW_PLUGIN by running $db2 get dbm cfg If SRVCON_PW_PLUGIN is not set to IBMLDAPauthserver, this is a finding. Note: In Windows, find the location of base installation directory of DB2 using one of following methods 1. Find the value of DB2PATH variable using db2set –all on DB2 CLP 2. Run db2level command 3. Go to Registry Editor in Windows Computer >> HKEY_LOCAL_MACHINE >> SOFTWARE >> IBM >> DB2 >> installedCopies >> DB2COPY1 Then find the value of the DB2 Path Name
Create an IBMLDAPSecurity.ini file at the default name and location for the IBM LDAP security plug-in configuration file: On UNIX/LINUX: $INSTHOME/sqllib/cfg/IBMLDAPSecurity.ini On Windows: %DB2PATH%\cfg\IBMLDAPSecurity.ini To create the file in a non-default location, set the environment variable DB2LDAPSecurityConfig to the directory name where configuration file IBMLDAPSecurity.ini is located. Set the value of SRVCON_PW_PLUGIN to IBMLDAPauthserver for instance by running the following command: $db2 update dbm cfg using SRVCON_PW_PLUGIN IBMLDAPauthserver immediate Refer to details below to determine appropriate values in LDAP configuration file. -- SERVER-RELATED values: 1) LDAP_HOST - The name of the LDAP server(s) - This is a space separated list of LDAP server host names or IP addresses, with an optional port number for each one. For example: host1[:port1] [host2:[port2] ... The default port number is 389, or 636 if SSL is enabled. 2) ENABLE_SSL - To enable SSL support, set ENABLE_SSL to TRUE (you must have the GSKit installed). This is an optional parameter; it defaults to FALSE (no SSL support). 3) SSL_KEYFILE - The path for the SSL keyring. A keyfile is only required if your LDAP server is using a certificate that is not automatically trusted by your GSKit installation. For example: SSL_KEYFILE = /home/db2inst1/IBMLDAPSecurity.kdb 4) SSL_PW - The SSL keyring password. For example: SSL_PW = keyfile-password 5) SECURITY_PROTOCOL - To enable TLS 1.2 support, set SECURITY_PROTOCOL to TLSV12. To enable TLS 1.0, 1.1, and 1.2 support, set SECURITY_PROTOCOL to ALL. By default, SECURITY_PROTOCOL is not set. This setting means TLS 1.2 is not supported. -- USER_RELATED values: 1) USER_OBJECTCLASS - The LDAP object class used for users. Generally, set USER_OBJECTCLASS to inetOrgPerson (the user for Microsoft Active Directory) For example: USER_OBJECTCLASS = inetOrgPerson 2) USER_BASEDN - The LDAP base DN to use when searching for users. If not specified, user searches start at the root of the LDAP directory. Some LDAP servers require that you specify a value for this parameter. For example: USER_BASEDN = o=ibm 3) USERID_ATTRIBUTE - The LDAP user attribute that represents the user ID. The USERID_ATTRIBUTE attribute is combined with the USER_OBJECTCLASS and USER_BASEDN (if specified) to construct an LDAP search filter when a user issues a DB2 CONNECT statement with an unqualified user ID. For example, if USERID_ATTRIBUTE = uid, then issuing this statement: db2 connect to MYDB user bob using bobpass results in the following search filter: &(objectClass=inetOrgPerson)(uid=bob) 4) AUTHID_ATTRIBUTE - The LDAP user attribute that represents the DB2 authorization ID. Usually this is the same as the USERID_ATTRIBUTE. For example: AUTHID_ATTRIBUTE = uid -- GROUP-RELATED values: 1) GROUP_OBJECTCLASS - The LDAP object class used for groups. Generally this is groupOfNames or groupOfUniqueNames (for Microsoft Active Directory, it is group) For example: GROUP_OBJECTCLASS = groupOfNames 2) GROUP_BASEDN - The LDAP base DN to use when searching for groups If not specified, group searches start at the root of the LDAP directory. Some LDAP servers require that you specify a value for this parameter. For example: GROUP_BASEDN = o=ibm 3) GROUPNAME_ATTRIBUTE - The LDAP group attribute that represents the name of the group. For example: GROUPNAME_ATTRIBUTE = cn 4) GROUP_LOOKUP_ METHOD - Determines the method used to find the group memberships for a user. Possible values are: SEARCH_BY_DN Indicates to search for groups that list the user as a member. Membership is indicated by the group attribute defined as GROUP_LOOKUP_ATTRIBUTE (typically, member or uniqueMember). USER_ATTRIBUTE In this case, a user's groups are listed as attributes of the user object itself. This setting indicates to search for the user attribute defined as GROUP_LOOKUP_ATTRIBUTE to get the user's groups (typically memberOf for Microsoft Active Directory or ibm-allGroups for IBM Tivoli Directory Server). For example: GROUP_LOOKUP_METHOD = SEARCH_BY_DN GROUP_LOOKUP_METHOD = USER_ATTRIBUTE 5) GROUP_LOOKUP_ATTRIBUTE - Name of the attribute used to determine group membership, as described for GROUP_LOOKUP_METHOD. For example: GROUP_LOOKUP_ATTRIBUTE = member GROUP_LOOKUP_ATTRIBUTE = ibm-allGroups NESTED_GROUPS If NESTED_GROUPS is TRUE, the DB2 database manager recursively searches for group membership by attempting to look up the group memberships for every group that is found. Cycles (such as A belongs to B, and B belongs to A) are handled correctly. This parameter is optional, and defaults to FALSE. -- MISCELLANEOUS values: 1) SEARCH_DN, SEARCH_PW If your LDAP server does not support anonymous access, or if anonymous access is not sufficient when searching for users or groups, then you can optionally define a DN and password that will be used to perform searches. For example: SEARCH_DN = cn=root SEARCH_PW = rootpassword 2) DEBUG Set DEBUG to TRUE to write extra information to the db2diag log files to aid in debugging LDAP related issues. Most of the additional information is logged at DIAGLEVEL 4 (INFO). DEBUG defaults to false.
Use the following query to determine if PUBLIC has been directly granted any privileges on objects in the database: DB2> SELECT PRIVILEGE, OBJECTNAME, OBJECTSCHEMA, OBJECTTYPE FROM SYSIBMADM.PRIVILEGES WHERE AUTHID = 'PUBLIC' If any rows are returned, this is a finding. Use the following query to determine if PUBLIC has been granted membership in any database roles: DB2> SELECT ROLENAME FROM TABLE (SYSPROC.AUTH_LIST_ROLES_FOR_AUTHID ('PUBLIC', 'G') ) For each role returned by this query, determine if any privileges have been granted to it with the following query: DB2> SELECT PRIVILEGE, OBJECTNAME, OBJECTSCHEMA, OBJECTTYPE FROM SYSIBMADM.PRIVILEGES WHERE AUTHID = '<rolename>' AND AUTHIDTYPE = 'R' If any rows are returned, this is a finding. Use the following query to determine if PUBLIC has been granted any database authorities directly or indirectly through a database role: DB2> SELECT AUTHORITY, D_PUBLIC, ROLE_PUBLIC FROM TABLE(SYSPROC.AUTH_LIST_AUTHORITIES_FOR_AUTHID ('PUBLIC', 'G') ) If any of the rows have a ‘Y’ value in the D_PUBLIC column, this is a finding. If any of the rows have a ‘Y’ value in the ROLE_PUBLIC column, this is a finding.
If a privilege is granted directly to PUBLIC, revoke it using the appropriate variation of the REVOKE statement specific to the object on which the privilege is granted. For example, if PUBLIC has EXECUTE privileges are on a package X.Y, revoke them using the REVOKE (package privileges). DB2> REVOKE EXECUTE ON PACKAGE X.Y FROM PUBLIC If a privilege has been granted indirectly to PUBLIC through membership in a database role, revoke membership in that database role from PUBLIC using the REVOKE (role) statement. DB2> REVOKE ROLE <role name> FROM PUBLIC If an authority is granted directly to PUBLIC, revoke it using the appropriate variation of the REVOKE (database authorities) statement. For example, if the CONNECT row shows a ‘Y’ value in the D_PUBLIC column, revoke CONNECT authority using this statement: DB2> REVOKE CONNECT ON DATABASE FROM PUBLIC If an authority is granted indirectly to PUBLIC through a database role, revoke membership in that database role from PUBLIC using the REVOKE (role) statement. DB2> REVOKE ROLE <role name> FROM PUBLIC To determine what database roles PUBLIC belongs, issue this query: DB2> SELECT ROLENAME FROM TABLE (SYSPROC.AUTH_LIST_ROLES_FOR_AUTHID ('PUBLIC', 'G') ) Notes: To prevent the default assignment of authorities and privileges to PUBLIC when a database is created, one should use the restrictive option on the create database statement as demonstrated below: DB2> CREATE DATABASE <dbname> RESTRICTIVE One can determine if a database was created with restrictive by looking at the value of restrict_access database configuration parameter using the following command at the command prompt: $db2 get db cfg http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000981.html?cp=SSEPGG_10.5.0%2F2-12-7-181&lang=en As authorities and privileges can be granted to PUBLIC after the database is created, it is recommended to run the above checks on a regular basis.
Run the following SQL statement to ensure that an audit policy is defined upon all the required application tables and/or the database: DB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN ('T',' ') If no rows are returned, this is a finding. If a row with OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. If a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy. For each audit policy returned in the statement above, run the following SQL statement to confirm that the CONTEXT and EXECUTE categories are part of that policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, EXECUTESTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES If the database audit policy has the values for the CONTEXTSTATUS and EXECUTESTATUS columns set to 'S' (Success) or 'B' (Both) as well as the value in the ERRORTYPE column set to 'A' (Audit), this is not a finding. If the database policy does not exist or does not cover CONTEXTSTATUS or EXECUTESTATUS then check if the appropriate policies are defined for all the required application tables. If all the required application table audit policies do not have the values for the CONTEXTSTATUS and EXECUTESTATUS columns set to 'S' (Success) or 'B' (Both) as well as the value in the ERRORTYPE column set to 'A' (Audit), this is a finding.
Define the audit policy using the following Create Audit Policy SQL statement: DB2> CREATE AUDIT POLICY <audit policy name> CATEGORIES CONTEXT STATUS BOTH, EXECUTE STATUS BOTH ERROR TYPE AUDIT Apply such a policy to either the database as a whole or to the specific application tables using one of these two statements: DB2> AUDIT DATABASE USING POLICY <audit policy name> Or DB2> AUDIT TABLE <table name> USING POLICY <audit policy name> Note : While DB2 does provide basic audit capabilities, IBM highly recommends investing in and using a dedicated enterprise audit tool such as the IBM Security Guardium Data Activity Monitor in order to provide a comprehensive audit solution.
To meet these requirements, at the minimum AUDIT, CHECKING, CONTEXT, SECMAINT, SYSADMIN, and VALIDATE category auditing need to be implemented at the database level. Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Using the AUDITPOLICYID from the query above find the details of the audit policy. DB2> SELECT AUDITPOLICYNAME, AUDITSTATUS, CHECKINGSTATUS, CONTEXTSTATUS, SECMAINTSTATUS, SYSADMINSTATUS, VALIDATESTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for AUDITSTATUS, CHECKINGSTATUS, CONTEXTSTATUS, SECMAINTSTATUS, SYSMADMINSTATUS and VALIDATESTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Define an audit policy using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES AUDIT STATUS BOTH, SYSADMIN STATUS BOTH, SECMAINT STATUS BOTH, VALIDATE STATUS BOTH, CHECKING STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
Run the following command to find the value of the SYSADM_GROUP parameter: $db2 get dbm cfg Only users approved by the ISSM should be part of the SYSADM_GROUP. If non-ISSM authorized users are part of SYSADM_GROUP group, this is a finding. On Windows systems, if the SYSADM_GROUP database manager configuration parameter is not specified, this is a finding. Database level audit The security administrator (who holds SECADM authority within a database) can define audit policies and control the audit requirements for an individual database. The security administrator can use the following audit routines to operate upon the database audit logs: - The SYSPROC.AUDIT_ARCHIVE stored procedure archives audit logs. - The SYSPROC.AUDIT_LIST_LOGS table function allows you to locate logs of interest. - The SYSPROC.AUDIT_DELIM_EXTRACT stored procedure extracts data into delimited files for analysis. The security administrator can also grant EXECUTE privilege on these routines to another user. Run the following query to find out which users have SECADM authority in database: DB2> SELECT CHAR(GRANTOR,35) AS GRANTOR, CHAR(GRANTEE,35) AS GRANTEE, GRANTEETYPE FROM SYSCAT.DBAUTH WHERE SECURITYADMAUTH='Y' If GRANTEETYPE is 'U' and the authorization ID is not an ISSM authorized user, this is a finding. If the GRANTEETYPE is 'G', then all members of the external group identified by GRANTEE must be ISSM authorized users, otherwise this is a finding. If the GRANTEETYPE is 'R', then all members of the database role identified by GRANTEE must be ISSM authorized users, otherwise this is a finding. The members of a role can be found using this statement: DB2> SELECT CHAR(GRANTOR,35) AS GRANTOR, CHAR(GRANTEE,35) AS GRANTEE, GRANTEETYPE FROM SYSCAT.ROLEAUTH WHERE ROLENAME= <search role name> Run the following query to find out which users have execute privilege on SYSPROC.AUDIT_ARCHIVE, SYSPROC.AUDIT_LIST_LOGS, SYSPROC.AUDIT_DELIM_EXTRACT: DB2> SELECT * FROM SYSCAT.ROUTINEAUTH WHERE SPECIFICNAME LIKE 'AUDIT%' AND SCHEMA='SYSPROC' If non-ISSM authorized users have execute privilege on any of above three routines, this is a finding.
Update the value SYSADM_GROUP to a group which has only members approved by the ISSM using the following command: $db2 update dbm cfg using SYSADM_GROUP <SYSADMIN GROUP> Remove users not approved by ISSM from SYSADM_GROUP group using operating system tools/commands. Revoke SECADM authority from non-ISSM users using the SQL statement: DB2> REVOKE SECADM ON DATABASE FROM USER <user name> Remove non-ISSM members using the following the following SQL statement: DB2> REVOKE SECADM ON DATABASE FROM GROUP <group name> Revoke SECADM from the group or role using the following SQL statement: DB2> REVOKE SECADM ON DATABASE FROM ROLE <role name> Revoke execute from unapproved users if they have execute on SYSPROC.AUDIT_ARCHIVE, SYSPROC.AUDIT_LIST_LOGS, SYSPROC.AUDIT_DELIM_EXTRACT using appropriate variation of Revoke (routine privileges) statement. Note: The audit facility provides the ability to audit at both the instance and the individual database level, independently recording all instance and database level activities with separate logs for each instance level audit. The system administrator (who holds SYSADM authority) can use the db2audit tool to configure audit at the instance level as well as to control when such audit information is collected. The system administrator can use the db2audit tool to archive both instance and database audit logs as well as to extract audit data from archived logs of either type. SYSADM authority is assigned to the group specified by the SYSADM_GROUP configuration parameter. Membership in that group is controlled outside the database manager through the security facility used on your platform.
To monitor who/what is reading the privilege/permission/role information from catalog tables a minimum audit set of CONTEXT and EXECUTE (with data) categories on the following catalog tables are required: SYSIBM.SYSINDEXAUTH SYSIBM.SYSPLANAUTH SYSIBM.SYSPASSTHRUAUTH SYSIBM.SYSROUTINEAUTH SYSIBM.SYSSCHEMAAUTH SYSIBM.SYSSECURITYLABELACCESS SYSIBM.SYSSECURITYPOLICYEXEMPTIONS SYSIBM.SYSSEQUENCEAUTH SYSIBM.SYSSURROGATEAUTHIDS SYSIBM.SYSTABAUTH SYSIBM.SYSTBSPACEAUTH SYSIBM.SYSXSROBJECTAUTH SYSIBM.SYSCOLAUTH SYSIBM.SYSLIBRARYAUTH SYSIBM.SYSMODULEAUTH SYSIBM.SYSROLEAUTH SYSIBM.SYSVARIABLEAUTH SYSIBM.SYSWORKLOADAUTH SYSIBM.SYSDBAUTH SYSIBM.SYSUSERAUTH Run the following SQL statement to ensure that an audit policy is defined upon the above catalog tables and/or the database: DB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN ('T',' ') If no rows are returned, this is a finding. If a row with the OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. If a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy. For each audit policy returned in the statement above, run the following SQL statement to confirm that the CONTEXT and EXECUTE categories are part of that policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, EXECUTESTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES If the values for CONTEXTSTATUS and EXECUTESTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding. If a database policy does not exist or does not cover CONTEXTSTATUS or EXECUTESTATUS then check if the appropriate policies are defined for all the required tables listed above. If audit policies for the required tables do not have the values for the CONTEXTSTATUS and EXECUTESTATUS columns set to 'S' (Success) or 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Define the audit policy using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY CATALOGAUDIT CATEGORIES CONTEXT STATUS BOTH, EXECUTE STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, apply the correct audit policy to either the database as a whole or to the specific catalog tables using one of these two statements: DB2> AUDIT DATABASE USING POLICY CATALOGAUDIT Or DB2> AUDIT TABLE <table name> USING POLICY CATALOGAUDIT Note: The Database level policy in the Check category, covered in SRG-DB2X-00-000600, generates audit events of successful/unsuccessful read attempts on views based on these catalog tables.
To monitor who/what is reading the privilege/permission/role information from catalog tables a minimum audit set of CONTEXT and EXECUTE (with data) categories on the following catalog tables are required: SYSIBM.SYSINDEXAUTH SYSIBM.SYSPLANAUTH SYSIBM.SYSPASSTHRUAUTH SYSIBM.SYSROUTINEAUTH SYSIBM.SYSSCHEMAAUTH SYSIBM.SYSSECURITYLABELACCESS SYSIBM.SYSSECURITYPOLICYEXEMPTIONS SYSIBM.SYSSEQUENCEAUTH SYSIBM.SYSSURROGATEAUTHIDS SYSIBM.SYSTABAUTH SYSIBM.SYSTBSPACEAUTH SYSIBM.SYSXSROBJECTAUTH SYSIBM.SYSCOLAUTH SYSIBM.SYSLIBRARYAUTH SYSIBM.SYSMODULEAUTH SYSIBM.SYSROLEAUTH SYSIBM.SYSVARIABLEAUTH SYSIBM.SYSWORKLOADAUTH SYSIBM.SYSDBAUTH SYSIBM.SYSUSERAUTH Run the following SQL statement to ensure that an audit policy is defined upon the above catalog tables and/or the database: DB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN ('T',' ') If no rows are returned, this is a finding. If a row with the OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. If a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy. For each audit policy returned in the statement above, run the following SQL statement to confirm that the CONTEXT and EXECUTE categories are part of that policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, EXECUTESTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES If the values for CONTEXTSTATUS and EXECUTESTATUS in the database audit policy are not 'F' (Failure) or 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding. If a database policy does not exist or does not cover CONTEXTSTATUS or EXECUTESTATUS then check if the appropriate policies are defined for all the required tables listed above. If audit policies for the required tables do not have the values for the CONTEXTSTATUS and EXECUTESTATUS columns set to 'F' (Failure) or 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Define an audit policy using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <audit policy name> CATEGORIES CONTEXT STATUS BOTH, EXECUTE STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, apply the correct audit policy to either the database as a whole or to the specific catalog tables using one of these two statements: DB2> AUDIT DATABASE USING POLICY <audit policy name> Or DB2> AUDIT TABLE <table name> USING POLICY <audit policy name> Note: the Database level policy in the Check covered in SRG-APP-DB2X-00-000600, generates audit events of successful/unsuccessful read attempts on views based on these catalog tables.
Determine whether there are any individuals for whom the organization requires session auditing. If there are none, this is not a finding. Type in the following command to check whether or not the user under investigation is being audited: DB2> SELECT AUDITPOLICYNAME, OBJECTNAME, OBJECTTYPE FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN ('i',' ') If no rows are returned, this is a finding. If a row with the OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. If a row with the OBJECTTYPE of 'i' exists in the output, it is a user level policy. For each audit policy returned in the statement above, run the following SQL statement to confirm that all categories are part of that policy: DB2> SELECT * FROM SYSCAT.AUDITPOLICIES If there is an audit policy defined at the database level with the values for the all the audit category columns set to 'B' (Both) and the value in the ERRORTYPE column set to 'A' (Audit), EXECUTEWITHDATA to 'Y' this is not a finding. If the database policy does not exist or does not cover all the categories with ERRORTYPE column set to 'A' (Audit), EXECUTEWITHDATA to 'Y' then check if the appropriate policies are defined for all the required users. If the audit policy is defined on the users under investigation and does not have the values for all the audit category columns set to 'B' (Both) and the value in the ERRORTYPE column set to 'A' (Audit), EXECUTEWITHDATA to 'Y', this is a finding.
Define an audit policy using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <user audit policy name> CATEGORIES AUDIT STATUS BOTH, CHECKING STATUS BOTH, CONTEXT STATUS BOTH, EXECUTE WITH DATA STATUS BOTH, OBJMAINT STATUS BOTH, SECMAINT STATUS BOTH, SYSADMIN STATUS BOTH, VALIDATE STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, apply the correct audit policy to either the database as a whole or to the specific user using one of these two statements: DB2> AUDIT DATABASE USING POLICY <user audit policy name> Or DB2> AUDIT USER <user name> USING POLICY <user audit policy name> Note: This requirement is to audit suspicious user activity. For a targeted session activity use the AUDIT USER command after the policy has been created. For a general database level use the AUDIT DATABASE command.
Run the following SQL statement to confirm that all audit policies are created with STATUS='B': DB2> SELECT * FROM SYSCAT.AUDITPOLICIES If any audit policy does not have the values for all the audit category columns set to 'B' (Both) and the value in the ERRORTYPE column set to 'A' (Audit), EXECUTEWITHDATA to 'Y' for Execute category audit policies, this is a finding.
Drop and recreate the policy with STATUS set to ""Both"" or use ALTER POLICY to set the STATUS='B'. To drop and recreate a policy use following statements: DB2> DROP AUDIT POLICY <audit1> DB2> CREATE AUDIT POLICY <audit1> CATEGORIES < audit categories > STATUS BOTH ERROR TYPE AUDIT To alter the audit policy: DB2> ALTER AUDIT POLICY <audit1> CATEGORIES < audit categories > STATUS BOTH ERROR TYPE AUDIT Notes: Each audit record has an Event Status represented by a SQLCODE where Successful event > = 0 Failed event < 0. To generate a record for both success and failed events, all the audit policies should be created with STATUS 'BOTH'. CREATE AUDIT POLICY information: http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0050607.html?lang=en ALTER AUDIT POLICY information: http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0050608.html?cp=SSEPGG_10.5.0%2F2-12-7-7&lang=en"
Check with the ISSO if any more of the organization-defined information needs to be captured as part of DBMS auditing. If there is additional information that needs to be captured and is currently not being written to audit logs, this is a finding.
Configure the application to write the organization-defined information to a database table. Set the auditing for the database table capturing the organization-defined information so that it is written to the database audit. Define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <table audit policy name> CATEGORIES CONTEXT STATUS BOTH, EXECUTE STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, apply the policy created to the database: DB2> AUDIT TABLE <org info table> using <audit policy name>
Ask the ISSO whether the system should stay available or stop processing the auditable events. If the system needs to stay available and the Error Type is set to 'A' for the policies then this is not applicable (NA). Run the following SQL statement to find the Error type value for all audit policies: DB2> SELECT * FROM SYSCAT.AUDITPOLICIES If the system needs to stop processing the auditable events and Error Type is not set to 'A' then this is a finding.
Drop and recreate the policy with ERROR TYPE as required by the ISSO or run the ALTER AUDIT POLICY command to set the ERROR TYPE as per ISSO requirement. Run the following command to drop and recreate the policy: DB2> DROP AUDIT POLICY <audit2> DB2> CREATE AUDIT POLICY <audit2> CATEGORIES EXECUTE WITH DATA STATUS BOTH ERROR TYPE AUDIT To alter the audit policy: DB2> ALTER AUDIT POLICY <audit2> CATEGORIES EXECUTE WITH DATA STATUS BOTH ERROR TYPE AUDIT
Run db2audit command to find the value of datapath where the audit logs are stored. $db2audit describe Only the instance owner needs write access to directory and users authorized to archive the audit logs need to have read access to audit directory. If any user other than the instance owner has write access to audit directory, this is a finding. If any user other than the users authorized to read audit log files have read access to audit directory, this is a finding.
Remove the write permission from non-instance owner users on the audit directory. Remove the read permission from non-authorized users from audit directory. Only the instance owner needs write access to directory and users authorized to archive the audit logs need to have read access to audit directory. Change the permissions on audit datapath and archivepath directories so that only the instance owner has write access on datapath and users with audit archive privileges have read access on datapath. Only users with SYSADM and SECADM privileges and can extract and archive the audit logs.
Run the db2audit command to find the value of the datapath where the audit logs are stored. $db2audit describe Only the instance owner needs write access to directory and users authorized to archive the audit logs need to have read access to the audit directory. If any user other than the instance owner has write access to the audit directory, this is a finding. If any user other than the users authorized to read audit log files have read access to audit directory, this is a finding.
At the operating system level, remove the write permission from non-instance owner users on the audit directory. At the operating system level, remove the read permission from non-authorized users on the audit directory.
Run the db2audit command to find the value of the datapath where the audit logs are stored. $db2audit describe Only the instance owner needs write access to directory and users authorized to archive the audit logs need to have read access to the audit directory. If any user other than the instance owner has write access to audit directory, this is a finding. If any user other than the users authorized to read audit log files have read access to the audit directory, this is a finding.
At the operating system level, remove the write permission from non-instance owner users on the audit directory. At the operating system level, remove the read permission from non-authorized users on the audit directory.
Run the following command to find the value of the SYSADM_GROUP parameter: $db2 get dbm cfg Only authorized OS users should be part of this group. If non-authorized users are part of SYSADM_GROUP group, this is a finding. On Windows systems, if the SYSADM_GROUP database manager configuration parameter is not specified, this is a finding. Security administrator (who holds SECADM authority within a database) can define audit policies and control the audit requirements for an individual database. The security administrator can use the following audit routines to operate upon the database audit logs: - The SYSPROC.AUDIT_ARCHIVE stored procedure archives audit logs. - The SYSPROC.AUDIT_LIST_LOGS table function allows you to locate logs of interest. - The SYSPROC.AUDIT_DELIM_EXTRACT stored procedure extracts data into delimited files for analysis. The security administrator can also grant EXECUTE privilege on these routines to another user. Run the following query to find out which users have SECADM authority in database: DB2> SELECT CHAR(GRANTOR,35) AS GRANTOR, CHAR(GRANTEE,35) AS GRANTEE, GRANTEETYPE FROM SYSCAT.DBAUTH WHERE SECURITYADMAUTH='Y' If GRANTEETYPE is 'U' and the authorization ID is not an authorized user, this is a finding. If the GRANTEETYPE is 'G', then all members of the external group identified by GRANTEE must be authorized users. Otherwise, this is a finding. If the GRANTEETYPE is 'R', then all members of the database role identified by GRANTEE must be authorized users. Otherwise, this is a finding. The members of a role can be found using this statement: DB2> SELECT CHAR(GRANTOR,35) AS GRANTOR, CHAR(GRANTEE,35) AS GRANTEE, GRANTEETYPE FROM SYSCAT.ROLEAUTH WHERE ROLENAME= <search role name> Run the following query to find out which users have execute privilege on SYSPROC.AUDIT_ARCHIVE, SYSPROC.AUDIT_LIST_LOGS, SYSPROC.AUDIT_DELIM_EXTRACT: DB2> SELECT * FROM SYSCAT.ROUTINEAUTH WHERE SPECIFICNAME LIKE 'AUDIT%' AND SCHEMA='SYSPROC' If non-authorized users have EXECUTE privilege on any of the above three routines, this is a finding.
Update the value SYSADM_GROUP to a group which has only members approved by ISSM using following command: $db2 update dbm cfg using SYSADM_GROUP <SYSADMIN GROUP> Remove unauthorized users from the SYSADM_GROUP using the operating system tools/commands. Revoke SECADM authority from non-authorized users using the SQL statement below: DB2> REVOKE SECADM ON DATABASE FROM USER <user name> Remove non-authorized members or revoke SECADM from the group or role using this SQL statement: DB2> REVOKE SECADM ON DATABASE FROM GROUP <group name> DB2> REVOKE SECADM ON DATABASE FROM ROLE <role name> Revoke execute from non-authorized users if they have execute on SYSPROC.AUDIT_ARCHIVE, SYSPROC.AUDIT_LIST_LOGS, SYSPROC.AUDIT_DELIM_EXTRACT using the appropriate variation of the Revoke (routine privileges) statement.
Run the following command to find the value of the SYSADM_GROUP parameter: $db2 get dbm cfg Only authorized OS users should be part of this group. If non-authorized users are part of SYSADM_GROUP group, this is a finding. On Windows systems, if the SYSADM_GROUP database manager configuration parameter is not specified, this is a finding. The security administrator (who holds SECADM authority within a database) can define audit policies and control the audit requirements for an individual database. The security administrator can use the following audit routines to operate upon the database audit logs: - The SYSPROC.AUDIT_ARCHIVE stored procedure archives audit logs. - The SYSPROC.AUDIT_LIST_LOGS table function allows you to locate logs of interest. - The SYSPROC.AUDIT_DELIM_EXTRACT stored procedure extracts data into delimited files for analysis. The security administrator can also grant EXECUTE privilege on these routines to another user. Run the following query to find out which users have SECADM authority in the database: DB2> SELECT CHAR(GRANTOR,35) AS GRANTOR, CHAR(GRANTEE,35) AS GRANTEE, GRANTEETYPE FROM SYSCAT.DBAUTH WHERE SECURITYADMAUTH='Y' If GRANTEETYPE is 'U' and the authorization ID is not an authorized user, this is a finding. If the GRANTEETYPE is 'G', then all members of the external group identified by GRANTEE must be authorized users; otherwise, this is a finding. If the GRANTEETYPE is 'R', then all members of the database role identified by GRANTEE must be authorized users; otherwise, this is a finding. The members of a role can be found using this statement: DB2> SELECT CHAR(GRANTOR,35) AS GRANTOR, CHAR(GRANTEE,35) AS GRANTEE, GRANTEETYPE FROM SYSCAT.ROLEAUTH WHERE ROLENAME= <search role name> Run the following query to find out which users have execute privilege on SYSPROC.AUDIT_ARCHIVE, SYSPROC.AUDIT_LIST_LOGS, SYSPROC.AUDIT_DELIM_EXTRACT: DB2> SELECT * FROM SYSCAT.ROUTINEAUTH WHERE SPECIFICNAME LIKE 'AUDIT%' AND SCHEMA='SYSPROC' If non-authorized users have EXECUTE privilege on any of the above three routines, this is a finding.
Update the value of SYSADM_GROUP to a group which has only authorized members. $db2 update dbm cfg using SYSADM_GROUP <SYSADMIN GROUP> Remove unauthorized users from the SYSADM_GROUP using the operating system tools/commands. Revoke SECADM authority from non-authorized users using the SQL statement below: DB2> REVOKE SECADM ON DATABASE FROM USER <user name> Remove non-authorized members or revokes SECADM from the group or role using this SQL statement: DB2> REVOKE SECADM ON DATABASE FROM GROUP <group name> DB2> REVOKE SECADM ON DATABASE FROM ROLE <role name> Revoke execute from non-authorized users if they have execute on SYSPROC.AUDIT_ARCHIVE, SYSPROC.AUDIT_LIST_LOGS, SYSPROC.AUDIT_DELIM_EXTRACT using the appropriate variation of the Revoke (routine privileges) statement.
Run the following command to find the value of the SYSADM_GROUP parameter: $db2 get dbm cfg Only authorized OS users should be part of this group. If non-authorized users are part of the SYSADM_GROUP group, this is a finding. On Windows systems, if the SYSADM_GROUP database manager configuration parameter is not specified, this is a finding. The security administrator (who holds SECADM authority within a database) can define audit policies and control the audit requirements for an individual database. The security administrator can use the following audit routines to operate upon the database audit logs: - The SYSPROC.AUDIT_ARCHIVE stored procedure archives audit logs. - The SYSPROC.AUDIT_LIST_LOGS table function allows you to locate logs of interest. - The SYSPROC.AUDIT_DELIM_EXTRACT stored procedure extracts data into delimited files for analysis. The security administrator can also grant EXECUTE privilege on these routines to another user. Run the following query to find out which users have SECADM authority in database: DB2> SELECT CHAR(GRANTOR,35) AS GRANTOR, CHAR(GRANTEE,35) AS GRANTEE, GRANTEETYPE FROM SYSCAT.DBAUTH WHERE SECURITYADMAUTH='Y' If GRANTEETYPE is 'U' and the authorization ID is not an authorized user, this is a finding. If the GRANTEETYPE is 'G', then all members of the external group identified by GRANTEE must be authorized users, otherwise, this is a finding. If the GRANTEETYPE is 'R', then all members of the database role identified by GRANTEE must be authorized users, otherwise, this is a finding. The members of a role can be found using this statement: DB2> SELECT CHAR(GRANTOR,35) AS GRANTOR, CHAR(GRANTEE,35) AS GRANTEE, GRANTEETYPE FROM SYSCAT.ROLEAUTH WHERE ROLENAME= <search role name> Run the following query to find out which users have execute privilege on SYSPROC.AUDIT_ARCHIVE, SYSPROC.AUDIT_LIST_LOGS, SYSPROC.AUDIT_DELIM_EXTRACT: DB2> SELECT * FROM SYSCAT.ROUTINEAUTH WHERE SPECIFICNAME LIKE 'AUDIT%' AND SCHEMA='SYSPROC' If non-authorized users have EXECUTE privilege on any of above three routines, this is a finding.
Update the value of SYSADM_GROUP to a group which has only authorized members. $db2 update dbm cfg using SYSADM_GROUP <SYSADMIN GROUP> Remove unauthorized users from the SYSADM_GROUP using the operating system tools/commands. Revoke SECADM authority from non-authorized users using the SQL statement below: DB2> REVOKE SECADM ON DATABASE FROM USER <user name> Remove non-authorized members or revokes SECADM from the group or role using this SQL statement: DB2> REVOKE SECADM ON DATABASE FROM GROUP <group name> DB2> REVOKE SECADM ON DATABASE FROM ROLE <role name> Revoke execute from non-authorized users if they have execute on SYSPROC.AUDIT_ARCHIVE, SYSPROC.AUDIT_LIST_LOGS, SYSPROC.AUDIT_DELIM_EXTRACT using the appropriate variation of Revoke (routine privileges) statement.
Use the following query to find who has privileges to alter, drop, and create objects in the schemas: DB2> SELECT * FROM SYSCAT.SCHEMAAUTH If non-authorized users have privileges to create, alter, or drop objects, this is a finding.
Use the appropriate variation of REVOKE (schema privileges) statement to remove the privileges from unauthorized users/roles/groups: DB2> REVOKE <ALTERIN/CREATEIN/DROPIN> ON SCHEMA <schema-name> FROM <USER/GROUP/PUBLIC/ROLE> For more on this topic, see the Help page on "REVOKE (schema privileges) statement": http://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000988.html
Run the db2level command to find the installation directory of DB2 server software: $db2level If any user other than the sysadmin and root users has write permission on these directories and subsequent subdirectories under this directory, this is a finding. On Linux and UNIX operating systems, the instance directory is located in the $INSTHOME/sqllib directory, where $INSTHOME is the home directory of the instance owner. On Windows operating systems, the instance directory is located under the /sqllib directory where the DB2 database product was installed. If any user other than the instance owner and the root user has write permission to instance home directory and subsequent subdirectories under it, this is a finding.
Remove the write permission from non-root, non-sysadmin users on the DB2 installation base directory and instance home directory.
Review procedures for controlling, granting access to, and tracking use of the DBMS software installation account. If access or use of this account is not restricted to the minimum number of personnel required or if unauthorized access to the account has been granted, this is a finding.
Develop, document, and implement procedures to restrict and track use of the DBMS software installation account.
The base installation directory of the database server software and the instance home directory location is configurable at the time of installation. Run the db2ls command to find the installation directory of DB2 server software. The environment variable INSTHOME points to instance home directory. If there are non-DB2-related files in the instance home directory and the subsequent subdirectories under it, this is a finding. If there are non-DB2-related files in the DB2 install directory and the subsequent subdirectories under it, this is a finding.
Remove the non-DB2 software from instance home directory and subdirectories. Remove the non-DB2 software from DB2 installation directories and subdirectories.
Get the list of authorized owners from ISSO or DBA. Use the following catalog views/queries to find the ownership of the various database objects: Select libname,owner from syscat.libraries Select modulename,owner from syscat.modules Select tabname,owner from syscat.nicknames Select pkgname,owner from syscat.packages Select routinename,owner from syscat.routines Select seqname,owner from syscat.sequences Select constname,owner from syscat.tabconst Select tabname,owner from syscat.tables Select tbspace,owner from syscat.tablespaces Select trigname,owner from syscat.triggers If any owner is not in the ISSO/DBA provided list, this is a finding.
Use the list identified in check. Drop and create the objects as necessary with the correct ownership. DB2> DROP DB2> CREATE Note: For additional information regarding the DROP statement, select the following link: http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000945.html?lang=en
Get the list of qualified and authorized owners from ISSO or DBA. The following view list information about privileges held by the users, the identities of users granting privileges, and the object ownership: DB2> SELECT * FROM SYSIBMADM.PRIVILEGES If any of the privileges is held by non-qualified and non-authorized individuals, this is a finding.
Use the appropriate variation of the REVOKE command to revoke the privileges from non-qualified and non-authorized individuals: DB2> REVOKE Notes: Information about each database is automatically maintained in a set of views called the system catalog which is created when the database is created. This system catalog describes tables, columns, indexes, programs, privileges, and other objects. information on the system catalog is available in the IBM knowledge base: http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/c0005478.html?lang=en http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/c0005817.html
Use the list db directory to see if the SAMPLE database exists. $db2 list db directory If the SAMPLE database exists, this is a finding.
Run the following command to DROP the SAMPLE database: $db2 drop database sample
On UNIX/LINUX, run the db2ls command to find all install paths of DB2 on the system: $db2ls Run the db2ls command to find installed features of database on install paths: $db2ls -q -b <db2 install path> If there are installed features which are not required by the mission objectives and are non-essential, this is a finding. On Windows, go to Registry Editor in Windows. Then select Computer >> HKEY_LOCAL_MACHINE >> SOFTWARE >> IBM >> DB2 >> COMPONENTS If there are installed features which are not required by the mission objectives and are non-essential, this is a finding. Example: db2ls -q -b /opt/ibm/db2/V10.5 Install Path : /opt/ibm/db2/V10.5 Feature Response File ID Level Fix Pack Feature Description ---------------------------------------------------------------------------------------------------- BASE_CLIENT 10.5.0.7 7 Base client support JAVA_SUPPORT 10.5.0.7 7 Java support SQL_PROCEDURES 10.5.0.7 7 SQL procedures BASE_DB2_ENGINE 10.5.0.7 7 Base server support CONNECT_SUPPORT 10.5.0.7 7 Connect support DB2_DATA_SOURCE_SUPPORT 10.5.0.7 7 DB2 data source support SPATIAL_EXTENDER_SERVER_SUPPORT 10.5.0.7 7 Spatial Extender server support JDK 10.5.0.7 7 IBM Software Development Kit (SDK) for Java(TM) LDAP_EXPLOITATION 10.5.0.7 7 DB2 LDAP support INSTANCE_SETUP_SUPPORT 10.5.0.7 7 DB2 Instance Setup wizard ACS 10.5.0.7 7 Integrated Flash Copy Support SPATIAL_EXTENDER_CLIENT_SUPPORT 10.5.0.7 7 Spatial Extender client COMMUNICATION_SUPPORT_TCPIP 10.5.0.7 7 Communication support - TCP/IP APPLICATION_DEVELOPMENT_TOOLS 10.5.0.7 7 Base application development tools DB2_UPDATE_SERVICE 10.5.0.7 7 DB2 Update Service REPL_CLIENT 10.5.0.7 7 Replication tools TEXT_SEARCH 10.5.0.7 7 DB2 Text Search INFORMIX_DATA_SOURCE_SUPPORT 10.5.0.7 7 Informix data source support ORACLE_DATA_SOURCE_SUPPORT 10.5.0.7 7 Oracle data source support FIRST_STEPS 10.5.0.7 7 First Steps GUARDIUM_INST_MNGR_CLIENT 10.5.0.7 7 Guardium Installation Manager Client
On UNIX/Linux, run the following db2_deinstall command to remove the non-essential features: $db2_deinstall –F <feature> Note: The db2_deinstall command is located at DB2DIR/install, where DB2DIR is the location where the current version of the DB2 database product is installed. (If uncertain of the value to provide for DB2DIR, find it using the db2level command. On Windows, run the db2unins command to remove one or more db2 product, feature or languages. >>-db2unins –p product (to remove db2 product) or >>-db2unins –u response-file (to remove db2 product, feature or languages.) Note: Use the following URL to access the knowledgebase documentation on the db2_deinstall command: http://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0023670.html Use the following URL to access the knowledgebase documentation on the db2unins command: http://www-01.ibm.com/support/knowledgecenter/SSEPGGman db2__10.5.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0023371.html?lang=en
Review the system security plan. Determine what DB2 features are recognized as requiring specific access controls. Determine which roles are authorized to use and which may not use the designated features. Review the permissions granted in the database. If any role is permitted to use any feature not designated as authorized, this is a finding.
Use the appropriate version of the REVOKE command to remove unauthorized access to the designated features.
Use the following SQL Query to find external routines: DB2> SELECT ROUTINENAME FROM SYSCAT.ROUTINES WHERE ORIGIN='E' Use the following command to find out which user has privileges to run the external routines found with last query. DB2> SELECT GRANTEE FROM SYSCAT.ROUTINEAUTH If non-essential routines exist outside the database, this is a finding. If non-authorized users have privileges on external routines, this is a finding.
Drop the external routines if these are non-essential for mission objective. DB2> DROP FUNCTION <name> Revoke execute privileges from non-authorized users on external routines. DB2> REVOKE EXECUTE ON FUNCTION <FUNCTION1> FROM <USER1> Note: Select the following link for the knowledgebase information on the DROP statement: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000945.html?cp=SSEPGG_10.5.0%2F2-12-7-129&lang=en
Find out the communication protocol used by running the following command: $db2set DB2COMM If DB2 is not set to SSL, this is a finding. Run the following command to find the service names/port numbers used by the database manager: $db2 get dbm cfg Find the port numbers used by the TCP/IP and SSL services used by database manager (SVCNAME, SSL_SVCENAME) or match the service name in services file to find port numbers. Default Location for services file Windows Service File: %SystemRoot%\system32\drivers\etc\services UNIX Services File: /etc/services If ports used by the database manager are nonapproved or deemed unsafe, this is a finding.
Run the following command to set the value of the DB2COMM parameter to the organization-approved communication protocol: $db2set DB2COMM=TCPIP,SSL Set the SSL version: $db2 update DBM CFG using SSL_VERSIONS TLSV12 The database manager can be set to a service name or an organization-approved port number directly for the SVCENAME parameter. Use the following command to change the database manager configuration: $db2 update dbm cfg using svcename <svcename> Or $db2 update dbm cfg using svcename <port number> Note: Configuring Secure Sockets Layer (SSL) support in a DB2 instance: https://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0025241.html
Run the following command to find the value of the authentication parameter: $db2 get dbm cfg If the AUTHENTICATION parameter is not set to SERVER_ENCRYPT, this is a finding. Run the following command to find the value of the registry variable DB2AUTH: $db2set -all If the value of DB2AUTH is not set to JCC_ENFORCE_SECMEC, or DB2AUTH is not set (i.e. a row is not returned for DB2AUTH from the above command), this is a finding.
Run the following command to set the value of the authentication encryption to SERVER_ENCRYPT: $db2 update dbm cfg using authentication server_encrypt Run the following db2set command to set the value of DB2AUTH to JCC_ENFORCE_SECMEC: $db2set DB2AUTH=JCC_ENFORCE_SECMEC Note: It is recommended to set the ALTERNATE_AUTH_ENC database manager configuration parameter to AES_ONLY to require that AES encryption be used.
Determine whether any applications that access the database allow for entry of the account name and password, or PIN. If any do, determine whether these applications obfuscate authentication data; if they do not, this is a finding.
Configure or modify applications to prohibit display of passwords in clear text.
For the "db2" command, which cannot be configured not to accept a plain-text password, and any other essential tool with the same limitation, verify that the system documentation explains the need for the tool, who uses it, and any relevant mitigations; and that AO approval has been obtained; if not, this is a finding. Request evidence that all users of the tool are trained in the importance of not using the plain-text password option and in how to keep the password hidden; and that they adhere to this practice. If not, this is a finding.
For the "db2" command, which cannot be configured not to accept a plain-text password, and any other essential tool with the same limitation: 1) Document the need for it, who uses it, and any relevant mitigations, and obtain AO approval. 2) Train all users of the tool in the importance of not using the plain-text password option and in how to keep the password hidden.
If it has been determined that encryption is not required, this is not a finding. Review the cryptographic configuration. If SSL/TLS is not specified for encryption of communications, this is a finding. See below for more detailed instructions. If IBM Database Native Encryption is not specified for encryption of data at rest, this is a finding. See below for more detailed instructions. To Verify SSL is in use: Check the DB2 registry variable DB2COMM to include SSL. $db2set -all If DB2COMM does not include SSL, this is a finding. Find the value of SSL_VERSIONS by running: $db2 get dbm cfg If SSL_VERSIONS is not set to TLSV12, this is a finding. Find the value of SSL_CIPHERSPECS by running: $db2 get dbm cfg If SSL_CIPHERSPECS is not set to a symmetric algorithm key length that is greater than or equal to 112, this is a finding. Find the value of SSL_SVC_LABEL by running: $db2 get dbm cfg If the parameter SSL_SVC_LABEL is not set to a certificate with RSA key length that is greater than or equal to 2048, this is a finding. If the certificate does not have a digital signature with minimum SHA2, this is a finding. The above settings ensure that all connections over SSL in any CLP or Java application strictly adhere to NIST SP 800-131A. To Verify DB2 native encryption is being used, run the following SQL Query: DB2> SELECT SUBSTR(object_name,1,8) AS NAME, SUBSTR(object_type,1,8) TYPE, SUBSTR(algorithm,1,8) ALGORITHM FROM TABLE(sysproc.admin_get_encryption_info()) If value of Algorithm is NULL for the database, this is a finding. If the database is not encrypted with native encryption or any third-party tool, this is a finding.
Modify the cryptographic configuration to employ SSL/TLS for encryption of communications. Modify the cryptographic configuration to employ IBM Database Native Encryption for encryption of data at rest.
Run the following command to find the privileged groups and get the value of SYSADM_GROUP, SYSCTRL_GROUP, SYSMAINT_GROUP, SYSMON_GROUP: $db2 get dbm cfg If general users are part of any of above groups, this is a finding. On Windows systems, if the SYSADM_GROUP database manager configuration parameter is not specified, this is a finding. Note: On UNIX to find the members of a group from the following two files or system admin utilities provided by LINUX/UNIX vendors. /etc/passwd /etc/group e.g. if value of SYSADM_GROUP is DB2IADM1 From operating system files find out who is member of DB2IADM1 ON WINDOWS You can use lusrmgr.msc or any other OS utility to manage user group memberships.
Remove general users from the privileged groups, SYSADM_GROUP, SYSCTRL_GROUP, SYSMAINT_GROUP, SYSMON_GROUP using OS utilities/interface. On Windows systems, set the SYSADM_GROUP database manager configuration parameter to the appropriate value.
Ensure DB2 is using the SSL communication protocol: Run the following command to find the value of the network service: $db2 get dbm cfg TCP/IP Service name (SVCENAME) SSL service name (SSL_SVCENAME) If the port numbers are not specified, look for the port numbers in services file and find the port numbers defined for the TCP/IP service name and SSL service name (SVCENAME, SSL_SVCENAME) above. Default Location for services file: Windows Service File: %SystemRoot%\system32\drivers\etc\services UNIX Services File: /etc/services If the network protocols and ports found in previous step are not in as per PPSM guidance, this is a finding.
Use the following commands to set the protocol and ports as per PPSM guidance: $db2 update dbm cfg using svcename [service_name | port_number] $db2 update dbm cfg using ssl_svcename [ssl_service_name | port_number] Note: http://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0025241.html
Review the system backup and recovery plan for db2 database to determine whether the database is in archive logging or circular logging, the recovery methods to be used, the backup schedule, backup media integration and the plan for testing database restoration. If any information is absent, this is a finding. Run the following command to get the details on the logging method: $db2 get db cfg If roll forward recovery is required and both logarchmeth1 and logarchmeth2 are set to value OFF then DB2 is not in archive logging, this is a finding. Run the following command to verify backup history: $db2 list history backup all for <dbname> Review the output of the above to see frequency and mode of backups, If the database is not being backed up per the organization’s system backup plan, this is a finding. Review evidence that database recovery is tested annually or more often per the backup and recovery document, and that the most recent test was successful. If not, this is a finding.
Modify the database backup plan to include whether the database needs to be in archive logging, the correct recovery model to be used, the backup schedule, and the plan for testing the database restoration. Update db2 logging to archive logging for the database which requires roll forward recovery using the following db2 command: $db2 update db2 cfg for <database name> using LOGARCHMETH1 <value> Note: Set the value as per your online file system or backup vendor like TSM Verify and correct the scheduled backup jobs. Correct any issues that have been causing backups to fail. Test the restoration of the database at least once a year; correct any issues that cause it to fail. Maintain a record of these tests. Note: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.1.0/com.ibm.db2.luw.admin.config.doc/doc/r0011448.html http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0001991.html
If the application owner and Authorizing Official have determined that encryption of data at rest is NOT required, this is not a finding. To protect the confidentiality and integrity of information at rest, the database must be encrypted. DB2 native encryption can encrypt the data at rest; or third-party tools, like IBM Guardium, can provide encryption for data at rest. To find if a database is encrypted with DB2 native encryption, run the following SQL Query: DB2> SELECT SUBSTR(OBJECT_NAME,1,8) AS NAME, SUBSTR(ALGORITHM,1,8) ALGORITHM FROM TABLE(SYSPROC.ADMIN_GET_ENCRYPTION_INFO()) WHERE OBJECT_TYPE='DATABASE' If the value of Algorithm is NULL for the database, this is a finding. If the database is not encrypted with native encryption or any third-party tool, this is a finding.
To create the database using DB2 native encryption run the following command: $db2 create db <database name> encrypt Note: Select the following link for details on how to set up DB2 native encryption: http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0061766.html?lang=en If a third-party tool is used for database encryption (IBM highly recommends using IBM Guardium) use the third-party tool's specific check and fix.
Determine application-specific security objects (lists of permissions, additional authentication information, stored procedures, application specific auditing, etc.) which are being housed inside DB2 database in addition to the built-in security objects. Review permissions, both direct and indirect, on the security objects, both built-in and application-specific. The following functions and views provided can help with this: DB2> SELECT LIBNAME, OWNER, LIBSCHEMA FROM SYSCAT.LIBRARIES DB2> SELECT MODULENAME, OWNER, MODULESCHEMA FROM SYSCAT.MODULES DB2> SELECT PKGNAME, OWNER, PKGSCHEMA FROM SYSCAT.PACKAGES DB2> SELECT ROUTINENAME, OWNER, ROUTINESCHEMA FROM SYSCAT.ROUTINES DB2> SELECT TRIGNAME, OWNER, TRIGSCHEMA FROM SYSCAT.TRIGGERS DB2> SELECT * FROM SYSIBMADM.PRIVILEGES If the database(s), schema(s) and permissions on security objects are not organized to provide effective isolation of security functions from nonsecurity functions, this is a finding.
Where possible, locate security-related database objects and code in a separate database, schema, or other separate security domain from database objects and code implementing application logic. In all cases, use GRANT, REVOKE, ALTER ROLE, DROP ROLE, statements to add and remove permissions on security-related objects to provide effective isolation.
Verify there are proper procedures in place for the transfer of development/test data from production. Review any scripts or code that exists for the movement of production data to development/test and verify copies of production data are not left in unprotected locations. If there is no documented procedure for data movement from production to development/test, this is a finding. If data movement code that copies from production to development/test does exist and leaves any copies of production data in unprotected locations, this is a finding.
Create and document a process for moving data from production to development/test systems and follow the process. Modify any code used for moving data from production to development/test systems to ensure copies of production data are not left in unsecured locations.
Review the permissions granted to users by the operating system/file system on the instance files, database files, database transaction log files, database audit log files, and database backup files. If any user/role who is not an authorized system administrator with a need to know or database administrator with a need to know, or a system account for running DBMS processes, is permitted to read/view any of these files, this is a finding. Note: When the instance and database directories are created by the DB2 database manager, the permissions are accurate and should not be changed. Use the Following queries/commands to find the locations of instance directory, database directory, transaction logs directory, archive logs directory, audit logs directory and backup files location. 1. Instance Directory On Linux and UNIX operating systems, the instance directory is located in the $INSTHOME/sqllib directory, where $INSTHOME is the home directory of the instance owner. For Windows run following command to show the parent directory of the instance directory: $db2set db2instprof e.g., for db2 instance "DB2" C:\>db2set db2instprof C:\ProgramData\IBM\DB2\DB2COPY1\DB2 The instance path in this case will be C:\ProgramData\IBM\DB2\DB2COPY1\DB2 2. Database Directory For LINUX/UNIX Run Command: $db2 list db directory Go to instance home directory then under this path, there is one or more db2 node directories. The naming convention is NODExxxx, where xxxx is numeric Identifying the DB2 node number. Under the node directory, there are 3 types of subdirectories a) Same as database name. b) Database directories. The naming convention is SQLxxxxx, where xxxxx is numeric. c) SQLDBDIR, the system database directory. For Windows: Under this local database directory, the next level is based on the instance name. For example db2 instance "DB2", the path will be C:\DB2 Under this path, there is one or more db2 node directories. The naming convention is NODExxxx, where xxxx is numeric Identifying the DB2 node number. Under the node directory, there are 3 types of subdirectories a) Same as database name. b) Database directories. The naming convention is SQLxxxxx, where xxxxx is numeric. c) SQLDBDIR, the system database directory. 3. Audit Log Directory Run following command: $db2audit describe Find value of Audit Data Path and Audit Archive Path 4. Transaction Log Directory and Archive Logs Directory Run the command: $db2 get db cfg Find value of following parameters and determine the directory locations. Changed path to log files (NEWLOGPATH) Path to log files Overflow log path (OVERFLOWLOGPATH) Mirror log path (MIRRORLOGPATH) Failover log archive path (FAILARCHPATH) First log archive method (LOGARCHMETH1) Second log archive method (LOGARCHMETH2) 5. Storage Files Run following SQL queries to find the value of tablespace containers and storage paths: DB2> SELECT varchar(container_name,70) as container_name, varchar(tbsp_name,20) as tbsp_name FROM TABLE(MON_GET_CONTAINER('',-2)) SELECT VARCHAR(STORAGE_GROUP_NAME, 30) AS STOGROUP, VARCHAR(DB_STORAGE_PATH, 40) AS STORAGE_PATH FROM TABLE(ADMIN_GET_STORAGE_PATHS('',-1)) 6. Backup File Location Run the following command and review the result for Location of Backups $db2 list history backup all for <database name>
Configure the permissions granted by the operating system/file system on the database files, database transaction log files, database audit log files, and database backup files so that only relevant system accounts and authorized system administrators and database administrators with a need to know are permitted to read/view these files.
Review DBMS code (stored procedures, functions, and triggers), application code, settings, column and field definitions, and constraints to determine whether the database is protected against invalid input. If code exists that allows invalid data to be acted upon or input into the database, this is a finding. If column/field definitions do not exist in the database, this is a finding. If columns/fields do not contain constraints and validity checking where required, this is a finding. Where a column/field is noted in the system documentation as necessarily free-form, even though its name and context suggest that it should be strongly typed and constrained, the absence of these protections is not a finding. Where a column/field is clearly identified by name, caption or context as Notes, Comments, Description, Text, etc., the absence of these protections is not a finding.
Modify database code to properly validate data before it is put into the database or acted upon by the database. Modify the database to contain column/field definitions for each column/field in the database. Modify the database to contain constraints and validity checking on database columns and tables that require them for data integrity.
Review DBMS source code (stored procedures, functions, triggers) and application source code, to identify cases of dynamic code execution. If dynamic code execution is employed in circumstances where the objective could practically be satisfied by static execution with strongly typed parameters, this is a finding.
Where dynamic code execution is employed in circumstances where the objective could practically be satisfied by static execution with strongly typed parameters, modify the code to do so.
Review DBMS source code (stored procedures, functions, triggers) and application source code, to identify cases of dynamic code execution. If dynamic code execution is employed in circumstances where the objective could practically be satisfied by static execution with strongly typed parameters, this is a finding.
Where dynamic code execution is employed in circumstances where the objective could practically be satisfied by static execution with strongly typed parameters, modify the code to do so.
Check DB2 settings and custom database code to verify that error messages do not contain information beyond what is needed for troubleshooting the issue. If database errors contain PII data, sensitive business data, or information useful for identifying the host system or database structure, this is a finding.
Configure DB2 settings, custom database code, and associated application code not to divulge sensitive information or information useful for system identification in error messages.
Check DB2 settings and custom database code to determine if detailed error messages are ever displayed to unauthorized individuals. If detailed error messages are displayed to individuals not authorized to view them, this is a finding.
Configure DB2 settings, custom database code, and associated application code not to display detailed error messages to those not authorized to view them.
Run the following query to check the existing thresholds defined in database: DB2> SELECT thresholdname, thresholdpredicate, maxvalue, execution FROM syscat.thresholds If there are no thresholds defined in the required categories this is a finding. Review the defined thresholds, if the thresholds are not defined per the organization policies, this is a finding. Note: Select the following link for the knowledgebase on syscat.thresholds: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0050565.html?cp=SSEPGG_10.5.0%2F2-12-8-111
Run the CREATE THRESHOLD statement to create the thresholds per organization policies. The following command is an example for creating a threshold to terminate any sessions which have been inactive for more than 5 hours: DB2> CREATE THRESHOLD MONIDLETIME FOR DATABASE ACTIVITIES ENFORCEMENT DATABASE WHEN CONNECTIONIDLETIME > 300 MINUTE STOP EXECUTION Note: Select the following link for the knowledgebase information on create threshold: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0050563.html?lang=en
If security labeling is not required, this is not a finding. Query the system catalog to find out the existing security labels: DB2> SELECT * FROM SYSCAT.SECURITYLABELS If the required labels are not created in database this is a finding. Query the following catalog views find details of existing security labels: DB2> SELECT * FROM SYSCAT.SECURITYLABELACCESS DB2> SELECT * FROM SYSCAT.SECURITYLABELCOMPONENTELEMENTS DB2> SELECT * FROM SYSCAT.SECURITYLABELCOMPONENTS If the security labels are not defined as per organization security policies, this is a finding.
Use Create security Label statement to create the security labels: See the following example to create the components, policy and then security labels: Create the components for Security labels: DB2> CREATE SECURITY LABEL COMPONENT LEVEL ARRAY ['Top Secret', 'Secret', 'Confidential', 'Unclassified']; DB2> CREATE SECURITY LABEL COMPONENT COMPARTMENTS SET {'Collection', 'Research', 'Analysis'}; Create the Policy: DB2> CREATE SECURITY POLICY DATA_ACCESS COMPONENTS LEVEL, COMPARTMENTS WITH DB2LBACRULES; Create Security Label: DB2> CREATE SECURITY LABEL DATA_ACCESS.EMPLOYEESECLABEL COMPONENT LEVEL 'Top Secret', COMPONENT COMPARTMENTS 'Research', 'Analysis' After creating the security labels, use one of the following statements to attach the labels to the table: DB2> CREATE TABLE Or DB2> ALTER TABLE For advice and examples, see the tutorial at: https://www.ibm.com/developerworks/data/tutorials/dm0605wong/ https://www.ibm.com/developerworks/data/tutorials/dm0605wong/section2.html Note: Select the following knowledgebase link for information regarding LBAC Details: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/c0021114.html Select the following knowledgebase link for information regarding Create Security Label: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0020026.html?cp=SSEPGG_10.5.0%2F2-12-7-94
If security labeling is not required, this is not a finding. Query the system catalog to find out the existing security labels: DB2> SELECT * FROM SYSCAT.SECURITYLABELS If the required labels are not created in database this is a finding. Query the following catalog views find details of existing security labels: DB2> SELECT * FROM SYSCAT.SECURITYLABELACCESS DB2> SELECT * FROM SYSCAT.SECURITYLABELCOMPONENTELEMENTS DB2> SELECT * FROM SYSCAT.SECURITYLABELCOMPONENTS If the security labels are not defined as per organization security policies, this is a finding.
Use Create security Label statement to create the security labels: See the following example to create the components, policy and then security labels: Create the components for Security labels: DB2> CREATE SECURITY LABEL COMPONENT LEVEL ARRAY ['Top Secret', 'Secret', 'Classified', 'Unclassified']; DB2> CREATE SECURITY LABEL COMPONENT COMPARTMENTS SET {'Collection', 'Research', 'Analysis'}; Create the Policy: DB2> CREATE SECURITY POLICY DATA_ACCESS COMPONENTS LEVEL, COMPARTMENTS WITH DB2LBACRULES; Create Security Label: DB2> CREATE SECURITY LABEL DATA_ACCESS.EMPLOYEESECLABEL COMPONENT LEVEL 'Top Secret', COMPONENT COMPARTMENTS 'Research', 'Analysis' After creating the security labels, use one of the following statements to attach the labels to the table: DB2> CREATE TABLE Or DB2> ALTER TABLE For advice and examples, see the tutorial at: https://www.ibm.com/developerworks/data/tutorials/dm0605wong/ https://www.ibm.com/developerworks/data/tutorials/dm0605wong/section2.html Note: Select the following knowledgebase link for information regarding LBAC Details: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/c0021114.html Select the following knowledgebase link for information regarding Create Security Label: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0020026.html?cp=SSEPGG_10.5.0%2F2-12-7-94
Review the system documentation to obtain the definition of the DB2 functionality considered privileged in the context of the system in question. Run the following command to find the privileged groups to get the value of SYSADM_GROUP, SYSCTRL_GROUP, SYSMAINT_GROUP, SYSMON_GROUP: $db2 get dbm cfg If non-privileged users are members of any of these groups, this is a finding. Run the following SQL command to find the database authorities: DB2> SELECT * FROM SYSCAT.DBAUTH If non-privileged users have any database authority, this is a finding. Query the following system catalog views to find out the authorities on all database objects: SYSCAT.COLAUTH: Lists the column privileges SYSCAT.DBAUTH: Lists the database privileges SYSCAT.INDEXAUTH: Lists the index privileges SYSCAT.MODULEAUTH: Lists the module privileges SYSCAT.PACKAGEAUTH: Lists the package privileges SYSCAT.PASSTHRUAUTH: Lists the server privilege SYSCAT.ROLEAUTH: Lists the role privileges SYSCAT.ROUTINEAUTH: Lists the routine (functions, methods, and stored procedures) privileges SYSCAT.SCHEMAAUTH: Lists the schema privileges SYSCAT.SEQUENCEAUTH: Lists the sequence privileges SYSCAT.SURROGATEAUTHIDS: Lists the authorization IDs for which another authorization ID can act as a surrogate. SYSCAT.TABAUTH: Lists the table and view privileges SYSCAT.TBSPACEAUTH: Lists the table space privileges SYSCAT.VARIABLEAUTH: Lists the variable privileges SYSCAT.WORKLOADAUTH: Lists the workload privileges SYSCAT.XSROBJECTAUTH: Lists the XSR object privileges If non-privileged users have any authority, this is a finding.
Use appropriate OS utility to remove the non-authorized users form privileged groups. Use REVOKE command to revoke database level or object privileges from non-authorized users. Note: The following views and table functions list information about privileges held by users, identities of users granting privileges, and object ownership: SYSCAT.COLAUTH: Lists the column privileges SYSCAT.DBAUTH: Lists the database privileges SYSCAT.INDEXAUTH: Lists the index privileges SYSCAT.MODULEAUTH: Lists the module privileges SYSCAT.PACKAGEAUTH: Lists the package privileges SYSCAT.PASSTHRUAUTH: Lists the server privilege SYSCAT.ROLEAUTH: Lists the role privileges SYSCAT.ROUTINEAUTH: Lists the routine (functions, methods, and stored procedures) privileges SYSCAT.SCHEMAAUTH: Lists the schema privileges SYSCAT.SEQUENCEAUTH: Lists the sequence privileges SYSCAT.SURROGATEAUTHIDS: Lists the authorization IDs for which another authorization ID can act as a surrogate. SYSCAT.TABAUTH: Lists the table and view privileges SYSCAT.TBSPACEAUTH: Lists the table space privileges SYSCAT.VARIABLEAUTH: Lists the variable privileges SYSCAT.WORKLOADAUTH: Lists the workload privileges SYSCAT.XSROBJECTAUTH: Lists the XSR object privileges
Run the following command to find the location of the audit data and archive data directories: $db2audit describe If this filesystem location is not compatible with the centralized audit management system, this is a finding. If DB2 is not used in conjunction with a centralized audit management system, this is a finding.
Run the following command to set the audit data directory and archive data directory to the location which is compatible with the organization's centralized system: $db2audit configure datapath <AUDIT DATA DIRECTORY > archivepath <AUDIT ARCHIVE DIRECTORY> Note: See the following knowledgebase page for information regarding extracting Audit logs to syslog for any file system other than Windows: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0002072.html DB2 does not directly support syslog on windows. Devise an alternate method of log capture.
Run the following command to find the location of the audit data directory: $db2audit describe Note the location of audit data directory. Check the operating system log records find out if there has been any out of space event for that location. If there has been any out of space event for audit data directory, this is a finding. Take samples of peak database activity and measure the space utilized in the audit data directory location during that time. If the audit data directory is not sized to handle the workload between audit archiving intervals this is a finding.
Allocate space to the file system where the audit data directory resides.
Use the following command to find the directory for the Audit Data Path: $db2audit describe If there is no monitoring of the Audit Data Path location at the Operating System level using OS utilities or system management utilities to send an alert at 75% space utilization, this is a finding.
Use the Operating system tools or external utilities to monitor the Audit Data Path and set alerts for 75% space utilization.
If the audit policies are created with ERRORTYPE=Audit and if there is a failure in writing the audit event log for the policy, audit failure is logged in the diagnostic.log file and user action is not completed. Run the following statement to find the error type for each policy: DB2> SELECT AUDITPOLICYNAME, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES If ERRORTYPE value is not set to 'A', this is a finding. Run the following command to monitor the database diagnostic log file for audit failure errors: $db2diag -g msg:="Write to audit log failed" If the diagnostic log file is not being monitored for audit failure errors, this is a finding.
Run the following command to alter the audit policies and to set the ERRORTYPE to audit: DB2>ALTER AUDIT POLICY <DB audit policy name> CATEGORIES AUDIT STATUS BOTH ERROR TYPE AUDIT Monitor the diagnostic log file for audit failure error using the following command: $db2diag -g msg:="Write to audit log failed"
The user needs CREATEINAUTH privileges for the schema to create objects in an existing schema. Run the following Query to find which user has privilege to create objects in schemas: DB2> SELECT GRANTEE, SCHEMANAME, CREATEINAUTH, ALTERINAUTH FROM SYSCAT.SCHEMAAUTH If a non-authorized user has privilege, this is a finding. Run the following query to which user has privilege to create new schema and other objects: DB2> SELECT GRANTEE, CREATETABAUTH, EXTERNALROUTINEAUTH, DBADMAUTH, IMPLSCHEMAAUTH FROM SYSCAT.DBAUTH If a non-authorized user has privilege, this is a finding.
Run the REVOKE command to revoke database authorities and schema privileges from user: DB2> REVOKE CREATEIN ON SCHEMA<schema_name> FROM <user> DB2> REVOKE <db authority> ON DATABASE FROM <USER> Note: Select the following knowledgebase link for information regarding revoking database authorities: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000981.html?cp=SSEPGG_10.5.0%2F2-12-7-181&lang=en Select the following knowledgebase link for information regarding revoking schema privileges: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000988.html?cp=SSEPGG_10.5.0%2F2-12-7-189&lang=en
The base installation directory of the database server software and instance home directory location is configurable at the time of installation. Run the db2level command to find the installation directory of DB2 server software: $db2level If any user other than the sysadmin and root users has write permission on these directories and subsequent subdirectories under this directory, this is a finding. On Linux and UNIX operating systems, the instance directory is located in the $INSTHOME/sqllib directory, where $INSTHOME is the home directory of the instance owner. On Windows operating systems, the instance directory is located under the /sqllib directory where the DB2 database product was installed. If any user other than the instance owner and the root user has write permission to instance home directory and subsequent subdirectories under it, this is a finding.
Remove the write permission from non-root/non-sysadmin users on the DB2 installation base directory and instance home directory.
To audit changes in configuration, the SYSADMIN category needs to be audited at both the instance level and the database level. Run the following command to ensure that the SYSADMIN category is being audited at the instance level: $db2audit describe If Log system administrator events is not set to “Both”, this is a finding. Run the following SQL statement to ensure that an audit policy exists at the database level: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE = ' ' If no rows are returned, this is a finding. For the audit policy returned in the statement above, run the following SQL statement to confirm that the SYSADMIN category is part of that policy and the ERROR TYPE='A': DB2> SELECT AUDITPOLICYNAME, SYSADMINSTATUS, CONTEXTSTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for SYSADMINSTATUS and CONTEXTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to set the auditing at the instance level: $db2audit configure scope sysadmin status both error type audit Run the following command to set the auditing at the database level: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SYSADMIN STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT Run the following command if the auditing policy exists but does not include the sysadmin category: DB2> ALTER AUDIT POLICY <DB audit policy name> SYSADMIN STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT If CREATE was used above, apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name> Note: See the following page for knowledgebase information regarding the ALTER AUDIT POLICY: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0050608.html?lang=en
Run the following command to find the value of the network service: $db2 get dbm cfg TCP/IP Service name (SVCENAME) SSL service name (SSL_SVCENAME) If the port numbers are not specified, look for the port numbers in services file and find the port numbers defined for the TCP/IP service name and SSL service name (SVCENAME, SSL_SVCENAME) above. Default Location for services file: Windows Service File: %SystemRoot%\system32\drivers\etc\services UNIX Services File: /etc/services If the network protocols and ports found in previous step are not in as per PPSM guidance, this is a finding.
Use the following commands to set the protocol and ports as per PPSM guidance: $db2 update dbm cfg using svcename [service_name | port_number] $db2 update dbm cfg using ssl_svcename [ssl_service_name | port_number] Note: http://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0025241.html
Run the following command to find certificate details: $gsk8capicmd_64 -cert -details -db "<mydbserver.kdb>" -pw "<PASSWORD>" -label "<myselfsigned>" The output is displayed in a form similar to the following: -- label : myselfsigned key size : 1024 version : X509 V3 serial : 96c2db8fa769a09d -- issue:CN=myhost.mycompany.com,O=myOrganization,OU=myOrganizationUnit, L=myLocation,ST=ON,C=CA -- subject:CN=myhost.mycompany.com,O=myOrganization,OU=myOrganizationUnit, L=myLocation,ST=ON,C=CA not before : Tuesday, 24 February 2009 17:11:50 PM not after : Thursday, 25 February 2010 17:11:50 PM If the certificate is not issued by DoD PKI or DoD-approved PKI Certification Authorities (CAs), this is a finding.
Create a key database and set up the digital certificates. The following command creates a key database called mydbserver.kdb and a stash file called mydbserver.sth: $gsk8capicmd_64 -keydb -create -db "mydbserver.kdb" -pw "myServerPassw0rdpw0" -stash When you create a key database, it is automatically populated with signer certificates from a few certificate authorities (CAs), such as Verisign. Add a certificate for your server to your key database. To obtain a certificate, you can either use GSKCapiCmd to create a new certificate request and submit it to a CA to be signed, or you can create a self-signed certificate for testing purposes. Following is an example of command to create a self-signed certificate with a label of myselfsigned, use the GSKCapiCmd command as shown in the following command: $gsk8capicmd_64 -cert -create -db "mydbserver.kdb" -pw "myServerPassw0rdpw0" -label "myselfsigned" -dn "CN=myhost.mycompany.com,O=myOrganization, OU=myOrganizationUnit,L=myLocation,ST=ON,C=CA" Notes: -- Use the GSKCapiCmd tool to create the key database. It must be a Certificate Management System (CMS) type key database. The GSKCapiCmd is a non-Java-based command-line tool, and Java does not need to be installed on the system to use this tool. You invoke GSKCapiCmd using the GSKCAPICMD command, as described in the GSKCapiCmd User's Guide. The path for the command is sqllib/gskit/bin on Linux and UNIX platforms, and C:\Program Files\IBM\GSK8\bin on both 32-bit and 64-bit Windows platforms. On 64-bit platforms, the 32-bit GSKit executable files and libraries are also present; in this case, the path for the command is C:\ProgramFiles (x86)\IBM\GSK8\bin. - Ensure PATH (on the Windows platform) includes the proper GSKit library path, and LIBPATH, SHLIB_PATH, or LD_LIBRARY_PATH (on UNIX or Linux platforms) include the proper GSKit library path, such as sqllib/lib64/gskit. The -stash option creates a stash file at the same path as the key database, with a file extension of .sth. At instance start-up, GSKit uses the stash file to obtain the password to the key database. To extract the certificate you created to a file, so that you can distribute it to computers running clients that will be establishing SSL connections to your DB2 server. Run the following GSKCapiCmd command extracts the certificate to a file called mydbserver.arm: $gsk8capicmd_64 -cert -extract -db "mydbserver.kdb" -pw "myServerPassw0rdpw0" -label "myselfsigned" -target "mydbserver.arm" -format ascii –fips
Review the system documentation to determine whether the organization has defined the information at rest that is to be protected from disclosure; which must include, at a minimum, PII and classified information. If the documentation indicates no information requires such protections, this is not a finding. DB2 native encryption can encrypt the data at rest; or third-party tools, like IBM Guardium, can provide encryption for data at rest. To find if a database is encrypted with DB2 native encryption, run the following SQL Query: DB2> SELECT * FROM TABLE(SYSPROC.ADMIN_GET_ENCRYPTION_INFO()) If the value of Algorithm is NULL for the database, this is a finding. If the database is not encrypted with native encryption or any third-party tool, this is a finding.
To create the database using DB2 native encryption run the following command: $db2 create db <database name> encrypt See the detailed instructions in the link in the note section below to create the encrypted database. Note: Select the following link for details on how to set up DB2 native encryption: http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0061766.html?lang=en If a third-party tool is used for database encryption (IBM highly recommends using IBM Guardium) use the third-party tool's specific check and fix.
Review the system documentation to determine whether the organization has defined the information at rest that is to be protected from disclosure; which must include, at a minimum, PII and classified information. If the documentation indicates no information requires such protections, this is not a finding. DB2 native encryption can encrypt the data at rest; or third-party tools, like IBM Guardium, can provide encryption for data at rest. To find if a database is encrypted with DB2 native encryption, run the following SQL Query: DB2> SELECT * FROM TABLE(SYSPROC.ADMIN_GET_ENCRYPTION_INFO()) If the value of Algorithm is NULL for the database, this is a finding. If the database is not encrypted with native encryption or any third-party tool, this is a finding.
To create the database using DB2 native encryption run the following command: $db2 create db mydb encrypt See the detailed instructions in link in the note section below to create the encrypted database. Note: Select the following link for details on how to set up DB2 native encryption: http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0061766.html?lang=en If a third-party tool is used for database encryption (IBM highly recommends using IBM Guardium) use the third-party tool's specific check and fix.
The DB2 database system supports the use of Transport Layer Security (TLS) to enable a client to authenticate a server and to provide private communication between the client and server by use of encryption. Run the following command to find out what versions of TLS are supported by the server: $db2 get dbm cfg If the value of the ssl_versions parameter is not set to "TLSV1" or "TLSV12", this is a finding. Check the value of the DB2COMM parameter using the following command: $db2set -all If the value of DB2COMM is not set to "SSL", this is a finding. Note: When this topic mentions SSL, the same information applies to TLS unless otherwise noted.
Run the following DB2 command to set the value of ssl_versions to approved TLS or SSL version: $db2 update dbm cfg using SSL_VERSIONS <SSL Version> Run the following command to set the value of db2comm parameter to SSL: $db2set db2comm=ssl Restart the database manager. Note: Details on key database creation and setting up SSL environment are in following links Select the following knowledgebase link for more information regarding configuring SSL support: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0025241.html?lang=en Select the following knowledgebase link for more information regarding SSL_versions: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.config.doc/doc/r0053616.html?cp=SSEPGG_10.5.0%2F2-4-4-8-88&lang=en Select the following knowledgebase link for setting communication protocol: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.qb.server.doc/doc/t0004714.html?cp=SSEPGG_10.5.0&lang=en
The DB2 database system supports the use of Transport Layer Security (TLS) to enable a client to authenticate a server and to provide private communication between the client and server by use of encryption. Run the following command to find out what versions of TLS are supported by the server: $db2 get dbm cfg If the value of the ssl_versions parameter is not set to "TLSV1" or "TLSV12" this is a finding. Check the value of the DB2COMM parameter using the following command: $db2set -all If the value of DB2COMM is not set to "SSL", this is a finding. Note: When this topic mentions SSL, the same information applies to TLS unless otherwise noted.
Run the following DB2 command to set the value of ssl_versions to approved TLS or SSL version: $db2 update dbm cfg using SSL_VERSIONS <SSL Version> Run the following command to set the value of db2comm parameter to SSL: $db2set db2comm=ssl Restart the database manager. Note: Details on key database creation and setting up SSL environment are in the following links Select the following knowledgebase link for more information regarding configuring SSL support: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0025241.html?lang=en Select the following knowledgebase link for more information regarding SSL_versions: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.config.doc/doc/r0053616.html?cp=SSEPGG_10.5.0%2F2-4-4-8-88&lang=en Select the following knowledgebase link for setting communication protocol: http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.qb.server.doc/doc/t0004714.html?cp=SSEPGG_10.5.0&lang=en
Review system documentation to determine how input errors are to be handled in general and if any special handling is defined for specific circumstances. Review the source code for database program objects (stored procedures, functions, triggers) and application source code to identify how the system responds to invalid input. If it does not implement the documented behavior, this is a finding.
Revise and deploy the source code for database program objects (stored procedures, functions, triggers) and application source code, to implement the documented behavior.
Obtain evidence that software patches are consistently applied to DB2 within the time frame defined for each patch. If such evidence cannot be obtained, or the evidence that is obtained indicates a pattern of noncompliance, this is a finding.
Institute and adhere to policies and procedures to ensure that patches are consistently applied to DB2 within the time allowed.
To ensure the database generates audit records when security objects are accessed the following audit categories must be implemented at the database level: AUDIT CHECKING CONTEXT SECMAINT SYSADMIN VALIDATE Run the following SQL statement to determine if an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Using the AUDITPOLICYID returned from above query, run the following command to find the details of audit policy: DB2> SELECT AUDITPOLICYNAME, AUDITSTATUS, CHECKINGSTATUS, CONTEXTSTATUS, SECMAINTSTATUS, SYSADMINSTATUS, VALIDATESTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for AUDITSTATUS, CHECKINGSTATUS, CONTEXTSTATUS, SECMAINTSTATUS, SYSMADMINSTATUS and VALIDATESTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, VALIDATE STATUS BOTH, CHECKING STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
To ensure the database generates audit records when unsuccessful attempts are made to access security objects the following audit categories must be implemented at the database level: AUDIT CHECKING CONTEXT SECMAINT SYSADMIN VALIDATE Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Run the following SQL statement using the AUDITPOLICYID from above query find the details of audit policy: DB2> SELECT AUDITPOLICYNAME, AUDITSTATUS, CHECKINGSTATUS, CONTEXTSTATUS, SECMAINTSTATUS, SYSADMINSTATUS, VALIDATESTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for AUDITSTATUS, CHECKINGSTATUS, CONTEXTSTATUS, SECMAINTSTATUS, SYSMADMINSTATUS and VALIDATESTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, VALIDATE STATUS BOTH, CHECKING STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
Review the system documentation to determine whether it is required to track categories of information, such as classification or sensitivity level. If it is not, this is not applicable (NA). To verify the database generates audit records when categorized information (e.g., classification levels/security levels) is accessed the SECMAINT, CONTEXT category auditing must be implemented at the database level. Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Run the following SQL statement using the AUDITPOLICYID from the above query to find the details of the audit policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for SECMAINTSTATUS and CONTEXTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name> Note: The SECMAINT tracks the security and EXECUTE tracks the info on the tables for which it is defined.
Review the system documentation to determine whether it is required to track categories of information, such as classification or sensitivity level. If it is not, this is not applicable (NA). To verify the database generates audit records when categorized information (e.g., classification levels/security levels) is unsuccessfully accessed the SECMAINT, CONTEXT category auditing must be implemented at the database level. Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Run the following SQL statement using the AUDITPOLICYID returned from query above to find the details of the audit policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values is not 'B' (Both) CONTEXTSTATUS, SECMAINTSTATUS, columns and the value in ERRORTYPE column set to 'A' (AUDIT) , this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
To verify the database generates audit records when privileges/permissions are added is accessed the SECMAINT, CONTEXT category auditing must be implemented at the database level. Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Run the following SQL statement using the AUDITPOLICYID from query above to find the details of the audit policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for CONTEXTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
To verify the database generates audit records when unsuccessful attempts are made to add privileges/permissions the SECMAINT, CONTEXT category auditing must be implemented at the database level. Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Run the following SQL statement using the AUDITPOLICYID from the query above find the details of the audit policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for CONTEXTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
To verify the database generates audit records when the database privileges/permissions are modified the SECMAINT, CONTEXT category auditing must be implemented at the database level. Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Run the following SQL statement using the AUDITPOLICYID from the query above to find the details of the audit policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for CONTEXTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
If a correct audit policy does not exist, define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
To verify the database generates audit records when an unsuccessful attempt is made to modify the database privileges/permissions and that the SECMAINT, CONTEXT category auditing must be implemented at the database level. Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Run the following SQL statement using the AUDITPOLICYID from the query above to find the details of the audit policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for CONTEXTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
If there are no locally defined security objects this is not applicable (NA). If there are locally defined security objects get a list of those objects from ISSO/DBA. If there are only tables in the list then a minimum audit set of OBJMAINT and SECMAINT categories on the locally defined security tables or database is required. If there are objects like packages and procedures in the list of locally defined security objects then a minimum audit set of OBJMAINT and SECMAINT categories on the database is required. Run the following SQL statement to ensure that an audit policy is defined in the database: DB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN ('T',' ') If no rows are returned, this is a finding. If a row with OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. If a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy. For each audit policy returned in the statement above, run the following SQL statement to confirm that the OBJMAINT and SECMAINT categories are part of that policy: DB2> SELECT AUDITPOLICYNAME, SECMAINTSTATUS, OBJMAINTSTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES If the database audit policy has the values for the SECMAINTSTATUS and OBJMAINTSTATUS columns set to 'S' (Success) or 'B' (Both) and the value in the ERRORTYPE column set to 'A' (Audit), this is not a finding. If there are objects in addition to tables in the list of locally defined security objects and if the database policy does not exist or does not cover SECMAINTSTATUS or OBJMAINTSTATUS, this is a finding. If there are only tables in the list and if the database policy does not exist or does not cover SECMAINTSTATUS or OBJMAINTSTATUS then check if the appropriate policies are defined for all the required locally defined security tables. If all the required locally defined security tables' audit policies do not have the values for the SECMAINTSTATUS and OBJMAINTSTATUS columns set to 'S' (Success) or 'B' (Both) or if the value in the ERRORTYPE column is not set to 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <execdb> CATEGORIES OBJMAINT STATUS SUCCESS, SECMAINT STATUS SUCCESS ERROR TYPE AUDIT or CREATE AUDIT POLICY <execdb> CATEGORIES OBJMAINT STATUS SUCCESS, SECMAINT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the correct policy to local security tables or database level: DB2> AUDIT TABLE <table name> USING POLICY EXECDB
If there are no locally defined security objects this is not applicable (NA). If there are locally defined security objects get a list of those objects from ISSO/DBA. If there are only tables in the list then a minimum audit set of OBJMAINT and SECMAINT categories on the locally defined security tables or database is required. If there are objects like packages and procedures in the list of locally defined security objects then a minimum audit set of OBJMAINT and SECMAINT categories on the database is required. Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN ('T',' ') If no rows are returned, this is a finding. If a row with OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. If a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy. For each audit policy returned in the statement above, run the following SQL statement to confirm that the OBJMAINT and SECMAINT categories are part of that policy: DB2> SELECT AUDITPOLICYNAME, SECMAINTSTATUS, OBJMAINTSTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES If the database audit policy has the values for the SECMAINTSTATUS and OBJMAINTSTATUS columns set to 'F' (Failure) or 'B' (Both) and the value in the ERRORTYPE column set to 'A' (Audit), this is not a finding. If there are objects in additions to tables in the list of locally defined security objects and if the database policy does not exist or does not cover SECMAINTSTATUS or OBJMAINTSTATUS, this is a finding. If there are only tables in the list and if the database policy does not exist or does not cover SECMAINTSTATUS or OBJMAINTSTATUS then check if the appropriate policies are defined for all the required locally defined security tables. If any of the required locally defined security tables' audit policies do not have the values for the SECMAINTSTATUS and OBJMAINTSTATUS columns set to 'F' (Failure) or 'B' (Both) or the value in the ERRORTYPE column set to 'A' (Audit), then this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <execdb> CATEGORIES OBJMAINT STATUS SUCCESS, SECMAINT STATUS BOTH ERROR TYPE AUDIT or CREATE AUDIT POLICY <execdb> CATEGORIES OBJMAINT STATUS SUCCESS, SECMAINT STATUS FAILURE ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the correct policy to local security tables or database level: DB2> AUDIT TABLE <table name> USING POLICY EXECDB
Review the system documentation to determine whether it is required to track categories of information, such as classification or sensitivity level. If it is not, this is not applicable (NA). To meet these requirements at the SECMAINT, CONTEXT category auditing needs to be implemented at database level. Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Using the AUDITPOLICYID from above query find the details of audit policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for CONTEXTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
Review the system documentation to determine whether it is required to track categories of information, such as classification or sensitivity level. If it is not, this is not applicable (NA). To meet these requirements at the SECMAINT, CONTEXT category auditing needs to be implemented at database level. Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Using the AUDITPOLICYID from above query find the details of audit policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for CONTEXTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
To meet these requirements at the SECMAINT, CONTEXT category auditing needs to be implemented at database level. Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Using the AUDITPOLICYID from above query find the details of audit policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for CONTEXTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, in the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
To meet these requirements at the SECMAINT, CONTEXT category auditing needs to be implemented at database level. Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Using the AUDITPOLICYID from above query find the details of audit policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for CONTEXTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
To meet these requirements at the SECMAINT, OBJMAINT, and CONTEXT categories, auditing need to be implemented at the database level. Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Using the AUDITPOLICYID from above query find the details of audit policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, OBJMAINTSTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for CONTEXTSTATUS, OBJMAINTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, OBJMAINTSTATUS STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name> Note: The SECMAINT command grants a role and the OBJMAINT command sets the grant on a user defined function.
To meet these requirements at the SECMAINT, OBJMAINT, and CONTEXT categories, auditing need to be implemented at the database level. Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Using the AUDITPOLICYID from above query find the details of audit policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, OBJMAINTSTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for CONTEXTSTATUS, OBJMAINTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, OBJMAINTSTATUS STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
Get a list of tables from ISSO/DBA where the categorized information is stored. If there are no tables with categorized information, this is not applicable (NA). Run the following SQL statement to ensure that an audit policy is defined upon all the required tables and/or the database: DB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN ('T',' ') If no rows are returned, this is a finding. If a row with OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. If a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy. For each audit policy returned in the statement above, run the following SQL statement to confirm that the CONTEXT and EXECUTE categories are part of that policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, EXECUTESTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the database audit policy has the values for the CONTEXTSTATUS and EXECUTESTATUS columns set to 'S' (Success) or 'B' (Both) and the value in the ERRORTYPE column set to 'A' (Audit), this is not a finding. If the database policy does not exist or does not cover CONTEXTSTATUS and EXECUTESTATUS then check if the appropriate policies are defined for all the required tables. If any required application table audit policies do not have the values for the CONTEXTSTATUS and EXECUTESTATUS columns set to 'S' (Success) or 'B' (Both) or the value in the ERRORTYPE column set to 'A' (Audit), then this is a finding.
Define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES EXECUTE STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name> Define an audit policy to audit deletes (DMLs) on required tables. DB2> CREATE AUDIT POLICY <table audit policy name> CATEGORIES EXECUTE STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to each required table: DB2> AUDIT TABLE <table name> USING POLICY <table audit policy name>
Get a list of tables from ISSO/DBA where the categorized information is stored. If there are no tables with categorized information, this is not applicable (NA). Run the following SQL statement to ensure that an audit policy is defined upon all the required tables and/or the database: DB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN ('T',' ') If no rows are returned, this is a finding. If a row with OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. If a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy. For each audit policy returned in the statement above, run the following SQL statement to confirm that the CONTEXT and EXECUTE categories are part of that policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, EXECUTESTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the database audit policy has the values for the CONTEXTSTATUS and EXECUTESTATUS columns set to 'F' (Failure) or 'B' (Both) and the value in the ERRORTYPE column set to 'A' (Audit), this is not a finding. If the database policy does not exist or does not cover CONTEXTSTATUS and EXECUTESTATUS then check if the appropriate policies are defined for all the required tables. If any required application table audit policies do not have the values for the CONTEXTSTATUS and EXECUTESTATUS columns set to 'F' (Failure) or 'B' (Both) or the value in the ERRORTYPE column set to 'A' (Audit), then this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT Run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
To meet these requirements at the VALIDATE, CONTEXT category auditing needs to be implemented at database level. Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Using the AUDITPOLICYID from above query find the details of audit policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, VALIDATESTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for CONTEXTSTATUS and VALIDATESTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <audit policy name> CATEGORIES VALIDATE STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <audit policy name>
To meet these requirements at the VALIDATE, CONTEXT category auditing needs to be implemented at database level. Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Using the AUDITPOLICYID from above query find the details of audit policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, VALIDATESTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for CONTEXTSTATUS and VALIDATESTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES VALIDATE STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Using the AUDITPOLICYID from above query find the details of the audit policy: DB2> SELECT AUDITPOLICYNAME, SECMAINTSTATUS, SYSADMINSTATUS, OBJMAINTSTATUS, AUDITSTATUS, CONTEXTSTATUS, ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for SECMAINTSTATUS, OBJMAINTSTATUS, SYSADMINSTATUS, AUDITSTATUS and CONTEXTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, OBJMAINT STATUS BOTH, AUDIT STATUS BOTH, SYSADMIN STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, apply the policy created to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Using the AUDITPOLICYID from above query find the details of audit policy: DB2> SELECT AUDITPOLICYNAME, SECMAINTSTATUS, SYSADMINSTATUS, OBJMAINTSTATUS, AUDITSTATUS, CONTEXTSTATUS, ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for SECMAINTSTATUS, OBJMAINTSTATUS, SYSADMINSTATUS, AUDITSTATUS and CONTEXTSTATUS are not 'B' (Both) or 'F' (Failure), or ERRORTYPE is not 'A' (Audit), this is a finding.
Define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SECMAINT STATUS BOTH, OBJMAINT STATUS BOTH, AUDIT STATUS BOTH, SYSADMIN STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Using the AUDITPOLICYID from above query find the details of audit policy. DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the value for CONTEXTSTATUS is not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Using the AUDITPOLICYID from above query find the details of audit policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, VALIDATESTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for CONTEXTSTATUS and VALIDATESTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES VALIDATE STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, Run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name> Note: Group by IPADDRESS and validate from audit log.
Run the following SQL statement to ensure that an audit policy is defined upon the all required application tables, routines and/or the database: DB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN ('T',' ') If no rows are returned, this is a finding. If a row with OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. If a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy. For each audit policy returned in the statement above, run the following SQL statement to confirm that the CONTEXT and EXECUTE categories are part of that policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, EXECUTESTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES If the database audit policy has the values for the CONTEXTSTATUS and EXECUTESTATUS columns set to 'S' (Success) or 'B' (Both) and the value in the ERRORTYPE column set to 'A' (Audit), this is not a finding. If the database policy does not exist or does not cover CONTEXTSTATUS or EXECUTESTATUS then check if the appropriate policies are defined for all the required application tables. If any required application table audit policies do not have the values for the CONTEXTSTATUS and EXECUTESTATUS columns set to 'S' (Success) or 'B' (Both) or the value in the ERRORTYPE column set to 'A' (Audit), then this is a finding. Note: If the routines (stored procedures) execution need to be audited then execute policy has to be defined at database level. In DB2 EXECUTE policy can be created at the Database level or table level. EXECUTE audit policy covers the routine also if defined at database level. Currently there is no provision to define auditing of individual/specified routines.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <execdb> CATEGORIES CONTEXT STATUS BOTH, EXECUTE STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run one of the following commands to apply the correct policy to either the database as a whole or to the specific application tables: DB2> AUDIT DATABASE USING POLICY EXECDB Or DB2> AUDIT TABLE <table name> USING POLICY EXECDB
Run the following SQL statement to ensure that an audit policy is defined upon the all required application tables, routines and/or the database: DB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN ('T',' ') If no rows are returned, this is a finding. If a row with OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. If a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy. For each audit policy returned in the statement above, run the following SQL statement to confirm that the CONTEXT and EXECUTE categories are part of that policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, EXECUTESTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES If the database audit policy has the values for the CONTEXTSTATUS and EXECUTESTATUS columns set to 'S' (Success) or 'B' (Both) and the value in the ERRORTYPE column set to 'A' (Audit), this is not a finding. If the database policy does not exist or does not cover CONTEXTSTATUS or EXECUTESTATUS then check if the appropriate policies are defined for all the required application tables. If any required application table audit policies do not have the values for the CONTEXTSTATUS and EXECUTESTATUS columns set to 'S' (Success) or 'B' (Both) or the value in the ERRORTYPE column set to 'A' (Audit), then this is a finding. Note: If the routines (stored procedures) execution need to be audited then execute policy has to be defined at database level. . In DB2 EXECUTE policy can be created at the Database level or table level. EXECUTE audit policy covers the routine also if defined at database level. Currently there is no provision to define auditing of individual/specified routines.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <execdb> CATEGORIES CONTEXT STATUS BOTH, EXECUTE STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run one of the following commands to apply the correct policy to either the database as a whole or to the specific application tables: DB2> AUDIT DATABASE USING POLICY EXECDB Or DB2> AUDIT TABLE <table name> USING POLICY EXECDB
Run the following SQL statement to ensure that an audit policy is defined upon the database: DB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID FROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN (' ') If no rows are returned, this is a finding. Using the AUDITPOLICYID from above query find the details of audit policy: DB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, VALIDATESTATUS, ERRORTYPE AS ERRORTYPE FROM SYSCAT.AUDITPOLICIES WHERE AUDITPOLICYID = <audit policy ID> If the values for CONTEXTSTATUS and VALIDATESTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.
Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: DB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES VALIDATE STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT To modify an existing audit policy, replace "CREATE" with "ALTER" in the preceding statement. Only the categories explicitly named in the statement will be affected. In this case, the changes take effect immediately. If CREATE was used above, run the following command to apply the policy created above to the database: DB2> AUDIT DATABASE USING POLICY <DB audit policy name>
Run the following command to find the value of “Audit Data Path” and “Audit Archive Path” $db2audit describe DB2 can asynchronously extract the audit records in comma delimited format from “Audit Archive Path”. If a separate log management facility approved by the organization exists and is configured to absorb the comma delimited audit log files, this is not a finding. If a separate log management facility is not configured to absorb the extracted log data, this is a finding.
Configure the separate log management facility to absorb audit logs data from comma delimited files produced by extracting the audit data from archived audit logs.
If the database is in the unclassified environment, this is not applicable (NA). Verify the instance configuration parameters so that the instance is strictly compliant with NIST SP 800-131A. Check the DB2 registry variable DB2COMM is set to SSL: $db2set -all If DB2COMM is not set to SSL, this is a finding. Find the value of SSL_VERSIONS by running: $db2 get dbm cfg If SSL_VERSIONS is not set to TLSV12, this is a finding. Find the value of SSL_CIPHERSPECS by running: $db2 get dbm cfg If SSL_CIPHERSPECS is not set to a symmetric algorithm key length that is greater than or equal to 112, this is a finding. Find the value of SSL_SVC_LABEL by running: $db2 get dbm cfg If the parameter SSL_SVC_LABEL is not set to a certificate with RSA key length that is greater than or equal to 2048, this is a finding. If the certificate does not have a digital signature with minimum SHA2, this is a finding. The above settings ensure that all connections over SSL in any CLP or Java application strictly adhere to NIST SP 800-131A.
Setting instance configuration parameters so that the instance is strictly compliant with NIST SP 800-131A. Set the DB2 registry variable DB2COMM to SSL: $db2set DB2COMM=SSL Set the DB2 database manager configuration parameter SSL_VERSIONS to TLSV12: $db2 update dbm cfg using SSL_VERSIONS TLSV12 Set the DB2 database manager configuration parameter SSL_CIPHERSPECS to a symmetric algorithm key length that is greater than or equal to 112: $db2 update dbm cfg using SSL_CIPHERSPECS TLS_RSA_WITH_AES_256_GCM_SHA384 Set the database manager configuration parameter SSL_SVC_LABEL to a certificate with RSA key length that is greater than or equal to 2048. That certificate must also have a digital signature with minimum SHA2. Create the certificate. Example: $gsk8capicmd_64 -cert -create -db "mydbserver.kdb" -pw "password" -size 2048 -sigalg SHA256WithRSA -label "myselfsigned_SHA2_2K" -dn "CN=myhost.mycompany.com,O=myOrganization, OU=myOrganizationUnit,L=myLocation,ST=ON,C=CA" $db2 update dbm cfg using SSL_SVR_LABEL myselfsigned_SHA_2K Note: Here is an example of SSL set up on Linux: 1. Create a directory "ssl" $mkdir ssl 2. Make sure gsk8capicmd_64 command in PATH $ export PATH=$PATH:/home/db2inst1/sqllib/gskit/bin 3. Make sure library is in path $ echo $LD_LIBRARY_PATH /home/db2inst1/sqllib/lib64:/home/db2inst1/sqllib/lib64/gskit:/home/db2inst1/sqllib/lib32 4. Go to ssl directory (/home/db2inst1/ssl) 5. Create Server key database $db2inst1@potserver:~/ssl> gsk8capicmd_64 -keydb -create -db "mydbserver.kdb" -pw "password" -stash $db2inst1@potserver:~/ssl> ls $mydbserver.crl mydbserver.kdb mydbserver.rdb mydbserver.sth 6. To create a self-signed certificate with a label of myselfsigned, use the GSKCapiCmd command as shown in the following example: $gsk8capicmd_64 -cert -create -db "mydbserver.kdb" -pw "password" -label "myselfsigned" -dn "CN=myhost.mycompany.com,O=myOrganization, OU=myOrganizationUnit,L=myLocation,ST=ON,C=CA" 7. Extract the certificate you just created to a file, so that you can distribute it to computers running clients that will be establishing SSL connections to your DB2 server. For example, the following GSKCapiCmd command extracts the certificate to a file called mydbserver.arm: $gsk8capicmd_64 -cert -extract -db "mydbserver.kdb" -pw "password" -label "myselfsigned" -target "mydbserver.arm" -format ascii -fips 8. Set database manager configuration parameters: $db2 update dbm cfg using SSL_SVR_KEYDB /home/db2inst1/ssl/mydbserver.kdb $db2 update dbm cfg using SSL_SVR_STASH /home/db2inst1/ssl/mydbserver.sth $db2 update dbm cfg using SSL_SVR_LABEL SSLLabel $db2 update dbm cfg using SSL_SVCENAME 50602 9. Add the value SSL to the DB2COMM registry variable. For example: $db2set -i db2inst1 DB2COMM=SSL or $db2set -i db2inst1 DB2COMM=SSL