{"stig":{"title":"IBM DB2 V10.5 LUW Security Technical Implementation Guide","version":"2","release":"1"},"checks":[{"vulnId":"V-213670","ruleId":"SV-213670r879511_rule","severity":"medium","ruleTitle":"DB2 must limit the number of concurrent sessions to an organization-defined number per user for all accounts and/or account types.","description":"Database management includes the ability to control the number of users and user sessions utilizing a DBMS. Unlimited concurrent connections to the DBMS could allow a successful Denial of Service (DoS) attack by exhausting connection resources; and a system can also fail or be degraded by an overload of legitimate users. Limiting the number of concurrent sessions per user is helpful in reducing these risks.\n\nThis requirement addresses concurrent session control for a single account. It does not address concurrent sessions by a single user via multiple system accounts; and it does not deal with the total number of sessions across all accounts.\n\nThe capability to limit the number of concurrent sessions per user must be configured in or added to the DBMS (for example, by use of a logon trigger), when this is technically feasible. Note that it is not sufficient to limit sessions via a web server or application server alone, because legitimate users and adversaries can potentially connect to the DBMS by other means.\n\nThe organization will need to define the maximum number of concurrent sessions by account type, by account, or a combination thereof. In deciding on the appropriate number, it is important to consider the work requirements of the various types of users. For example, 2 might be an acceptable limit for general users accessing the database via an application; but 10 might be too few for a database administrator using a database management GUI tool, where each query tab and navigation pane may count as a separate session.\n\n(Sessions may also be referred to as connections or logons, which for the purposes of this requirement are synonyms.)","checkContent":"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.\n\nThe 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.\n \nFind the value of CONNECT_PROC by running the following command:\n\n     $db2 get db cfg\n\nIf the value of CONNECT_PROC is null (i.e., not set), this is a finding. \n\nIf the value of CONNECT_PROC is set, run the following command to review the DDL for the connect procedure: \nDB2> SELECT text FROM SYSCAT.ROUTINES WHERE ROUTINENAME=<MY_CONNECT>\n\nIf the connect procedure does not restrict the user sessions as per organization guidelines, this is a finding.","fixText":"Create the stored procedure per organization guidelines to restrict the number of concurrent sessions using the CREATE or REPLACE procedure:\nDB2> CREATE or REPLACE   PROCEDURE <DBINST1.MY_CONNECT> (Example below.)\n\nUpdate the database CONNECT_PROC parameter to set to the procedure created in previous step:\n\n     $db2 update db cfg using CONNECT_PROC db2inst1.my_connect\n\nGrant execute to the public to connect the procedure.\nDB2> GRANT EXECUTE ON procedure <schema>.MY_CONNECT_MAIN TO PUBLIC\n\nNote:  This is an example. Modify and test to comply with organization policy.\n\nCREATE OR REPLACE PROCEDURE db2inst1.my_connect_main()\nBEGIN\n   DECLARE vcount integer;\n   DECLARE vcount_admin integer;\n 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();\n 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');\nIF (vcount_admin > 0 AND vcount > 5)\nTHEN\n      SIGNAL SQLSTATE '42502' SET MESSAGE_TEXT='Connection refused. More than 5 connections not allowed for admin!';\nELSEIF (vcount > 3 AND vcount_admin = 0)\nTHEN\n      SIGNAL SQLSTATE '42502' SET MESSAGE_TEXT='Connection refused. More than 3 connections not allowed!';\nEND IF;\nEND\n@ \n\nNote: @ sign in above statement is statement terminator, using db2 –t option, statement terminator can be changed \n\nDB2> GRANT EXECUTE ON PROCEDURE  db2inst1.my_connect_main TO PUBLIC\n\n     $db2 UPDATE DB CFG USING CONNECT_PROC db2inst1. my_connect_main","ccis":["CCI-000054"]},{"vulnId":"V-213671","ruleId":"SV-213671r879522_rule","severity":"medium","ruleTitle":"DB2 must integrate with an organization-level authentication/access mechanism providing account management and automation for all users, groups, roles, and any other principals.","description":"Enterprise environments make account management for applications and databases challenging and complex. A manual process for account management functions adds the risk of a potential oversight or other error. Managing accounts for the same person in multiple places is inefficient and prone to problems with consistency and synchronization.\n\nA comprehensive application account management process that includes automation helps to ensure that accounts designated as requiring attention are consistently and promptly addressed. \n\nExamples include, but are not limited to, using automation to take action on multiple accounts designated as inactive, suspended, or terminated, or by disabling accounts located in non-centralized account stores, such as multiple servers. Account management functions can also include: assignment of group or role membership; identifying account type; specifying user access authorizations (i.e., privileges); account removal, update, or termination; and administrative alerts. The use of automated mechanisms can include, for example: using email or text messaging to notify account managers when users are terminated or transferred; using the information system to monitor account usage; and using automated telephone notification to report atypical system account usage.\n\nThe DBMS must be configured to automatically utilize organization-level account management functions, and these functions must immediately enforce the organization's current account policy. \n\nAutomation may be comprised of differing technologies that when placed together contain an overall mechanism supporting an organization's automated account management requirements.","checkContent":"The default name and location for the IBM LDAP security plug-in configuration file is:\n\nOn UNIX/LINUX: INSTHOME/sqllib/cfg/IBMLDAPSecurity.ini\n\nOn Windows: %DB2PATH%\\cfg\\IBMLDAPSecurity.ini\n\nIf the IBMLDAPSecurity.ini  file does not exist in the default location and environment variable DB2LDAPSecurityConfig  is not set, this is a finding. \n\nIf the environment variable DB2LDAPSecurityConfig is set and file does not exist in DB2LDAPSecurityConfig location, this is a finding. \n\nFind the value of SRVCON_PW_PLUGIN by running \n\n     $db2 get dbm cfg\n\nIf SRVCON_PW_PLUGIN is not set to IBMLDAPauthserver, this is a finding. \n\nNote:\nIn Windows, find the location of base installation directory of DB2 using one of following methods\n1. Find the value of DB2PATH variable using  db2set –all on DB2 CLP \n2. Run db2level command\n3. Go to Registry Editor in Windows\n     Computer >> HKEY_LOCAL_MACHINE >> SOFTWARE >> IBM >> DB2 >> installedCopies >> DB2COPY1\nThen find the value of the DB2 Path Name","fixText":"Create an IBMLDAPSecurity.ini file at the default name and location for the IBM LDAP security plug-in configuration file:\n\n    On UNIX/LINUX:  $INSTHOME/sqllib/cfg/IBMLDAPSecurity.ini\n    On Windows:  %DB2PATH%\\cfg\\IBMLDAPSecurity.ini\n\nTo create the file in a non-default location, set the environment variable DB2LDAPSecurityConfig to the directory name where configuration file IBMLDAPSecurity.ini is located. \n\nSet the value of SRVCON_PW_PLUGIN to IBMLDAPauthserver for instance by running the following command:\n\n     $db2 update dbm cfg using SRVCON_PW_PLUGIN IBMLDAPauthserver immediate\n\nRefer to details below to determine appropriate values in LDAP configuration file.\n\n-- SERVER-RELATED values:\n1) 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. \n\nFor example: host1[:port1] [host2:[port2] ... The default port number is 389, or 636 if SSL is enabled.\n\n2) 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).\n\n3) 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. \n\nFor example: SSL_KEYFILE = /home/db2inst1/IBMLDAPSecurity.kdb\n\n4) SSL_PW - The SSL keyring password. For example: SSL_PW = keyfile-password\n\n5) 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. \n\nBy default, SECURITY_PROTOCOL is not set. This setting means TLS 1.2 is not supported.\n\n-- USER_RELATED values:\n1) USER_OBJECTCLASS - The LDAP object class used for users. \n\nGenerally, set USER_OBJECTCLASS to inetOrgPerson (the user for Microsoft Active Directory) \n\nFor example: USER_OBJECTCLASS = inetOrgPerson\n\n2) 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. \n\nFor example: USER_BASEDN = o=ibm\n\n3) 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. \n\nFor example, if USERID_ATTRIBUTE = uid, then issuing this statement: db2 connect to MYDB user bob using bobpass results in the following search filter:\n&(objectClass=inetOrgPerson)(uid=bob)\n\n4) AUTHID_ATTRIBUTE - The LDAP user attribute that represents the DB2 authorization ID. Usually this is the same as the USERID_ATTRIBUTE.\nFor example: AUTHID_ATTRIBUTE = uid\n\n-- GROUP-RELATED values: \n1) GROUP_OBJECTCLASS - The LDAP object class used for groups. Generally this is groupOfNames or groupOfUniqueNames\n(for Microsoft Active Directory, it is group)\n\nFor example: GROUP_OBJECTCLASS = groupOfNames\n\n2) 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.\n\nFor example: GROUP_BASEDN = o=ibm\n\n3) GROUPNAME_ATTRIBUTE - The LDAP group attribute that represents the name of the group.\n\nFor example: GROUPNAME_ATTRIBUTE = cn\n\n4) GROUP_LOOKUP_ METHOD - Determines the method used to find the group memberships for a user. \nPossible values are:\nSEARCH_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). \n\nUSER_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).\n\nFor example: GROUP_LOOKUP_METHOD = SEARCH_BY_DN\nGROUP_LOOKUP_METHOD = USER_ATTRIBUTE\n\n5) GROUP_LOOKUP_ATTRIBUTE - Name of the attribute used to determine group membership, as described for GROUP_LOOKUP_METHOD.\n\nFor example:\nGROUP_LOOKUP_ATTRIBUTE = member\nGROUP_LOOKUP_ATTRIBUTE = ibm-allGroups\nNESTED_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.\n\nCycles (such as A belongs to B, and B belongs to A) are handled correctly.\nThis parameter is optional, and defaults to FALSE.\n\n-- MISCELLANEOUS  values:\n1) 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.\n\nFor example:\nSEARCH_DN = cn=root\nSEARCH_PW = rootpassword\n\n2) DEBUG  Set DEBUG to TRUE to write extra information to the db2diag log files to aid in debugging LDAP related issues.\n\nMost of the additional information is logged at\nDIAGLEVEL 4 (INFO).\nDEBUG defaults to false.","ccis":["CCI-000015"]},{"vulnId":"V-213672","ruleId":"SV-213672r879530_rule","severity":"medium","ruleTitle":"DB2 must enforce approved authorizations for logical access to information and system resources in accordance with applicable access control policies.","description":"Authentication with a DoD-approved PKI certificate does not necessarily imply authorization to access the DBMS.  To mitigate the risk of unauthorized access to sensitive information by entities that have been issued certificates by DoD-approved PKIs, all DoD systems, including databases, must be properly configured to implement access control policies. \n\nSuccessful authentication must not automatically give an entity access to an asset or security boundary. Authorization procedures and controls must be implemented to ensure each authenticated entity also has a validated and current authorization. Authorization is the process of determining whether an entity, once authenticated, is permitted to access a specific asset. Information systems use access control policies and enforcement mechanisms to implement this requirement. \n\nAccess control policies include identity-based policies, role-based policies, and attribute-based policies. Access enforcement mechanisms include access control lists, access control matrices, and cryptography. These policies and mechanisms must be employed by the application to control access between users (or processes acting on behalf of users) and objects (e.g., devices, files, records, processes, programs, and domains) in the information system. \n\nThis requirement is applicable to access control enforcement applications, a category that includes database management systems.  If the DBMS does not follow applicable policy when approving access, it may be in conflict with networks or other applications in the information system. This may result in users either gaining or being denied access inappropriately and in conflict with applicable policy.","checkContent":"Use the following query to determine if PUBLIC has been directly granted any privileges on objects in the database:\n\nDB2> SELECT PRIVILEGE, OBJECTNAME, OBJECTSCHEMA, OBJECTTYPE FROM SYSIBMADM.PRIVILEGES WHERE AUTHID = 'PUBLIC'\n\nIf any rows are returned, this is a finding.\n\nUse the following query to determine if PUBLIC has been granted membership in any database roles:\n\nDB2> SELECT ROLENAME  FROM TABLE (SYSPROC.AUTH_LIST_ROLES_FOR_AUTHID ('PUBLIC', 'G') )\n\nFor each role returned by this query, determine if any privileges have been granted to it with the following query:\n\nDB2> SELECT PRIVILEGE, OBJECTNAME, OBJECTSCHEMA, OBJECTTYPE FROM SYSIBMADM.PRIVILEGES WHERE AUTHID = '<rolename>' AND AUTHIDTYPE = 'R'\n\nIf any rows are returned, this is a finding.\n\nUse the following query to determine if PUBLIC has been granted any database authorities directly or indirectly through a database role:\n\nDB2> SELECT AUTHORITY, D_PUBLIC, ROLE_PUBLIC FROM TABLE(SYSPROC.AUTH_LIST_AUTHORITIES_FOR_AUTHID ('PUBLIC', 'G') )\n\nIf 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.","fixText":"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).\n\nDB2> REVOKE EXECUTE ON PACKAGE X.Y FROM PUBLIC\n\nIf 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. \n\nDB2> REVOKE ROLE <role name> FROM PUBLIC\n\nIf 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: \n\nDB2> REVOKE CONNECT ON DATABASE FROM PUBLIC\n\nIf an authority is granted indirectly to PUBLIC through a database role, revoke membership in that database role from PUBLIC using the REVOKE (role) statement. \n\nDB2> REVOKE ROLE <role name> FROM PUBLIC\n\nTo determine what database roles PUBLIC belongs, issue this query:\n\nDB2> SELECT ROLENAME  FROM TABLE (SYSPROC.AUTH_LIST_ROLES_FOR_AUTHID ('PUBLIC', 'G') )\n\nNotes: 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:\n\nDB2> CREATE DATABASE <dbname> RESTRICTIVE\n\nOne 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: \n\n$db2 get db cfg\n\nhttp://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\n\nAs 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.","ccis":["CCI-000213"]},{"vulnId":"V-213673","ruleId":"SV-213673r879554_rule","severity":"medium","ruleTitle":"DB2 must protect against a user falsely repudiating having performed organization-defined actions.","description":"Non-repudiation of actions taken is required in order to maintain data integrity. Examples of particular actions taken by individuals include creating information, sending a message, approving information (e.g., indicating concurrence or signing a contract), and receiving a message. \n\nNon-repudiation protects against later claims by a user of not having created, modified, or deleted a particular data item or collection of data in the database.\n\nIn designing a database, the organization must define the types of data and the user actions that must be protected from repudiation. The implementation must then include building audit features into the application data tables, and configuring the DBMS' audit tools to capture the necessary audit trail. Design and implementation also must ensure that applications pass individual user identification to the DBMS, even where the application connects to the DBMS with a standard, group account.","checkContent":"Run the following SQL statement to ensure that an audit policy is defined upon all the required application tables and/or the database:\nDB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN ('T',' ')\n\nIf no rows are returned, this is a finding. \n\nIf a row with OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. \n\nIf a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy. \n\nFor 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: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, EXECUTESTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES\n\nIf 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. \n\nIf 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. \n\nIf 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.","fixText":"Define the audit policy using the following Create Audit Policy SQL statement:\nDB2> CREATE AUDIT POLICY <audit policy name> \n                CATEGORIES CONTEXT STATUS BOTH, EXECUTE STATUS BOTH\n                ERROR TYPE AUDIT\n\nApply such a policy to either the database as a whole or to the specific application tables using one of these two statements: \nDB2> AUDIT DATABASE USING POLICY <audit policy name> \n Or \nDB2> AUDIT TABLE <table name> USING POLICY <audit policy name> \n\nNote : 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.","ccis":["CCI-000166"]},{"vulnId":"V-213674","ruleId":"SV-213674r879559_rule","severity":"medium","ruleTitle":"DB2 must provide audit record generation capability for DoD-defined auditable events within all DBMS/database components.","description":"Without the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n\nAudit records can be generated from various components within the DBMS (e.g., process, module). Certain specific application functionalities may be audited as well. The list of audited events is the set of events for which audits are to be generated. This set of events is typically a subset of the list of all events for which the system is capable of generating audit records.\n\nDoD has defined the list of events for which the DBMS will provide an audit record generation capability as the following: \n\n(i) Successful and unsuccessful attempts to access, modify, or delete privileges, security objects, security levels, or categories of information (e.g., classification levels);\n(ii) Access actions, such as successful and unsuccessful logon attempts, privileged activities, or other system-level access, starting and ending time for user access to the system, concurrent logons from different workstations, successful and unsuccessful accesses to objects, all program initiations, and all direct access to the information system; and\n(iii) All account creation, modification, disabling, and termination actions.\n\nOrganizations may define additional events requiring continuous or ad hoc auditing.","checkContent":"To meet these requirements, at the minimum AUDIT, CHECKING, CONTEXT, SECMAINT, SYSADMIN, and VALIDATE category auditing need to be implemented at the database level. \n\nRun the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ') \n\nIf no rows are returned, this is a finding. \n\nUsing the AUDITPOLICYID from the query above find the details of the audit policy. \nDB2> SELECT AUDITPOLICYNAME, AUDITSTATUS, CHECKINGSTATUS, CONTEXTSTATUS, SECMAINTSTATUS, SYSADMINSTATUS, VALIDATESTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for AUDITSTATUS, CHECKINGSTATUS, CONTEXTSTATUS, SECMAINTSTATUS, SYSMADMINSTATUS and VALIDATESTATUS  are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Define an audit policy using the CREATE AUDIT POLICY SQL statement:\nDB2> 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\n\nTo 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.\n\nIf CREATE was used above, apply the policy created above to the database:\nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000169"]},{"vulnId":"V-213675","ruleId":"SV-213675r879560_rule","severity":"medium","ruleTitle":"DB2 must allow only the ISSM (or individuals or roles appointed by the ISSM) to select which auditable events are to be audited.","description":"Without the capability to restrict which roles and individuals can select which events are audited, unauthorized personnel may be able to prevent or interfere with the auditing of critical events.\n\nSuppression of auditing could permit an adversary to evade detection.\n\nMisconfigured audits can degrade the system's performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.","checkContent":"Run the following command to find the value of the SYSADM_GROUP parameter: \n\n     $db2 get dbm cfg \n\nOnly 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.\n\nOn Windows systems, if the SYSADM_GROUP database manager configuration parameter is not specified, this is a finding.\n\nDatabase level audit\n\nThe 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:\n\n- The SYSPROC.AUDIT_ARCHIVE stored procedure archives audit logs.\n- The SYSPROC.AUDIT_LIST_LOGS table function allows you to locate logs of interest.\n- The SYSPROC.AUDIT_DELIM_EXTRACT stored procedure extracts data into delimited files for analysis.\n\nThe security administrator can also grant EXECUTE privilege on these routines to another user.\n\nRun the following query to find out which users have SECADM authority in database: \nDB2> SELECT CHAR(GRANTOR,35) AS GRANTOR, CHAR(GRANTEE,35) AS GRANTEE, GRANTEETYPE \n           FROM SYSCAT.DBAUTH\n           WHERE SECURITYADMAUTH='Y'\n\nIf GRANTEETYPE is 'U' and the authorization ID is not an ISSM authorized user, this is a finding. \n\nIf the GRANTEETYPE is 'G', then all members of the external group identified by GRANTEE must be ISSM authorized users, otherwise this is a finding.\n\nIf the GRANTEETYPE is 'R', then all members of the database role identified by GRANTEE must be ISSM authorized users, otherwise this is a finding.\n\nThe members of a role can be found using this statement: \nDB2> SELECT CHAR(GRANTOR,35) AS GRANTOR, CHAR(GRANTEE,35) AS GRANTEE, GRANTEETYPE\n           FROM SYSCAT.ROLEAUTH\n           WHERE ROLENAME= <search role name>\n\nRun the following query to find out which users have execute privilege on SYSPROC.AUDIT_ARCHIVE, SYSPROC.AUDIT_LIST_LOGS, SYSPROC.AUDIT_DELIM_EXTRACT: \nDB2> SELECT * \n           FROM SYSCAT.ROUTINEAUTH\n           WHERE SPECIFICNAME LIKE 'AUDIT%' AND SCHEMA='SYSPROC'\n\nIf non-ISSM authorized users have execute privilege on any of above three routines, this is a finding.","fixText":"Update the value SYSADM_GROUP to a group which has only members approved by the ISSM using the following command: \n\n     $db2 update dbm cfg using SYSADM_GROUP <SYSADMIN GROUP>\n\nRemove users not approved by ISSM from SYSADM_GROUP group using operating system tools/commands.\n\nRevoke SECADM authority from non-ISSM users using the SQL statement: \nDB2> REVOKE SECADM ON DATABASE FROM USER <user name> \n\nRemove non-ISSM members using the following the following SQL statement: \nDB2> REVOKE SECADM ON DATABASE FROM GROUP <group name> \n\nRevoke SECADM from the group or role using the following SQL statement: \nDB2> REVOKE SECADM ON DATABASE FROM ROLE <role name> \n\nRevoke 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.\n\nNote: 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.\n\nThe 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.\n\nSYSADM 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.","ccis":["CCI-000171"]},{"vulnId":"V-213676","ruleId":"SV-213676r879561_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when privileges/permissions are retrieved.","description":"Under some circumstances, it may be useful to monitor who/what is reading privilege/permission/role information. Therefore, it must be possible to configure auditing to do this. DBMSs typically make such information available through views or functions.\n\nThis requirement addresses explicit requests for privilege/permission/role membership information. It does not refer to the implicit retrieval of privileges/permissions/role memberships that the DBMS continually performs to determine if any and every action on the database is permitted.","checkContent":"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:\n\nSYSIBM.SYSINDEXAUTH\nSYSIBM.SYSPLANAUTH\nSYSIBM.SYSPASSTHRUAUTH\nSYSIBM.SYSROUTINEAUTH\nSYSIBM.SYSSCHEMAAUTH\nSYSIBM.SYSSECURITYLABELACCESS\nSYSIBM.SYSSECURITYPOLICYEXEMPTIONS\nSYSIBM.SYSSEQUENCEAUTH\nSYSIBM.SYSSURROGATEAUTHIDS\nSYSIBM.SYSTABAUTH \nSYSIBM.SYSTBSPACEAUTH \nSYSIBM.SYSXSROBJECTAUTH\nSYSIBM.SYSCOLAUTH\nSYSIBM.SYSLIBRARYAUTH\nSYSIBM.SYSMODULEAUTH\nSYSIBM.SYSROLEAUTH\nSYSIBM.SYSVARIABLEAUTH\nSYSIBM.SYSWORKLOADAUTH\nSYSIBM.SYSDBAUTH\nSYSIBM.SYSUSERAUTH\n\nRun the following SQL statement to ensure that an audit policy is defined upon the above catalog tables and/or the database:\n\nDB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE \nFROM SYSCAT.AUDITUSE \nWHERE OBJECTTYPE IN ('T',' ')\n\nIf no rows are returned, this is a finding. \n\nIf a row with the OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. \n\nIf a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy.\n\nFor 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:\n\nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, EXECUTESTATUS, ERRORTYPE AS ERRORTYPE \nFROM SYSCAT.AUDITPOLICIES\n\nIf the values for CONTEXTSTATUS and EXECUTESTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.\n\nIf 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.\n\nIf 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.","fixText":"Define the audit policy using the CREATE AUDIT POLICY SQL statement:\nDB2> CREATE AUDIT POLICY CATALOGAUDIT CATEGORIES CONTEXT STATUS BOTH, EXECUTE STATUS BOTH ERROR TYPE AUDIT\n\nTo 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.\n\nIf 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:\nDB2> AUDIT DATABASE USING POLICY CATALOGAUDIT \n  Or \nDB2> AUDIT TABLE <table name> USING POLICY CATALOGAUDIT\n\nNote: 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.","ccis":["CCI-000172"]},{"vulnId":"V-213677","ruleId":"SV-213677r879561_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when unsuccessful attempts to retrieve privileges/permissions occur.","description":"Under some circumstances, it may be useful to monitor who/what is reading privilege/permission/role information. Therefore, it must be possible to configure auditing to do this. DBMSs typically make such information available through views or functions.\n\nThis requirement addresses explicit requests for privilege/permission/role membership information. It does not refer to the implicit retrieval of privileges/permissions/role memberships that the DBMS continually performs to determine if any and every action on the database is permitted.\n\nTo aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.","checkContent":"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:\n\nSYSIBM.SYSINDEXAUTH\nSYSIBM.SYSPLANAUTH\nSYSIBM.SYSPASSTHRUAUTH\nSYSIBM.SYSROUTINEAUTH\nSYSIBM.SYSSCHEMAAUTH\nSYSIBM.SYSSECURITYLABELACCESS\nSYSIBM.SYSSECURITYPOLICYEXEMPTIONS\nSYSIBM.SYSSEQUENCEAUTH\nSYSIBM.SYSSURROGATEAUTHIDS\nSYSIBM.SYSTABAUTH \nSYSIBM.SYSTBSPACEAUTH \nSYSIBM.SYSXSROBJECTAUTH\nSYSIBM.SYSCOLAUTH\nSYSIBM.SYSLIBRARYAUTH\nSYSIBM.SYSMODULEAUTH\nSYSIBM.SYSROLEAUTH\nSYSIBM.SYSVARIABLEAUTH\nSYSIBM.SYSWORKLOADAUTH\nSYSIBM.SYSDBAUTH\nSYSIBM.SYSUSERAUTH\n\nRun the following SQL statement to ensure that an audit policy is defined upon the above catalog tables and/or the database:\n\nDB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE \nFROM SYSCAT.AUDITUSE WHERE OBJECTTYPE IN ('T',' ')\n\nIf no rows are returned, this is a finding. \n\nIf a row with the OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. \n\nIf a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy.\n\nFor 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:\n\nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, EXECUTESTATUS, ERRORTYPE AS ERRORTYPE \nFROM SYSCAT.AUDITPOLICIES\n\nIf 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.\n\nIf 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.\n\nIf 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.","fixText":"Define an audit policy using the CREATE AUDIT POLICY SQL statement:\n\nDB2> CREATE AUDIT POLICY <audit policy name>  CATEGORIES CONTEXT STATUS BOTH, EXECUTE STATUS BOTH ERROR TYPE AUDIT\n\nTo 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.\n\nIf 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:\n\nDB2> AUDIT DATABASE USING POLICY <audit policy name> \n  Or \nDB2> AUDIT TABLE <table name> USING POLICY <audit policy name>\n\nNote:  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.","ccis":["CCI-000172"]},{"vulnId":"V-213678","ruleId":"SV-213678r879562_rule","severity":"medium","ruleTitle":"DB2 must initiate session auditing upon startup.","description":"Session auditing is for use when a user's activities are under investigation. To be sure of capturing all activity during those periods when session auditing is in use, it needs to be in operation for the whole time the DBMS is running.","checkContent":"Determine whether there are any individuals for whom the organization requires session auditing.  If there are none, this is not a finding.\n\nType in the following command to check whether or not the user under investigation  is being audited:\nDB2> SELECT AUDITPOLICYNAME, OBJECTNAME, OBJECTTYPE \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN ('i',' ')\n\nIf no rows are returned, this is a finding. \n\nIf a row with the OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. \n\nIf a row with the OBJECTTYPE of 'i' exists in the output, it is a user level policy. \n\nFor each audit policy returned in the statement above, run the following SQL statement to confirm that all categories are part of that policy:\nDB2> SELECT * FROM SYSCAT.AUDITPOLICIES\n\nIf 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.\n\nIf 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. \n\nIf 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.","fixText":"Define an audit policy using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <user audit policy name>\nCATEGORIES 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\n\nTo 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.\n\nIf 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:\nDB2> AUDIT DATABASE USING POLICY <user audit policy name>\n  Or \nDB2> AUDIT USER <user name> USING POLICY <user audit policy name>\n\nNote: 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.","ccis":["CCI-001464"]},{"vulnId":"V-213679","ruleId":"SV-213679r879567_rule","severity":"medium","ruleTitle":"DB2 must produce audit records containing sufficient information to establish the outcome (success or failure) of the events.","description":"Information system auditing capability is critical for accurate forensic analysis. Without information about the outcome of events, security personnel cannot make an accurate assessment as to whether an attack was successful or if changes were made to the security state of the system.\n\nEvent outcomes can include indicators of event success or failure and event-specific results (e.g., the security state of the information system after the event occurred). As such, they also provide a means to measure the impact of an event and help authorized personnel to determine the appropriate response.","checkContent":"Run the following SQL statement to confirm that all audit policies are created with STATUS='B':\nDB2> SELECT * FROM SYSCAT.AUDITPOLICIES\n\nIf 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.","fixText":"Drop and recreate the policy with STATUS set to \"\"Both\"\" or use ALTER POLICY to set the STATUS='B'.\n\nTo drop and recreate a policy use following statements:\nDB2> DROP AUDIT POLICY <audit1>\nDB2> CREATE AUDIT POLICY <audit1> \n          CATEGORIES < audit categories >  STATUS BOTH ERROR TYPE AUDIT\n\nTo alter the audit policy:\nDB2> ALTER AUDIT POLICY <audit1> \n          CATEGORIES < audit categories >  STATUS BOTH ERROR TYPE AUDIT\n\nNotes: 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'.\n\nCREATE AUDIT POLICY information:\nhttp://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0050607.html?lang=en\n\nALTER AUDIT POLICY information:\nhttp://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\"","ccis":["CCI-000134"]},{"vulnId":"V-213680","ruleId":"SV-213680r879569_rule","severity":"medium","ruleTitle":"DB2 must include additional, more detailed, organization-defined information in the audit records for audit events identified by type, location, or subject.","description":"Information system auditing capability is critical for accurate forensic analysis. Reconstruction of harmful events or forensic analysis is not possible if audit records do not contain enough information. To support analysis, some types of events will need information to be logged that exceeds the basic requirements of event type, time stamps, location, source, outcome, and user identity. If additional information is not available, it could negatively impact forensic investigations into user actions or other malicious events.\n\nThe organization must determine what additional information is required for complete analysis of the audited events. The additional information required is dependent on the type of information (e.g., sensitivity of the data and the environment within which it resides). At a minimum, the organization must employ either full-text recording of privileged commands or the individual identities of group users, or both. The organization must maintain audit trails in sufficient detail to reconstruct events to determine the cause and impact of compromise. \n\nExamples of detailed information the organization may require in audit records are full-text recording of privileged commands or the individual identities of group account users.","checkContent":"Check with the ISSO if any more of the organization-defined information needs to be captured as part of DBMS auditing.\n\nIf there is additional information that needs to be captured and is currently not being written to audit logs, this is a finding.","fixText":"Configure the application to write the organization-defined information to a database table.\n\nSet the auditing for the database table capturing the organization-defined information so that it is written to the database audit.\n\nDefine an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement:\nDB2> CREATE AUDIT POLICY <table audit policy name> \n           CATEGORIES CONTEXT STATUS BOTH, EXECUTE STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, apply the policy created to the database: \nDB2> AUDIT TABLE <org info table> using <audit policy name>","ccis":["CCI-000135"]},{"vulnId":"V-213681","ruleId":"SV-213681r879571_rule","severity":"medium","ruleTitle":"Unless it has been determined that availability is paramount, DB2 must, upon audit failure, cease all auditable activity.","description":"It is critical that when the DBMS is at risk of failing to process audit logs as required, it take action to mitigate the failure. Audit processing failures include: software/hardware errors; failures in the audit capturing mechanisms; and audit storage capacity being reached or exceeded. Responses to audit failure depend upon the nature of the failure mode. \n\nWhen the need for system availability does not outweigh the need for a complete audit trail, the DBMS should cease production of audit records immediately, rolling back all in-flight transactions.  DB2 does this when  configured to track audit errors.\n\nSystems where audit trail completeness is paramount will most likely be at a lower MAC level than MAC I; the final determination is the prerogative of the application owner, subject to Authorizing Official concurrence. In any case, sufficient auditing resources must be allocated to avoid a shutdown in all but the most extreme situations.","checkContent":"Ask the ISSO whether the system should stay available or stop processing the auditable events.\n\nIf the system needs to stay available and the Error Type is set to 'A' for the policies then this is not applicable (NA).\n\nRun the following SQL statement to find the Error type value for all audit policies:\nDB2> SELECT * FROM SYSCAT.AUDITPOLICIES\n\nIf the system needs to stop processing the auditable events and Error Type is not set to 'A' then this is a finding.","fixText":"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. \n\nRun the following command to drop and recreate the policy:\nDB2> DROP AUDIT POLICY <audit2>\nDB2> CREATE AUDIT POLICY <audit2> \n          CATEGORIES EXECUTE WITH DATA STATUS BOTH ERROR TYPE AUDIT\n\nTo alter the audit policy:\nDB2> ALTER AUDIT POLICY <audit2> \n          CATEGORIES EXECUTE WITH DATA STATUS BOTH ERROR TYPE AUDIT","ccis":["CCI-000140"]},{"vulnId":"V-213682","ruleId":"SV-213682r879576_rule","severity":"medium","ruleTitle":"The audit information produced by DB2 must be protected from unauthorized read access.","description":"If audit data were to become compromised, then competent forensic analysis and discovery of the true source of potentially malicious system activity is difficult, if not impossible, to achieve. In addition, access to audit records provides information an attacker could potentially use to his or her advantage.\n\nTo ensure the veracity of audit data, the information system and/or the application must protect audit information from any and all unauthorized access. This includes read, write, copy, etc.\n\nThis requirement can be achieved through multiple methods which will depend upon system architecture and design. Some commonly employed methods include ensuring log files enjoy the proper file system permissions utilizing file system protections and limiting log data location. \n\nAdditionally, applications with user interfaces to audit records should not allow for the unfettered manipulation of or access to those records via the application. If the application provides access to the audit data, the application becomes accountable for ensuring that audit information is protected from unauthorized access.\n\nAudit information includes all information (e.g., audit records, audit settings, and audit reports) needed to successfully audit information system activity.","checkContent":"Run db2audit command to find the value of datapath where the audit logs are stored. \n\n     $db2audit describe\n\nOnly the instance owner needs write access to directory and users authorized to archive the audit logs need to have read access to audit directory. \n\nIf any user other than the instance owner has write access to audit directory, this is a finding.\n\nIf any user other than the users authorized to read audit log files have read access to audit directory, this is a finding.","fixText":"Remove the write permission from non-instance owner users on the audit directory.\n\nRemove the read permission from non-authorized users from audit directory.\n\nOnly the instance owner needs write access to directory and users authorized to archive the audit logs need to have read access to audit directory. \n\nChange 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.","ccis":["CCI-000162"]},{"vulnId":"V-213683","ruleId":"SV-213683r879577_rule","severity":"medium","ruleTitle":"The audit information produced by DB2 must be protected from unauthorized modification.","description":"If audit data were to become compromised, then competent forensic analysis and discovery of the true source of potentially malicious system activity is impossible to achieve. \n\nTo ensure the veracity of audit data the information system and/or the application must protect audit information from unauthorized modification. \n\nThis requirement can be achieved through multiple methods that will depend upon system architecture and design. Some commonly employed methods include ensuring log files enjoy the proper file system permissions and limiting log data locations. \n\nApplications providing a user interface to audit data will leverage user permissions and roles identifying the user accessing the data and the corresponding rights that the user enjoys in order to make access decisions regarding the modification of audit data.\n\nAudit information includes all information (e.g., audit records, audit settings, and audit reports) needed to successfully audit information system activity. \n\nModification of database audit data could mask the theft of, or the unauthorized modification of, sensitive data stored in the database.","checkContent":"Run the db2audit command to find the value of the datapath where the audit logs are stored.\n\n     $db2audit describe\n\nOnly 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.\n\nIf any user other than the instance owner has write access to the audit directory, this is a finding.\n\nIf any user other than the users authorized to read audit log files have read access to audit directory, this is a finding.","fixText":"At the operating system level, remove the write permission from non-instance owner users on the audit directory.\n\nAt the operating system level, remove the  read permission from non-authorized users on the audit directory.","ccis":["CCI-000163"]},{"vulnId":"V-213684","ruleId":"SV-213684r879578_rule","severity":"medium","ruleTitle":"The audit information produced by DB2 must be protected from unauthorized deletion.","description":"If audit data were to become compromised, then competent forensic analysis and discovery of the true source of potentially malicious system activity is impossible to achieve.\n\nTo ensure the veracity of audit data, the information system and/or the application must protect audit information from unauthorized deletion. This requirement can be achieved through multiple methods which will depend upon system architecture and design.\n\nSome commonly employed methods include: ensuring log files enjoy the proper file system permissions utilizing file system protections; restricting access; and backing up log data to ensure log data is retained.\n\nApplications providing a user interface to audit data will leverage user permissions and roles identifying the user accessing the data and the corresponding rights the user enjoys in order make access decisions regarding the deletion of audit data.\n\nAudit information includes all information (e.g., audit records, audit settings, and audit reports) needed to successfully audit information system activity.\n\nDeletion of database audit data could mask the theft of, or the unauthorized modification of, sensitive data stored in the database.","checkContent":"Run the db2audit command to find the value of the datapath where the audit logs are stored. \n\n     $db2audit describe\n\nOnly 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.\n\nIf any user other than the instance owner has write access to audit directory, this is a finding.\n\nIf any user other than the users authorized to read audit log files have read access to the audit directory, this is a finding.","fixText":"At the operating system level, remove the write permission from non-instance owner users on the audit directory.\n\nAt the operating system level, remove the  read permission from non-authorized users on the audit directory.","ccis":["CCI-000164"]},{"vulnId":"V-213685","ruleId":"SV-213685r879579_rule","severity":"medium","ruleTitle":"DB2 must protect its audit features from unauthorized access.","description":"Protecting audit data also includes identifying and protecting the tools used to view and manipulate log data. \n\nDepending upon the log format and application, system and application log tools may provide the only means to manipulate and manage application and system log data. It is, therefore, imperative that access to audit tools be controlled and protected from unauthorized access. \n\nApplications providing tools to interface with audit data will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user enjoys in order make access decisions regarding the access to audit tools.\n\nAudit tools include, but are not limited to, OS-provided audit tools, vendor-provided audit tools, and open source audit tools needed to successfully view and manipulate audit information system activity and records. \n\nIf an attacker were to gain access to audit tools, he could analyze audit logs for system weaknesses or weaknesses in the auditing itself. An attacker could also manipulate logs to hide evidence of malicious activity.","checkContent":"Run the following command to find the value of the SYSADM_GROUP parameter:\n\n     $db2 get dbm cfg \n\nOnly authorized OS users should be part of this group. If non-authorized users are part of SYSADM_GROUP group, this is a finding.\n\nOn Windows systems, if the SYSADM_GROUP database manager configuration parameter is not specified, this is a finding.\n\nSecurity 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:\n\n- The SYSPROC.AUDIT_ARCHIVE stored procedure archives audit logs.\n- The SYSPROC.AUDIT_LIST_LOGS table function allows you to locate logs of interest.\n- The SYSPROC.AUDIT_DELIM_EXTRACT stored procedure extracts data into delimited files for analysis.\n\nThe security administrator can also grant EXECUTE privilege on these routines to another user.\n\nRun the following query to find out which users have SECADM authority in database: \nDB2> SELECT CHAR(GRANTOR,35) AS GRANTOR, CHAR(GRANTEE,35) AS GRANTEE, GRANTEETYPE\n           FROM SYSCAT.DBAUTH \n           WHERE SECURITYADMAUTH='Y'\n\nIf GRANTEETYPE is 'U' and the authorization ID is not an authorized user, this is a finding.\n\nIf the GRANTEETYPE is 'G', then all members of the external group identified by GRANTEE must be authorized users. Otherwise, this is a finding.\n\nIf the GRANTEETYPE is 'R', then all members of the database role identified by GRANTEE must be authorized users. Otherwise, this is a finding.\n\nThe members of a role can be found using this statement: \nDB2> SELECT CHAR(GRANTOR,35) AS GRANTOR, CHAR(GRANTEE,35) AS GRANTEE, GRANTEETYPE \n           FROM SYSCAT.ROLEAUTH \n           WHERE ROLENAME= <search role name>\n\nRun the following query to find out which users have execute privilege on SYSPROC.AUDIT_ARCHIVE, SYSPROC.AUDIT_LIST_LOGS, SYSPROC.AUDIT_DELIM_EXTRACT:\nDB2> SELECT * \n           FROM SYSCAT.ROUTINEAUTH \n           WHERE SPECIFICNAME LIKE 'AUDIT%' AND SCHEMA='SYSPROC'\n\nIf non-authorized users have EXECUTE privilege on any of the above three routines, this is a finding.","fixText":"Update the value SYSADM_GROUP to a group which has only members approved by ISSM using following command: \n\n     $db2 update dbm cfg using SYSADM_GROUP <SYSADMIN GROUP>\n\nRemove unauthorized users from the SYSADM_GROUP using the operating system tools/commands. \n\nRevoke SECADM authority from non-authorized users using the SQL statement below:\nDB2> REVOKE SECADM ON DATABASE FROM USER <user name> \n\nRemove non-authorized members or revoke SECADM from the group or role using this SQL statement:\nDB2> REVOKE SECADM ON DATABASE FROM GROUP <group name> \nDB2> REVOKE SECADM ON DATABASE FROM ROLE <role name> \n\nRevoke 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.","ccis":["CCI-001493"]},{"vulnId":"V-213686","ruleId":"SV-213686r879580_rule","severity":"medium","ruleTitle":"DB2 must protect its audit configuration from unauthorized modification.","description":"Protecting audit data also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit data.\n\nApplications providing tools to interface with audit data will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user enjoys in order make access decisions regarding the modification of audit tools.\n\nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.","checkContent":"Run the following command to find the value of the SYSADM_GROUP parameter:\n\n     $db2 get dbm cfg \n\nOnly authorized OS users should be part of this group. If non-authorized users are part of SYSADM_GROUP group, this is a finding.\n\nOn Windows systems, if the SYSADM_GROUP database manager configuration parameter is not specified, this is a finding.\n\nThe 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:\n\n- The SYSPROC.AUDIT_ARCHIVE stored procedure archives audit logs.\n- The SYSPROC.AUDIT_LIST_LOGS table function allows you to locate logs of interest.\n- The SYSPROC.AUDIT_DELIM_EXTRACT stored procedure extracts data into delimited files for analysis.\n\nThe security administrator can also grant EXECUTE privilege on these routines to another user.\n\nRun the following query to find out which users have SECADM authority in the database: \nDB2> SELECT CHAR(GRANTOR,35) AS GRANTOR, CHAR(GRANTEE,35) AS GRANTEE, GRANTEETYPE  \n           FROM SYSCAT.DBAUTH \n           WHERE SECURITYADMAUTH='Y'\n\nIf GRANTEETYPE is 'U' and the authorization ID is not an authorized user, this is a finding.\n\nIf the GRANTEETYPE is 'G', then all members of the external group identified by GRANTEE must be authorized users; otherwise, this is a finding.\n\nIf the GRANTEETYPE is 'R', then all members of the database role identified by GRANTEE must be authorized users; otherwise, this is a finding.\n\nThe members of a role can be found using this statement: \nDB2> SELECT CHAR(GRANTOR,35) AS GRANTOR, CHAR(GRANTEE,35) AS GRANTEE, GRANTEETYPE \n           FROM SYSCAT.ROLEAUTH \n           WHERE ROLENAME= <search role name>\n\nRun the following query to find out which users have execute privilege on SYSPROC.AUDIT_ARCHIVE, SYSPROC.AUDIT_LIST_LOGS, SYSPROC.AUDIT_DELIM_EXTRACT:\nDB2> SELECT * \n           FROM SYSCAT.ROUTINEAUTH \n           WHERE SPECIFICNAME LIKE 'AUDIT%' AND SCHEMA='SYSPROC'\n\nIf non-authorized users have EXECUTE privilege on any of the above three routines, this is a finding.","fixText":"Update the value of SYSADM_GROUP to a group which has only authorized members.\n\n     $db2 update dbm cfg using SYSADM_GROUP <SYSADMIN GROUP>\n\nRemove unauthorized users from the SYSADM_GROUP using the operating system tools/commands. \n\nRevoke SECADM authority from non-authorized users using the SQL statement below:\nDB2> REVOKE SECADM ON DATABASE FROM USER <user name> \n\nRemove non-authorized members or revokes SECADM from the group or role using this SQL statement:\nDB2> REVOKE SECADM ON DATABASE FROM GROUP <group name> \nDB2> REVOKE SECADM ON DATABASE FROM ROLE <role name> \n\nRevoke 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.","ccis":["CCI-001494"]},{"vulnId":"V-213687","ruleId":"SV-213687r879581_rule","severity":"medium","ruleTitle":"DB2 must protect its audit features from unauthorized removal.","description":"Protecting audit data also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit data.\n\nApplications providing tools to interface with audit data will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user enjoys in order make access decisions regarding the deletion of audit tools.\n\nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.","checkContent":"Run the following command to find the value of the SYSADM_GROUP parameter:\n\n     $db2 get dbm cfg \n\nOnly authorized OS users should be part of this group. If non-authorized users are part of the SYSADM_GROUP group, this is a finding.\n\nOn Windows systems, if the SYSADM_GROUP database manager configuration parameter is not specified, this is a finding.\n\nThe 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:\n\n- The SYSPROC.AUDIT_ARCHIVE stored procedure archives audit logs.\n- The SYSPROC.AUDIT_LIST_LOGS table function allows you to locate logs of interest.\n- The SYSPROC.AUDIT_DELIM_EXTRACT stored procedure extracts data into delimited files for analysis.\n\nThe security administrator can also grant EXECUTE privilege on these routines to another user.\n\nRun the following query to find out which users have SECADM authority in database: \n\nDB2> SELECT CHAR(GRANTOR,35) AS GRANTOR, CHAR(GRANTEE,35) AS GRANTEE, GRANTEETYPE  \n           FROM SYSCAT.DBAUTH \n           WHERE SECURITYADMAUTH='Y'\n\nIf GRANTEETYPE is 'U' and the authorization ID is not an authorized user, this is a finding.\n\nIf the GRANTEETYPE is 'G', then all members of the external group identified by GRANTEE must be authorized users, otherwise, this is a finding.\n\nIf the GRANTEETYPE is 'R', then all members of the database role identified by GRANTEE must be authorized users, otherwise, this is a finding.\n\nThe members of a role can be found using this statement: \n\nDB2> SELECT CHAR(GRANTOR,35) AS GRANTOR, CHAR(GRANTEE,35) AS GRANTEE, GRANTEETYPE \n           FROM SYSCAT.ROLEAUTH \n           WHERE ROLENAME= <search role name>\n\nRun the following query to find out which users have execute privilege on SYSPROC.AUDIT_ARCHIVE, SYSPROC.AUDIT_LIST_LOGS, SYSPROC.AUDIT_DELIM_EXTRACT:\nDB2> SELECT * \n           FROM SYSCAT.ROUTINEAUTH \n           WHERE SPECIFICNAME LIKE 'AUDIT%' AND SCHEMA='SYSPROC'\n\nIf non-authorized users have EXECUTE privilege on any of above three routines, this is a finding.","fixText":"Update the value of SYSADM_GROUP to a group which has only authorized members.\n\n     $db2 update dbm cfg using SYSADM_GROUP <SYSADMIN GROUP>\n\nRemove unauthorized users from the SYSADM_GROUP using the operating system tools/commands. \n\nRevoke SECADM authority from non-authorized users using the SQL statement below:\nDB2> REVOKE SECADM ON DATABASE FROM USER <user name> \n\nRemove non-authorized members or revokes SECADM from the group or role using this SQL statement:\nDB2> REVOKE SECADM ON DATABASE FROM GROUP <group name> \nDB2> REVOKE SECADM ON DATABASE FROM ROLE <role name> \n\nRevoke 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.","ccis":["CCI-001495"]},{"vulnId":"V-213688","ruleId":"SV-213688r879586_rule","severity":"medium","ruleTitle":"DB2 must limit  privileges to change software modules, to include stored procedures, functions and triggers, and links to software external to DB2.","description":"If the system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process.\n\nAccordingly, only qualified and authorized individuals shall be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.\n\nUnmanaged changes that occur to the database software libraries or configuration can lead to unauthorized or compromised installations.","checkContent":"Use the following query to find who has privileges to alter, drop, and create objects in the schemas:\nDB2> SELECT * FROM SYSCAT.SCHEMAAUTH\n \nIf non-authorized users have privileges to create, alter, or drop objects, this is a finding.","fixText":"Use the appropriate variation of REVOKE (schema privileges) statement to remove the privileges from unauthorized users/roles/groups:\n DB2> REVOKE <ALTERIN/CREATEIN/DROPIN> ON SCHEMA <schema-name> FROM <USER/GROUP/PUBLIC/ROLE> \n \nFor more on this topic, see the Help page on \"REVOKE (schema privileges) statement\":\nhttp://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000988.html","ccis":["CCI-001499"]},{"vulnId":"V-213689","ruleId":"SV-213689r879586_rule","severity":"medium","ruleTitle":"The OS must limit privileges to change the DB2 software resident within software libraries (including privileged programs).","description":"If the system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process.\n\nAccordingly, only qualified and authorized individuals shall be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.\n\nUnmanaged changes that occur to the database software libraries or configuration can lead to unauthorized or compromised installations.","checkContent":"Run the db2level command to find the installation directory of DB2 server software: \n\n     $db2level  \n\nIf 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. \n\nOn 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. \n\nOn Windows operating systems, the instance directory is located under the /sqllib directory where the DB2 database product was installed. \n\nIf 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.","fixText":"Remove the write permission from non-root, non-sysadmin users on the DB2 installation base directory and instance home directory.","ccis":["CCI-001499"]},{"vulnId":"V-213690","ruleId":"SV-213690r879586_rule","severity":"medium","ruleTitle":"The DB2 software installation account must be restricted to authorized users.","description":"When dealing with change control issues, it should be noted any changes to the hardware, software, and/or firmware components of the information system and/or application can have significant effects on the overall security of the system. \n\nIf the system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process.\n\nAccordingly, only qualified and authorized individuals shall be allowed access to information system components for purposes of initiating changes, including upgrades and modifications.\n\nDBA and other privileged administrative or application owner accounts are granted privileges that allow actions that can have a great impact on database security and operation. It is especially important to grant privileged access to only those persons who are qualified and authorized to use them.","checkContent":"Review procedures for controlling, granting access to, and tracking use of the DBMS software installation account.\n\nIf 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.","fixText":"Develop, document, and implement procedures to restrict and track use of the DBMS software installation account.","ccis":["CCI-001499"]},{"vulnId":"V-213691","ruleId":"SV-213691r879586_rule","severity":"medium","ruleTitle":"Database software, including DBMS configuration files, must be stored in dedicated directories, separate from the host OS and other applications.","description":"When dealing with change control issues, it should be noted any changes to the hardware, software, and/or firmware components of the information system and/or application can potentially have significant effects on the overall security of the system.\n\nMultiple applications can provide a cumulative negative effect. A vulnerability and subsequent exploit to one application can lead to an exploit of other applications sharing the same security context. For example, an exploit to a web server process that leads to unauthorized administrative access to host system directories can most likely lead to a compromise of all applications hosted by the same system. Database software not installed using dedicated directories both threatens and is threatened by other hosted applications. Access controls defined for one application may by default provide access to the other application's database objects or directories. Any method that provides any level of separation of security context assists in the protection between applications.","checkContent":"The base installation directory of the database server software and the instance home directory location is configurable at the time of installation.\n\nRun the db2ls command to find the installation directory of DB2 server software.\n\nThe environment variable INSTHOME points to instance home directory.\n\nIf there are non-DB2-related files in the instance home directory and the subsequent subdirectories under it, this is a finding. \n\nIf there are non-DB2-related files in the DB2 install directory and the subsequent subdirectories under it, this is a finding.","fixText":"Remove the non-DB2 software from instance home directory and subdirectories.\n\nRemove the non-DB2 software from DB2 installation directories and subdirectories.","ccis":["CCI-001499"]},{"vulnId":"V-213692","ruleId":"SV-213692r879586_rule","severity":"medium","ruleTitle":"Database objects (including but not limited to tables, indexes, storage, stored procedures, functions, triggers, links to software external to DB2, etc.) must be owned by database/DBMS principals authorized for ownership.","description":"Within the database, object ownership implies full privileges to the owned object, including the privilege to assign access to the owned objects to other subjects. Database functions and procedures can be coded using definer's rights. This allows anyone who utilizes the object to perform the actions if they were the owner. If not properly managed, this can lead to privileged actions being taken by unauthorized individuals.\n\nConversely, if critical tables or other objects rely on unauthorized owner accounts, these objects may be lost when an account is removed.","checkContent":"Get the list of authorized owners from ISSO or DBA.\n\nUse the following catalog views/queries to find the ownership of the various database objects:\n\nSelect libname,owner from syscat.libraries\nSelect modulename,owner from syscat.modules\nSelect tabname,owner from syscat.nicknames\nSelect pkgname,owner from syscat.packages\nSelect routinename,owner from syscat.routines\nSelect seqname,owner from syscat.sequences\nSelect constname,owner from syscat.tabconst\nSelect tabname,owner from syscat.tables\nSelect tbspace,owner from syscat.tablespaces\nSelect trigname,owner from syscat.triggers\n\nIf any owner is not in the ISSO/DBA provided list, this is a finding.","fixText":"Use the list identified in check. Drop and create the objects as necessary with the correct ownership.\nDB2> DROP\nDB2> CREATE\n\nNote: For additional information regarding the DROP statement, select the following link:\nhttp://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000945.html?lang=en","ccis":["CCI-001499"]},{"vulnId":"V-213693","ruleId":"SV-213693r879586_rule","severity":"medium","ruleTitle":"The role(s)/group(s) used to modify database structure (including but not necessarily limited to tables, indexes, storage, etc.) and logic modules (stored procedures, functions, triggers, links to software external to DB2, etc.) must be restricted to authorized users.","description":"If the DBMS were to allow any user to make changes to database structure or logic, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process.\n\nAccordingly, only qualified and authorized individuals shall be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.\n\nUnmanaged changes that occur to the database software libraries or configuration can lead to unauthorized or compromised installations.","checkContent":"Get the list of qualified and authorized owners from ISSO or DBA. \n\nThe following view list information about privileges held by the users, the identities of users granting privileges, and the object ownership:\nDB2> SELECT * FROM SYSIBMADM.PRIVILEGES\n\nIf any of the privileges is held by non-qualified and non-authorized individuals, this is a finding.","fixText":"Use the appropriate variation of the REVOKE command to revoke the privileges from non-qualified and non-authorized individuals:\nDB2> REVOKE\n\nNotes: 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.\n\ninformation on the system catalog is available in the IBM knowledge base:\n\nhttp://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/c0005478.html?lang=en\n \nhttp://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/c0005817.html","ccis":["CCI-001499"]},{"vulnId":"V-213694","ruleId":"SV-213694r879587_rule","severity":"medium","ruleTitle":"Default demonstration and sample databases, database objects, and applications must be removed.","description":"Information systems are capable of providing a wide variety of functions and services. Some of the functions and services, provided by default, may not be necessary to support essential organizational operations (e.g., key missions, functions).\n\nIt is detrimental for software products to provide, or install by default, functionality exceeding requirements or mission objectives. Examples include, but are not limited to, installing advertising software, demonstrations, or browser plugins not related to requirements or providing a wide array of functionality, not required for every mission, that cannot be disabled.\n\nDBMSs must adhere to the principles of least functionality by providing only essential capabilities.\n\nDemonstration and sample database objects and applications present publicly known attack points for malicious users. These demonstration and sample objects are meant to provide simple examples of coding specific functions and are not developed to prevent vulnerabilities from being introduced to the DBMS and host system.","checkContent":"Use the list db directory to see if the SAMPLE database exists.\n\n     $db2 list db directory\n\nIf the SAMPLE database exists, this is a finding.","fixText":"Run the following command to DROP the SAMPLE database:\n\n     $db2 drop database sample","ccis":["CCI-000381"]},{"vulnId":"V-213695","ruleId":"SV-213695r879587_rule","severity":"medium","ruleTitle":"Unused database components, DBMS software, and database objects must be removed.","description":"Information systems are capable of providing a wide variety of functions and services. Some of the functions and services, provided by default, may not be necessary to support essential organizational operations (e.g., key missions, functions).\n\nIt is detrimental for software products to provide, or install by default, functionality exceeding requirements or mission objectives. \n\nDBMSs must adhere to the principles of least functionality by providing only essential capabilities.","checkContent":"On UNIX/LINUX, run the db2ls command to find all install paths of DB2 on the system:\n\n     $db2ls\n\nRun the db2ls command to find installed features of database on install paths:\n\n     $db2ls -q -b <db2 install path>\n\nIf there are installed features which are not required by the mission objectives and are non-essential, this is a finding.\n\nOn Windows, go to Registry Editor in Windows.\nThen select Computer >> HKEY_LOCAL_MACHINE >> SOFTWARE >> IBM >> DB2 >> COMPONENTS \nIf there are installed features which are not required by the mission objectives and are non-essential, this is a finding.\n\nExample: \n     db2ls -q -b /opt/ibm/db2/V10.5\nInstall Path : /opt/ibm/db2/V10.5\n\nFeature Response File ID             Level   Fix Pack   Feature Description  \n----------------------------------------------------------------------------------------------------\nBASE_CLIENT                         10.5.0.7          7   Base client support \nJAVA_SUPPORT                        10.5.0.7          7   Java support \nSQL_PROCEDURES                      10.5.0.7          7   SQL procedures \nBASE_DB2_ENGINE                     10.5.0.7          7   Base server support \nCONNECT_SUPPORT                     10.5.0.7          7   Connect support \nDB2_DATA_SOURCE_SUPPORT             10.5.0.7          7   DB2 data source support \nSPATIAL_EXTENDER_SERVER_SUPPORT     10.5.0.7          7   Spatial Extender server support \nJDK                                 10.5.0.7          7   IBM Software Development Kit (SDK) for Java(TM) \nLDAP_EXPLOITATION                   10.5.0.7          7   DB2 LDAP support \nINSTANCE_SETUP_SUPPORT              10.5.0.7          7   DB2 Instance Setup wizard \nACS                                 10.5.0.7          7   Integrated Flash Copy Support \nSPATIAL_EXTENDER_CLIENT_SUPPORT     10.5.0.7          7   Spatial Extender client \nCOMMUNICATION_SUPPORT_TCPIP         10.5.0.7          7   Communication support - TCP/IP \nAPPLICATION_DEVELOPMENT_TOOLS       10.5.0.7          7   Base application development tools \nDB2_UPDATE_SERVICE                  10.5.0.7          7   DB2 Update Service \nREPL_CLIENT                         10.5.0.7          7   Replication tools \nTEXT_SEARCH                         10.5.0.7          7   DB2 Text Search \nINFORMIX_DATA_SOURCE_SUPPORT        10.5.0.7          7   Informix data source support \nORACLE_DATA_SOURCE_SUPPORT          10.5.0.7          7   Oracle data source support \nFIRST_STEPS                         10.5.0.7          7   First Steps \nGUARDIUM_INST_MNGR_CLIENT           10.5.0.7          7   Guardium Installation Manager Client","fixText":"On UNIX/Linux, run the following db2_deinstall command to remove the non-essential features:\n\n     $db2_deinstall –F <feature>\n\nNote: 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.\n\nOn Windows, run the db2unins command to remove one or more db2 product, feature or languages. \n   \n     >>-db2unins –p product     (to remove db2 product) \n         or \n     >>-db2unins –u response-file     (to remove db2 product, feature or languages.)\n\nNote: \nUse the following URL to access the knowledgebase documentation on the db2_deinstall command: \nhttp://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0023670.html\n\nUse the following URL to access the knowledgebase documentation on the db2unins command: \nhttp://www-01.ibm.com/support/knowledgecenter/SSEPGGman db2__10.5.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0023371.html?lang=en","ccis":["CCI-000381"]},{"vulnId":"V-213696","ruleId":"SV-213696r879587_rule","severity":"medium","ruleTitle":"Unused database components which are integrated in DB2 and cannot be uninstalled must be disabled.","description":"Information systems are capable of providing a wide variety of functions and services. Some of the functions and services, provided by default, may not be necessary to support essential organizational operations (e.g., key missions, functions). \n\nIt is detrimental for software products to provide, or install by default, functionality exceeding requirements or mission objectives. \n\nDBMSs must adhere to the principles of least functionality by providing only essential capabilities.\n\nUnused, unnecessary DBMS components increase the attack vector for the DBMS by introducing additional targets for attack. By minimizing the services and applications installed on the system, the number of potential vulnerabilities is reduced. Components of the system that are unused and cannot be uninstalled must be disabled. The techniques available for disabling components will vary by DBMS product, OS and the nature of the component and may include DBMS configuration settings, OS service settings, OS file access security, and DBMS user/group permissions.","checkContent":"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.\n\nReview the permissions granted in the database.  If any role is permitted to use any feature not designated as authorized, this is a finding.","fixText":"Use the appropriate version of the REVOKE command to remove unauthorized access to the designated features.","ccis":["CCI-000381"]},{"vulnId":"V-213697","ruleId":"SV-213697r879587_rule","severity":"medium","ruleTitle":"Access to external executables must be disabled or restricted.","description":"Information systems are capable of providing a wide variety of functions and services. Some of the functions and services, provided by default, may not be necessary to support essential organizational operations (e.g., key missions, functions). \n\nIt is detrimental for applications to provide, or install by default, functionality exceeding requirements or mission objectives. \n\nApplications must adhere to the principles of least functionality by providing only essential capabilities.\n\nDBMSs may spawn additional external processes to execute procedures that are defined in the DBMS but stored in external host files (external procedures). The spawned process used to execute the external procedure may operate within a different OS security context than the DBMS and provide unauthorized access to the host system.","checkContent":"Use the following SQL Query to find external routines: \nDB2> SELECT ROUTINENAME \n           FROM SYSCAT.ROUTINES \n           WHERE ORIGIN='E' \n\nUse the following command to find out which user has privileges to run the external routines found with last query.\nDB2> SELECT GRANTEE \n           FROM SYSCAT.ROUTINEAUTH \n\nIf non-essential routines exist outside the database, this is a finding.\n\nIf non-authorized users have privileges on external routines, this is a finding.","fixText":"Drop the external routines if these are non-essential for mission objective.\nDB2> DROP FUNCTION <name>\n\nRevoke execute privileges from non-authorized users on external routines. \nDB2> REVOKE EXECUTE ON FUNCTION <FUNCTION1> FROM <USER1>\n\nNote: Select the following link for the knowledgebase information on the DROP statement: \nhttp://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","ccis":["CCI-000381"]},{"vulnId":"V-213698","ruleId":"SV-213698r917662_rule","severity":"medium","ruleTitle":"DB2 must be configured to prohibit or restrict the use of organization-defined functions, ports, protocols, and/or services, as defined in the PPSM CAL and vulnerability assessments.","description":"In order to prevent unauthorized connection of devices, unauthorized transfer of information, or unauthorized tunneling (i.e., embedding of data types within data types), organizations must disable or restrict unused or unnecessary physical and logical ports/protocols/services on information systems.\n\nApplications are capable of providing a wide variety of functions and services. Some of the functions and services provided by default may not be necessary to support essential organizational operations. Additionally, it is sometimes convenient to provide multiple services from a single component (e.g., email and web services); however, doing so increases risk over limiting the services provided by any one component. \n\nTo support the requirements and principles of least functionality, the application must support the organizational requirements providing only essential capabilities and limiting the use of ports, protocols, and/or services to only those required, authorized, and approved to conduct official business or to address authorized quality of life issues.\n\nDatabase Management Systems using ports, protocols, and services deemed unsafe are open to attack through those ports, protocols, and services. This can allow unauthorized access to the database and through the database to other components of the information system.","checkContent":"Find out the communication protocol used by running the following command:\n\n$db2set DB2COMM\n\nIf DB2 is not set to SSL, this is a finding.\n\nRun the following command to find the service names/port numbers used by the database manager:\n\n$db2 get dbm cfg  \n\nFind 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.\n\nDefault Location for services file\n\nWindows Service File: %SystemRoot%\\system32\\drivers\\etc\\services\nUNIX Services File: /etc/services\n\nIf ports used by the database manager are nonapproved or deemed unsafe, this is a finding.","fixText":"Run the following command to set the value of the DB2COMM parameter to the organization-approved communication protocol:\n\n     $db2set DB2COMM=TCPIP,SSL\n\nSet the SSL version:\n\n     $db2 update DBM CFG using SSL_VERSIONS TLSV12    \n\nThe database manager can be set to a service name or an organization-approved port number directly for the SVCENAME parameter.\n\nUse the following command to change the database manager configuration: \n\n     $db2 update dbm cfg using svcename <svcename> \n       Or\n     $db2 update dbm cfg using svcename <port number>\n\nNote: Configuring Secure Sockets Layer (SSL) support in a DB2 instance:\nhttps://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0025241.html","ccis":["CCI-000382"]},{"vulnId":"V-213699","ruleId":"SV-213699r917664_rule","severity":"medium","ruleTitle":"If passwords are used for authentication, DB2 must transmit only encrypted representations of passwords.","description":"The DoD standard for authentication is DoD-approved PKI certificates.\n\nAuthentication based on User ID and Password may be used only when it is not possible to employ a PKI certificate, and requires AO approval.\n\nIn such cases, passwords need to be protected at all times, and encryption is the standard method for protecting passwords during transmission.\n\nDBMS passwords sent in clear text format across the network are vulnerable to discovery by unauthorized users. Disclosure of passwords may easily lead to unauthorized access to the database.","checkContent":"Run the following command to find the value of the authentication parameter: \n\n$db2 get dbm cfg \n\nIf the AUTHENTICATION parameter is not set to SERVER_ENCRYPT, this is a finding.\n\nRun the following command to find the value of the registry variable DB2AUTH: \n\n$db2set -all\n\nIf 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.","fixText":"Run the following command to set the value of the authentication encryption to SERVER_ENCRYPT: \n\n$db2 update dbm cfg using authentication server_encrypt\n\nRun the following db2set command to set the value of DB2AUTH to JCC_ENFORCE_SECMEC: \n\n$db2set DB2AUTH=JCC_ENFORCE_SECMEC\n\nNote: It is recommended to set the ALTERNATE_AUTH_ENC database manager configuration parameter to AES_ONLY to require that AES encryption be used.","ccis":["CCI-000197"]},{"vulnId":"V-213700","ruleId":"SV-213700r879615_rule","severity":"high","ruleTitle":"Applications using the database must obscure feedback of authentication information during the authentication process to protect the information from possible exploitation/use by unauthorized individuals.","description":"To prevent the compromise of authentication information, such as passwords and PINs, during the authentication process, the feedback from the information system must not provide any information that would allow an unauthorized user to compromise the authentication mechanism.\n\nObfuscation of user-provided information when typed into the system is a method used in addressing this risk.\n\nFor example, displaying asterisks when a user types in a password or PIN, is an example of obscuring feedback of authentication information.\n\nDatabase applications may allow for entry of the account name and password as a visible parameter of the application execution command. This practice must be prohibited and disabled to prevent shoulder surfing.\n\nThis calls for the review of applications, which will require collaboration with the application developers. It is recognized that in many cases the database administrator (DBA) is organizationally separate from the application developers, and may have limited, if any, access to source code. Nevertheless, protections of this type are so important to the secure operation of databases that they must not be ignored. At a minimum, the DBA must attempt to obtain assurances from the development organization that this issue is addressed, and must document what has been discovered.","checkContent":"Determine whether any applications that access the database allow for entry of the account name and password, or PIN.\n\nIf any do, determine whether these applications obfuscate authentication data; if they do not, this is a finding.","fixText":"Configure or modify applications to prohibit display of passwords in clear text.","ccis":["CCI-000206"]},{"vulnId":"V-213701","ruleId":"SV-213701r879615_rule","severity":"high","ruleTitle":"When using command-line tools such as db2, users must use a Connect method that does not expose the password.","description":"To prevent the compromise of authentication information, such as passwords and PINs, during the authentication process, the feedback from the information system must not provide any information that would allow an unauthorized user to compromise the authentication mechanism.\n\nObfuscation of user-provided information when typed into the system is a method used in addressing this risk.\n\nFor example, displaying asterisks when a user types in a password or PIN, is an example of obscuring feedback of authentication information.\n\n\"db2\" and other command-line tools are part of any DB2 for LUW installation. These tools can accept a plain-text password, but do offer alternative techniques. Since the typical user of these tools is a database administrator, the consequences of password compromise are particularly serious. Therefore, the use of plain-text passwords must be prohibited, as a matter of practice and procedure.","checkContent":"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.\n\nRequest 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.","fixText":"For the \"db2\" command, which cannot be configured not to accept a plain-text password, and any other essential tool with the same limitation:\n1) Document the need for it, who uses it, and any relevant mitigations, and obtain AO approval.\n2) 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.","ccis":["CCI-000206"]},{"vulnId":"V-213702","ruleId":"SV-213702r917666_rule","severity":"high","ruleTitle":"DB2 must use NIST FIPS 140-2 validated cryptographic modules for cryptographic operations.","description":"Use of weak or not validated cryptographic algorithms undermines the purposes of utilizing encryption and digital signatures to protect data.  Weak algorithms can be easily broken and not validated cryptographic modules may not implement algorithms correctly. Unapproved cryptographic modules or algorithms should not be relied on for authentication, confidentiality or integrity. Weak cryptography could allow an attacker to gain access to and modify data stored in the database as well as the administration settings of the DBMS.\n\nApplications, including DBMSs, utilizing cryptography are required to use approved NIST FIPS 140-2 validated cryptographic modules that meet the requirements of applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance.  \n\nThe security functions validated as part of FIPS 140-2 for cryptographic modules are described in FIPS 140-2 Annex A.\n\nThe cryptographic functionality in IBM DB2 for LUW includes features that are fully FIPS 140-2 validated, and others that are not.  To be sure of using only FIPS 140-2 validated modules, specify SSL (TLS) for communication and IBM Database Native Encryption for data at rest.\n\nThe decision whether to employ cryptography is the responsibility of the information owner/steward, who exercises discretion within the framework of applicable rules, policies, and law.","checkContent":"If it has been determined that encryption is not required, this is not a finding.\n\nReview the cryptographic configuration.  \n\nIf SSL/TLS is not specified for encryption of communications, this is a finding. See below for more detailed instructions.\n\nIf IBM Database Native Encryption is not specified for encryption of data at rest, this is a finding. See below for more detailed instructions.\n\nTo Verify SSL is in use:\nCheck the DB2 registry variable DB2COMM to include SSL.\n\n     $db2set -all\n\nIf DB2COMM does not include SSL, this is a finding. \n\nFind the value of SSL_VERSIONS by running:\n\n     $db2 get dbm cfg\n\nIf SSL_VERSIONS is not set to TLSV12, this is a finding.\n\nFind the value of SSL_CIPHERSPECS by running:\n\n     $db2 get dbm cfg\n\nIf SSL_CIPHERSPECS is not set to a symmetric algorithm key length that is greater than or equal to 112, this is a finding. \n\nFind the value of SSL_SVC_LABEL by running: \n\n     $db2 get dbm cfg\n\nIf 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. \n\nIf the certificate does not have a digital signature with minimum SHA2, this is a finding.\n\nThe above settings ensure that all connections over SSL in any CLP or Java application strictly adhere to NIST SP 800-131A.\n\nTo Verify DB2 native encryption is being used, run the following SQL Query:\nDB2> SELECT SUBSTR(object_name,1,8) AS NAME, SUBSTR(object_type,1,8) TYPE, SUBSTR(algorithm,1,8) ALGORITHM \n           FROM TABLE(sysproc.admin_get_encryption_info())\n\nIf value of Algorithm is NULL for the database, this is a finding.\n\nIf the database is not encrypted with native encryption or any third-party tool, this is a finding.","fixText":"Modify the cryptographic configuration to employ SSL/TLS for encryption of communications.\n\nModify the cryptographic configuration to employ IBM Database Native Encryption for encryption of data at rest.","ccis":["CCI-000803"]},{"vulnId":"V-213703","ruleId":"SV-213703r879631_rule","severity":"medium","ruleTitle":"DB2 must separate user functionality (including user interface services) from database management functionality.","description":"Information system management functionality includes functions necessary to administer databases, network components, workstations, or servers and typically requires privileged user access. \n\nThe separation of user functionality from information system management functionality is either physical or logical and is accomplished by using different computers, different central processing units, different instances of the operating system, different network addresses, combinations of these methods, or other methods, as appropriate. \n\nAn example of this type of separation is observed in web administrative interfaces that use separate authentication methods for users of any other information system resources. \n\nThis may include isolating the administrative interface on a different domain and with additional access controls.\n\nIf administrative functionality or information regarding DBMS management is presented on an interface available for users, information on DBMS settings may be inadvertently made available to the user.","checkContent":"Run the following command to find the privileged groups and get the value of SYSADM_GROUP, SYSCTRL_GROUP, SYSMAINT_GROUP, SYSMON_GROUP:\n\n     $db2 get dbm cfg \n\nIf general users are part of any of above groups, this is a finding. \n\nOn Windows systems, if the SYSADM_GROUP database manager configuration parameter is not specified, this is a finding.\n\nNote: On UNIX to find the members of a group from the following two files or system admin utilities provided by LINUX/UNIX vendors. \n\n/etc/passwd\n/etc/group\ne.g. if value of SYSADM_GROUP is DB2IADM1 \nFrom operating system files find out who is member of DB2IADM1\n\nON WINDOWS\nYou can use lusrmgr.msc or any other OS utility to manage user group memberships.","fixText":"Remove general users from the privileged groups, SYSADM_GROUP, SYSCTRL_GROUP, SYSMAINT_GROUP, SYSMON_GROUP using OS utilities/interface.\n\nOn Windows systems, set the SYSADM_GROUP database manager configuration parameter to the appropriate value.","ccis":["CCI-001082"]},{"vulnId":"V-213704","ruleId":"SV-213704r879639_rule","severity":"medium","ruleTitle":"DB2 must maintain the authenticity of communications sessions by guarding against man-in-the-middle attacks that guess at Session ID values.","description":"One class of man-in-the-middle, or session hijacking, attack involves the adversary guessing at valid session identifiers based on patterns in identifiers already known.\n\nThe preferred technique for thwarting guesses at Session IDs is the generation of unique session identifiers using a FIPS 140-2 approved random number generator.\n\nHowever, it is recognized that available DBMS products do not all implement the preferred technique yet may have other protections against session hijacking. Therefore, other techniques are acceptable, provided they are demonstrated to be effective.","checkContent":"Ensure DB2 is using the SSL communication protocol:\n\nRun the following command to find the value of the network service:\n\n     $db2 get dbm cfg\n\nTCP/IP Service name                     (SVCENAME) \nSSL service name                         (SSL_SVCENAME) \n\nIf 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.\n\nDefault Location for services file:\n    Windows Service File:  %SystemRoot%\\system32\\drivers\\etc\\services\n    UNIX Services File: /etc/services\n\nIf the network protocols and ports found in previous step are not in as per PPSM guidance, this is a finding.","fixText":"Use the following commands to set the protocol and ports as per PPSM guidance:\n\n     $db2 update dbm cfg using svcename    [service_name | port_number]\n     $db2 update dbm cfg using ssl_svcename [ssl_service_name | port_number]\n\nNote: http://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0025241.html","ccis":["CCI-001188"]},{"vulnId":"V-213705","ruleId":"SV-213705r879641_rule","severity":"medium","ruleTitle":"In the event of a system failure, DB2 must preserve any information necessary to determine cause of failure and any information necessary to return to operations with least disruption to mission processes.","description":"Failure to a known state can address safety or security in accordance with the mission/business needs of the organization.\n\nFailure to a known secure state helps prevent a loss of confidentiality, integrity, or availability in the event of a failure of the information system or a component of the system. \n\nPreserving information system state information helps to facilitate system restart and return to the operational mode of the organization with less disruption of mission/business processes. \n\nSince it is usually not possible to test this capability in a production environment, systems should either be validated in a testing environment or prior to installation. This requirement is normally a function of the design of the IDPS component. Compliance can be verified by acceptance/validation processes or vendor attestation.","checkContent":"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.\n\nRun the following command to get the details on the logging method:\n\n     $db2 get db cfg\n\nIf 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.\n\nRun the following command to verify backup history:\n\n     $db2 list history backup all for <dbname>\n\nReview 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. \n\nReview 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.","fixText":"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.\n\nUpdate db2 logging to archive logging for the database which requires roll forward recovery using the following db2 command:\n\n     $db2 update db2 cfg for <database name> using LOGARCHMETH1 <value>\n\nNote: Set the value as per your online file system or backup vendor like TSM \n\nVerify and correct the scheduled backup jobs.\n\nCorrect any issues that have been causing backups to fail.\n\nTest the restoration of the database at least once a year; correct any issues that cause it to fail. Maintain a record of these tests.\n\nNote: \nhttp://www.ibm.com/support/knowledgecenter/SSEPGG_10.1.0/com.ibm.db2.luw.admin.config.doc/doc/r0011448.html\nhttp://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0001991.html","ccis":["CCI-001665"]},{"vulnId":"V-213706","ruleId":"SV-213706r879642_rule","severity":"medium","ruleTitle":"DB2 must protect the confidentiality and integrity of all information at rest.","description":"This control is intended to address the confidentiality and integrity of information at rest in non-mobile devices and covers user information and system information. Information at rest refers to the state of information when it is located on a secondary storage device (e.g., disk drive, tape drive) within an organizational information system. Applications and application users generate information throughout the course of their application use. \n\nUser data generated, as well as application-specific configuration data, needs to be protected. Organizations may choose to employ different mechanisms to achieve confidentiality and integrity protections, as appropriate. \n\nIf the confidentiality and integrity of application data is not protected, the data will be open to compromise and unauthorized modification.","checkContent":"If the application owner and Authorizing Official have determined that encryption of data at rest is NOT required, this is not a finding.\n\nTo 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.\n \nTo find if a database is encrypted with DB2 native encryption, run the following SQL Query:\nDB2> SELECT SUBSTR(OBJECT_NAME,1,8) AS NAME, SUBSTR(ALGORITHM,1,8) ALGORITHM \n           FROM TABLE(SYSPROC.ADMIN_GET_ENCRYPTION_INFO()) \n           WHERE OBJECT_TYPE='DATABASE'\n\nIf the value of Algorithm is NULL for the database, this is a finding. \n\nIf the database is not encrypted with native encryption or any third-party tool, this is a finding.","fixText":"To create the database using DB2 native encryption run the following command:\n\n     $db2 create db <database name> encrypt\n\nNote: Select the following link for details on how to set up DB2 native encryption:\nhttp://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0061766.html?lang=en \n\nIf 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.","ccis":["CCI-001199"]},{"vulnId":"V-213707","ruleId":"SV-213707r879643_rule","severity":"medium","ruleTitle":"DB2 must isolate security functions from non-security functions.","description":"An isolation boundary provides access control and protects the integrity of the hardware, software, and firmware that perform security functions. \n\nSecurity functions are the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based.\n\nDevelopers and implementers can increase the assurance in security functions by employing well-defined security policy models; structured, disciplined, and rigorous hardware and software development techniques; and sound system/security engineering principles. \n\nDatabase Management Systems typically separate security functionality from non-security functionality via separate databases or schemas. Database objects or code implementing security functionality should not be commingled with objects or code implementing application logic. When security and non-security functionality are commingled, users who have access to non-security functionality may be able to access security functionality.","checkContent":"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.\n\nReview 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:\nDB2> SELECT LIBNAME, OWNER, LIBSCHEMA FROM SYSCAT.LIBRARIES \nDB2> SELECT MODULENAME, OWNER, MODULESCHEMA FROM SYSCAT.MODULES \nDB2> SELECT PKGNAME, OWNER, PKGSCHEMA FROM SYSCAT.PACKAGES \nDB2> SELECT ROUTINENAME, OWNER, ROUTINESCHEMA FROM SYSCAT.ROUTINES \nDB2> SELECT TRIGNAME, OWNER, TRIGSCHEMA FROM SYSCAT.TRIGGERS\nDB2> SELECT * FROM SYSIBMADM.PRIVILEGES\n\nIf 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.","fixText":"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.\n\nIn all cases, use GRANT, REVOKE, ALTER ROLE, DROP ROLE, statements to add and remove permissions on security-related objects to provide effective isolation.","ccis":["CCI-001084"]},{"vulnId":"V-213708","ruleId":"SV-213708r879649_rule","severity":"medium","ruleTitle":"Database contents must be protected from unauthorized and unintended information transfer by enforcement of a data-transfer policy.","description":"Applications, including DBMSs, must prevent unauthorized and unintended information transfer via shared system resources. \n\nData used for the development and testing of applications often involves copying data from production. It is important that specific procedures exist for this process, to include the conditions under which such transfer may take place, where the copies may reside, and the rules for ensuring sensitive data are not exposed.\n\nCopies of sensitive data must not be misplaced or left in a temporary location without the proper controls.","checkContent":"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.\n\nIf there is no documented procedure for data movement from production to development/test, this is a finding.\n\nIf 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.","fixText":"Create and document a process for moving data from production to development/test systems and follow the process.\n\nModify any code used for moving data from production to development/test systems to ensure copies of production data are not left in unsecured locations.","ccis":["CCI-001090"]},{"vulnId":"V-213709","ruleId":"SV-213709r879649_rule","severity":"medium","ruleTitle":"Access to database files must be limited to relevant processes and to authorized, administrative users.","description":"Applications, including DBMSs, must prevent unauthorized and unintended information transfer via shared system resources. Permitting only DBMS processes and authorized, administrative users to have access to the files where the database resides helps ensure that those files are not shared inappropriately and are not open to backdoor access and manipulation.","checkContent":"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.\n\nIf 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.\n\nNote: When the instance and database directories are created by the DB2 database manager, the permissions are accurate and should not be changed.\n\nUse 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.\n1. Instance Directory\n\nOn 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. \n\nFor Windows run following command to show the parent directory of the instance directory:\n  \n     $db2set db2instprof \n\ne.g., for db2 instance \"DB2\"\nC:\\>db2set db2instprof\nC:\\ProgramData\\IBM\\DB2\\DB2COPY1\\DB2\n\nThe instance path in this case will be\nC:\\ProgramData\\IBM\\DB2\\DB2COPY1\\DB2\n\n2. Database Directory \nFor LINUX/UNIX Run Command:\n  \n     $db2 list db directory\n\nGo to instance home directory then under this path, there is one or more db2 node directories.\nThe naming convention is NODExxxx, where xxxx is numeric\nIdentifying the DB2 node number.\nUnder the node directory, there are 3 types of subdirectories\n  a) Same as database name.\n  b) Database directories.  The naming convention is SQLxxxxx, where xxxxx is numeric.\n  c) SQLDBDIR, the system database directory.\n \nFor Windows:\nUnder this local database directory, the next level is based on the instance name.\n\nFor example db2 instance \"DB2\", the path will be C:\\DB2\n\nUnder this path, there is one or more db2 node directories.\nThe naming convention is NODExxxx, where xxxx is numeric\nIdentifying the DB2 node number.\nUnder the node directory, there are 3 types of subdirectories\n  a) Same as database name.\n  b) Database directories.  The naming convention is SQLxxxxx, where xxxxx is numeric.\n  c) SQLDBDIR, the system database directory.\n\n3. Audit Log Directory\nRun following command:\n\n     $db2audit describe\n\nFind value of Audit Data Path and Audit Archive Path\n\n4. Transaction Log Directory and Archive Logs Directory\nRun the command:\n     $db2 get db cfg \n\nFind value of following parameters and determine the directory locations.\nChanged path to log files                  (NEWLOGPATH) \nPath to log files                                       \nOverflow log path                     (OVERFLOWLOGPATH)\nMirror log path                         (MIRRORLOGPATH) \nFailover log archive path                (FAILARCHPATH)\nFirst log archive method                 (LOGARCHMETH1)\nSecond log archive method                (LOGARCHMETH2)\n\n5. Storage Files \nRun following SQL queries to find the value of tablespace containers and storage paths:\n\nDB2> SELECT varchar(container_name,70) as container_name, varchar(tbsp_name,20) as tbsp_name\n           FROM TABLE(MON_GET_CONTAINER('',-2))\n\n           SELECT VARCHAR(STORAGE_GROUP_NAME, 30) AS STOGROUP, VARCHAR(DB_STORAGE_PATH, 40) AS STORAGE_PATH \n           FROM TABLE(ADMIN_GET_STORAGE_PATHS('',-1))\n\n6.  Backup File Location\nRun the following command and review the result for Location of Backups\n\n     $db2 list history backup all for <database name>","fixText":"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.","ccis":["CCI-001090"]},{"vulnId":"V-213710","ruleId":"SV-213710r879652_rule","severity":"medium","ruleTitle":"DB2 must check the validity of all data inputs except those specifically identified by the organization.","description":"Invalid user input occurs when a user inserts data or characters into an application's data entry fields and the application is unprepared to process that data. This results in unanticipated application behavior, potentially leading to an application or information system compromise. Invalid user input is one of the primary methods employed when attempting to compromise an application.\n\nWith respect to database management systems, one class of threat is known as SQL Injection, or more generally, code injection. It takes advantage of the dynamic execution capabilities of various programming languages, including dialects of SQL. Potentially, the attacker can gain unauthorized access to data, including security settings, and severely corrupt or destroy the database.\n\nEven when no such hijacking takes place, invalid input that gets recorded in the database, whether accidental or malicious, reduces the reliability and usability of the system. Available protections include data types, referential constraints, uniqueness constraints, range checking, and application-specific logic. Application-specific logic can be implemented within the database in stored procedures and triggers, where appropriate.\n\nThis calls for the review of applications, which will require collaboration with the application developers. It is recognized that in many cases the database administrator (DBA) is organizationally separate from the application developers, and may have limited, if any, access to source code. Nevertheless, protections of this type are so important to the secure operation of databases that they must not be ignored. At a minimum, the DBA must attempt to obtain assurances from the development organization that this issue is addressed, and must document what has been discovered.","checkContent":"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.\n\nIf code exists that allows invalid data to be acted upon or input into the database, this is a finding.\n\nIf column/field definitions do not exist in the database, this is a finding.\n\nIf columns/fields do not contain constraints and validity checking where required, this is a finding.\n\nWhere 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.\n\nWhere 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.","fixText":"Modify database code to properly validate data before it is put into the database or acted upon by the database.\n\nModify the database to contain column/field definitions for each column/field in the database.\n\nModify the database to contain constraints and validity checking on database columns and tables that require them for data integrity.","ccis":["CCI-001310"]},{"vulnId":"V-213711","ruleId":"SV-213711r879652_rule","severity":"medium","ruleTitle":"DB2 and associated applications must reserve the use of dynamic code execution for situations that require it.","description":"With respect to database management systems, one class of threat is known as SQL Injection, or more generally, code injection. It takes advantage of the dynamic execution capabilities of various programming languages, including dialects of SQL. In such cases, the attacker deduces the manner in which SQL statements are being processed, either from inside knowledge or by observing system behavior in response to invalid inputs. When the attacker identifies scenarios where SQL queries are being assembled by application code (which may be within the database or separate from it) and executed dynamically, the attacker is then able to craft input strings that subvert the intent of the query. Potentially, the attacker can gain unauthorized access to data, including security settings, and severely corrupt or destroy the database.\n\nThe principal protection against code injection is not to use dynamic execution except where it provides necessary functionality that cannot be utilized otherwise. Use strongly typed data items rather than general-purpose strings as input parameters to task-specific, pre-compiled stored procedures and functions (and triggers).\n\nThis calls for the review of applications, which will require collaboration with the application developers. It is recognized that in many cases the database administrator (DBA) is organizationally separate from the application developers, and may have limited, if any, access to source code. Nevertheless, protections of this type are so important to the secure operation of databases that they must not be ignored. At a minimum, the DBA must attempt to obtain assurances from the development organization that this issue is addressed, and must document what has been discovered.","checkContent":"Review DBMS source code (stored procedures, functions, triggers) and application source code, to identify cases of dynamic code execution.\n\nIf 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.","fixText":"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.","ccis":["CCI-001310"]},{"vulnId":"V-213712","ruleId":"SV-213712r879652_rule","severity":"medium","ruleTitle":"DB2 and associated applications, when making use of dynamic code execution, must scan input data for invalid values that may indicate a code injection attack.","description":"With respect to database management systems, one class of threat is known as SQL Injection, or more generally, code injection. It takes advantage of the dynamic execution capabilities of various programming languages, including dialects of SQL. In such cases, the attacker deduces the manner in which SQL statements are being processed, either from inside knowledge or by observing system behavior in response to invalid inputs. When the attacker identifies scenarios where SQL queries are being assembled by application code (which may be within the database or separate from it) and executed dynamically, the attacker is then able to craft input strings that subvert the intent of the query. Potentially, the attacker can gain unauthorized access to data, including security settings, and severely corrupt or destroy the database.\n\nThe principal protection against code injection is not to use dynamic execution except where it provides necessary functionality that cannot be utilized otherwise. Use strongly typed data items rather than general-purpose strings as input parameters to task-specific, pre-compiled stored procedures and functions (and triggers).\n\nWhen dynamic execution is necessary, ways to mitigate the risk include the following, which should be implemented both in the on-screen application and at the database level, in the stored procedures:\n-- Allow strings as input only when necessary. \n-- Rely on data typing to validate numbers, dates, etc. Do not accept invalid values. If substituting other values for them, think carefully about whether this could be subverted.\n-- Limit the size of input strings to what is truly necessary.\n-- If single quotes/apostrophes, double quotes, semicolons, equals signs, angle brackets, or square brackets will never be valid as input, reject them.\n-- If comment markers will never be valid as input, reject them. In SQL, these are -- or /* */ \n-- If HTML and XML tags, entities, comments, etc., will never be valid, reject them.\n-- If wildcards are present, reject them unless truly necessary. In SQL these are the underscore and the percentage sign, and the word ESCAPE is also a clue that wildcards are in use.\n-- If SQL key words, such as SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, ESCAPE, UNION, GRANT, REVOKE, DENY, MODIFY will never be valid, reject them. Use case-insensitive comparisons when searching for these. Bear in mind that some of these words, particularly Grant (as a person's name), could also be valid input. \n-- If there are range limits on the values that may be entered, enforce those limits.\n-- Institute procedures for inspection of programs for correct use of dynamic coding, by a party other than the developer.\n-- Conduct rigorous testing of program modules that use dynamic coding, searching for ways to subvert the intended use.\n-- Record the inspection and testing in the system documentation.\n-- Bear in mind that all this applies not only to screen input, but also to the values in an incoming message to a web service or to a stored procedure called by a software component that has not itself been hardened in these ways. Not only can the caller be subject to such vulnerabilities; it may itself be the attacker.\n\nThis calls for the review of applications, which will require collaboration with the application developers. It is recognized that in many cases the database administrator (DBA) is organizationally separate from the application developers, and may have limited, if any, access to source code. Nevertheless, protections of this type are so important to the secure operation of databases that they must not be ignored. At a minimum, the DBA must attempt to obtain assurances from the development organization that this issue is addressed, and must document what has been discovered.","checkContent":"Review DBMS source code (stored procedures, functions, triggers) and application source code, to identify cases of dynamic code execution.\n\nIf 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.","fixText":"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.","ccis":["CCI-001310"]},{"vulnId":"V-213713","ruleId":"SV-213713r879655_rule","severity":"medium","ruleTitle":"DB2 must provide non-privileged users with error messages that provide information necessary for corrective actions without revealing information that could be exploited by adversaries.","description":"Any DBMS or associated application providing too much information in error messages on the screen or printout risks compromising the data and security of the system. The structure and content of error messages need to be carefully considered by the organization and development team.\n\nDatabases can inadvertently provide a wealth of information to an attacker through improperly handled error messages. In addition to sensitive business or personal information, database errors can provide host names, IP addresses, user names, and other system information not required for troubleshooting but very useful to someone targeting the system.\n\nCarefully consider the structure/content of error messages. The extent to which information systems are able to identify and handle error conditions is guided by organizational policy and operational requirements. Information that could be exploited by adversaries includes, for example, logon attempts with passwords entered by mistake as the username, mission/business information that can be derived from (if not stated explicitly by) information recorded, and personal information, such as account numbers, social security numbers, and credit card numbers.\n\nThis calls for the review of applications, which will require collaboration with the application developers. It is recognized that in many cases the database administrator (DBA) is organizationally separate from the application developers, and may have limited, if any, access to source code. Nevertheless, protections of this type are so important to the secure operation of databases that they must not be ignored. At a minimum, the DBA must attempt to obtain assurances from the development organization that this issue is addressed, and must document what has been discovered.","checkContent":"Check DB2 settings and custom database code to verify that error messages do not contain information beyond what is needed for troubleshooting the issue. \n\nIf database errors contain PII data, sensitive business data, or information useful for identifying the host system or database structure, this is a finding.","fixText":"Configure DB2 settings, custom database code, and associated application code not to divulge sensitive information or information useful for system identification in error messages.","ccis":["CCI-001312"]},{"vulnId":"V-213714","ruleId":"SV-213714r879656_rule","severity":"medium","ruleTitle":"DB2 must reveal detailed error messages only to the ISSO, ISSM, SA and DBA.","description":"If the DBMS provides too much information in error logs and administrative messages to the screen, this could lead to compromise. The structure and content of error messages need to be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements. \n\nSome default DBMS error messages can contain information that could aid an attacker in, among others things, identifying the database type, host address, or state of the database. Custom errors may contain sensitive customer information. \n\nIt is important that detailed error messages be visible only to those who are authorized to view them; that general users receive only generalized acknowledgment that errors have occurred; and that these generalized messages appear only when relevant to the user's task. For example, a message along the lines of, \"An error has occurred. Unable to save your changes. If this problem persists, contact your help desk\" would be relevant. A message such as \"Warning: your transaction generated a large number of page splits\" would likely not be relevant. \n\nAdministrative users authorized to review detailed error messages typically are the ISSO, ISSM, SA and DBA. Other individuals or roles may be specified according to organization-specific needs, with DBA approval.\n\nThis calls for the review of applications, which will require collaboration with the application developers. It is recognized that in many cases the database administrator (DBA) is organizationally separate from the application developers, and may have limited, if any, access to source code. Nevertheless, protections of this type are so important to the secure operation of databases that they must not be ignored. At a minimum, the DBA must attempt to obtain assurances from the development organization that this issue is addressed, and must document what has been discovered.","checkContent":"Check DB2 settings and custom database code to determine if detailed error messages are ever displayed to unauthorized individuals.\n\nIf detailed error messages are displayed to individuals not authorized to view them, this is a finding.","fixText":"Configure DB2 settings, custom database code, and associated application code not to display detailed error messages to those not authorized to view them.","ccis":["CCI-001314"]},{"vulnId":"V-213715","ruleId":"SV-213715r879673_rule","severity":"medium","ruleTitle":"DB2 must automatically terminate a user session after organization-defined conditions or trigger events requiring session disconnect.","description":"This addresses the termination of user-initiated logical sessions in contrast to the termination of network connections that are associated with communications sessions (i.e., network disconnect). A logical session (for local, network, and remote access) is initiated whenever a user (or process acting on behalf of a user) accesses an organizational information system. Such user sessions can be terminated (and thus terminate user access) without terminating network sessions. \n\nSession termination ends all processes associated with a user's logical session except those batch processes/jobs that are specifically created by the user (i.e., session owner) to continue after the session is terminated. \n\nConditions or trigger events requiring automatic session termination can include, for example, organization-defined periods of user inactivity, targeted responses to certain types of incidents, and time-of-day restrictions on information system use.\n\nThis capability is typically reserved for specific cases where the system owner, data owner, or organization requires additional assurance.","checkContent":"Run the following query to check the existing thresholds defined in database: \nDB2> SELECT thresholdname, thresholdpredicate, maxvalue, execution \n           FROM syscat.thresholds\n\nIf there are no thresholds defined in the required categories this is a finding. \n\nReview the defined thresholds, if the thresholds are not defined per the organization policies, this is a finding. \n\nNote: Select the following link for the knowledgebase on syscat.thresholds: \n\nhttp://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","fixText":"Run the CREATE THRESHOLD statement to create the thresholds per organization policies. \n\nThe following command is an example for creating a threshold to terminate any sessions which have been inactive for more than 5 hours: \nDB2>  CREATE THRESHOLD MONIDLETIME FOR DATABASE ACTIVITIES ENFORCEMENT DATABASE \n     WHEN CONNECTIONIDLETIME > 300 MINUTE STOP EXECUTION \n\nNote: Select the following link for the knowledgebase information on create threshold: \n\nhttp://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0050563.html?lang=en","ccis":["CCI-002361"]},{"vulnId":"V-213716","ruleId":"SV-213716r879689_rule","severity":"medium","ruleTitle":"When supporting applications that require security labeling of data, DB2 must associate organization-defined types of security labels having organization-defined security label values with information in storage.","description":"Without the association of security labels to information, there is no basis for the DBMS to make security-related access-control decisions.\n\nSecurity labels are abstractions representing the basic properties or characteristics of an entity (e.g., subjects and objects) with respect to safeguarding information. \n\nThese labels are typically associated with internal data structures (e.g., tables, rows) within the database and are used to enable the implementation of access control and flow control policies, reflect special dissemination, handling or distribution instructions, or support other aspects of the information security policy. \n\nOne example includes marking data as classified or FOUO. These security labels may be assigned manually or during data processing, but, either way, it is imperative these assignments are maintained while the data is in storage. If the security labels are lost when the data is stored, there is the risk of a data compromise.\n\nThe mechanism used to support security labeling may be a feature of the DBMS product, a third-party product, or custom application code.","checkContent":"If security labeling is not required, this is not a finding.\n\nQuery the system catalog to find out the existing security labels:\nDB2> SELECT * FROM SYSCAT.SECURITYLABELS\n\nIf the required labels are not created in database this is a finding.\n\nQuery the following catalog views find details of existing security labels:\nDB2> SELECT * FROM SYSCAT.SECURITYLABELACCESS\nDB2> SELECT * FROM SYSCAT.SECURITYLABELCOMPONENTELEMENTS\nDB2> SELECT * FROM SYSCAT.SECURITYLABELCOMPONENTS\n\nIf the security labels are not defined as per organization security policies, this is a finding.","fixText":"Use Create security Label statement to create the security labels: \n\nSee the following example to create the components, policy and then security labels:\n\nCreate the components for Security labels:\nDB2> CREATE SECURITY LABEL COMPONENT LEVEL ARRAY ['Top Secret', 'Secret', 'Confidential', 'Unclassified'];\nDB2> CREATE SECURITY LABEL COMPONENT COMPARTMENTS SET {'Collection', 'Research', 'Analysis'};\n\nCreate the Policy:\nDB2> CREATE SECURITY POLICY DATA_ACCESS COMPONENTS LEVEL, COMPARTMENTS WITH DB2LBACRULES;\n\nCreate Security Label:\nDB2> CREATE SECURITY LABEL DATA_ACCESS.EMPLOYEESECLABEL COMPONENT LEVEL 'Top Secret', COMPONENT COMPARTMENTS 'Research', 'Analysis'\n\nAfter creating the security labels, use one of the following statements to attach the labels to the table:\nDB2>  CREATE TABLE\n  Or\nDB2> ALTER TABLE\n\nFor advice and examples, see the tutorial at:\nhttps://www.ibm.com/developerworks/data/tutorials/dm0605wong/\nhttps://www.ibm.com/developerworks/data/tutorials/dm0605wong/section2.html\n\nNote: Select the following knowledgebase link for information regarding LBAC Details: \nhttp://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/c0021114.html\n\nSelect the following knowledgebase link for information regarding Create Security Label: \nhttp://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","ccis":["CCI-002262"]},{"vulnId":"V-213717","ruleId":"SV-213717r879690_rule","severity":"medium","ruleTitle":"When supporting applications that require security labeling of data, DB2 must associate organization-defined types of security labels having organization-defined security label values with information in process.","description":"Without the association of security labels to information, there is no basis for the DBMS to make security-related access-control decisions.\n\nSecurity labels are abstractions representing the basic properties or characteristics of an entity (e.g., subjects and objects) with respect to safeguarding information. \n\nThese labels are typically associated with internal data structures (e.g., tables, rows) within the database and are used to enable the implementation of access control and flow control policies, reflect special dissemination, handling or distribution instructions, or support other aspects of the information security policy. \n\nOne example includes marking data as classified or FOUO. These security labels may be assigned manually or during data processing, but, either way, it is imperative these assignments are maintained while the data is in storage. If the security labels are lost when the data is stored, there is the risk of a data compromise.\n\nThe mechanism used to support security labeling may be a feature of the DBMS product, a third-party product, or custom application code.","checkContent":"If security labeling is not required, this is not a finding.\n\nQuery the system catalog to find out the existing security labels:\nDB2> SELECT * FROM SYSCAT.SECURITYLABELS\n\nIf the required labels are not created in database this is a finding.\n\nQuery the following catalog views find details of existing security labels:\nDB2> SELECT * FROM SYSCAT.SECURITYLABELACCESS\nDB2> SELECT * FROM SYSCAT.SECURITYLABELCOMPONENTELEMENTS\nDB2> SELECT * FROM SYSCAT.SECURITYLABELCOMPONENTS\n\nIf the security labels are not defined as per organization security policies, this is a finding.","fixText":"Use Create security Label statement to create the security labels: \n\nSee the following example to create the components, policy and then security labels:\n\nCreate the components for Security labels:\nDB2> CREATE SECURITY LABEL COMPONENT LEVEL ARRAY ['Top Secret', 'Secret', 'Classified', 'Unclassified'];\nDB2> CREATE SECURITY LABEL COMPONENT COMPARTMENTS SET {'Collection', 'Research', 'Analysis'};\n\nCreate the Policy:\nDB2> CREATE SECURITY POLICY DATA_ACCESS COMPONENTS LEVEL, COMPARTMENTS WITH DB2LBACRULES;\n\nCreate Security Label:\nDB2> CREATE SECURITY LABEL DATA_ACCESS.EMPLOYEESECLABEL COMPONENT LEVEL 'Top Secret', COMPONENT COMPARTMENTS 'Research', 'Analysis'\n\nAfter creating the security labels, use one of the following statements to attach the labels to the table:\nDB2>  CREATE TABLE\n  Or\nDB2> ALTER TABLE\n\nFor advice and examples, see the tutorial at:\nhttps://www.ibm.com/developerworks/data/tutorials/dm0605wong/\nhttps://www.ibm.com/developerworks/data/tutorials/dm0605wong/section2.html\n\nNote: Select the following knowledgebase link for information regarding LBAC Details: \nhttp://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/c0021114.html\n\nSelect the following knowledgebase link for information regarding Create Security Label: \nhttp://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","ccis":["CCI-002263"]},{"vulnId":"V-213718","ruleId":"SV-213718r879717_rule","severity":"high","ruleTitle":"DB2 must prevent non-privileged users from executing privileged functions, to include disabling, circumventing, or altering implemented security safeguards/countermeasures.","description":"Preventing non-privileged users from executing privileged functions mitigates the risk that unauthorized individuals or processes may gain unnecessary access to information or privileges. \n\nSystem documentation should include a definition of the functionality considered privileged.\n\nDepending on circumstances, privileged functions can include, for example, establishing accounts, performing system integrity checks, or administering cryptographic key management activities. Non-privileged users are individuals that do not possess appropriate authorizations. Circumventing intrusion detection and prevention mechanisms or malicious code protection mechanisms are examples of privileged functions that require protection from non-privileged users.\n\nA privileged function in the DBMS/database context is any operation that modifies the structure of the database, its built-in logic, or its security settings. This would include all Data Definition Language (DDL) statements and all security-related statements. In an SQL environment, it encompasses, but is not necessarily limited to: \n\nCREATE\nALTER\nDROP\nGRANT\nREVOKE\nDENY\n\nThere may also be Data Manipulation Language (DML) statements that, subject to context, should be regarded as privileged. Possible examples include:\n\nTRUNCATE TABLE;\nDELETE, or\nDELETE affecting more than n rows, for some n, or\nDELETE without a WHERE clause;\n\nUPDATE or\nUPDATE affecting more than n rows, for some n, or\nUPDATE without a WHERE clause;\n\nany SELECT, INSERT, UPDATE, or DELETE to an application-defined security table executed by other than a security principal.\n\nDepending on the capabilities of the DBMS and the design of the database and associated applications, the prevention of unauthorized use of privileged functions may be achieved by means of DBMS security features, database triggers, other mechanisms, or a combination of these.","checkContent":"Review the system documentation to obtain the definition of the DB2 functionality considered privileged in the context of the system in question.\n\nRun the following command to find the privileged groups to get the value of SYSADM_GROUP, SYSCTRL_GROUP, SYSMAINT_GROUP, SYSMON_GROUP:\n     \n     $db2 get dbm cfg \n\nIf non-privileged users are members of any of these groups, this is a finding. \n\nRun the following SQL command to find the database authorities: \nDB2> SELECT * FROM SYSCAT.DBAUTH\n\nIf non-privileged users have any database authority, this is a finding. \n\nQuery the following system catalog views to find out the authorities on all database objects:\n\nSYSCAT.COLAUTH: Lists the column privileges\nSYSCAT.DBAUTH: Lists the database privileges\nSYSCAT.INDEXAUTH: Lists the index privileges\nSYSCAT.MODULEAUTH: Lists the module privileges\nSYSCAT.PACKAGEAUTH: Lists the package privileges\nSYSCAT.PASSTHRUAUTH: Lists the server privilege\nSYSCAT.ROLEAUTH: Lists the role privileges\nSYSCAT.ROUTINEAUTH: Lists the routine (functions, methods, and stored procedures) privileges\nSYSCAT.SCHEMAAUTH: Lists the schema privileges\nSYSCAT.SEQUENCEAUTH: Lists the sequence privileges\nSYSCAT.SURROGATEAUTHIDS: Lists the authorization IDs for which another authorization ID can act as a surrogate. \nSYSCAT.TABAUTH: Lists the table and view privileges\nSYSCAT.TBSPACEAUTH: Lists the table space privileges\nSYSCAT.VARIABLEAUTH: Lists the variable privileges\nSYSCAT.WORKLOADAUTH: Lists the workload privileges\nSYSCAT.XSROBJECTAUTH: Lists the XSR object privileges\n\nIf non-privileged users have any authority, this is a finding.","fixText":"Use appropriate OS utility to remove the non-authorized users form privileged groups.\n\nUse REVOKE command to revoke database level or object privileges from non-authorized users. \n\nNote: The following views and table functions list information about privileges held by users, identities of users granting privileges, and object ownership:\nSYSCAT.COLAUTH: Lists the column privileges\nSYSCAT.DBAUTH: Lists the database privileges\nSYSCAT.INDEXAUTH: Lists the index privileges\nSYSCAT.MODULEAUTH: Lists the module privileges\nSYSCAT.PACKAGEAUTH: Lists the package privileges\nSYSCAT.PASSTHRUAUTH: Lists the server privilege\nSYSCAT.ROLEAUTH: Lists the role privileges\nSYSCAT.ROUTINEAUTH: Lists the routine (functions, methods, and stored procedures) privileges\nSYSCAT.SCHEMAAUTH: Lists the schema privileges\nSYSCAT.SEQUENCEAUTH: Lists the sequence privileges\nSYSCAT.SURROGATEAUTHIDS: Lists the authorization IDs for which another authorization ID can act as a surrogate.\nSYSCAT.TABAUTH: Lists the table and view privileges\nSYSCAT.TBSPACEAUTH: Lists the table space privileges\nSYSCAT.VARIABLEAUTH: Lists the variable privileges\nSYSCAT.WORKLOADAUTH: Lists the workload privileges\nSYSCAT.XSROBJECTAUTH: Lists the XSR object privileges","ccis":["CCI-002235"]},{"vulnId":"V-213719","ruleId":"SV-213719r879729_rule","severity":"medium","ruleTitle":"DB2 must utilize centralized management of the content captured in audit records generated by all components of DB2.","description":"Without the ability to centrally manage the content captured in the audit records, identification, troubleshooting, and correlation of suspicious behavior would be difficult and could lead to a delayed or incomplete analysis of an ongoing attack.\n\nThe content captured in audit records must be managed from a central location (necessitating automation). Centralized management of audit records and logs provides for efficiency in maintenance and management of records, as well as the backup and archiving of those records. \n\nThe DBMS may write audit records to database tables, to files in the file system, to other kinds of local repository, or directly to a centralized log management system. Whatever the method used, it must be compatible with off-loading the records to the centralized system.","checkContent":"Run the following command to find the location of the audit data and archive data directories: \n\n     $db2audit describe \n\nIf this filesystem location is not compatible with the centralized  audit management system, this is a finding.\n\nIf DB2 is not used in conjunction with a centralized audit management system, this is a finding.","fixText":"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:\n\n     $db2audit configure datapath <AUDIT DATA DIRECTORY > archivepath <AUDIT ARCHIVE DIRECTORY>\n\nNote: See the following knowledgebase page for information regarding extracting Audit logs to syslog for any file system other than Windows: \nhttp://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0002072.html\n\nDB2 does not directly support syslog on windows.  Devise an alternate method of log capture.","ccis":["CCI-001844"]},{"vulnId":"V-213720","ruleId":"SV-213720r879730_rule","severity":"medium","ruleTitle":"DB2 must allocate audit record storage capacity in accordance with organization-defined audit record storage requirements.","description":"In order to ensure sufficient storage capacity for the audit logs, the DBMS must be able to allocate audit record storage capacity. Although another requirement (SRG-APP-000515-DB-000318) mandates that audit data be off-loaded to a centralized log management system, it remains necessary to provide space on the database server to serve as a buffer against outages and capacity limits of the off-loading mechanism.\n\nThe task of allocating audit record storage capacity is usually performed during initial installation of the DBMS and is closely associated with the DBA and system administrator roles. The DBA or system administrator will usually coordinate the allocation of physical drive space with the application owner/installer and the application will prompt the installer to provide the capacity information, the physical location of the disk, or both.\n\nIn determining the capacity requirements, consider such factors as: total number of users; expected number of concurrent users during busy periods; number and type of events being monitored; types and amounts of data being captured; the frequency/speed with which audit records are off-loaded to the central log management system; and any limitations that exist on the DBMS's ability to reuse the space formerly occupied by off-loaded records.","checkContent":"Run the following command to find the location of the audit data directory: \n\n     $db2audit describe \n\nNote the location of audit data directory.\n\nCheck the operating system log records find out if there has been any out of space event for that location.\n\nIf there has been any out of space event for audit data directory, this is a finding.\n\nTake samples of peak database activity and measure the space utilized in the audit data directory location during that time.\n\nIf the audit data directory is not sized to handle the workload between audit archiving intervals this is a finding.","fixText":"Allocate space to the file system where the audit data directory resides.","ccis":["CCI-001849"]},{"vulnId":"V-213721","ruleId":"SV-213721r879732_rule","severity":"medium","ruleTitle":"DB2 must provide a warning to appropriate support staff when allocated audit record storage volume reaches 75% of maximum audit record storage capacity.","description":"Organizations are required to use a central log management system, so, under normal conditions, the audit space allocated to the DBMS on its own server will not be an issue. However, space will still be required on the DBMS server for audit records in transit, and, under abnormal conditions, this could fill up. Since a requirement exists to halt processing upon audit failure, a service outage would result.\n\nIf support personnel are not notified immediately upon storage volume utilization reaching 75%, they are unable to plan for storage capacity expansion. \n\nThe appropriate support staff include, at a minimum, the ISSO and the DBA/SA.","checkContent":"Use the following command to find the directory for the Audit Data Path: \n\n     $db2audit describe \n\nIf 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.","fixText":"Use the Operating system tools or external utilities to monitor the Audit Data Path and set alerts for 75% space utilization.","ccis":["CCI-001855"]},{"vulnId":"V-213722","ruleId":"SV-213722r879733_rule","severity":"medium","ruleTitle":"DB2 must provide an immediate real-time alert to appropriate support staff of all audit failure events requiring real-time alerts.","description":"It is critical for the appropriate personnel to be aware if a system is at risk of failing to process audit logs as required. Without a real-time alert, security personnel may be unaware of an impending failure of the audit capability, and system operation may be adversely affected. \n\nThe appropriate support staff include, at a minimum, the ISSO and the DBA/SA.\n\nAlerts provide organizations with urgent messages. Real-time alerts provide these messages immediately (i.e., the time from event detection to alert occurs in seconds or less).","checkContent":"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. \n\nRun the following statement to find the error type for each policy:\nDB2> SELECT AUDITPOLICYNAME, ERRORTYPE AS ERRORTYPE \nFROM SYSCAT.AUDITPOLICIES\n\nIf ERRORTYPE value is not set to 'A', this is a finding. \n\nRun the following command to monitor the database diagnostic log file for audit failure errors:\n\n     $db2diag -g msg:=\"Write to audit log failed\"\n\nIf the diagnostic log file is not being monitored for audit failure errors, this is a finding.","fixText":"Run the following command to alter the audit policies and to set the ERRORTYPE to audit: \nDB2>ALTER AUDIT POLICY <DB audit policy name> CATEGORIES AUDIT STATUS BOTH  ERROR TYPE AUDIT\n\nMonitor the diagnostic log file for audit failure error using the following command: \n\n     $db2diag  -g msg:=\"Write to audit log failed\"","ccis":["CCI-001858"]},{"vulnId":"V-213723","ruleId":"SV-213723r879751_rule","severity":"medium","ruleTitle":"DB2 must prohibit user installation of logic modules (stored procedures, functions, triggers, views, etc.) without explicit privileged status.","description":"Allowing regular users to install software, without explicit privileges, creates the risk that untested or potentially malicious software will be installed on the system. Explicit privileges (escalated or administrative privileges) provide the regular user with explicit capabilities and control that exceed the rights of a regular user.\n\nDBMS functionality and the nature and requirements of databases will vary; so while users are not permitted to install unapproved software, there may be instances where the organization allows the user to install approved software packages such as from an approved software repository. The requirements for production servers will be more restrictive than those used for development and research.\n\nThe DBMS must enforce software installation by users based upon what types of software installations are permitted (e.g., updates and security patches to existing software) and what types of installations are prohibited (e.g., software whose pedigree with regard to being potentially malicious is unknown or suspect) by the organization). \n\nIn the case of a database management system, this requirement covers stored procedures, functions, triggers, views, etc.","checkContent":"The user needs CREATEINAUTH privileges for the schema to create objects in an existing schema.\n\nRun the following Query to find which user has privilege to create objects in schemas:\nDB2> SELECT GRANTEE, SCHEMANAME, CREATEINAUTH, ALTERINAUTH \n           FROM SYSCAT.SCHEMAAUTH\n\nIf a non-authorized user has privilege, this is a finding.\n\nRun the following query to which user has privilege to create new schema and other objects:\nDB2> SELECT GRANTEE, CREATETABAUTH, EXTERNALROUTINEAUTH, DBADMAUTH, IMPLSCHEMAAUTH \n           FROM SYSCAT.DBAUTH\n\nIf a non-authorized user has privilege, this is a finding.","fixText":"Run the REVOKE command to revoke database authorities and schema privileges from user: \nDB2> REVOKE CREATEIN ON SCHEMA<schema_name> FROM <user> \nDB2> REVOKE <db authority> ON DATABASE FROM <USER>\n\nNote: Select the following knowledgebase link for information regarding revoking database authorities: \nhttp://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\n\nSelect the following knowledgebase link for information regarding revoking schema privileges: \nhttp://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","ccis":["CCI-001812"]},{"vulnId":"V-213724","ruleId":"SV-213724r879753_rule","severity":"medium","ruleTitle":"DB2 and the operating system must enforce access restrictions associated with changes to the configuration of DB2 or database(s).","description":"Failure to provide logical access restrictions associated with changes to configuration may have significant effects on the overall security of the system. \n\nWhen dealing with access restrictions pertaining to change control, it should be noted that any changes to the hardware, software, and/or firmware components of the information system can potentially have significant effects on the overall security of the system. \n\nAccordingly, only qualified and authorized individuals should be allowed to obtain access to system components for the purposes of initiating changes, including upgrades and modifications.","checkContent":"The base installation directory of the database server software and instance home directory location is configurable at the time of installation.\n\nRun the db2level command to find the installation directory of DB2 server software: \n\n     $db2level  \n\nIf 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. \n\nOn 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. \n\nOn Windows operating systems, the instance directory is located under the /sqllib directory where the DB2 database product was installed. \n\nIf 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.","fixText":"Remove the write permission from non-root/non-sysadmin users on the DB2 installation base directory and instance home directory.","ccis":["CCI-001813"]},{"vulnId":"V-213725","ruleId":"SV-213725r879754_rule","severity":"medium","ruleTitle":"DB2 must produce audit records of its enforcement of access restrictions associated with changes to the configuration of DB2 or database(s).","description":"Without auditing the enforcement of access restrictions against changes to configuration, it would be difficult to identify attempted attacks and an audit trail would not be available for forensic investigation for after-the-fact actions. \n\nEnforcement actions are the methods or mechanisms used to prevent unauthorized changes to configuration settings. Enforcement action methods may be as simple as denying access to a file based on the application of file permissions (access restriction). Audit items may consist of lists of actions blocked by access restrictions or changes identified after the fact.","checkContent":"To audit changes in configuration, the SYSADMIN category needs to be audited at both the instance level and the database level.\n\nRun the following command to ensure that the SYSADMIN category is being audited at the instance level: \n\n     $db2audit describe\n\nIf Log system administrator events is not set to “Both”, this is a finding.\n\nRun the following SQL statement to ensure that an audit policy exists at the database level: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE = ' '\n\nIf no rows are returned, this is a finding.\n\nFor 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': \nDB2> SELECT AUDITPOLICYNAME, SYSADMINSTATUS, CONTEXTSTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for SYSADMINSTATUS and CONTEXTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to set the auditing at the instance level: \n\n     $db2audit configure scope sysadmin status both error type audit\n\nRun the following command to set the auditing at the database level: \nDB2> CREATE AUDIT POLICY <DB audit policy name> CATEGORIES SYSADMIN STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT\n\nRun the following command if the auditing policy exists but does not include the sysadmin category: \nDB2> ALTER AUDIT POLICY <DB audit policy name> SYSADMIN STATUS BOTH, CONTEXT STATUS BOTH ERROR TYPE AUDIT \n\nIf CREATE was used above, apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>\n\nNote: See the following page for knowledgebase information regarding the ALTER AUDIT POLICY: \nhttp://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0050608.html?lang=en","ccis":["CCI-001814"]},{"vulnId":"V-213726","ruleId":"SV-213726r879756_rule","severity":"medium","ruleTitle":"DB2 must disable network functions, ports, protocols, and services deemed by the organization to be nonsecure, in accord with the Ports, Protocols, and Services Management (PPSM) guidance.","description":"Use of nonsecure network functions, ports, protocols, and services exposes the system to avoidable threats.","checkContent":"Run the following command to find the value of the network service:\n\n     $db2 get dbm cfg\n\nTCP/IP Service name                     (SVCENAME) \nSSL service name                         (SSL_SVCENAME) \n\nIf 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.\n\nDefault Location for services file:\n   Windows Service File:  %SystemRoot%\\system32\\drivers\\etc\\services\n   UNIX Services File: /etc/services\n\nIf the network protocols and ports found in previous step are not in as per PPSM guidance, this is a finding.","fixText":"Use the following commands to set the protocol and ports as per PPSM guidance:\n\n     $db2 update dbm cfg using svcename [service_name | port_number]\n\n     $db2 update dbm cfg using ssl_svcename [ssl_service_name | port_number]\n\n\nNote: http://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0025241.html","ccis":["CCI-001762"]},{"vulnId":"V-213728","ruleId":"SV-213728r879798_rule","severity":"medium","ruleTitle":"DB2 must only accept end entity certificates issued by DoD PKI or DoD-approved PKI Certification Authorities (CAs) for the establishment of all encrypted sessions.","description":"Only DoD-approved external PKIs have been evaluated to ensure that they have security controls and identity vetting procedures in place which are sufficient for DoD systems to rely on the identity asserted in the certificate.  PKIs lacking sufficient security controls and identity vetting procedures risk being compromised and issuing certificates that enable adversaries to impersonate legitimate users. \n\nThe authoritative list of DoD-approved PKIs is published at http://iase.disa.mil/pki-pke/interoperability.\n\nThis requirement focuses on communications protection for the DBMS session rather than for the network packet.","checkContent":"Run the following command to find certificate details: \n\n     $gsk8capicmd_64 -cert -details -db \"<mydbserver.kdb>\" -pw \"<PASSWORD>\" -label \"<myselfsigned>\"\n\nThe output is displayed in  a form similar to the following: \n\n-- label : myselfsigned key size : 1024 version : X509 V3 serial : 96c2db8fa769a09d\n\n-- issue:CN=myhost.mycompany.com,O=myOrganization,OU=myOrganizationUnit,\nL=myLocation,ST=ON,C=CA \n\n-- subject:CN=myhost.mycompany.com,O=myOrganization,OU=myOrganizationUnit,\nL=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\n\nIf the certificate is not issued by DoD PKI or DoD-approved PKI Certification Authorities (CAs), this is a finding.","fixText":"Create a key database and set up the digital certificates.\n\nThe following command creates a key database called mydbserver.kdb and a stash file called mydbserver.sth: \n\n     $gsk8capicmd_64 -keydb -create -db \"mydbserver.kdb\" -pw \"myServerPassw0rdpw0\" -stash\n\nWhen you create a key database, it is automatically populated with signer certificates from a few certificate authorities (CAs), such as Verisign.\n\nAdd a certificate for your server to your key database. \n\nTo 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. \n\nFollowing 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:\n\n     $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\"\n\nNotes:\n\n-- Use the GSKCapiCmd tool to create the key database. It must be a Certificate Management System (CMS) type key database. \n\nThe GSKCapiCmd is a non-Java-based command-line tool, and Java does not need to be installed on the system to use this tool. \n\nYou invoke GSKCapiCmd using the GSKCAPICMD command, as described in the GSKCapiCmd User's Guide. \n\nThe 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. \n\nOn 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.\nThe -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.\nTo 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.\n\nRun the following GSKCapiCmd command extracts the certificate to a file called mydbserver.arm:\n\n     $gsk8capicmd_64 -cert -extract -db \"mydbserver.kdb\" -pw \"myServerPassw0rdpw0\" -label \"myselfsigned\" -target \"mydbserver.arm\" -format ascii –fips","ccis":["CCI-002470"]},{"vulnId":"V-213729","ruleId":"SV-213729r879799_rule","severity":"medium","ruleTitle":"DB2 must implement cryptographic mechanisms to prevent unauthorized modification of organization-defined information at rest (to include, at a minimum, PII and classified information) on organization-defined information system components.","description":"DBMSs handling data requiring \"data at rest\" protections must employ cryptographic mechanisms to prevent unauthorized disclosure and modification of the information at rest. These cryptographic mechanisms may be native to the DBMS or implemented via additional software or operating system/file system settings, as appropriate to the situation.\n\nSelection of a cryptographic mechanism is based on the need to protect the integrity of organizational information. The strength of the mechanism is commensurate with the security category and/or classification of the information. Organizations have the flexibility to either encrypt all information on storage devices (i.e., full disk encryption) or encrypt specific data structures (e.g., files, records, or fields). \n\nThe decision whether to employ cryptography is the responsibility of the information owner/steward, who exercises discretion within the framework of applicable rules, policies, and law.","checkContent":"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.\n\nIf the documentation indicates no information requires such protections, this is not a finding.\n\nDB2 native encryption can encrypt the data at rest; or third-party tools, like IBM Guardium, can provide encryption for data at rest.\n \nTo find if a database is encrypted with DB2 native encryption, run the following SQL Query:\nDB2> SELECT * FROM TABLE(SYSPROC.ADMIN_GET_ENCRYPTION_INFO())\n\nIf the value of Algorithm is NULL for the database, this is a finding. \n\nIf the database is not encrypted with native encryption or any third-party tool, this is a finding.","fixText":"To create the database using DB2 native encryption run the following command:\n\n     $db2 create db <database name> encrypt\n\nSee the detailed instructions in the link in the note section below to create the encrypted database.\n\nNote: Select the following link for details on how to set up DB2 native encryption:\nhttp://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0061766.html?lang=en \n\nIf 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.","ccis":["CCI-002475"]},{"vulnId":"V-213730","ruleId":"SV-213730r879800_rule","severity":"medium","ruleTitle":"DB2 must implement and/or support cryptographic mechanisms preventing the unauthorized disclosure of organization-defined information at rest on organization-defined information system components.","description":"DBMSs handling data requiring \"data at rest\" protections must employ cryptographic mechanisms to prevent unauthorized disclosure and modification of the information at rest. These cryptographic mechanisms may be native to the DBMS or implemented via additional software or operating system/file system settings, as appropriate to the situation.\n\nSelection of a cryptographic mechanism is based on the need to protect the integrity of organizational information. The strength of the mechanism is commensurate with the security category and/or classification of the information. Organizations have the flexibility to either encrypt all information on storage devices (i.e., full disk encryption) or encrypt specific data structures (e.g., files, records, or fields). \n\nThe decision whether to employ cryptography is the responsibility of the information owner/steward, who exercises discretion within the framework of applicable rules, policies, and law.","checkContent":"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.\n\nIf the documentation indicates no information requires such protections, this is not a finding.\n\nDB2 native encryption can encrypt the data at rest; or third-party tools, like IBM Guardium, can provide encryption for data at rest.\n \nTo find if a database is encrypted with DB2 native encryption, run the following SQL Query:\nDB2> SELECT * FROM TABLE(SYSPROC.ADMIN_GET_ENCRYPTION_INFO())\n\nIf the value of Algorithm is NULL for the database, this is a finding. \n\nIf the database is not encrypted with native encryption or any third-party tool, this is a finding.","fixText":"To create the database using DB2 native encryption run the following command:\n\n  $db2 create db mydb encrypt\n\nSee the detailed instructions in link in the note section below to create the encrypted database.\n\nNote: Select the following link for details on how to set up DB2 native encryption:\nhttp://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0061766.html?lang=en \n\nIf 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.","ccis":["CCI-002476"]},{"vulnId":"V-213731","ruleId":"SV-213731r917668_rule","severity":"medium","ruleTitle":"DB2 must maintain the confidentiality and integrity of information during preparation for transmission.","description":"Information can be either unintentionally or maliciously disclosed or modified during preparation for transmission, including, for example, during aggregation, at protocol transformation points, and during packing/unpacking. These unauthorized disclosures or modifications compromise the confidentiality or integrity of the information.\n\nUse of this requirement will be limited to situations where the data owner has a strict requirement for ensuring data integrity and confidentiality is maintained at every step of the data transfer and handling process. \n\nWhen transmitting data, the DBMS, associated applications, and infrastructure must leverage transmission protection mechanisms.","checkContent":"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. \n\nRun the following command to find out what versions of TLS are supported by the server:\n\n$db2 get dbm cfg \n\nIf the value of the ssl_versions parameter is not set to \"TLSV1\" or \"TLSV12\", this is a finding.\n\nCheck the value of the DB2COMM parameter using the following command:\n\n$db2set -all \n\nIf the value of DB2COMM is not set to \"SSL\", this is a finding. \n\nNote: When this topic mentions SSL, the same information applies to TLS unless otherwise noted.","fixText":"Run the following DB2 command to set the value of ssl_versions to approved TLS or SSL version: \n\n$db2 update dbm cfg using SSL_VERSIONS <SSL Version>\n\nRun the following command to set the value of db2comm parameter to SSL: \n\n$db2set db2comm=ssl\n\nRestart the database manager.\n\nNote: Details on key database creation and setting up SSL environment are in following links\n\nSelect the following knowledgebase link for more information regarding configuring SSL support:\nhttp://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0025241.html?lang=en\n\nSelect the following knowledgebase link for more information regarding SSL_versions:\nhttp://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\n\nSelect the following knowledgebase link for setting communication protocol:\nhttp://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","ccis":["CCI-002420"]},{"vulnId":"V-213732","ruleId":"SV-213732r917670_rule","severity":"medium","ruleTitle":"DB2 must maintain the confidentiality and integrity of information during reception.","description":": Information can be either unintentionally or maliciously disclosed or modified during reception, including, for example, during aggregation, at protocol transformation points, and during packing/unpacking. These unauthorized disclosures or modifications compromise the confidentiality or integrity of the information.\n\nThis requirement applies only to those applications that are either distributed or can allow access to data non-locally. Use of this requirement will be limited to situations where the data owner has a strict requirement for ensuring data integrity and confidentiality is maintained at every step of the data transfer and handling process. \n\nWhen receiving data, the DBMS, associated applications, and infrastructure must leverage protection mechanisms.","checkContent":"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. \n\nRun the following command to find out what versions of TLS are supported by the server:\n\n$db2 get dbm cfg \n\nIf the value of the ssl_versions parameter is not set to \"TLSV1\" or \"TLSV12\" this is a finding.\n\nCheck the value of the DB2COMM parameter using the following command:\n\n$db2set -all \n\nIf the value of DB2COMM is not set to \"SSL\", this is a finding. \n\nNote: When this topic mentions SSL, the same information applies to TLS unless otherwise noted.","fixText":"Run the following DB2 command to set the value of ssl_versions to approved TLS or SSL version: \n\n$db2 update dbm cfg using SSL_VERSIONS <SSL Version>\n\nRun the following command to set the value of db2comm parameter to SSL: \n\n$db2set db2comm=ssl\n\nRestart the database manager.\n\nNote: Details on key database creation and setting up SSL environment are in the following links\n\nSelect the following knowledgebase link for more information regarding configuring SSL support:\nhttp://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0025241.html?lang=en\n\nSelect the following knowledgebase link for more information regarding SSL_versions:\nhttp://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\n\nSelect the following knowledgebase link for setting communication protocol:\nhttp://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","ccis":["CCI-002422"]},{"vulnId":"V-213733","ruleId":"SV-213733r879818_rule","severity":"medium","ruleTitle":"When invalid inputs are received, DB2 must behave in a predictable and documented manner that reflects organizational and system objectives.","description":"A common vulnerability is unplanned behavior when invalid inputs are received. This requirement guards against adverse or unintended system behavior caused by invalid inputs, where information system responses to the invalid input may be disruptive or cause the system to fail into an unsafe state.\n\nThe behavior will be derived from the organizational and system requirements and includes, but is not limited to, notification of the appropriate personnel, creating an audit record, and rejecting invalid input.\n\nThis calls for the review of applications, which will require collaboration with the application developers. It is recognized that in many cases the database administrator (DBA) is organizationally separate from the application developers, and may have limited, if any, access to source code. Nevertheless, protections of this type are so important to the secure operation of databases that they must not be ignored. At a minimum, the DBA must attempt to obtain assurances from the development organization that this issue is addressed, and must document what has been discovered.","checkContent":"Review system documentation to determine how input errors are to be handled in general and if any special handling is defined for specific circumstances.\n\nReview the source code for database program objects (stored procedures, functions, triggers) and application source code to identify how the system responds to invalid input.\n\nIf it does not implement the documented behavior, this is a finding.","fixText":"Revise and deploy the source code for database program objects (stored procedures, functions, triggers) and application source code, to implement the documented behavior.","ccis":["CCI-002754"]},{"vulnId":"V-213734","ruleId":"SV-213734r879827_rule","severity":"high","ruleTitle":"Security-relevant software updates to DB2 must be installed within the time period directed by an authoritative source (e.g. IAVM, CTOs, DTMs, and STIGs).","description":"Security flaws with software applications, including database management systems, are discovered daily. Vendors are constantly updating and patching their products to address newly discovered security vulnerabilities. Organizations (including any contractor to the organization) are required to promptly install security-relevant software updates (e.g., patches, service packs, and hot fixes). Flaws discovered during security assessments, continuous monitoring, incident response activities, or information system error handling must also be addressed expeditiously. \n\nOrganization-defined time periods for updating security-relevant software may vary based on a variety of factors including, for example, the security category of the information system or the criticality of the update (i.e., severity of the vulnerability related to the discovered flaw). \n\nThis requirement will apply to software patch management solutions that are used to install patches across the enclave and also to applications themselves that are not part of that patch management solution. For example, many browsers today provide the capability to install their own patch software. Patch criticality, as well as system criticality, will vary. Therefore, the tactical situations regarding the patch management process will also vary. This means that the time period utilized must be a configurable parameter. Time frames for application of security-relevant software updates may be dependent upon the Information Assurance Vulnerability Management (IAVM) process.\n\nThe application will be configured to check for and install security-relevant software updates within an identified time period from the availability of the update. The specific time period will be defined by an authoritative source (e.g. IAVM, CTOs, DTMs, and STIGs).","checkContent":"Obtain evidence that software patches are consistently applied to DB2 within the time frame defined for each patch.\n\nIf such evidence cannot be obtained, or the evidence that is obtained indicates a pattern of noncompliance, this is a finding.","fixText":"Institute and adhere to policies and procedures to ensure that patches are consistently applied to DB2 within the time allowed.","ccis":["CCI-002605"]},{"vulnId":"V-213735","ruleId":"SV-213735r879863_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when security objects are accessed.","description":"Changes to the security configuration must be tracked.\n\nThis requirement applies to situations where security data is retrieved or modified via data manipulation operations, as opposed to via specialized security functionality.\n\nIn an SQL environment, types of access include, but are not necessarily limited to:\n\nSELECT\nINSERT\nUPDATE\nDELETE\nEXECUTE","checkContent":"To ensure the database generates audit records when security objects are accessed the following audit categories must be implemented at the database level: \n\nAUDIT\nCHECKING\nCONTEXT\nSECMAINT\nSYSADMIN\nVALIDATE \n\nRun the following SQL statement to determine if an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nUsing the AUDITPOLICYID returned from above query, run the following command to find the details of audit policy: \nDB2> SELECT AUDITPOLICYNAME, AUDITSTATUS, CHECKINGSTATUS, CONTEXTSTATUS, SECMAINTSTATUS, SYSADMINSTATUS, VALIDATESTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for AUDITSTATUS, CHECKINGSTATUS, CONTEXTSTATUS, SECMAINTSTATUS, SYSMADMINSTATUS and VALIDATESTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES SECMAINT STATUS BOTH, VALIDATE STATUS BOTH, CHECKING STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213736","ruleId":"SV-213736r879863_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when unsuccessful attempts to access security objects occur.","description":"Changes to the security configuration must be tracked.\n\nThis requirement applies to situations where security data is retrieved or modified via data manipulation operations, as opposed to via specialized security functionality.\n\nIn an SQL environment, types of access include, but are not necessarily limited to:\n\nSELECT\nINSERT\nUPDATE\nDELETE\nEXECUTE\n\nTo aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.","checkContent":"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: \n\nAUDIT\nCHECKING\nCONTEXT\nSECMAINT\nSYSADMIN\nVALIDATE \n\nRun the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nRun the following SQL statement using the AUDITPOLICYID from above query find the details of audit policy: \nDB2> SELECT AUDITPOLICYNAME, AUDITSTATUS, CHECKINGSTATUS, CONTEXTSTATUS, SECMAINTSTATUS, SYSADMINSTATUS, VALIDATESTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for AUDITSTATUS, CHECKINGSTATUS, CONTEXTSTATUS, SECMAINTSTATUS, SYSMADMINSTATUS and VALIDATESTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name>\n           CATEGORIES SECMAINT STATUS BOTH, VALIDATE STATUS BOTH, CHECKING STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213737","ruleId":"SV-213737r879865_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when categorized information (e.g., classification levels/security levels) are accessed.","description":"Use of categorized information must be tracked. Without an audit trail, unauthorized access to protected data could go undetected.\n\nFor detailed information on categorizing information, refer to FIPS Publication 199, Standards for Security Categorization of Federal Information and Information Systems, and FIPS Publication 200, Minimum Security Requirements for Federal Information and Information Systems.","checkContent":"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).\n\nTo 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. \n\nRun the following SQL statement to ensure that an audit policy is defined upon the database:\n \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n     FROM SYSCAT.AUDITUSE \n     WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nRun the following SQL statement using the AUDITPOLICYID from the above query to find the details of the audit policy:\n \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE \n     FROM SYSCAT.AUDITPOLICIES \n     WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for SECMAINTSTATUS and CONTEXTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name> \n\nNote: The SECMAINT tracks the security and EXECUTE tracks the info on the tables for which it is defined.","ccis":["CCI-000172"]},{"vulnId":"V-213738","ruleId":"SV-213738r879865_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when unsuccessful attempts to access categorized information (e.g., classification levels/security levels) occur.","description":"Use of categorized information must be tracked. Without an audit trail, unauthorized access to protected data could go undetected.\n\nTo aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.\n\nFor detailed information on categorizing information, refer to FIPS Publication 199, Standards for Security Categorization of Federal Information and Information Systems, and FIPS Publication 200, Minimum Security Requirements for Federal Information and Information Systems.","checkContent":"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).\n\nTo 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. \n\nRun the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n          WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nRun the following SQL statement using the AUDITPOLICYID returned from query above to find the details of the audit policy: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values is not 'B' (Both) CONTEXTSTATUS, SECMAINTSTATUS, columns and the value in ERRORTYPE column set to 'A' (AUDIT) , this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213739","ruleId":"SV-213739r879866_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when privileges/permissions are added.","description":"Changes in the permissions, privileges, and roles granted to users and roles must be tracked. Without an audit trail, unauthorized elevation or restriction of individuals' and groups' privileges could go undetected. Elevated privileges give users access to information and functionality that they should not have; restricted privileges wrongly deny access to authorized users.\n\nIn an SQL environment, adding permissions is typically done via the GRANT command.","checkContent":"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. \n\nRun the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nRun the following SQL statement using the AUDITPOLICYID from query above to find the details of the audit policy: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for CONTEXTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213740","ruleId":"SV-213740r879866_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when unsuccessful attempts to add privileges/permissions occur.","description":"Failed attempts to change the permissions, privileges, and roles granted to users and roles must be tracked. Without an audit trail, unauthorized attempts to elevate or restrict individuals' and groups' privileges could go undetected. \n\nIn an SQL environment, adding permissions is typically done via the GRANT command. \n\nTo aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.","checkContent":"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. \n\nRun the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nRun the following SQL statement using the AUDITPOLICYID from the query above find the details of the audit policy: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for CONTEXTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name>  \n           CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213741","ruleId":"SV-213741r879866_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when privileges/permissions are modified.","description":"Changes in the permissions, privileges, and roles granted to users and roles must be tracked. Without an audit trail, unauthorized elevation or restriction of individuals' and groups' privileges could go undetected. Elevated privileges give users access to information and functionality that they should not have; restricted privileges wrongly deny access to authorized users.\n\nIn an SQL environment, modifying permissions is typically done via the GRANT and REVOKE.","checkContent":"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. \n\nRun the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nRun the following SQL statement using the AUDITPOLICYID from the query above to find the details of the audit policy: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for CONTEXTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"If a correct audit policy does not exist, define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213742","ruleId":"SV-213742r879866_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when unsuccessful attempts to modify privileges/permissions occur.","description":"Failed attempts to change the permissions, privileges, and roles granted to users and roles must be tracked. Without an audit trail, unauthorized attempts to elevate or restrict individuals' and groups' privileges could go undetected. \n\nIn an SQL environment, modifying permissions is typically done via the GRANT and REVOKE. \n\nTo aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.","checkContent":"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. \n\nRun the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nRun the following SQL statement using the AUDITPOLICYID from the query above to find the details of the audit policy: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for CONTEXTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213743","ruleId":"SV-213743r879867_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when security objects are modified.","description":"Changes in the database objects (tables, views, procedures, functions) that record and control permissions, privileges, and roles granted to users and roles must be tracked. Without an audit trail, unauthorized changes to the security subsystem could go undetected. The database could be severely compromised or rendered inoperative.","checkContent":"If there are no locally defined security objects this is not applicable (NA).\n\nIf there are locally defined security objects get a list of those objects from ISSO/DBA.\n\nIf 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.\n\nIf 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.\n\nRun the following SQL statement to ensure that an audit policy is defined in the database:\nDB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN ('T',' ')\n\nIf no rows are returned, this is a finding. \n\nIf a row with OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. \n\nIf a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy. \n\nFor 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: \nDB2> SELECT AUDITPOLICYNAME, SECMAINTSTATUS, OBJMAINTSTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES\n\nIf 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. \n\nIf 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. \n\nIf 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. \n\nIf 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.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement:\nDB2> CREATE AUDIT POLICY <execdb> CATEGORIES OBJMAINT STATUS SUCCESS, SECMAINT STATUS SUCCESS ERROR TYPE AUDIT\n             or\n           CREATE AUDIT POLICY <execdb> CATEGORIES OBJMAINT STATUS SUCCESS, SECMAINT STATUS BOTH ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the correct policy to local security tables or database level:\nDB2> AUDIT TABLE <table name> USING POLICY EXECDB","ccis":["CCI-000172"]},{"vulnId":"V-213744","ruleId":"SV-213744r879867_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when unsuccessful attempts to modify security objects occur.","description":"Changes in the database objects (tables, views, procedures, functions) that record and control permissions, privileges, and roles granted to users and roles must be tracked. Without an audit trail, unauthorized changes to the security subsystem could go undetected. The database could be severely compromised or rendered inoperative.\n\nTo aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.","checkContent":"If there are no locally defined security objects this is not applicable (NA).\n\nIf there are locally defined security objects get a list of those objects from ISSO/DBA.\n\nIf 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.\n\nIf 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.\n\nRun the following SQL statement to ensure that an audit policy is defined upon the database:\nDB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN ('T',' ')\n\nIf no rows are returned, this is a finding. \n\nIf a row with OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. \n\nIf a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy. \n\nFor 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: \nDB2> SELECT AUDITPOLICYNAME, SECMAINTSTATUS, OBJMAINTSTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES\n\nIf 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. \n\nIf 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. \n\nIf 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. \n\nIf 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.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement:\nDB2> CREATE AUDIT POLICY <execdb> CATEGORIES OBJMAINT STATUS SUCCESS, SECMAINT STATUS BOTH ERROR TYPE AUDIT\n             or\n           CREATE AUDIT POLICY <execdb> CATEGORIES OBJMAINT STATUS SUCCESS, SECMAINT STATUS FAILURE ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the correct policy to local security tables or database level:\nDB2> AUDIT TABLE <table name> USING POLICY EXECDB","ccis":["CCI-000172"]},{"vulnId":"V-213745","ruleId":"SV-213745r879869_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when categorized information (e.g., classification levels/security levels) is modified.","description":"Changes in categorized information must be tracked. Without an audit trail, unauthorized access to protected data could go undetected.\n\nFor detailed information on categorizing information, refer to FIPS Publication 199, Standards for Security Categorization of Federal Information and Information Systems, and FIPS Publication 200, Minimum Security Requirements for Federal Information and Information Systems.","checkContent":"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).\n\nTo meet these requirements at the SECMAINT, CONTEXT category auditing needs to be implemented at database level. \n\nRun the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nUsing the AUDITPOLICYID from above query find the details of audit policy: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for CONTEXTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213746","ruleId":"SV-213746r879869_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when unsuccessful attempts to modify categorized information (e.g., classification levels/security levels) occur.","description":"Changes in categorized information must be tracked. Without an audit trail, unauthorized access to protected data could go undetected.\n\nTo aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.\n\nFor detailed information on categorizing information, refer to FIPS Publication 199, Standards for Security Categorization of Federal Information and Information Systems, and FIPS Publication 200, Minimum Security Requirements for Federal Information and Information Systems.","checkContent":"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).\n\nTo meet these requirements at the SECMAINT, CONTEXT category auditing needs to be implemented at database level. \n\nRun the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nUsing the AUDITPOLICYID from above query find the details of audit policy: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for CONTEXTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n            CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH \n            ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213747","ruleId":"SV-213747r879870_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when privileges/permissions are deleted.","description":"Changes in the permissions, privileges, and roles granted to users and roles must be tracked. Without an audit trail, unauthorized elevation or restriction of individuals' and groups' privileges could go undetected. Elevated privileges give users access to information and functionality that they should not have; restricted privileges wrongly deny access to authorized users.\n\nIn an SQL environment, deleting permissions is typically done via the REVOKE  command.","checkContent":"To meet these requirements at the SECMAINT, CONTEXT category auditing needs to be implemented at database level. \n\nRun the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nUsing the AUDITPOLICYID from above query find the details of audit policy: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for CONTEXTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, in the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213748","ruleId":"SV-213748r879870_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when unsuccessful attempts to delete privileges/permissions occur.","description":"Failed attempts to change the permissions, privileges, and roles granted to users and roles must be tracked. Without an audit trail, unauthorized attempts to elevate or restrict individuals' and groups' privileges could go undetected. \n\nIn an SQL environment, deleting permissions is typically done via the REVOKE command. \n\nTo aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.","checkContent":"To meet these requirements at the SECMAINT, CONTEXT category auditing needs to be implemented at database level. \n\nRun the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nUsing the AUDITPOLICYID from above query find the details of audit policy: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for CONTEXTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213749","ruleId":"SV-213749r879872_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when security objects are deleted.","description":"The removal of security objects from the database/DBMS would seriously degrade a system's information assurance posture. If such an event occurs, it must be logged.","checkContent":"To meet these requirements at the SECMAINT, OBJMAINT, and CONTEXT categories, auditing need to be implemented at the database level. \n\nRun the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nUsing the AUDITPOLICYID from above query find the details of audit policy: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, OBJMAINTSTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for CONTEXTSTATUS, OBJMAINTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES SECMAINT STATUS BOTH, OBJMAINTSTATUS STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name> \n\nNote: The SECMAINT command grants a role and the OBJMAINT command sets the grant on a user defined function.","ccis":["CCI-000172"]},{"vulnId":"V-213750","ruleId":"SV-213750r879872_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when unsuccessful attempts to delete security objects occur.","description":"The removal of security objects from the database/DBMS would seriously degrade a system's information assurance posture. If such an action is attempted, it must be logged.\n\nTo aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.","checkContent":"To meet these requirements at the SECMAINT, OBJMAINT, and CONTEXT categories, auditing need to be implemented at the database level. \n\nRun the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nUsing the AUDITPOLICYID from above query find the details of audit policy: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, SECMAINTSTATUS, OBJMAINTSTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for CONTEXTSTATUS, OBJMAINTSTATUS and SECMAINTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES SECMAINT STATUS BOTH, OBJMAINTSTATUS STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213751","ruleId":"SV-213751r879873_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when categorized information (e.g., classification levels/security levels) is deleted.","description":"Changes in categorized information must be tracked. Without an audit trail, unauthorized access to protected data could go undetected.\n\nFor detailed information on categorizing information, refer to FIPS Publication 199, Standards for Security Categorization of Federal Information and Information Systems, and FIPS Publication 200, Minimum Security Requirements for Federal Information and Information Systems.","checkContent":"Get a list of tables from ISSO/DBA where the categorized information is stored. \n\nIf there are no tables with categorized information, this is not applicable (NA).\n\nRun the following SQL statement to ensure that an audit policy is defined upon all the required tables and/or the database:\nDB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN ('T',' ')\n\nIf no rows are returned, this is a finding. \n\nIf a row with OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. \n\nIf a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy. \n\nFor 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: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, EXECUTESTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES\n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf 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. \n\nIf 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. \n\nIf 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.","fixText":"Define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES EXECUTE STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>\n\nDefine an audit policy to audit deletes (DMLs) on required tables. \nDB2> CREATE AUDIT POLICY <table audit policy name> \n           CATEGORIES EXECUTE STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to each required table:\nDB2> AUDIT TABLE <table name> USING POLICY <table audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213752","ruleId":"SV-213752r879873_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when unsuccessful attempts to delete categorized information (e.g., classification levels/security levels) occur.","description":"Changes in categorized information must be tracked. Without an audit trail, unauthorized access to protected data could go undetected.\n\nTo aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.\n\nFor detailed information on categorizing information, refer to FIPS Publication 199, Standards for Security Categorization of Federal Information and Information Systems, and FIPS Publication 200, Minimum Security Requirements for Federal Information and Information Systems.","checkContent":"Get a list of tables from ISSO/DBA where the categorized information is stored. \n\nIf there are no tables with categorized information, this is not applicable (NA).\n\nRun the following SQL statement to ensure that an audit policy is defined upon all the required tables and/or the database:\nDB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN ('T',' ')\n\nIf no rows are returned, this is a finding. \n\nIf a row with OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. \n\nIf a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy. \n\nFor 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: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, EXECUTESTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES\n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf 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. \n\nIf 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. \n\nIf 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.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES SECMAINT STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nRun the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213753","ruleId":"SV-213753r879874_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when successful logons or connections occur.","description":"For completeness of forensic analysis, it is necessary to track who/what (a user or other principal) logs on to the DBMS.","checkContent":"To meet these requirements at the VALIDATE, CONTEXT category auditing needs to be implemented at database level. \n\nRun the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nUsing the AUDITPOLICYID from above query find the details of audit policy: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, VALIDATESTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for CONTEXTSTATUS and VALIDATESTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <audit policy name> \n           CATEGORIES VALIDATE STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213754","ruleId":"SV-213754r879874_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when unsuccessful logons or connection attempts occur.","description":"For completeness of forensic analysis, it is necessary to track failed attempts to log on to the DBMS. While positive identification may not be possible in a case of failed authentication, as much information as possible about the incident must be captured.","checkContent":"To meet these requirements at the VALIDATE, CONTEXT category auditing needs to be implemented at database level. \n\nRun the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nUsing the AUDITPOLICYID from above query find the details of audit policy: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, VALIDATESTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for CONTEXTSTATUS and VALIDATESTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES VALIDATE STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213755","ruleId":"SV-213755r879875_rule","severity":"medium","ruleTitle":"DB2 must generate audit records for all privileged activities or other system-level access.","description":"Without tracking privileged activity, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n\nSystem documentation should include a definition of the functionality considered privileged.\n\nA privileged function in this context is any operation that modifies the structure of the database, its built-in logic, or its security settings. This would include all Data Definition Language (DDL) statements and all security-related statements. In an SQL environment, it encompasses, but is not necessarily limited to:\n\nCREATE\nALTER\nDROP\nGRANT\nREVOKE\n\nThere may also be Data Manipulation Language (DML) statements that, subject to context, should be regarded as privileged. Possible examples in SQL include:\n\nTRUNCATE TABLE;\nDELETE, or\nDELETE affecting more than n rows, for some n, or\nDELETE without a WHERE clause;\n\nUPDATE or\nUPDATE affecting more than n rows, for some n, or\nUPDATE without a WHERE clause;\n\nany SELECT, INSERT, UPDATE, or DELETE to an application-defined security table executed by other than a security principal.\n\nDepending on the capabilities of the DBMS and the design of the database and associated applications, audit logging may be achieved by means of DBMS auditing features, database triggers, other mechanisms, or a combination of these.\n\nNote that it is particularly important to audit, and tightly control, any action that weakens the implementation of this requirement itself, since the objective is to have a complete audit trail of all administrative activity.","checkContent":"Run the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ') \n\nIf no rows are returned, this is a finding. \n\nUsing the AUDITPOLICYID from above query find the details of the audit policy: \nDB2> SELECT AUDITPOLICYNAME, SECMAINTSTATUS, SYSADMINSTATUS, OBJMAINTSTATUS, AUDITSTATUS, CONTEXTSTATUS, ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for SECMAINTSTATUS, OBJMAINTSTATUS, SYSADMINSTATUS, AUDITSTATUS and CONTEXTSTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \n\nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES SECMAINT STATUS BOTH, OBJMAINT STATUS BOTH, AUDIT STATUS BOTH, SYSADMIN STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, apply the policy created to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213756","ruleId":"SV-213756r879875_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when unsuccessful attempts to execute privileged activities or other system-level access occur.","description":"Without tracking privileged activity, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n\nSystem documentation should include a definition of the functionality considered privileged.\n\nA privileged function in this context is any operation that modifies the structure of the database, its built-in logic, or its security settings. This would include all Data Definition Language (DDL) statements and all security-related statements. In an SQL environment, it encompasses, but is not necessarily limited to:\n\nCREATE\nALTER\nDROP\nGRANT\nREVOKE\n\nNote that it is particularly important to audit, and tightly control, any action that weakens the implementation of this requirement itself, since the objective is to have a complete audit trail of all administrative activity.\n\nTo aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.","checkContent":"Run the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ') \n\nIf no rows are returned, this is a finding. \n\nUsing the AUDITPOLICYID from above query find the details of audit policy: \nDB2> SELECT AUDITPOLICYNAME, SECMAINTSTATUS, SYSADMINSTATUS, OBJMAINTSTATUS, AUDITSTATUS, CONTEXTSTATUS, ERRORTYPE \n            FROM SYSCAT.AUDITPOLICIES \n            WHERE AUDITPOLICYID = <audit policy ID>\n\nIf 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.","fixText":"Define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES SECMAINT STATUS BOTH, OBJMAINT STATUS BOTH, AUDIT STATUS BOTH, SYSADMIN STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213757","ruleId":"SV-213757r879876_rule","severity":"medium","ruleTitle":"DB2 must generate audit records showing starting and ending time for user access to the database(s).","description":"For completeness of forensic analysis, it is necessary to know how long a user's (or other principal's) connection to the DBMS lasts. This can be achieved by recording disconnections, in addition to logons/connections, in the audit logs. \n\nDisconnection may be initiated by the user or forced by the system (as in a timeout) or result from a system or network failure. To the greatest extent possible, all disconnections must be logged.","checkContent":"Run the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nUsing the AUDITPOLICYID from above query find the details of audit policy. \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the value for CONTEXTSTATUS is not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name>\n           CATEGORIES CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213758","ruleId":"SV-213758r879877_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when concurrent logons/connections by the same user from different workstations occur.","description":"For completeness of forensic analysis, it is necessary to track who logs on to the DBMS.\n\nConcurrent connections by the same user from multiple workstations may be valid use of the system; or such connections may be due to improper circumvention of the requirement to use the CAC for authentication; or they may indicate unauthorized account sharing; or they may be because an account has been compromised.\n\n(If the fact of multiple, concurrent logons by a given user can be reliably reconstructed from the log entries for other events (logons/connections; voluntary and involuntary disconnections), then it is not mandatory to create additional log entries specifically for this.)","checkContent":"Run the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding.\n\nUsing the AUDITPOLICYID from above query find the details of audit policy: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, VALIDATESTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for CONTEXTSTATUS and VALIDATESTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES VALIDATE STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, Run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name> \n\nNote: Group by IPADDRESS and validate from audit log.","ccis":["CCI-000172"]},{"vulnId":"V-213759","ruleId":"SV-213759r879878_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when successful accesses to objects occur.","description":"Without tracking all or selected types of access to all or selected objects (tables, views, procedures, functions, etc.), it would be difficult to establish, correlate, and investigate the events relating to an incident, or identify those responsible for one. \n\nIn an SQL environment, types of access include, but are not necessarily limited to:\n\nSELECT\nINSERT\nUPDATE\nDELETE\nEXECUTE","checkContent":"Run the following SQL statement to ensure that an audit policy is defined upon the all required application tables, routines and/or the database: \nDB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN ('T',' ')\n\nIf no rows are returned, this is a finding. \n\nIf a row with OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. \n\nIf a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy. \n\nFor 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: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, EXECUTESTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES\n\nIf 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.\n\nIf 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. \n\nIf 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.\n\nNote: 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.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <execdb> \n           CATEGORIES CONTEXT STATUS BOTH, EXECUTE STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf 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: \nDB2> AUDIT DATABASE USING POLICY EXECDB\n  Or \nDB2> AUDIT TABLE <table name> USING POLICY EXECDB","ccis":["CCI-000172"]},{"vulnId":"V-213760","ruleId":"SV-213760r879878_rule","severity":"medium","ruleTitle":"DB2 must generate audit records when unsuccessful accesses to objects occur.","description":"Without tracking all or selected types of access to all or selected objects (tables, views, procedures, functions, etc.), it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n\nIn an SQL environment, types of access include, but are not necessarily limited to:\n\nSELECT\nINSERT\nUPDATE\nDELETE\nEXECUTE\n\nTo aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.","checkContent":"Run the following SQL statement to ensure that an audit policy is defined upon the all required application tables, routines and/or the database: \nDB2> SELECT AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE \n           FROM SYSCAT.AUDITUSE \n           WHERE OBJECTTYPE IN ('T',' ')\n\nIf no rows are returned, this is a finding. \n\nIf a row with OBJECTTYPE of ' ' (Database; value is a blank) exists in the output, it is a database level policy. \n\nIf a row with OBJECTTYPE of 'T' exists in the output, it is a table level policy. \n\nFor 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: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, EXECUTESTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES\n\nIf 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. \n\nIf 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. \n\nIf 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.\n\nNote: 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.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <execdb> \n           CATEGORIES CONTEXT STATUS BOTH, EXECUTE STATUS BOTH\n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf 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: \nDB2> AUDIT DATABASE USING POLICY EXECDB\n  Or\nDB2> AUDIT TABLE <table name> USING POLICY EXECDB","ccis":["CCI-000172"]},{"vulnId":"V-213761","ruleId":"SV-213761r879879_rule","severity":"medium","ruleTitle":"DB2 must generate audit records for all direct access to the database(s).","description":"In this context, direct access is any query, command, or call to the DBMS that comes from any source other than the application(s) that it supports. Examples would be the command line or a database management utility program. The intent is to capture all activity from administrative and non-standard sources.","checkContent":"Run the following SQL statement to ensure that an audit policy is defined upon the database: \nDB2> SELECT AUDITPOLICYNAME, AUDITPOLICYID \n           FROM SYSCAT.AUDITUSE  \n           WHERE OBJECTTYPE IN (' ')\n\nIf no rows are returned, this is a finding. \n\nUsing the AUDITPOLICYID from above query find the details of audit policy: \nDB2> SELECT AUDITPOLICYNAME, CONTEXTSTATUS, VALIDATESTATUS, ERRORTYPE AS ERRORTYPE \n           FROM SYSCAT.AUDITPOLICIES \n           WHERE AUDITPOLICYID = <audit policy ID>\n\nIf the values for CONTEXTSTATUS and VALIDATESTATUS are not 'B' (Both) or ERRORTYPE is not 'A' (Audit), this is a finding.","fixText":"Run the following command to define an audit policy with the needed subset using the CREATE AUDIT POLICY SQL statement: \nDB2> CREATE AUDIT POLICY <DB audit policy name> \n           CATEGORIES VALIDATE STATUS BOTH, CONTEXT STATUS BOTH \n           ERROR TYPE AUDIT\n\nTo 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.\n\nIf CREATE was used above, run the following command to apply the policy created above to the database: \nDB2> AUDIT DATABASE USING POLICY <DB audit policy name>","ccis":["CCI-000172"]},{"vulnId":"V-213762","ruleId":"SV-213762r879886_rule","severity":"medium","ruleTitle":"DB2 must off-load audit data to a separate log management facility; this must be continuous and in near real time for systems with a network connection to the storage facility and weekly or more often for stand-alone systems.","description":"Information stored in one location is vulnerable to accidental or incidental deletion or alteration.\n\nOff-loading is a common process in information systems with limited audit storage capacity. \n\nThe DBMS may write audit records to database tables, to files in the file system, to other kinds of local repository, or directly to a centralized log management system. Whatever the method used, it must be compatible with off-loading the records to the centralized system.","checkContent":"Run the following command to find the value of “Audit Data Path” and “Audit Archive Path” \n\n     $db2audit describe \n\nDB2 can asynchronously extract the audit records in comma delimited format from “Audit Archive Path”.\n\nIf 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. \n\nIf a separate log management facility is not configured to absorb the extracted log data, this is a finding.","fixText":"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.","ccis":["CCI-001851"]},{"vulnId":"V-253507","ruleId":"SV-253507r917672_rule","severity":"high","ruleTitle":"DB2 must use NSA-approved cryptography to protect classified information in accordance with the data owners requirements.","description":"Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data. The application must implement cryptographic modules adhering to the higher standards approved by the federal government since this provides assurance they have been tested and validated.\n\nIt is the responsibility of the data owner to assess the cryptography requirements in light of applicable federal laws, Executive Orders, directives, policies, regulations, and standards.\n\nNSA-approved cryptography for classified networks is hardware based. This requirement addresses the compatibility of a DBMS with the encryption devices.","checkContent":"If the database is in the unclassified environment, this is not applicable (NA).\n\nVerify the instance configuration parameters so that the instance is strictly compliant with NIST SP 800-131A. \n\nCheck the DB2 registry variable DB2COMM is set to SSL:\n\n$db2set -all\n\nIf DB2COMM is not set to SSL, this is a finding. \n\nFind the value of SSL_VERSIONS by running: \n\n$db2 get dbm cfg\n\nIf SSL_VERSIONS is not set to TLSV12, this is a finding.\n\nFind the value of SSL_CIPHERSPECS by running:\n\n$db2 get dbm cfg\n\nIf SSL_CIPHERSPECS is not set to a symmetric algorithm key length that is greater than or equal to 112, this is a finding. \n\nFind the value of SSL_SVC_LABEL by running:\n\n$db2 get dbm cfg\n\nIf 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. \n\nIf the certificate does not have a digital signature with minimum SHA2, this is a finding.\n\nThe above settings ensure that all connections over SSL in any CLP or Java application strictly adhere to NIST SP 800-131A.","fixText":"Setting instance configuration parameters so that the instance is strictly compliant with NIST SP 800-131A. \n\nSet the DB2 registry variable DB2COMM to SSL:\n\n$db2set DB2COMM=SSL \n\nSet the DB2 database manager configuration parameter SSL_VERSIONS to TLSV12:\n\n$db2 update dbm cfg using SSL_VERSIONS TLSV12 \n\nSet the DB2 database manager configuration parameter SSL_CIPHERSPECS to a symmetric algorithm key length that is greater than or equal to 112:\n\n$db2 update dbm cfg using SSL_CIPHERSPECS TLS_RSA_WITH_AES_256_GCM_SHA384 \n\nSet 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. \n\nCreate the certificate. Example:\n\n$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\"\n\n$db2 update dbm cfg using SSL_SVR_LABEL myselfsigned_SHA_2K\n\nNote: Here is an example of SSL set up on Linux:\n\n1. Create a directory \"ssl\"\n$mkdir ssl\n2. Make sure gsk8capicmd_64 command in PATH $ export PATH=$PATH:/home/db2inst1/sqllib/gskit/bin\n3. Make sure library is in path $ echo $LD_LIBRARY_PATH /home/db2inst1/sqllib/lib64:/home/db2inst1/sqllib/lib64/gskit:/home/db2inst1/sqllib/lib32\n4. Go to ssl directory (/home/db2inst1/ssl)\n5. Create Server key database\n$db2inst1@potserver:~/ssl> gsk8capicmd_64 -keydb -create -db \"mydbserver.kdb\" -pw \"password\" -stash\n$db2inst1@potserver:~/ssl> ls\n$mydbserver.crl mydbserver.kdb mydbserver.rdb mydbserver.sth\n6. To create a self-signed certificate with a label of myselfsigned, use the GSKCapiCmd command as shown in the following example:\n$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\"\n7. 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:\n$gsk8capicmd_64 -cert -extract -db \"mydbserver.kdb\" -pw \"password\" -label \"myselfsigned\" -target \"mydbserver.arm\" -format ascii -fips\n8. Set database manager configuration parameters:\n$db2 update dbm cfg using SSL_SVR_KEYDB /home/db2inst1/ssl/mydbserver.kdb\n$db2 update dbm cfg using SSL_SVR_STASH /home/db2inst1/ssl/mydbserver.sth\n$db2 update dbm cfg using SSL_SVR_LABEL SSLLabel\n$db2 update dbm cfg using SSL_SVCENAME 50602 \n9. Add the value SSL to the DB2COMM registry variable. For example:\n$db2set -i db2inst1 DB2COMM=SSL\nor \n$db2set -i db2inst1 DB2COMM=SSL","ccis":["CCI-002450"]}]}