Abstract:
An auditing framework for determining whether a database disclosure of information adhered to its data disclosure policies. Users formulate audit expressions to specify the (sensitive) data subject to disclosure review. An audit component accepts audit expressions and returns all queries (deemed “suspicious”) that accessed the specified data during their execution.

Description:
BACKGROUND OF THE INVENTION  
       [0001]     1. Field of Invention  
         [0002]     The present invention relates generally to the field of managing sensitive data. More specifically, the present invention is related to auditing compliance.  
         [0003]     2. Discussion of Prior Art  
         [0004]     The requirement for responsibly managing privacy sensitive data is being mandated internationally through legislations and guidelines such as the United States Fair Information Practices Act, the European Union Privacy Directive, the Canadian Standard Association&#39;s Model Code for the Protection of Personal Information, the Australian Privacy Amendment Act, the Japanese Personal Information Protection Law, and others. A vision for a Hippocratic database as described in article entitled, “Hippocratic databases” by Agrawal et al., proposes ten privacy principles for managing private data responsibly. A vital principle among these is compliance, which requires auditing disclosures of privacy sensitive information to demonstrate that these disclosures of information adhere to their declared data disclosure policy. Closely related to compliance is the privacy principle of limited disclosure as described in article entitled, “Limiting Disclosure in Hippocratic Databases” by LeFevre et al., which means that the database should not communicate private information outside the database for reasons other than those for which there is consent from the data subject. The principle of limited disclosure comes into play at the time a query is executed against the database, whereas demonstrating compliance is post facto and is concerned with showing that usage of the database indeed observed limited disclosure in every query execution.  
         [0005]     Consider Alice who gets a blood test done at Healthco, a company whose privacy policy stipulates that it does not release patient data to external parties without the patient&#39;s consent. After some time, Alice starts receiving advertisements for an over-the-counter diabetes test. She suspects that Healthco might have released the information that she is at risk of developing diabetes. The United States Health Insurance Portability and Accountability Act (HIPAA) empowers Alice to demand from Healthco the name of every entity to whom Healthco has disclosed her information. As another example, consider Bob who consented that Healthco can provide his medical data to its affiliates for the purposes of research, provided his personally identifiable information was excluded. Later on, Bob could ask Healthco to show that they indeed did exclude his name, social security number, and address when they provided his medical record to the Cardio Institute. The demand for demonstrating compliance need not only arise from an externally initiated complaint—a company may institute periodic internal audits to proactively guard against potential exposures.  
         [0006]     A straightforward approach of physically logging the result set of every query and then using this audit trail to ascertain compliance is unsatisfactory. This approach burdens normal query processing with excessive overhead, particularly for queries that produce a large result set, as every output tuple would cause an additional write to the audit trail. Moreover, the auditing supported by such logging is limited since data disclosed by a query may not be part of the output. For example, P3P as discussed in article entitled, “The platform for privacy preferences 1.0 (P3P1.0) specification” by Cranor et al., allows individuals to specify whether an enterprise can use their data in aggregation. Auditing compliance to such user preferences is not possible given only the log of aggregated results. The above shortcoming might be overcome by logging the tuples read by a query. However, it is non-trivial to determine which out of all the tuples accessed during the processing of a query should be logged.  
         [0007]     Oracle offers a “fine-grained auditing” function as described in pages 574-578 of the book entitled, “Oracle Privacy Security Auditing”, by Nanda et al., where the administrator can specify that read queries are to be logged if they access specified tables. This function logs various user context data along with the query issued, the time the query was issued, and the other system parameters including the “system change number”. Oracle also supports “flash-back queries” as described in pages 613-618 of the book entitled, “Oracle Privacy Security Auditing”, by Nanda et al., whereby the state of the database can be reverted to the state implied by a given system change number. A logged query can then be rerun as if the database was in the state to determine what data was revealed when the query was originally run. There does not appear to be any auditing facility whereby an audit expression can be processed to discover which queries disclosed data specified by the audit expression. Instead, Oracle seems to offer the temporal database (flash-back queries) and query logging (fine-grained auditing) components largely independent of each other.  
         [0008]     The problem of matching a query against an audit expression bears resemblance to the problem of predicate locking as described in article entitled, “The notions of consistency and predicate locks in a database system” by Eswaran et al., that tests if predicates associated with two lock requests are mutually satisfiable. Besides being expensive, this test can lead to false positives when applied to the auditing problem.  
         [0009]     Query processing over views that contain the notion of augmenting a user query with predicates derived from the view definition is discussed in the book entitled “Database Management Systems” by Ramakrishnan et al. Optimizing of a group of queries as described in article entitled “NiagaraCQ: A scalable continuous query system for internet databases” by Chen et al. and article entitled “Multiple-query optimization” by Sellis can be used to accelerate the execution of audit queries.  
         [0010]     Article entitled “Computational Issues Connected with the Protection of Sensitive Statistics by Auditing Sum-Queries”, by Malvestuto et al., discusses an implementation of an auditing strategy for sum-queries restricted according to a query-set-overlap control. A query map which is a graphical summary of answered queries is used.  
         [0011]     Article entitled “The Specification and Enforcement of Advanced Security Policies”, by Ryutov et al., discusses an authorization framework that enables the specification and enforcement of advanced policies that can conditionally generate audit records and can react to state generated by intrusion detection engines based on observation of audit records.  
         [0012]     U.S. patent assigned to Haystack Labs, Inc. (U.S. Pat. No. 5,557,742), provides an intrusion misuse detection and reporting system that uses processing system inputs, which include processing system audit trail records, system log file data, and system security state data information for further analysis to detect and report processing system intrusions and misuses.  
         [0013]     U.S. patent assigned to Hitachi, Ltd. (U.S. Pat. No. 5,982,890), discusses a method and system for detecting fraudulent or unauthorized data update by insiders of databases of a distributed computer system, capable of allowing third parties to check for fraud, by generating parity data of initial data collected from databases and comparing the parity data generated at an auditing time from the latest data stored in the databases with the parity already stored such that if the two do not match, it means that the databases were updated fraudulently.  
         [0014]     U.S. patent assigned to The Chase Manhattan Bank (U.S. Pat. No. 6,070,244), discusses an improved security management system for computer systems where deviations from security policies are reported and compliance problems are fixed by administering the native security platforms. The system includes a self-correcting data security audit system. System parameters (e.g. minimum password length made consistent with policy) or user parameters (e.g. forcing a password change at next login) are automatically changed as necessary.  
         [0015]     U.S. patent assigned to PRC Inc. (U.S. Pat. No. 6,134,664), discusses a method and apparatus for eliminating audit trail records from further consideration by an intrusion and misuse detection engine. Received identified native audit are compared against at least one template and in case of a match, each of the matched native audits is reduced.  
         [0016]     U.S. patent assigned to Psionic Software, Inc. (U.S. Pat. No. 6,405,318 B1), discusses a network independent, host based computer implemented method for detecting intruders in a host computer wherein an unauthorized user attempting to enter into the host computer is detected by comparing actions of the user to a dynamically built profile for the user, and if the action is out of range of the user profile, notifying a control function at the host computer.  
         [0017]     U.S. patent application to Kayashima et al. (2001/0025346 A1), provides a security management and audit program database in which information security policy and an object system correspond to management and audit programs.  
         [0018]     U.S. patent application assigned to International Business Machines Corporation (2002/0178374 A1), discusses a method and apparatus for protecting data from damage in a data processing system. Detection of a virus may be performed by using pattern matching on system audit trails in which audit trails contain activities occurring within the data processing system.  
         [0019]     U.S. patent application assigned to Enterasys Networks, Inc. (2004/0049693 A1), discusses a method for efficiently managing and reporting intrusion, or attempted intrusion events of a computer network using event processing means that detect a corresponding event related to intrusion.  
         [0020]     U.S. patent application to Schwartz et al. (2004/0111639 A1), discusses the automatic enforcement of a pre-defined policy, e.g., data access and handling rules developed by network users within a community of trust, regarding sensitive information. A broad range of interactions are monitored to generate alerts and logs that can be reviewed by interested parties to ensure compliance with the established policy.  
         [0021]     U.S. patent application to Callahan et al. (2004/0172558 A1), discusses a security repository software that uses a database such that advanced queries can be performed on audit data.  
         [0022]     Whatever the precise merits, features, and advantages of the above cited references, none of them achieves or fulfills the purposes of the present invention.  
       SUMMARY OF THE INVENTION  
       [0023]     A method to perform disclosure-based database auditing. At the time of audit, the auditor specifies, using an audit expression, the data whose disclosure is to be tracked by the audit. A subset of logged queries possibly having disclosed the data identified by the audit expression are selected and form the set of candidate queries. These candidate queries are then combined and transformed into an audit query, which when run against the backlog database, identifies the suspicious queries having disclosed the data specified by the audit expression efficiently and precisely.  
         [0024]     A system comprising an audit query generator that processes audit expressions specifying the data whose disclosure is to be tracked, is used to perform disclosure-based database auditing. The audit query generator identifies a subset of logged queries from a query log possibly having disclosed the data identified by the audit expression and then formulates an audit query that is run against a backlog database to identify suspicious queries having disclosed the data specified by the audit expression efficiently and precisely. 
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0025]      FIG. 1  illustrates an auditing framework, as per the present invention.  
         [0026]      FIG. 2  illustrates audit query generation for simple selections, as per the present invention.  
         [0027]      FIGS. 3   a  and  3   b  illustrate a QGM for the audit query of example 6, as per the present invention.  
         [0028]      FIG. 4  illustrates audit query generation when both the candidate query and the audit query expression contain joins, as per the present invention.  
         [0029]      FIGS. 5   a  and  5   b  illustrate a QGM for the audit query of example 7, as per the present invention.  
         [0030]      FIG. 6  illustrates audit query generation for an aggregate query containing having clause, as per the present invention.  
         [0031]      FIGS. 7   a  and  7   b  illustrate a QGM for the audit query of example 8, as per the present invention.  
     
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS  
       [0032]     While this invention is illustrated and described in a preferred embodiment, the invention may be produced in many different configurations. There is depicted in the drawings, and will herein be described in detail, a preferred embodiment of the invention, with the understanding that the present disclosure is to be considered as an exemplification of the principles of the invention and the associated functional specifications for its construction and is not intended to limit the invention to the embodiment illustrated. Those skilled in the art will envision many other possible variations within the scope of the present invention.  
         [0033]     An ideal audit system should have the following properties: 
        Non-disruptive: The system should put minimal burden on normal query processing.     Fast and precise: The system should be able to quickly and precisely identify all the queries that accessed the specified data.     Fine-grained: It should be possible to audit even a single field of a specific record.     Convenient: The language for specifying data of interest should be intuitive and user friendly.        
 
         [0038]      FIG. 1  illustrates an audit system architecture that satisfies the above desiderata. During normal operation, the text of every query processed by the database system is logged along with annotations such as the time when the query was executed, the user submitting the query, and the query&#39;s purpose into query log  102 . The system uses database triggers to capture and record all updates to base tables  104  into backlog tables of a backlog database  106  for recovering the state of the database at any past point in time. Read queries, which are usually predominant, do not write any tuple to the backlog database.  
         [0039]     To perform an audit, an auditor formulates an audit expression that declaratively specifies the data whose disclosure is to be audited (i.e. sensitive data). Sensitive data could be for example, information that a doctor wants to track for a specific individual that could help to resolve disclosure issues during an audit process. Audit expressions are designed to essentially correspond to SQL queries, allowing audits to be performed at the level of an individual cell of a table. The audit expression is processed by an audit query generator  108 , which first performs a static analysis of the expression to select a subset of logged queries that could potentially disclose the specified information. It then combines and transforms the selected queries into a single audit query by augmenting them with additional predicates derived from the audit expression. This audit query, expressed in standard SQL, when run against a backlog database  106  yields the precise set of logged queries that accessed the designated data. Indices on the backlog tables make the execution of the audit query fast.  
         [0040]     The overhead of the above mentioned approach on query processing is small, involving primarily the logging of each query string along with other minor annotations. Database triggers are used to capture updates in a backlog database. At the time of audit, a static analysis phase selects a subset of logged queries for further analysis. These queries are combined, transformed into an audit query generated as standard SQL, which when run against the backlog database, identifies suspicious queries efficiently and precisely.  
         [0041]     Backlog tables of backlog database  106  as shown in  FIG. 1  are used to reconstruct the snapshot of the database at the time a logged query was run. Backlog tables are maintained by database triggers which respond to updates over base tables. However, the same backlog organization can instead be computed using DB2 V8 replication services. DB2 V8 uses the database recovery log to maintain table replicas. A special DB2 V8 replication option can create a replica whose organization is similar to backlog tables described above. Thus, using DB2 V8, backlog tables can be maintained asynchronously from the recovery log instead of being maintained using triggers. Oracle offers flash-back queries as yet another alternative to the backlog organization of  FIG. 1 . A SQL query can be run against any previous snapshot of the database using Oracle SQL language extensions.  
         [0042]     Two fundamental assumptions/limitations of the above mentioned system are: 
        The problem is limited to that of determining if specified data was disclosed by a single query when that query was considered in isolation. There are subtle ways in which an adversary may compose multiple queries to obtain certain information. For example, the statistical database as described in article entitled, “Security-control methods for statistical databases” by Adam at al., discusses how individual information can be deduced by running several aggregate queries and the database security literature as described in article entitled, “Database Security” by Castano et al., shows how covert channels can be used to leak information. The assumption is that end users are not maliciously posing specially crafted queries to deduce information without detection.     The SQL queries considered comprise a single select clause. A large class of queries (including those containing existential subqueries) can be converted into this form as discussed in article entitled, “Extensible/rule based query rewrite optimization in starburst” by Pirahesh et al. Specifically, queries containing selection, projection (including distinct), relational join, and aggregation (including having) operations are considered.        
 
         [0045]     The syntax of an audit expression and the concept of an indispensable tuple which is used to identify suspicious queries with respect to the audit expression can be understood with the help of following definitions:  
         [0000]     Definitions  
         [0046]     A database D is a collection of base tables. The scheme of table T is denoted as T (C0, C1, . . . , Cm) and t.C is used to refer to the value of the field C in tuple t. The following schema will be used in the examples that follow.  
         [0000]     Customer (cid, name, address, phone, zip, contact)  
         [0000]     Treatment (pcid, date, rcid, did, disease, duration)  
         [0000]     Doctor (did, name)  
         [0047]     The primary keys have been underlined. A customer can be a patient, someone accepting financial responsibility for a patient&#39;s treatment, or an emergency contact. The Treatment table uses pcid to identify the patient receiving the treatment and uses rcid to identify the customer assuming financial responsibility for the treatment (who could be the same person as the patient). The date is the start date of the treatment and duration reflects the length of the treatment. Other column names are self-explanatory. To simplify exposition, it will be assumed that the database has referential integrity and that no field value is null.  
         [0000]     Audit Expressions  
         [0048]     Expressions that essentially correspond to SQL queries enable an auditor to conveniently specify the queries of interest, termed suspicious queries. Specifically, the syntax of an audit expression is identical to that of a select-project-join (SPJ) query without any distinct in the select list, except that audit replaces the keyword select and the elements of the audit list are restricted to be column names:  
         [0000]     audit audit list  
         [0000]     from table list  
         [0000]     where condition list  
         [0049]     Let U be the cross product of all the base tables in the database. The audit expression marks a set of cells in the table U. The marked cells belong to the columns in the audit list for the tuples that satisfy the predicate in the where clause. Queries that access all the marked cells in any of the tuples in U are to be found. These are the suspicious queries with respect to the audit expression.  
       Example 1  
       [0000]     Disclosure of disease information of anyone living in the ZIP code 95120 needs to be audited. Here is the audit Expression:  
         [0000]     audit disease  
         [0000]     from Customer c, Treatment t  
         [0000]     where c.cid=t.pcid and c.zip=‘95120’ 
         [0050]     This audit expression marks the cells corresponding to the disease column of those tuples in the Customer*Treatment table that have c.cid=t.pcid and c.zip=95120. Any query that accesses the disease column of any of these tuples will be considered suspicious.  
         [0000]     Informal Definitions  
         [0051]     Indispensable Tuple—ind(t,Q)  
         [0052]     A tuple tεU is indispensable in the computation of a query Q, if its omission makes a difference.  
         [0053]     Candidate Query—cand(QA)  
         [0054]     A query Q is a candidate query with respect to an audit expression A, if Q accesses all the columns that A specifies in its audit list.  
         [0055]     Suspicious Query—susp(Q,A)  
         [0056]     A candidate query Q is suspicious with respect to an audit expression A, if Q and A share an indispensable tuple.  
       Example 2  
       [0000]     Consider the audit expression A in Example 1 and the following query Q  
         [0000]     select address  
         [0000]     from Customer c, Treatment t  
         [0000]     where c.cid=t.pcid and t.disease=‘diabetes’ 
         [0057]     Q is a candidate query with respect to A as it accesses the disease column that A is auditing. Consider the Customer*Treatment table. Clearly, tuples that match the join condition and have diabetes in the disease column are indispensable for Q. Similarly, tuples that match the join condition and have 95120 as the zip code are indispensable for A. Therefore Q will be deemed suspicious with respect to A if there was some customer who lived in the ZIP code 95120 and was also treated for diabetes.  
       Example 3  
       [0000]     Consider the query Q from Example 2 and the following audit expression A:  
         [0000]     audit address  
         [0000]     from Customer c, Treatment t  
         [0000]     where c.cid=t.pcid and t.disease=‘cancer’ 
         [0058]     Q will not be deemed suspicious with respect to A because no tuple in Customer*Treatment can simultaneously satisfy the predicates of Q and A. But how about Alice who has both cancer and diabetes? Although Q discloses Alice&#39;s address, the fact that Alice has cancer is not relevant to the query. Q only asks for people who have diabetes. In other words, anyone looking at the output of the query will not learn that Alice has cancer. Hence it is reasonable to not consider the query to be suspicious. Note that all the tuples of Customer*Treatment marked by A have cancer in the disease column and Q does not access any one of them.  
         [0000]     Formal Definitions  
         [0059]     Let the query Q and audit expression A be of the form: 
 
 Q = . . . (σ P     Q   ( T*R ))  (1) 
 
 A={overscore (π)}   C     OA   (σ P     A   ( T*S ))  (2) 
 
 where T, R, S are virtual tables of the database D, that is, cross products of base tables: 
 
 T=T   1   *T   2   * . . . *T   n  
 
 R=R   1   *R   2   * . . . *R   m  
 
 S=S   1   *S   2   * . . . *S   k  
 
         [0060]     The operator {overscore (π)} is the multi-set projection operator that preserves duplicates in the output (as opposed to the relational projection operator π which eliminates duplicates). Note that T is common to Q and A. C Q  denotes the column names that appear anywhere in a query Q, and C OQ  denotes the column names appearing in the select list of Q. Similarly, C OA  denotes the column names present in the audit list of an audit expression A. P Q  denotes the predicate of the query and P A  is the predicate of the audit expression. Tuples of any virtual table are referred to as virtual tuples.  
         [0061]     The definition of indispensability, for all classes of queries of interest, specifically (a) SPJ queries, (b) queries with aggregation without having, and (c) queries with aggregation and having, are formalized as follows:  
         [0000]     SPJ Queries  
         [0062]     Consider first a SPJ query that does not contain a distinct in its select list. Rest of the cases are based on this case. For such queries, the form of the query of Eq. (1) is specialized to: 
 
 Q={overscore (π)}   C     OQ   (σ P     Q   ( T*R ))  (3) 
 
 The definition of an indispensable tuple for an SPJ query is formalized as follows: 
 
 Definition 1 (Indispensability—SPJ) A (virtual) tuple vεT is indispensable for an SPJ query Q if the result of Q changes when we delete v: 
 
 ind ( v,Q )         {overscore (π)} C     Q   (σ P     Q   ( T*R ))≠{overscore (π)} C     Q   (σ P     Q   (( T−{v })* R )) 
 
 Theorem 1 A (virtual) tuple vεT of the SPJ query Q is indispensable if 
 
 ind ( v,Q )         σ P     Q   ({ v}*R )≠0  (4) 
 
 Proof From Definition 1, 
 
 ind ( v,Q )         {overscore (π)} C     Q   (σ P     Q   ( T*R ))≠{overscore (π)} C     Q   (σ P     Q   (( T−{v })* R )) 
 
 Since the projections {overscore (π)} maintain the duplicates,  
               ind   ⁡     (     v   ,   Q     )       ⇔       ⁢         σ     P   Q       ⁡     (     T   *   R     )       ≠       σ     P   Q       ⁡     (       (     T   -     {   v   }       )     *   R     )                       ⇔       ⁢         σ     P   Q       ⁡     (     T   *   R     )       ≠         σ     P   Q       ⁡     (     T   *   R     )       -         σ     P   Q       ⁡     (     {   v   }     )       *   R           )                   ⇔       ⁢         σ     P   Q       ⁡     (     {   v   }     )       *   R       )     ≠   0             
 
         [0063]     Queries with distinct in the select clause produce a duplicate-free table. Such queries have the form Q=π C     OQu   (σ P     Q   (T*R)). Let Q be the SPJ query obtained from the original query Q after removing distinct from the query text. Then, the definition will be:  
         [0000]     Definition 2 (Indispensability—Distinct) A (virtual) tuple V is indispensable for Q=π C     OQ   (σ P     Q   (T*R)) if and only if it is indispensable for Q={overscore (π)} C     OQ   (σ P     Q   (T*R)).  
         [0000]     Queries with distinct can be viewed as a special case of aggregation, the aggregation function being the first tuple in a group.  
         [0000]     Observation 1 Duplicate elimination does not change the set of indispensable tuples for an SPJ query.  
         [0000]     Indispensability—Aggregation Without Having  
         [0064]     Consider a query that computes average salary per department. If Alice happens to have exactly the average salary of her department and her tuple is omitted, the query result will not be affected. However, it will be wrong to treat Alice&#39;s tuple as dispensable because the privacy systems such as P3P allow individuals to opt out of the use of their values in the computation of an aggregation.  
         [0065]     The form of the query of Eq. 1 for an aggregation query without a having clause is specialized to: 
 
 Q=gbyγ   agg (σ P     Q   ( T*R ))  (5) 
 
 where gby are the grouping columns and agg represent aggregations like avg(duration), count(disease). 
 
         [0066]     Consider the query Q that is a version of Q, but without aggregations. That is, Q has exactly the same from and where clauses, and a select clause with the same columns as Q, but without the aggregation functions. Note that the columns used in agg (e.g. duration, disease) are included in the select list of Q.  
         [0000]     Definition 3 (Indispensability—Aggregation) A (virtual) tuple v is indispensable for Q if and only if it is indispensable for the aggregate-free version Q.  
       Example 4  
       [0000]     Consider the following query that outputs average duration of diabetes treatment by doctor:  
         [0000]     select name, avg(duration)  
         [0000]     from Doctor d, Treatment t  
         [0000]     where d.did=t.did and t.disease=‘diabetes’ 
         [0000]     group by name  
         [0000]     Indispensability of a tuple t in the above query is determined by considering the indispensability of t in the following SPJ query:  
         [0000]     select name, duration  
         [0000]     from Doctor d, Treatment t  
         [0000]     where d.did=t.did and t.disease=‘diabetes’ 
         [0000]     Every Treatment tuple having diabetes in the disease field is indispensable. Thus the fact that the duration values of these tuples were used in computing the output is not lost. Thus, the following observation can be made:  
         [0000]     Observation 2 A tuple v is indispensable for Q=gby γ agg (σ P     Q   (T*R)) if and only if it is indispensable for Q={overscore (π)} C     Q   (σ P     Q   (T*R)).  
         [0000]     Indispensability—Aggregation with Having  
       Example 5  
       [0000]     A modified version of the query given in Example 4 is shown below. It outputs average duration of diabetes treatment, but only for those doctors for whom this average is greater than 100 days.  
         [0000]     select name, avg(duration)  
         [0000]     from Doctor d, Treatment t  
         [0000]     where d.did=t.did and t.disease=‘diabetes’ 
         [0000]     group by name  
         [0000]     having avg(duration)&gt;100  
         [0000]     The general form of an aggregation query Q that includes a having clause can be written as: 
 
 Q=σ   P     H   ( gbyγ   agg (σ P     Q   ( T*R )))  (6) 
 
 Compared to Eq. (5), an extra having predicate P H (avg(duration)&gt;100 in Example 5) is added. Any group that does not satisfy this predicate is not included in the results of Q, which implies that any tuple belonging to a group that gets filtered out by P H  is dispensable. Let Q be the having-free version of Q, obtained by simply removing the having clause from Q. 
 
 Definition 4 (Indispensability—Aggregation with having) A (virtual) tuple v is indispensable for Q if and only if it is indispensable for Q and it belongs to a group that satisfies the having predicate P H . 
 
 To recast indispensability in terms of an SPJ query, a group table is defined as: 
 
 G=gbyγ   agg (σ P     Q   ( T*R ))  (7) 
 
 For the example query, G will have two columns: name and avg(duration). it will have as many tuples as there are doctors who treat diabetes. Every tuple will have the average duration of diabetes treatment for the corresponding doctor. 
 
 Next form the following table: 
 
 QG=σ   P     G   ((σ P     Q   ( T*R ))* G )  (8) 
 
 where P G  is the natural join condition on the group-by-columns, gby. The results tuples of the having-free version Q are augmented with the corresponding group values. The query Q is computed from σ P     H   (QG). 
 
 Observation 3 A (virtual) tuple v is indispensable for query Q with aggregation and having if and only if v is indispensable for the SPJ query 
 
