Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Interesting Exploit in PL/SQL
On 12/2/06, Jacques Kilchoer <Jacques.Kilchoer_at_quest.com> wrote:
>
> I agree with Mr. Litchfield. The invalid assumption here is : the
> noaudit command can only have an error if auditing wasn't turned on in the
> first place. And I have found that it's a mistake to assume "there's only
> one possible thing that can go wrong here." IMHO, it would be better to look
> for the "expected" errors (at a cursory glance, ORA-00942 and ORA-01031) and
> trap only those (see below). Or else, like Mark Farnham said yesterday, to
> publish a list of tables that still have auditing enabled once your
> procedure has run.
>
I agree with you there, the statement "the noaudit command can only have an error if auditing wasn't turned on in the first place" was wrong. But that's not actually the point. The point is that we don't care about any errors that could happen.
I remember a developer coming to me after spending half an hour trying to
> debug an the application error message "This order number already exists in
> the system." The answer: our application assumed that the only error on an
> insert would be a duplicate primary key, when in this case the error was
> "maximum number of extents reached for the table" - but the application
> reported it as a duplicate entry
>
This example is a wholly different story, though. You're absolutely right that this is no place for a when others then null;
.
>
> SQL> -- table does not exist (or insufficient privileges to "see" the
> table)
> SQL> noaudit insert on a.b ;
> noaudit insert on a.b
> *
> ERREUR à la ligne 1 :
> ORA-00942: Table ou vue inexistante
>
Yep, that can happen. And actually, we've had several occasions where you'd select objects from the dba_ audit views, and when you'd then try to use audit / noaudit on them, Oracle would say they don't exist (even though they did, and we ran it as SYS). Point being, when turning ON auditing, we need to know that this failed. When turning it off, we don't.
SQL> -- insufficient privileges
> SQL> noaudit insert on sys.tab$ ;
> noaudit insert on sys.tab$
> *
> ERREUR à la ligne 1 :
> ORA-01031: privilèges insuffisants
>
> SQL> -- turning off auditing on a table that did not have auditing turned
> on (doing it twice just to be sure)
> SQL> noaudit insert on jrk.t ;
> Commande Noaudit réussie
> SQL> noaudit insert on jrk.t ;
> Commande Noaudit réussie
>
> SQL>
>
And there's also about a dozen more errors (take a peek at grep -i audit $ORACLE_HOME/rdbms/mesg/oraus.msg) that can be raised when trying to audit / noaudit an object. We don't have a problem when the ENABLE would faild due to a nôn-handled exception. We can fix that, and include the error handler in the code. But the DISABLE cannot abort under any circumstances.
Hope I made my point clear now :-)
Stefan
-- http://www.freelists.org/webpage/oracle-lReceived on Sat Dec 02 2006 - 01:22:47 CST
![]() |
![]() |