52
Database Security Managing Users and Security Models

Database Security Managing Users and Security Models

Embed Size (px)

Citation preview

Page 1: Database Security Managing Users and Security Models

Database Security Managing Users and

Security Models

Page 2: Database Security Managing Users and Security Models

Managing Users

• Authorization & Authentication

• Creating Users

• Check for Default Users

• Check for weak passwords

• Lock & Remove Accounts

Page 3: Database Security Managing Users and Security Models

Operating System Authentication

• Many databases (including Microsoft SQL Server 2000) depend on OS to authenticate users

• Reasons:– Once an intruder is inside the OS, it is easier to

access the database– Centralize administration of users

• Users must be authenticated at each level– (defense in depth)

Page 4: Database Security Managing Users and Security Models

Creating Users

• Must be a standardized, well-documented, and securely managed process

• In Oracle10g, use the CREATE USER statement:– Part of the a Data Definition Language (DDL)

Page 5: Database Security Managing Users and Security Models

Creating an Oracle10g User• IDENTIFIED clause

– Tells Oracle how to authenticate a user account– BY PASSWORD option: encrypts and stores an

assigned password in the database– EXTERNALLY option: user is authenticated by the OS– GLOBALLY AS option: depends on authentication

through centralized user management method

Example: CREATE USER smith identified by s9 default tablespace users;

ALTER USER smith IDENTIFIED EXTERNALLY; -- by OS

ALTER USER scott ACCOUNT LOCK -- lock a user account

ALTER USER scott ACCOUNT UNLOCK;

ALTER USER scott PASSWORD EXPIRE; -- Force new pwd

Page 6: Database Security Managing Users and Security Models

• DEFAULT TABLESPACE clause: specifies default storage for the user

• TEMPORARY TABLESPACE clause

• QUOTA clause: tells Oracle 10g how much storage space a user is allowed for a specified tablespace

• PROFILE clause: indicates the profile used for limiting database resources and enforcing password policies

Creating Users (continued)

Page 7: Database Security Managing Users and Security Models

Creating Users (continued)

Page 8: Database Security Managing Users and Security Models

Creating Users (continued)

Page 9: Database Security Managing Users and Security Models

Creating a SQL Server User

• Create a login ID first; controls access to SQL Server system

• Associate login ID with a database user• Must be member of fixed server roles (SYSADMIN

or SECURITYADMIN)• Two types of login IDs:

– Windows Integrated (trusted) login– SQL Server login

Page 10: Database Security Managing Users and Security Models

Creating Windows Integrated Logins

Page 11: Database Security Managing Users and Security Models

Creating SQL Server Logins

Page 12: Database Security Managing Users and Security Models

Removing Users

• Make a backup first

• Obtain a written request (for auditing purposes)

Or

Lock a user’s account

Page 13: Database Security Managing Users and Security Models

Removing an Oracle User

• DROP command

• CASCADE option: when user owns database objects

• Recommendations:– Backup the account for one to three months– Listing all owned objects– Lock the account or revoke the CREATE

SESSION privilege

Page 14: Database Security Managing Users and Security Models

Modifying an Oracle User

• ALTER USER statement

• Oracle Enterprise Manager: graphical tool

Page 15: Database Security Managing Users and Security Models

Modifying an Oracle User (continued)

Page 16: Database Security Managing Users and Security Models

Default Users

• Oracle default users:– SYS, owner of the data dictionary– SYSTEM, performs almost all database tasks

• SQL Server default users:– SA, system administrator

Page 17: Database Security Managing Users and Security Models

Database Links

Connection from one database to another: allow DDL and SQL statements

• Public or Private• Authentication Methods

Example:CREATE DATABASE LINK sales.hq.acme.com CONNECT TO scott IDENTIFIED BY tiger USING 'sales';

SELECT * FROM [email protected];

Page 18: Database Security Managing Users and Security Models

Database Links (continued)

Page 19: Database Security Managing Users and Security Models

Linked Servers

• Allow you to connect to almost any:– Object Linking and Embedding Database

(OLEDB)– Open Database Connectivity (ODBC)

Page 20: Database Security Managing Users and Security Models

Linked Servers (continued)

Page 21: Database Security Managing Users and Security Models

Best Practices

• Follow company’s policies and procedures

• Always document and create logs

• Educate users

• Keep updated on database and security technology

• Review and modify procedures

• Block direct access to database tables

• Limit and restrict access to the server

• Use strong passwords

• Patches, patches, patches

Page 22: Database Security Managing Users and Security Models

Defining and Using Profiles

• Profile:– Describes limitation of database resources– Defines database users behavior– Prevents users from wasting resources

• Not offered by every database system:– Oracle does– Microsoft SQL Server does not

Page 23: Database Security Managing Users and Security Models

Creating Profiles in Oracle (continued)

Page 24: Database Security Managing Users and Security Models

Creating Profiles in Oracle (continued)

• ALTER PROFILE: modifies a limit for a profile

• ALTER USER: assigns a profile to a user

• Oracle Enterprise Manager Security Tool: view all details about users and profiles in a GUI

Page 25: Database Security Managing Users and Security Models

Creating Profiles in Oracle (continued)

Page 26: Database Security Managing Users and Security Models

Creating Profiles in SQL Server 2000

• Profiles are not available in Microsoft SQL Server 2000 or 2005

• Query and connection time-outs: handled at application level within OLEDB

Page 27: Database Security Managing Users and Security Models

Designing and Implementing Password Policies

• Password is the key to open a user account; strong passwords are harder to break

• User authentication depends on passwords• Hacker violations begin with breaking a

password• Companies spend on:

