方案:使用行和列访问控制的 ExampleBANK - 列掩码

ExampleBANK 安全性管理员通过使用列掩码(行和列访问控制的一个部件)来进一步限制数据访问。 除非允许用户或应用程序查看返回的数据,否则列掩码将按列来隐藏返回到用户或应用程序的数据。

客户服务代表可以查看 ExampleBANK 系统中的所有客户,但是不允许客户服务代表查看完整的帐号,除非他们正在使用特定的应用程序。

安全性管理员将实现以下列掩码,以便将客户服务代表限制为只能查看他们有特权查看的结果集:
CREATE MASK ACCOUNT_COL_MASK ON RCACTSPM.CUSTOMER FOR
------------------------------------------------------------
-- Account number information:
-- Role customer service representative (CSR) is allowed to 
-- access account number information only when they are using 
-- the account update application. This application is
-- identified through stored procedure ACCOUNTS.ACCTUPDATE. 
-- If a CSR queries this data outside of this application, the
-- account information is masked and the first 12 digits are
-- replaced with "x".
------------------------------------------------------------
COLUMN ACCOUNT RETURN
  CASE WHEN (VERIFY_ROLE_FOR_USER (USER, 'CSR') = 1 AND
             ROUTINE_SPECIFIC_NAME = 'ACCTUPDATE' AND
             ROUTINE_SCHEMA = 'ACCOUNTS' AND
             ROUTINE_TYPE = 'P')
       THEN ACCOUNT
       ELSE 'xxxx-xxxx-xxxx-' || SUBSTR(ACCOUNT,16,4)
  END
ENABLE;
安全性管理员观察到,即使在创建列掩码之后,所有职员仍然可以查看该数据。 直到对定义了列掩码的表激活列掩码之后,才会应用列掩码。 安全性管理员必须立即激活该掩码:
--Activate column access control to implement column masks

ALTER TABLE RCACTSPM.CUSTOMER ACTIVATE COLUMN ACCESS CONTROL;