Sap Database Security
Sap Database Security
Make sure that you take all relevant security precautions for your Oracle database. For more information on Oracle database security with your SAP system, see: Oracle Under UNIX Oracle Under Windows
You also need to take security precautions at operating system level. For more information, see: SAP documentation on operating system security with the SAP system: SAP System Security Under UNIX/LINUX SAP System Security Under Windows
The documentation provided by your operating system vendor For example, for more information about operating system security on Microsoft Windows, see: www.microsoft.com/security
For more information about how to protect these users, see the following topics:
The OPS$ Mechanism Under UNIX Protecting the SAP Database User Changing Password for Database Users Using BRCONNECT Changing the Passwords for <sapsid>adm and ora<dbsid>
1.
When the system accesses the database, it first logs on to the database as the user OPS$<operating_system_user>, for example,OPS$<SAPSID>adm. (The OPS$ user that corresponds to the operating system user must be defined in the database and identified as externally.) It retrieves the password for SAPR3from the SAPUSER table. It then logs on to the database as the user SAPR3.
2. 3.
In a distributed system, the client is responsible for the authorization checks for the operating system user <sapsid>adm. Therefore, make sure that only authorized persons have access to PC clients that directly access the database server.
Do not change the value of the Oracle parameter REMOTE_OS_AUTHENT to FALSE. The OPS$ mechanism needs to be able to work from remote clients for example, SAP System work processes need to be able to log on to the application servers as the user OPS$<sapsid>adm. Therefore, keep this parameter set to TRUE. With the Oracle network protocol SQL*Net, you can also use the file sqlnet.ora to restrict access to the database using IP addresses. In this file, you specify invited and excluded IP addresses. For example: tcp.validnode_checking = yes tcp.invited_nodes = (139.185.5.73, ...) or: tcp.excluded_nodes = (139.185.6.71, ...) In this way, you can make sure that only specific hosts (for example, only the application server host) are capable of accessing the database.
Procedure
Use one of the following methods to change the passwords with BRCONNECT:
1. 2.
Start BRCONNECT with the command: brconnect [-u system/<system_password>] f chpass u <user_name> Enter the new password twice for confirmation.
When you change the password interactively, on some platforms you can enter the new password hidden, as long as it is no longer than eight characters.
If you omit the -u option, then the logon occurs using SYSTEM with its default password.
1. 2.
Log on as user <sapsid>adm. Enter the passwd command at the UNIX prompt.
3. Enter the old and new passwords. Repeat steps 1 to 3 for the user ora<dbsid>.
If you use Network Information Service (NIS), you should also refer to the NIS guide and the operating system documentation. (Changing the password with an activated NIS may be different from changing it with passwd.)
The access rights as shown in the table below are automatically set in the installation procedures. Setting Access Privileges for Oracle Directories and Files Oracle Directory or File Access Privilege in Octal Form 4.x 755 755 640 755 640 755 755 755 755 755 755 755 755 640 755 640 755 640 Owner Group Comment
/oracle/<DBSID>/sapdata* /oracle/<DBSID>/sapdata*/* /oracle/<DBSID>/sapdata*/*/* /oracle/<DBSID>/oraarch /oracle/<DBSID>/oraarch/* /oracle/<DBSID>/saparch /oracle/<DBSID>/sapreorg /oracle/<DBSID>/sapbackup /oracle/<DBSID>/dbs /oracle/<DBSID>/sapcheck /oracle/<DBSID>/sapstat /oracle/<DBSID>/saptrace /oracle/<DBSID>/saptrace/* /oracle/<DBSID>/saptrace/*/* /oracle/<DBSID>/origlog* /oracle/<DBSID>/origlog*/* /oracle/<DBSID>/mirrlog* /oracle/<DBSID>/mirrlog*/*
ora<dbsid> ora<dbsid> ora<dbsid> ora<dbsid> ora<dbsid> ora<dbsid> ora<dbsid> ora<dbsid> ora<dbsid> ora<dbsid> ora<dbsid> ora<dbsid> ora<dbsid> ora<dbsid> ora<dbsid> ora<dbsid> ora<dbsid> ora<dbsid>
dba dba dba dba dba dba dba dba dba dba dba dba dba dba dba dba dba dba Redo log directories Redo log files Redo log directories Redo log files Archive files Data files
Do not use chmod recursively. It is very easy to make unintended changes to authorizations when doing so. chmod <access privileges in octal> <file or directory>
allows <sapsid>adm to run the programs using the rights from ora<dbsid>. Make sure the owner of these programs is ora<dbsid> and set their access rights to 4775. (See SAP Note 8523.)
The owner for BRRESTORE, BRRECOVER, and BRSPACE is <dbsid>adm and its access rights are 755.
8523: DB backups using CCMS do not work 27928: Consequences in transport during password change 319211: Problems with CHDPASS under Oracle >= 8.0.6
Installation documentation <SAP Component> on UNIX: Oracle on SAP Service Marketplace at: service.sap.com/instguides <SAP Component> Release
Oracle on Windows
The following list provides an overview of the sections that describe the security measures to take on Windows when your database is Oracle: Protecting the Database Standard Users The OPS$ Mechanism on Windows Protecting the SAP Database User Changing Passwords for SAP Database Users with BRCONNECT Apply Security Settings for Database-Related File System Resources Access Privileges for BR*Tools
For general information about Windows operating system security, see http://www.microsoft.com/security For additional information about the Oracle database administration, see the database administration guide SAP Database Guide: Oracle on SDN: http:// www.sdn.sap.com/irj/sdn/ora
Operating system user Database user Operating system user Database user Database user Database user (SAP ABAP system) Database user (SAP Java system)
Standard Windows method OPS$ mechanism Standard Windows method OPS$ mechanism BRCONNECT, SQLPLUS BRCONNECT, SQLPLUS
SAP<SCHEMAID>DB
With SAP releases prior to 4.6C the database user SAPR3 was used instead of SAP<SAPSID>. Upgrades to current SAP releases do not change the database user name.
Note that if you change the passwords for <sapsid>adm and SAPService<SAPSID>, you also have to change the passwords of all services and batch jobs started with the Windows Scheduler that use these users. For more information about how to protect these users, see the following sections: The OPS$ Mechanism on Windows Protecting the SAP Database User Changing Passwords for SAP Database Users with BRCONNECT
1.
When the SAP system accesses the database, it first logs on to the database as user OPS$<operating_system_user>, for example, OPS$<domain>\<sapsid>adm. (The OPS$ user that corresponds to the operating system user must be defined in the database and identified as externally.)
SAP does not support changes of the Oracle parameter os_authent_prefix whose default value is OPS$. The os_authent_prefix is automatically set to O$ if the resulting string (OPS$<osusername> has more than 30 characters). 2. 3. It retrieves the password for SAP<SAPSCHEMAID> or SAPR3 from the SAPUSER table. It then logs on to the database as the user SAP<SAPSCHEMAID> or SAPR3.
Procedure
Use one of the following methods to change the passwords with BRCONNECT:
1. 2.
Start BRCONNECT with the command: brconnect [-u system/<system_password>] f chpass u <user_name> Enter the new password twice for confirmation.
When you change the password interactively, on some platforms you can enter the new password hidden, as long as it is no longer than eight characters.
Where: <system_password> is the password of the SYSTEM database user. You can use another user with DBA privileges. <user_name> is the database user for which the password should be changed (for example, SAP<SCHEMAID>). <new_password> is the new password for the user.
If you omit the -u option, then the logon occurs using SYSTEM with its default password.
Procedure
For all Oracle directories and the ORACLE_HOME set the security settings for the built-in accounts and groups SYSTEM, Administrators,SAP_<SAPSID>_GlobalAdmin (domain installation), and SAP_<SAPSID>_LocalAdmin (local installation) as follows:
...
1. 2. 3. 4.
In the Windows Explorer, right-click the Oracle root directory and choose Properties. On the Security tab, choose Advanced. Deselect Allow inheritable permissions from the paren t... In the upcoming dialog, choose Copy, to copy the permission entries that were previously applied from the parent to this object. 5. Choose OK.
6.
Set the permissions for the above-mentioned accounts SYSTEM, Administrators, SAP_<DBSID>_GlobalAdmin, or SAP_<DBSID>_LocalAdminto Full Control. Delete all other accounts.
7.
The most important recommendation for securing your system at the operating system level is to keep your operating system up to date! Stay informed and install any securityrelated patches that are released by your operating system vendor.
There are certain security risks involved when using these services and you should take special precautions. For example, when using NFS, you should be cautious when determining which directories should be made available. Do not export directories that contain SAP data to arbitrary recipients using NFS. Export to known and "trustworthy" systems only. Be cautious when assigning write authorization for NFS paths and avoid distributing the home directories of users across NFS. X Windows There are security issues involved with the use of X Windows. Therefore, for an SAP Web AS installation, you should check and see if you need to have the corresponding X server running on an SAP application server. If not, then disable this service. Otherwise, take precautions according to your vendor to protect this service. Summary To summarize the precautions that you should take, especially pertaining to NIS, NFS and the BSD remote services, adhere to the following guidelines: Disable any services that you do not need. To ensure a safe environment when using any of these services, follow the instructions of your OS vendor. Also use tools for monitoring activities to help you detect potential misuse of these services. If you do use these services, then use them only within a secure LAN. Do not export directories that contain SAP data to arbitrary recipients using NFS. Export to "trustworthy" systems only. Protect the following users: root, <sid>adm and <db><sid>. These should be the only users that exist on your application servers and your main instance at the operating system level. After installation, you should lock <db><sid> on your application servers. For critical users, empty the .rhosts files and assign it the access rights "000". Either delete the file /etc/hosts.equiv or make sure that it is empty. Keep your operating system up to date regarding security-related patches that are released by your operating system vendor!
The access rights shown in the table below are automatically set in the installation procedures. Setting Access Privileges for SAP System Directories and Files SAP Directory or Files /sapmnt/<SID>/exe /sapmnt/<SID>/exe/saposcol /sapmnt/<SID>/global Access Privilege in Octal Form 775 4755 700 Owner <sid>adm root <sid>adm Group sapsys sapsys sapsys
/sapmnt/<SID>/profile /usr/sap/<SID> /usr/sap/<SID>/<Instance ID> /usr/sap/<SID>/<Instance ID>/* /usr/sap/<SID>/<Instance ID>/sec /usr/sap/<SID>/SYS /usr/sap/<SID>/SYS/* /usr/sap/trans /usr/sap/trans/* /usr/sap/trans/.sapconf <home directory of <sid>adm> <home directory of <sid>adm>/*
755 751 755 750 700 755 755 775 770 775 700 700 <sid>adm <sid>adm <sid>adm <sid>adm <sid>adm <sid>adm <sid>adm <sid>adm <sid>adm sapsys sapsys sapsys sapsys sapsys sapsys sapsys sapsys sapsys
UMASK
Newly created files have rights determined by UMASK definitions. An UMASK is a four digit octal number that specifies those access rights that are not to be given to newly created files. You can define UMASKS in any of several files, to include: .login .cshrc .profile /etc/profile
As with UNIX access rights, the corresponding octal positions represent user, group, and world access, and the value of the digit represents which access privileges should be removed (remove none = 0, remove write = 2, remove all = 7). You can use the UMASK to automatically restrict permissions for newly created files. For example, by defining a UMASK of 0027, you specify that all newly created files have the access rights 750.
During the installation of an SAP system, user rights are assigned to local users instead of groups. For example, the user <sapsid>adm gets the user right Log on as a service. However, to simplify user administration, we recommend that you assign server resources to local groups instead of single users. You can then assign the appropriate domain users and domain groups to the local group.
Be careful when using domain controllers. If you define a local group of users, or a single local user on a domain controller, the group or user is known on all domain controllers within the domain. Therefore we do not support installing SAP systems on a domain controller. The following relationships exist between users, local groups and domain groups: A local user can only be a member of the local group. A domain user can be a member of both a local group and a domain group.
A domain group can be included in a local group. You may also export a domain group to another Windows domain. If several users need the same rights for a certain set of resources, you can create a group. You do not need to assign individual user rights to each of the files. Instead, you assign the rights to a group. Thereby, all users in the group automatically receive the rights of the group. The same applies to the users in a domain group that is itself the member of a local group. To simplify your administrative tasks, we recommend adding all Windows users to user groups that are granted the appropriate rights at the operating system level.
<sapsid>adm
<DBuser>
Note the following: Windows automatically creates the users Administrator and Guest during the installation. You do not need them for SAP system operations. You must enable the guest account to grant non-authenticated users (that have not specified a valid user name or password) access to resources on a computer. The Windows built-in group Everyone includes authenticated users and guests. However, non-authenticated guest users only have access to resources that are secured with Everyone, if the guest account is enabled. SAP strongly recommends to keep the guest account disabled. The database users <DBservice and <DBuser> are database-specific. Their name and availability depend on the database you use.
Protecting Administrator
The Windows built-in super user Administrator has unlimited access to all Windows resources. However, the built-in user Administrator cannot access resources that are located on other computers, except when this user already exists and has the same password on these computers. The user Administrator can do the following: Create, manage, and become the owner of all data files, hard disks, and file shares. Create and manage local users and their rights.
Create and manage peripherals, kernel services, and user services. Change the user name and hide its password. Create other users for administrative tasks and limit their rights to those tasks for which they are used (for example, user administrators, backup operators or server operators).
Protecting <sapsid>adm
The <sapsid>adm user is the Windows super user for SAP system administration. This user is created during the SAP system installation process, normally as a domain user for the SAP system. This user can therefore log on to all Windows machines in the domain. The <sapsid>adm user also needs full access to all instance-specific resources for the SAP system such as files, shares, peripheral devices (for example, tape drives or printers), and network resources (for example, the SAProuter service). <sapsid>adm has an SAP instance-specific environment (variables, registry settings, group membership) that allows this user to administer the SAP system in a proper manner. Furtheron, the user is a member of the local Administrators group and has sufficient privileges during special tasks such as upgrading and administrating an SAP instance. Customer-specific created users might not have this complete environment and are therefore not supported for SAP system administration tasks. To protect this user from unauthorized access, take the following precautions: Change the password regularly. Restrict the access rights to instance-specific resources for the SAP system only. Although <sapsid>adm can access SAP system files, a different user runs the SAP system itself, namely SAPService<SAPSID>.
Protecting SAPService<SAPSID>
SAPService<SID> is also created during the SAP system installation. It is usually created as a domain user to run the SAP system and to manage database resources. This user can log on locally on all Windows machines in the domain. Since the SAP system must run even if no user is logged onto the local Windows machine, the SAP system runs as a Windows service. Therefore, during the installation, the user SAPService<SAPSID> receives the right to Log on as a service on the local machine. SAPService<SAPSID> also administers the SAP system and database resources within the Computing Center Management System (CCMS). Therefore, it needs full access to all instance-specific and database-specific resources such as files, shares, peripheral devices, and network resources.
It is rather difficult to change the password of this user. To change the password for a Windows service user, you must stop the service, edit its start-up properties, and restart it. Therefore, to change the password of this user, you need to stop the SAP system. To protect SAPService<SAPSID>, take the following precautions: Cancel the users right to Log on locally. Restrict its access rights to instance-specific and database-specific resources only.
In addition, prevent this special service user from logging on to the system interactively. This prevents misuse by users who try to access the system from the presentation servers. You then do not have to set an expiration date for the password and you can disable the setting change passwd at logon.
MS SQL Server
MaxDB
Database
Function Runs the SAP system SAP system administrator SAP service account Database administrator User for SAP system database objects
The user SYSTEM is a virtual user without password. (You cannot log on as user SYSTEM.) However, this user has complete access to the local Windows system.
SAP system application and database servers SAP system or database services SAP system administrators Windows administrators SAPdomain administrator
This is the SAP system administrator account that enables interactive administration of the system. It is a member of the local administrators group. SAPService<SAPSID>
This is the virtual user account that is required to start the SAP system. It has the local user right to log on as a service. SAPinst creates the domain group SAP_<SAPSID>_GlobalAdmin SAPinst creates the local group SAP_<SAPSID>_LocalAdmin and includes the domain group SAP_<SAPSID>_GlobalAdmin SAPinst creates the local administrator group SAP_<SAPSID>_LocalAdmin on the transport host. Members of the group have full control over the transport directory \usr\sap\trans that allows transports to take place between systems. The SAP_<SAPSID>_GlobalAdmin group is added to theSAP_LocalAdmingroup. SAPinst protects the SAP directories \usr, \usr\sap, \usr\sap\trans, \usr\sap\<sapsid> and its sub-directories by only granting Full controlaccess rights for the Administrators and SAP_<SAPSID>_LocalAdmin groups. Eliminate any Full control rights for Everyone to shares on the SAP system servers. For additional protection, you can eliminate the dynamically-created Windows root shares on the SAP system server. The server can then only be accessed from the network over manually created shares. If you have installed other software on the application server, make sure that the access rights for their directories and files are also set properly. These rights apply specifically for SAP system resources. For details applying to the database files and directories, see the security instructions from your database supplier.
administration in the client or server environment, since new users who need SAP system administration rights only need to become members of the global group.
systems. Therefore, give Full Control access rights to the SAP_<SAPSID>_LocalAdmin local groups for the executable file saposcol.exe. To avoid access conflicts here, start saposcol.exe before starting the SAP system.