Database Administration with Style! |
Database Diva Presents: Security Tutorials for Overworked Oracle™ Database Administrators |
|
|
Securing Your Oracle™ Database With User ProfilesUser profiles define a set of limitations for resources and passwords. By default, every user is assigned the "DEFAULT" profile, which by default has no limitations on resources or password use. By altering the default profile, you can set limits for all users in the database. You can also create customized profiles, with limitations for a particular set of users. Profiles can be used to set limits for:
Limiting system resources can protect your system from a denial of service attack. It can also protect you from "accidents", where a query might consume 100% of available resources. These settings are very useful for applications that use individual database users for authentication. For applications that use a single account for all database activity, setting limits could prove disastrous. Limiting connect time and idle time are a good idea if the application is designed in such a way that each user creates a session. If the application is designed to forward all requests to a single connection that is created at application startup, limiting connect and idle time would also be disastrous. It is important to understand how the application works before setting these limits. Setting password limitations is a good idea, no matter how the application works. Most organizations have policies about password lifetime and reuse, and the profile allows you to comply with those policies. The following command gives an example of setting passwords to expire in 90 days: SQL> alter profile default limit password_life_time 90; By default, the password validation is not enabled in the database. A script called utlpwdmg.sql can be found in the $ORACLE_HOME/rdbms/admin directory that sets limits for the DEFAULT profile. It sets password lifetime to 60 days, password grace time (the time between expiration and lockout) to 10 days, password reuse time to 1800 days and failed login attempts to 3 before locking the account for 1 minute. The script also creates a very rudimentary password validation procedure that requires a minimum of 4 characters, with at least one alpha character, one numeric character and one special character.
You can alter the script to reflect your organizations password policies. The following script has been customized to meet the organizations policies. The verify_function now requires a minimum of 8 characters.
Privileged users should have stricter limits set. Create a new profile, PRIVUSERS for any account with SYS or DBA privileges. Use the ALTER PROFILE command to update resource limits. You can query the DBA_PROFILES view to obtain information about a profile: So, what what are PASSWORD_REUSE_TIME and PASSWORD_REUSE_MAX? These two resources work together to limit the number of times a password may be used. If PASSWORD_REUSE_TIME is unlimited, and PASSWORD_REUSE_MAX has a numeric value, passwords may not be reused. If PASSWORD_REUSE_MAX is unlimited, and PASSWORD_REUSE_TIME has a numeric value, passwords may not be reused. If PASSWORD_REUSE_MAX and PASSWORD_REUSE_TIME both have numeric values, passwords may be reused the number of times defined by PASSWORD_REUSE_MAX, but only after waiting the number of days defined by PASSWORD_REUSE_TIME. Setting FAILED_LOGIN_ATTEMPTS is a brilliant idea for end user accounts, and a terrible idea for accounts that are used for automated authentication of applications. When set, this parameter limits the number of failed login attempts that can be made before the account is locked for the value of the PASSWORD_LOCK_TIME setting. For example, if FAILED_LOGIN_ATTEMPTS is set to 5, and a user makes 5 unsuccessful attempts to login, the account will be locked to prevent a possible brute force attack. If the user has made an honest mistake, they will contact you and ask you to unlock the account. Setting FAILED_LOGIN_ATTEMPTS for accounts that are used to authenticate web applications could result in a Denial of Service attack. The attacker would only need to know the account name. Attempting to login 5 times with a bad password would disable the application for the duration of the PASSWORD_LOCK_TIME setting. Don't make it easy for an attacker. Create a special profile for application accounts that doesn't lock the account for failed login attempts, but does require a longer, stronger password. Be sure to enable auditing of failed login attempts, and monitor the DBA_AUDIT_LOG for attempted break-ins. |
Last update 05/10/2008
Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates.