DEFAULT security labels
When DBSECADM adds a IDSSECURITYLABEL column to a table that is protected by a security policy, the DEFAULT label specification is required unless the table is empty. If the table is not empty, the specified label is inserted into the existing rows of the table
- if the label is the default value for a column whose data type is not IDSSECURITYLABEL,
- or if the table has no security policy,
- or if the security policy of the label is not the security policy of the table.
To define a specific label as the default value of an IDSSECURITYLABEL column, specify the label name without the policy qualifier, rather than as policy.label. The current security policy of the table is the only valid policy for any security label that protects data in the table.
Examples of security labels as default values
ALTER TABLE T1 ADD (D IDSSECURITYLABEL DEFAULT mylabel1) ADD SECURITY POLICY MegaCorp;Because no BEFORE clause is included, column D is last among the columns in the schema of table T1. This statement fails if any of the database objects that it references (except new column D) does not already exist in the database, or if the table already has a different security policy.
ALTER TABLE T1 DROP SECURITY POLICY MegaCorp; ALTER TABLE T1 ADD (D IDSSECURITYLABEL DEFAULT myNewLabel1) ADD SECURITY POLICY Watchdog;
- The DROP SECURITY POLICY clause of the first statement removes table T1 from the protection of the MegaCorp security policy,
- and automatically drops from the schema of table T1 any IDSSECURITYLABEL column that stores a label of the MegaCorp security policy. This has no effect, however, on other tables in the database that are protected by the MegaCorp security policy.
- The
ADD (D IDSSECURITYLABEL DEFAULT myNewLabel1)
clause protects table T1 with the myNewLabel1 security label, - and the
ADD SECURITY POLICY Watchdog
clause replaces MegaCorp with Watchdog as the new security policy of table T1.
For more information about using the ALTER TABLE statement to add, modify, or drop an association between a table and a label-based security policy, see Modify Column Security clause and SECURITY POLICY Clause. See also the DDL statements for creating label-based security objects, including CREATE SECURITY POLICY statement, CREATE SECURITY LABEL statement, and CREATE SECURITY LABEL COMPONENT statement.