– Training– Education

Page 28: Database Security Managing Users and Security Models

What Is a Password Policy?

• Set of guidelines:– Enhances the robustness of a password– Reduces the likelihood of password breaking

• Deals with:– Complexity– Change frequency– Reuse

Page 29: Database Security Managing Users and Security Models

Importance of Password Policies

• First line of defense

• Most companies invest considerable resources to strengthen authentication by adopting technological measures that protect their assets

• Forces employees to abide by the guidelines set by the company and raises employee awareness of password protection

• Helps ensure that a company does not fail audits

Page 30: Database Security Managing Users and Security Models

Designing Password Policies

• Complexity: set of guidelines for creating passwords

• Aging: how long a password can be used

• Usage: how many times a password can be used

• Storage: storing a password in an encrypted manner

Page 31: Database Security Managing Users and Security Models

Implementing Password Policies

• Oracle; using profiles:– CREATE PROFILE– Oracle Enterprise Manager– PASSWORD_VERIFY_FUNCTION

Page 32: Database Security Managing Users and Security Models

Implementing Password Policies (continued)

Page 33: Database Security Managing Users and Security Models

Grant and Revoke User Privileges

Page 34: Database Security Managing Users and Security Models

• In SQL Server (continued):– Database privileges:

• Fixed database roles

• Statement permissions

– Grant permission using the GRANT statement– Revoke permission using the REVOKE statement– Enterprise Manager– Deny permission using the DENY statement

Page 35: Database Security Managing Users and Security Models

Grant and Revoke User Privileges (continued)

Page 36: Database Security Managing Users and Security Models

Security Models

• Access Matrix Model:– Represents two main entities: objects and

subjects:• Columns represent objects• Rows represent subjects

– Objects: tables, views, procedures, db objects– Subjects: users, roles, privileges, modules– Authorization cell

Page 37: Database Security Managing Users and Security Models

Main vulnerabilities

• People Having too many privileges

• Default Users and Passwords

• Known vulnerabilities that are not patched

• Too many open ports by default

• Solution– Must be trained to put yourself in the place of

the hacker [Pete Finnigan]

Page 38: Database Security Managing Users and Security Models

Who has DBA ROLES ?

Page 39: Database Security Managing Users and Security Models
Page 40: Database Security Managing Users and Security Models

Default Passwords

• Easiest way to log into an Oracle database is to use a default account with a known password [Finnigan]

• http://www.petefinnigan.com/default/default_password_checker.htm

• This site has scripts that will identify all default users and lets you know if they still have their default passwords. You may download these scripts.

Page 41: Database Security Managing Users and Security Models

Password Cracking

• At http://www.toolcrypt.org/index.html there are tools that you can download to crack the passwords. You need to verify this against the DB, because you can be sure that the hacker has these tools.

Page 42: Database Security Managing Users and Security Models

Find all Privileges

• http://www.petefinnigan.com/find_all_privs.sql

• Script to find which privileges have been granted to a particular user. This scripts lists ROLES, SYSTEM privileges and object privileges granted to a user. If a ROLE is found -- then it is checked recursively.

• Output can be directed to the screen or to a file.

Page 43: Database Security Managing Users and Security Models

Benchmark your DB

• http://www.cisecurity.org/bench_oracle.html

• Set of tools that will tell you how secure your Oracle DB is compared to other Oracle DB and allows you to fix vulnerabilities.

Page 44: Database Security Managing Users and Security Models

Encrypted Passwords

• http://www.cqure.net

• allows you to extract encrypted passwords (hashes) from a Windows system and use the hashes, without knowing the password, in order to authenticate to other Windows systems with users having the same passwords.

Page 45: Database Security Managing Users and Security Models

Listener Password

• http://www.integrity.com/downloads.lsnrcheck.exe

• In Oracle, by default you don’t need a password to activate to run lsnrctl.exe. Verify that there is a password to activate listener, otherwise create one using Oracle Net manager.

Otherwise, somebody can hijack listener and avoid future connections by

1) Installing oracle on their local machine

2) Update the listener.ora file on local machine to include access to remote server

3) From OS prompt: “lsnrctl stop”

Page 46: Database Security Managing Users and Security Models

Linux Vulnerabilities

• http://www.remote-exploit.org/backtrack.html

• Tools to verify Linux vulnerabilities

Page 47: Database Security Managing Users and Security Models

More Oracle tools

www.databasesecurity.com/dbsec/OAK.zip

Checks for SID, Database users, etc.

Page 48: Database Security Managing Users and Security Models

Security Models (continued)

Page 49: Database Security Managing Users and Security Models

Application Security Models

• Models:– Database role based– Application role based– Application function based– Application role and function based– Application table based

Page 50: Database Security Managing Users and Security Models

DB Security Models• Plan, Policy, Procedure, Model• Model: scheme to implement Plan, Policy,

Procedure• MAC versus DAC (two extremes)• Many different Models

– Bell LaPadula Model (MAC, focus on confidentiality)– Harrison-Ruzzo-Ullman Access Matrix Model – Sea View Model (Relational Imp. Of LaPadula)– Jajodia Sandhu Model (adaptation of Sea View)– Biba Model (focus on Integrity)

• MLS, Polyinstantiation

Page 51: Database Security Managing Users and Security Models

Document User Administration

• Part of the administration process• Reasons to document:

– Provide a paper trail– Ensure administration consistency

• What to document:– Administration policies, staff and management– Security procedures– Procedure implementation scripts or programs– Predefined roles description

Page 52: Database Security Managing Users and Security Models

http://www.oreilly.com/catalog/orasec/chapter/ch07.html