Row-level security in a relational database management system
09870483 ยท 2018-01-16
Assignee
Inventors
Cpc classification
G06F2221/2145
PHYSICS
G06F21/6227
PHYSICS
Y10S707/99935
GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
Y10S707/954
GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
Y10S707/956
GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
Y10S707/99939
GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
Y10S707/99933
GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
Y10S707/99934
GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
International classification
Abstract
Access control methods provide multilevel and mandatory access control for a database management system. The access control techniques provide access control at the row level in a relational database table. The database table contains a security label column within which is recorded a security label that is defined within a hierarchical security scheme. A user's security label is encoded with security information concerning the user. When a user requests access to a row, a security mechanism compares the user's security information with the security information in the row. If the user's security dominates the row's security, the user is given access to the row.
Claims
1. A computer-implemented method of controlling access to a relational database, comprising: receiving via a network from a user computer, by a server computer, a user request for data from the relational database, the user request including a user security label and a request to perform a database operation; determining, by a server computer, whether a security label column is included in a table of the relational database, the security label column storing, in each row of the table, a row security label, which indicates a security level required by a user of the user request to access the data contained in a respective row in the table; and automatically activating, by the server computer, a mandatory security enforcement mechanism, independent of the relational database operation to access the database, as a result of determination that the security label column is included in the table of the relational database; wherein the mandatory security enforcement mechanism is automatically activated independent of creating a view based on the database operation to access the relational database; the mandatory security enforcement mechanism comprising: determining user security information from the user security label; determining row security information for each row to be accessed by the database operation being performed by the request, from the security label column in the respective row; comparing the user security information and the row security information, the user security information and the row security information being unchanged during a period when the database operation is performed; retrieving one or more rows of data from the table in the relational database based on a result of the comparing the user security information and the row security information; and returning, to the user computer, only the one or more rows for which the user is determined to have authorization to access for performing the database operation on the rows.
2. The method of claim 1, wherein the request contains one or more queries of one or more tables.
3. The method of claim 1, wherein the table containing the rows of data contains access control information for limiting user access to the relational database.
4. The method of claim 1, wherein the database operation is a query.
5. The method of claim 1, wherein the database operation involves a row update.
6. The method of claim 1, wherein said determining row security information includes checking a cache for row security information corresponding to respective row security label.
7. The method of claim 1, wherein the user security label is one of plurality of security labels arranged in a hierarchy of security levels.
8. The method of claim 1, wherein the user is authorized to modify the row only when the user security information is equal to the row security information.
9. A computer-implemented method of controlling access to data in at least one row of a relational database, wherein said at least one row is associated with row-level access control information, the method comprising: receiving via a network from a user computer, by a server computer, a user request to operate on the relational database, the user request including a user security label, which indicates a user security level and a request to perform a database operation; determining, by a server computer, whether a security label column is included in a table of the relational database, the security label column storing, in each row of the table, a row security label, which indicates a row security level required by a user of the request to access the data contained in a respective row in the table; and automatically applying, by a server computer, mandatory access control rules to rows of the database satisfying the request independent of creating a view based on the database operation to access the relational database when the security label column is included in the table of the relational database, by determining whether privileges associated with a first security level are included in the privileges associated with a second security level, the applying the mandatory access control rules comprising: determining row security information for each row to be accessed by the database operation being performed by the request, from the security label column in the respective row; comparing the user security level and the row security level, the user security level and the row security level being unchanged during a period when the database operation is performed; retrieving one or more rows of data from the table in the relational database based on a result of the comparing the user security level and the row security level; and returning data from one or more rows in the relational database to the user computer, if the row security level associated with one or more rows is at least a subset of the user security level, to perform the database operation on the one or more rows.
10. The method of claim 9, wherein the request is a Structured Query Language (SQL) query.
11. The method of claim 9, wherein the relational database comprises a plurality of tables and the received request includes a request for access to at least one of the plurality of tables.
12. The method of claim 9, wherein the subset of the user security level corresponds to all security levels equal to or lower than the security level of the user.
13. A computer-implemented method of controlling a user's access to data in rows of a relational database, the method comprising: receiving via a network, by using a server computer, a user request from a user computer to operate on the relational database, the user request including a user security label and a request to perform a database operation; determining, by the server computer, whether a security label column is included in a table of the relational database, the security label column storing, in each row of the table, a first access level, which indicates a row security level required by a user of the user request to access the data contained in a respective row in the table; and automatically activating, by the server computer, a mandatory security enforcement mechanism, independent of creating a view based on the relational database operation to access the database, when the security label column is included in the table of the relational database; the mandatory security enforcement mechanism including: determining whether the user is authorized to operate on a row of the relational database that satisfies the request by comparing the first access level stored in the security label column of the table and a second access level and determining whether privileges associated with the first access level are included in the privileges associated with the second access level included in the user security label, the first access level and the second access level being unchanged during a period when the database operation is performed; retrieving one or more rows of data from the table in the relational database based on a result of the comparing the first access level and the second access level; and returning data from the one or more rows only if the user is determined to be authorized to perform the database operation on the one or more rows.
14. The method of claim 13, wherein the determining whether the privileges associated with the first access level are included in the privileges associated with the second access level comprising: determining whether the first access level is equal to or lower than the second access level.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
DETAILED DESCRIPTION
(9) The embodiments described below are described with reference to the above drawings, in which like reference numerals designate like components.
(10) Certain conventional database management systems (DBMS) provide some capabilities to limit access to rows within the database. However, those conventional systems rely on a database administrator to create views that restrict access to the desired rows. The application programmer must then use those special views to enforce the security controls. Often, the application programmer must populate session variables with values that the views use to control access to the data rows. Although such conventional systems do allow a programmer to control access to the data, those conventional systems suffer from several disadvantages.
(11) For example, conventional DBMSs use views to control access to a database. Using views to control access to the database is cumbersome for the database administrator and the application programmer to implement. For example, it is common to have to create separate views for each security level (e.g., a TOP_SECRET VIEW, a SECRET VIEW, etc.) in the security scheme.
(12) Using views to control access is also error prone, since it is easy to implement the views incorrectly and inadvertently permit access to the wrong data rows. Also, some security schemes are difficult to express as additional predicates on the view or user query. There is a need to automatically enforce access to the data such that no changes are required to the user application logic or views.
(13) The security policy achieved using views is only discretionary rather than mandatory. A person with database administrator authority is able to view the data in the database without using the special views that implement the security mechanism. There is a need to provide mandatory security controls that prevent unauthorized access by end users, application programmers, and database administrators. In order to limit the universe of users with access to data in the database, the system security administrator should be the only individual with unbridled access to the data.
(14)
(15) The query processor 20 processes requests containing queries received at a web site from a client. For example, a typical query might be a Structured Query Language (SQL) query that is received at a web site. The SQL query is passed to the query processor 20 for parsing and execution by the DBMS. Based on the query, the query processor 20 controls the data manager 22 to interact with the data repository 24 to handle the appropriate data satisfying the query.
(16)
(17) Access to USER.TABLE, in a conventional DBMS, is controlled by a database view. A system administrator creates a view of the related tables within the database in order to restrict access based on a user's security label.
(18) The system administrator creates a table by using, for example, SQL statements as shown in
(19)
(20)
(21) These problems with conventional database management systems can be overcome using the following concepts to provide row-level security.
(22) 1. Each end user of the database management system is assigned a SECURITY_LABEL. That label identifies a security level for the user within a multilevel security scheme and defines certain privileges for accessing data in the database. The security label also identifies security categories within that security level that the user is allowed to access. An example of a security category is a software development project on which the user is authorized to work. For example, a given user might be allowed to view data designated by certain security levels, such as the security levels: TOP SECRET, SECRET, and UNCLASSIFIED. That user also can be permitted to access data that pertains to certain categories, such as, for example, projects ABC, DEF, and XYZ. The value stored in the security label is encoded in a manner that expresses the security level and category information to the security system. An example of such an encoding is the label SECRETABC, where SECRET specifies the security level and ABC specify security categories A, B and C, which could be identifiers of projects on which the user is assigned to work.
(23) The user's security label can be determined using different techniques. For example, the user's security label can be determined with a lookup using the relational DBMS catalog; by making a security call to an external security manager; or by a call to a trusted installation exit routine, for example. It will be understood that other techniques to determine the user's security label can be employed.
(24) 2. Each row within a secure table is associated with a security label, which can be a column within that security table. For example, that column can have a predetermined name (e.g. SECURITY_LABEL) or it can be identified through an SQL clause when the table is defined (e.g. AS SECURITY LABEL clause on the CREATE TABLE column definition). It will be understood that other techniques can be used to associate a security label with a row.
(25) The SECURITY_LABEL column in the row identifies the security level of the data contained in the row, as well as security categories to which the row applies. For example, the row might contain data having a security level of SECRET, that pertains to projects ABC and XYZ (security categories). The value stored in the SECURITY_LABEL is encoded in a manner that expresses the security level and category information to the security system.
(26) 3. A mandatory security enforcement mechanism controls read access to the secure data rows. That mechanism is activated automatically when a relational database table is known to include a SECURITY_LABEL column. This read security enforcement mechanism compares the user's security label to the row's security label to determine whether access should be allowed. Read access is allowed only if the user's security dominates the row's security, in which both of the following conditions are true:
(27) a. The security level indicated by the user's security label is greater than or equal to the security level indicated by the row's security label.
(28) b. The security categories associated with the row's security label are a proper subset of the security categories associated with the user's security label.
(29) Write access is controlled separately, so that users can force compliance with the general rule of not reading from rows having higher security levels than the user or writing to rows having lower security levels than the user.
(30) The read and write access security mechanisms can use several various techniques to enforce the access scheme, such as by using a lookup with the relational DBMS catalog; using a security call to an external security manager; or using a call to a trusted installation exit routine, for example.
(31) 4. A mandatory security enforcement mechanism controls write access to the secure data rows. This mechanism is activated automatically when a relational database table is known to include a specific column name. The mechanism determines which security label is recorded in the updated data rows to be written in the database. This write access security mechanism forces each of those updated rows to contain one of the following possible values.
(32) a. A security label that is the same as the user's security label is used as the security label for the updated row.
(33) b. If a user is specially authorized, that user is allowed to update rows using a row security label that has a lower level than the user's current security label indicates. The write access security mechanism verifies that the user's security dominates the row's security, such that all of the following conditions are true, before allowing the row to be updated. i) The user is specially authorized to write data in a row having a security label designated for a security level lower than a security level associated with the user's security label. ii) The security label specified for the row has a security level that is less than or equal to the security level associated with the user's security label. iii) The security categories for the security label specified for the row are a proper subset of the security categories associated with the user's security label. That is, all the security categories associated with the row's label are also associated with the user's security label.
(34) The write access security mechanism uses several different techniques to enforce the access scheme. For example, it can perform a lookup with the relational DBMS catalog; make a security call to an external security manager; or make a call to a trusted installation exit routine.
(35) A DBMS that supports mandatory access control at the row level is illustrated in
(36) By placing the mandatory security units between the data manager 22 and the data repository 24, mandatory access control is achieved. If the data manager 22 attempts to read a row of data from the data storage unit 24, the request is directed through the read mandatory security unit 36. That security unit compares a user's security label passed by the data manager with a security label associated with the requested row of data in the data storage unit 24. If the conditions discussed above are met, access to the row is granted. That is, the read mandatory security unit 36 determines, from the user's security label, the user's security level and security categories. It also determines, from the row's security label, the row security level and row security categories. If the user's security level is greater than or equal to the security level for the row, and if the security categories associated with the row are a proper subset of the security categories associated with the user's security level, then read access is allowed. Since every attempted read access to the data passes through the read mandatory security unit, mandatory access control is achieved.
(37) Similarly, when writing an updated row to the database, the write mandatory security unit 38 receives from the data manager 22 the request to store the row in the data storage unit 24. The write mandatory security unit 38 ensures that the conditions discussed above are met before allowing the row to be updated in the data storage unit 24. That is, the write mandatory security unit ensures that the user's security label indicates both that the user's security level and security categories correspond with the security level and categories indicated by the security label of the row to be updated.
(38) A hierarchical security scheme is illustrated, conceptually, in
(39) Security level 60, labeled rainbow is located at the highest level of the security hierarchy. As shown in
(40) In a DBMS employing the mandatory security access controls described here, a user may query the DBMS tables directly and mandatory access control is automatically performed. This allows a query, such as query 62 shown in
(41) This control aspect is illustrated in
(42) The security label might be a security level at a leaf node in the hierarchy shown in
(43) Another example of a hierarchical security level is shown in row 64d for the user ID BOSS 2. BOSS 2 has a security label sunset. As shown in
(44)
(45) In the embodiment shown in
(46) The data manager 70 retrieves the next row from the data storage unit 24. Upon retrieving a row from the data storage unit 24 the data manager 70 performs the mandatory security function of checking whether the returned row includes a security label. If so, the cache 66 is searched to determine if information associated with that security label is already present in the cache. If so, the security information within the cache is used to compare the user security level with the security level associated with the retrieved row. If the security label is not found in the cache then the data manager 70 determines the information associated with the security label. This can be performed in various ways, such as by calling a security layer, as illustrated in
(47) Once the security information is available, the security level and category of the label associated with the retrieved row are compared with the security level and category associated with the user's security label. A determination then is made whether to allow the user to access that row.
(48) If the result of the comparison is that the user is to be given access, then the row is returned to the query processor 20 for return to the user. The loop shown in the query processor 20 then continues until the query is complete.
(49) When the query is complete, the query processor notifies the data manager which then purges the cache. In this manner, the cache information is used only for a single query by a single user. In other words, for each query made by a user, the security label information held in the cache is refreshed so that the information in the cache is present only during the time when a user's query is processed. A user's security level and a row's security level are assumed to stay unchanged during the period when a query is performed. However, by purging the cache after each query, changes to both the user's security level and to the security levels of rows in the data can occur without having to invalidate information held in the cache.
(50) The following are examples of processes that can be used to provide row-level security with mandatory access control.
(51) When a database administrator creates a table in the DBMS shown in
(52) When the end user logs on to the DBMS, the user will provide authentication tokens (e.g., userid/password, KERBEROS ticket, etc.) that identify the user to the DBMS. Once the user's identity has been ascertained, the DBMS determines the security label associated with the end user. This can be done using many different techniques, such as via a table lookup in the DBMS's authorization tables; via a security check to an external security product; or via a trusted user exit routine, for example. As with the security label for the row, the user's security label is encoded to encapsulate the following information. a. The security level of the data the user is authorized to access. This allows implementation of multilevel, hierarchical security schemes (e.g., TOP SECRET, SECRET, UNCLASSIFIED levels). b. The security categories the user is associated with and authorized to access. For example, a user might be associated with three different projects (e.g., projects A, B and C, each of which can be designated as a security category).
(53)
(54) Referring to
(55) If the table has a SECURITY_LABEL column, then the security mechanism is invoked in operation 90 where the user's security level and security categories are determined by decoding the user's security label. The row's security label is retrieved from the SECURITY_LABEL column and decoded. The security mechanism can be implemented in many ways, such as via a lookup within the DBMS's authorization tables, via a call to an external security product, or via an installation exit routine, for example. The security mechanism is responsible for examining the row's security label to determine whether the user is authorized to retrieve that particular row. This is accomplished in operation 92 by comparing the user's security level with the row's security level. There are two possible cases for each row.
(56) a. The security label of the row has a value that is within a range of values that are accessible to the user. This is the case when the user's security dominates the row's security, both of the following conditions are true. i) The security level indicated by the user's security label is greater than or equal to the security level indicated by the row's security label, as determined in operation 94. If not, the user is denied access to the row in operation 96. If so, then the next condition is tested in operation 98. ii) The security categories associated with the row's security label are a proper subset of the security categories associated with the user's security label, as determined in operation 98. If that is the case, the DBMS processes the row and retrieves the requested data values and returns the result to the user in operation 102. If not, the user is denied access to the row in operation 100.
(57) b. The security label associated with the row is outside the range of values corresponding to the user's security label. In this case, the DBMS either ignores the row, or declares an attempted security violation depending upon the security policy employed for the database management system. The user is thus denied access to the protected row, as shown in operations 96 and 100.
(58) To minimize the computer processor usage and elapsed time associated with the row-level security checks, the DBMS can cache the row security label values that were authenticated successfully during the course of running the transaction, in cache 66 shown in
(59) Having the security mechanism check both security level and security category gives the security mechanism a great deal of flexibility in supporting various security policies. Some examples of this include the following.
(60) a. An installation might choose to allow access only on an exact match (user security label=RED and row security label=RED).
(61) b. An installation might choose to allow access only when the row's security label is a proper subset of the user's security label (user security label=RAINBOW which means RED, ORANGE, YELLOW, GREEN, BLUE, INDIGO, and VIOLET are allowable values for the row security label for this user).
(62) c. An installation might choose to allow access based on a hierarchy. For example, a TOP SECRET security label for the user would allow access to all security levels at that same level and below, namely for TOP SECRET, SECRET, and UNCLASSIFIED row security label values.
(63) d. Combinations of the above schemes also can be used, depending on the application.
(64) Referring to
(65) Referring to
(66) If the row includes a SECURITY_LABEL column, then operation 120 is performed which determines if the user's security label is equal to the security label for the row. If it is, the update is performed in operation 122, and the row's security label is set equal to the user's security label.
(67) If the user's security label is not equal to the row's security label, then it is determined in operation 124 if the user is specially authorized to record updates with a security level that is different from the user's security level. If the user is not specially authorized, then access for making the update to the table is denied in operation 126. However, if the user is specially authorized, then the user's security level, determined from the user's security label, is compared with the security level for the row to be updated, in operation 128 to determine if the user's security dominates the row's security. In this operation the user's security label and the row's security label are decoded to determine the security information encoded therein. This decoding operation can be implemented using many different techniques, such as via a lookup within the DBMS's authorization tables; via a call to an external security product; or via an installation exit routine, for example. The information from the decoded security labels, such as the security level information, is compared in operation 128.
(68) Following connector A to
(69) In operation 134, if the security categories of the row to be updated form a proper subset of the user's security categories, then the updated row is recorded in the database, in operation 136. The security categories for the row form a proper subset of the security categories for the user if all of the row's security categories are included in the set of security categories for the user. However, if the security categories for a row do not form a proper subset of the security categories of the user, then in operation 138 the user is denied access to update the row.
(70) In updating a row, the security mechanism, such as the write mandatory security unit 38, shown in
(71) IBM Corporation's Resource Access Control Facility (RACF) is an example of a product that can be used to perform the functions of the mandatory security units. According to one embodiment, a database table can activate row level security support by adding a specially named column that acts as the security label. A RACF exit is used to check for each security label value that is accessed within a cursor, and determine whether a SQL query requester submitting an SQL query is allowed to access the data row. The security layer in RACF will understand hierarchical relationships such as the hierarchy representing the colors of the rainbow illustrated in
(72) With that hierarchy established in RACF, the DBMS understands that users with authority to access pastel information can access any row associated with blue, indigo, violet, or pastel. With these capabilities that type of security scheme can be implemented without requiring application programs to access the data using special views or predicates.
(73) Having described apparatuses, articles of manufacture and methods of providing row-level security in a relational database management system, it is believed that other modifications, variations and changes will be suggested to those skilled in the art in view of the teachings set forth herein. It is therefore to be understood that all such variations, modifications and changes are believed to fall within the scope of the present invention as defined by the appended claims. Although specific terms are employed herein, they are used in their ordinary and accustomed manner only, unless expressly defined differently herein, and not for purposes of limitation.
TRADEMARKS
(74) IBM, DB2, z/OS and RACF are trademarks or registered trademarks of International Business Machines, Corporation in the United States and other countries.