{overscore (π)} C     Q   (σ P     H   (σ P     G   (σ P     Q   ( T*R*G ))))  (9) 
 
 Suspicious Queries 
 
 A maximal virtual tuple for queries Q 1  and Q 2  is defined. 
 
 Definition 5 (Maximal Virtual tuple) A tuple v is a maximal virtual tuple for queries and Q 1  and Q 2 , if it belongs to the cross product of common tables in their from clauses. 
 
 Definition 6 (Candidate Query) A query Q is a candidate query with respect to the audit expression A if and only if 
 
C Q   ⊂ C OA  
 
 Definition 7 (Suspicious Query) A candidate query Q is suspicious with respect to audit expression A if they share an indispensable maximal virtual tuple v, that is: 
 
susp(Q,A)         ∃vεT s.t. ind(v,Q)Λind(v,A) 
 
         [0067]     Note that T=T 1 *T 2 * . . . * T n  is the cross product of the common tables in Q and A.  
         [0000]     System Structures  
         [0000]     The system structures needed to handle audits in the presence of updates to the database are as follows:  
         [0000]     i) Full Audit Expression  
         [0000]     The audit expression is prepended with an additional during clause that specifies the time period of interest:  
         [0000]     during start-time to end-time  
         [0000]     audit audit-list  
         [0068]     Only if a query has accessed the data of concern during the specified time period is the query deemed suspicious. Privacy policies specify who is allowed to receive what information and for what purpose as described in article entitled, “Hippocratic databases” by Agrawal et al. and article entitled, “The platform for privacy preferences 1.0 (P3P1.0) specification” by Cranor et al. An audit expression can use the other than clause to specify the purpose-recipient pairs to whom the data disclosure does not constitute non-compliance:  
         [0000]     otherthan purpose-recipient pairs  
         [0000]     during start-time to end-time  
         [0000]     audit audit-list  
         [0000]     ii) Query Log  
         [0000]     As shown in  FIG. 1 , the audit system maintains a log of past queries executed over the database. The query log is used during the static analysis to limit the set of logged queries that are transformed into an audit query.  
         [0069]     A thin middleware lies between the application and the database engine. This middleware is implemented as an extension to a JDBC driver. The middleware intercepts queries and writes the query string and associated annotations to the log. The annotations include the timestamp of when the query finished, the ID of the user issuing the query, and the purpose and the recipient information extracted from the context of the application as described in articles entitled, “Limiting disclosure in Hippocratic databases” by LeFevre et al. and pages 574-578 of the book entitled, “Oracle Privacy Security Auditing”, by Nanda et al, in which the query is embedded. The query log is maintained as a table. Some database systems (e.g. DB2) provide the facility for logging incoming queries. This capability can be extended to log additional information required for auditing.  
         [0000]     iii) Temporal Extensions  
         [0070]     To determine if a candidate query Q accessed the data specified in an audit expression the history is selectively played back. Thus the state of the database as it existed at the time Q was executed needs to be recreated. A backlog database is eminently suited for this purpose.  
         [0071]     Two organizations for the backlog database are described: time stamped and interval stamped. In both the organizations, a backlog table T b  is created for every table T in the database. T b  records all updates to T. It is assumed that every table T has a primary key column P; the system can create an internally generated key column otherwise.  
         [0000]     Time Stamped Organization  
         [0072]     This organization is based on the ideas presented in article entitled, “Incremental implementation model for relational databases with transaction time” by Jensen et al. Aside from all columns in T, a tuple in T b  has two additional columns: TS that stores the time when a tuple is inserted into T b , and OP that takes one of the values from {‘insert’, ‘delete’, ‘update’}. For every table, three triggers are created to capture updates. An insert trigger responds to inserts in table T by inserting a tuple with identical values into T b  and setting its OP column to ‘insert’. An update trigger responds to updates to T by inserting a tuple into T b  having the after values of the tuple in T and setting its OP column to ‘update’. A delete trigger responds to deletes in T by inserting into T b  the value of the tuple before the delete operation and setting its OP column to ‘delete’. In all the three cases, the value of the TS column for the new tuple is set to the time of the operation.  
         [0073]     To recover the state of T at timer τ, the “snapshot” of T at time τ is generated. This is achieved by defining a view T τ  over the backlog table T b : 
 
 T   τ =π P,C1, . . . ,Cm ({ t|tεT   b   t.OP≠ ‘delete’           rεT   b   s.t.t.P=r.Pr.TS≦τr.TS&gt;t.TS }) 
 
 The scheme for T τ  is identical to T. T τ  contains at most one tuple from T b  for every distinct primary key value P. Among a group of tuples in T b  having an identical primary key value, the selected tuple t is the one that was created at or before timer, is not a deleted tuple, and there is no other tuple r having the same primary key value that was created at or before time r but whose creation time is later than that of t. 
 
 Interval Stamped Organization 
 
 In this organization, the end time (TE) of a tuple is explicitly stored in addition to the start time (TS). Thus, the combination of TS and TE for a tuple gives the time period during which the tuple was alive. A null value of TE is treated as current time. The operation field (OP) is no longer necessary. 
 
 When a new tuple t is inserted into T, the insert trigger also adds t to T b , setting its TE column to null. When a tuple tεT is updated, the update trigger searches for the tuple bεT b  such that b.P=t.P         b.TE=null and sets b.TE to the current time. Additionally, the trigger inserts a copy of t into T b  with updated values and its TE column set to null. When a tuple t is deleted from T, the delete trigger searches for bεT b  such that b.P=t.P         b.TE=null and sets b.TE to the current time. 
 
 Indexing 
 
 Two strategies for indexing a backlog table T b  are: 
 
         [0074]     1. Eager: Index is kept fresh and updated every time T b  is updated.  
         [0075]     2. Lazy: Index is created afresh at the time of audit. Otherwise, T b  is kept unindexed.  
         [0076]     The advantage of the eager strategy is that there is no latency at the time of audit due to the time needed to build the index. However, an update during normal query processing is burdened with the additional overhead of updating the index. The trade-off is reversed in the lazy strategy.  
         [0000]     Columns that need to be indexed are chosen. The primary key can be indexed. A composite index consisting of the primary key concatenated with the timestamp can also be created.  
         [0000]     Algorithms  
         [0000]     The audit query is generated in two steps:  
         [0000]    
       
         
           
              1. Static Analysis: Select candidate queries (i.e., potentially suspicious queries) from the query log. (“Candidate query” is referred to as a query that passes the static analysis.)  
              2. Audit Query Generation: Augment every candidate query with information from the audit expression and combine them into an audit query that unions their output to identify the suspicious queries. 
 
 Static Analysis 
 
           
         
       
     
         [0079]     For a given audit expression A, some queries will be judged as non-candidates, and excluded immediately. Four static tests can be utilized for selection of candidate queries. The query log is indexed to make these tests fast.  
         [0080]     The first is by comparing the attribute names: with audit columns C OA , check whether C Q   ⊃ C OA . The second test checks whether the timestamp of query Q is out of range with respect to the audit interval in the during clause of A. The third test checks whether the purpose-recipient pair of Q matches any of the purpose-recipient pairs specified in the other than clause of A. Finally, some queries can be eliminated by checking for contradictions between the predicates P Q  and P A , such as P Q =(age &gt;40) and P A =(age&lt;20). This class of tests is an instance of the constraint satisfaction problem, for which many solution techniques are described in the book entitled “Constant Processing” by Dechter.  
         [0000]     Audit Query Generation  
         [0081]     At the end of static analysis, a set of candidate queries Q i ={Q 1 , . . . , Q n } that are potentially suspicious with respect to the audit expression A are found. Every Q i  is augmented with information in A, producing another query AQ i  defined against the view of the backlog database at time τ i , where τ i  is the timestamp of Q i  as recorded in the query log. Upon execution of these AQ i  queries, those with non-empty results will comprise the exact set of suspicious queries. However, to increase opportunities for optimization, all AQ i  are combined into one audit query AQ whose output is the union of the output of the individual AQ i . This audit query is the one that is executed against the backlog database.  
         [0082]     To simplify exposition, it is assumed that Q i  has only one query Q that is transformed into an audit query AQ. A Query Graph Model (QGM) as discussed in article entitled, “Extensible/rule based query rewrite optimization in starburst” by Pirahesh et al., is used to manipulate Q and A to generate AQ. QGM is an internal representation of queries which captures query semantics and which can be manipulated to transform candidate queries and audit expressions in order to generate an audit query. QGM is composed of entities portrayed as boxes and relationships among entities portrayed as lines between boxes. Entities can be operators among, for example, union, select, group, table. The union operator has multiple inputs having compatible schemas and represents the union of the inputs as a single output stream. The select operator can have multiple inputs and outputs and can be used to express join predicates as well as simple predicates. The group operator has a single input and computes grouping and aggregation. The table operator represents a base table and has a set of columns. Lines between operators represent quantifiers which feed one operator by ranging over the output of another operator. To avoid QGM diagrams from becoming unwieldy, column names are abbreviated. The abbreviated column names used in the figures are indicated in bold letters:  
         [0000]     Customer (cid, name, address, phone, zip, contact)  
         [0000]     Treatment (pcid, rcid, did, disease, duration, date)  
         [0000]     Doctor (did, name)  
         [0000]     Simple Selections  
         [0083]     Consider first the simple case of a candidate query Q involving a selection over a single base table T and the audit expression A over the same table. This case is a special case of the upcoming SPJ queries.  
         [0000]     Lemmal Let T be a base table of database D. Let A={overscore (π)} C     OA   (σ P     A   (T)) be an audit expression and let Q={overscore (π)} C     Q   (σ P     Q   (T)) be a candidate query. Q is suspicious with respect to A if and only if σ P     A   (σ P     Q   (T))≠0.  
         [0084]     Given that the query Q has passed the static analysis, the combined selection σ P     A   (σ P     Q   (T)) needs to the checked as whether it is empty or not, which is what  FIG. 2  implements using the QGM representation.  
         [0085]     The audit query generation algorithm is illustrated using the following example.  
       Example 6  
       [0000]     Candidate query Q: Retrieve all customers in ZIP code 95120.  
         [0000]     select*  
         [0000]     from Customer  
         [0000]     where zip=‘95120’ 
         [0000]     Audit expression A: Find queries that have accessed Alice&#39;s name and address.  
         [0000]     audit name, address  
         [0000]     from Customer  
         [0000]     where name=‘Alice’ 
         [0086]      FIG. 3   a  shows the state of the QGM graph after line  3  of  FIG. 2 . A new QGM structure for the audit query AQ is created and both the candidate query Q and the audit expression are added to AQ.  FIG. 3   b  shows the state of QGM after line  6  of  FIG. 2 . Line  4  of  FIG. 2  changed the audit expression&#39;s quantifier (range variable) C 2  from ranging over the Customer table to ranging over the result of the query Q. As part of this transformation, each column referenced by C 2  is changed to reference a column of Q&#39;s output. If a column referenced by C 2  is not in the output of Q, it is propagated up from the customer table to be included in the Q&#39;s select list. Line  5  of  FIG. 2  replaces the customer table with a view of the customer table at time τ when Q is completed.  
         [0000]     SPJ Queries  
         [0087]     Consider now the case when the candidate query as well as the audit expression contain joins in the Where clauses.  FIG. 4  shows the audit query generation algorithm when both the candidate query and the audit expression contain joins. The audit list may contain columns from multiple tables and the join condition in the candidate query may be different from the one in the audit expression.  
         [0000]     Theorem 2 A candidate SPJ query Q={overscore (π)} C     Q   (σ P     Q   ( T*R )) is suspicious with respect to an audit expression A={overscore (π)} C     OA   (σ P     A   ( T*S )) if and only if 
 
