accessControl checkOutObject

Proactive Security with Parent Object Fallback

Scénario de test & Cas d'usage

Business Context

An automated security bot is scanning for a temporary table named 'Audit_Log'. If the table does not exist yet, the bot needs to lock the parent Library (Caslib) to safely create the table and apply immediate restrictions, preventing race conditions where another user might create an insecure table with the same name.
About the Set : accessControl

Management of access rights and data security.

Discover all actions of accessControl
Data Preparation

Setup the Caslib, ensuring the specific table 'Audit_Log' does NOT exist yet.

Copied!
1 
2PROC CAS;
3caslib audit_lib path='/tmp/audit_lib' dataSource={srcType='path'}
4SESSION=true;
5TABLE.dropTable / caslib='audit_lib' TABLE='Audit_Log' quiet=true;
6 
7RUN;
8 

Étapes de réalisation

1
Start transaction for the security bot.
Copied!
1PROC CAS; ACCESSCONTROL.startTransaction; RUN;
2
Attempt to checkout 'Audit_Log'. Since it doesn't exist, 'checkoutParent=TRUE' triggers a lock on 'audit_lib'.
Copied!
1 
2PROC CAS;
3ACCESSCONTROL.checkOutObject / checkoutParent=TRUE, objectSelector={objType='TABLE', caslib='audit_lib', TABLE='Audit_Log'};
4 
5RUN;
6 
3
Create the table and secure it within the safe parent-lock context.
Copied!
1 
2PROC CAS;
3datastep.runCode / code='
4data audit_lib.Audit_Log;
5Timestamp=datetime();
6 
7run;
8';
9ACCESSCONTROL.commitTransaction;
10 
11RUN;
12 

Expected Result


The system detects the absence of 'Audit_Log' and automatically locks the 'audit_lib' Caslib instead. The table is then created safely within the locked environment.