σ P     A   (σ P     Q   ( T*R*S ))≠0 
 
 Proof According to definition 7,  
               susp   ⁡     (     Q   ,   A     )       ⇔       ⁢     ∃     m   ∈     T   ⁢           ⁢       s   .   t   .           ⁢     ind   ⁡     (     m   ,   Q     )         ⋀     ind   ⁡     (     m   ,   A     )                             ⇔       ⁢     ∃     m   ∈   T         ,     r   ∈   R     ,     s   ∈     S   ⁢           ⁢       s   .   t   .           ⁢       P   Q     ⁡     (     {     m   ⁢           ⁢   r     }     )         ⋀       P   A     ⁡     (     {     m   ⁢           ⁢   s     }     )                           ⇔       ⁢     ∃     m   ∈   T         ,     r   ∈   R     ,     s   ∈     S   ⁢           ⁢     s   .   t   .           ⁢     (     m   ⁢           ⁢   r   ⁢           ⁢   s     }         ∈       σ     P   A       ⁡     (       σ     P   Q       ⁡     (     T   *   R   *   S     )       )                     ⇔       ⁢         σ     P   A       ⁡     (       σ     P   Q       ⁡     (     T   *   R   *   S     )       )       ≠   0               
 
 Note that an audit expression A may have multiple quantifiers, only some subset of which may range over a table that also appears in query Q. These are the only ones for which A is made to range over the result of the query (lines  5 - 6  of  FIG. 4 ). For others, A continues to range over the original tables. The following example is used to illustrate the algorithm. 
 
       Example 7  
       [0000]     Candidate query Q: Find all diseases treated by doctor Phil.  
         [0000]     select T.disease  
         [0000]     from Treatment T, Doctor D  
         [0000]     where T.did=D.did and D.name=‘Phil’ 
         [0000]     Audit expression A: Find queries that have disclosed the diseases of Alice.  
         [0000]     audit T.disease  
         [0000]     from Customer C, Treatment T  
         [0000]     where C.cid=T.pcid and C.name=‘Alice’ 
         [0088]      FIG. 5   a  shows the initial QGM (after Line  3  of  FIG. 4 ) and  FIG. 5   b  shows the final QGM (after Line  7  of  FIG. 4 ). In the final QGM, the audit expression ranges over the result of the query and then joins the results with the Customer table since Customer only appears in the audit expression.  
         [0000]     Aggregation  
         [0089]     To determine if an aggregate query without a having clause is suspicious, aggregate functions are simply removed along with the group by clause. Columns previously referenced by aggregate functions are added to the select list of the query. The resulting SPJ query is then handled using the algorithm given in  FIG. 4   
         [0090]     If the aggregate query, however, additionally contains a having clause, the predicate therein might have eliminated the data specified by the audit expression from the query result. Simply removing the having clause can thus lead to false positives. This limitation is overcome by the algorithm given in  FIG. 6 , which is based on the upcoming theorem.  
         [0091]     Recall that the general form of such a query is given by eq. 6: Q=σ P     Q   (gby γ agg (σ P     Q   (T*R))). By eq. 7, the group table G=gby γ agg (σ P     Q   (T*R)) and the audit expression is A={overscore (π)} C     OA   (σ P     A   (T*S)) by eq. 2.  
         [0092]      FIG. 6  shows the audit query generation algorithm for an aggregate query containing having clause.  
         [0000]     Theorem 3 A candidate query Q with aggregation and having is suspicious with respect to an audit expression A if and only if 
 
σ P     A   (σ P     H   (σ P     G   (σ P     Q   ( T*R*G*S ))))≠0  (10) 
 
 Proof From Observation 3, the query Q has the same indispensable tuples as the SPJ query Q′ below: 
 
 Q′={overscore (π)}   C     Q   ((σ P     Q   (σ P     Q   (σ P     Q   ( T*R*G )))) 
 
 Then, from Theorem 2, Q is suspicious if and only if eq. 10 holds. An aggregate query with a having clause can be viewed as consisting of three parts: Q s , Q g  and Q h . The first part, Q s , ignores grouping and aggregation and finds the tuples qualifying the WHERE clause. Grouping and aggregations are then applied to this result in Q g . Finally, any predicates on groups are applied using a selection operator over the result of grouping and aggregation in Q h . A new select box is created on Line  8  in  FIG. 6 . This operator joins the tuples emanating from Q h  with those from A to ensure that these A tuples were not all filtered out by the having predicates in Q h . Example 8 is used to illustrate the algorithm in  FIG. 6 . 
 
       Example 8  
       [0000]     Candidate query Q: Compute the average treatment duration grouped by disease and the doctor performing the treatment for treatments which were between Jan. 1, 2001 and Dec. 31, 2003 having a minimum duration &lt;100.  
         [0000]     select D.name, T.disease, avg(T.duration)  
         [0000]     from Doctor D, Treatment T  
         [0000]     where T.date between Jan. 1, 2001′ and Dec. 31, 2003′ and D.did=T.did  
         [0000]     group by D.name, T.disease  
         [0000]     having min (T.duration)&lt;100  
         [0000]     Audit expression A: Find queries that have accessed the disease and treatment duration of patients who have diabetes and live in ZIP code 95120.  
         [0000]     audit T.disease, T.duration  
         [0000]     from Customer C, Treatment T  
         [0000]     where C.cid=T.pcid and C.zip=‘95120’ and T.disease=‘diabetes’ 
         [0093]     The QGM for the candidate query Q in Example 8 integrated with the audit expression is shown in  FIG. 7   a .  FIG. 7   b  shows the audit query. The select box B ensures that the groups formed by the grouping operator that survived the having predicate match the audit expression&#39;s data.  
       CONCLUSION  
       [0094]     A system and method has been shown in the above embodiments for the effective implementation of an auditing compliance with a hippocratic database. While various preferred embodiments have been shown and described, it will be understood that there is no intent to limit the invention by such disclosure, but rather, it is intended to cover all modifications falling within the spirit and scope of the invention, as defined in the appended claims. For example, the present invention should not be limited by software/program, computing environment, or specific computing hardware.  
         [0095]     The above enhancements are implemented in various computing environments. For example, the present invention may be implemented on a conventional IBM PC or equivalent, multi-nodal system (e.g., LAN) or networking system (e.g., Internet, WWW, wireless web). All programming and data related thereto are stored in computer memory, static or dynamic, and may be retrieved by the user in any of: conventional computer storage, display (i.e., CRT) and/or hardcopy (i.e., printed) formats.