This action requires elevated privileges.
Elevation code: proc cas; accessControl.assumeRole / adminRole="superuser"; run;
The createBackup action is a crucial administrative tool within the accessControl action set. It allows a CAS administrator to create a backup of the access control lists (ACLs) for various CAS resources, such as caslibs, tables, and action sets. This backup can be saved to a specified path on the CAS server's file system or, alternatively, be created as a set of in-memory CAS tables. This functionality is essential for disaster recovery, migration, and auditing of security settings. Executing this action requires administrator privileges.
| Parameter | Description |
|---|---|
| path | Specifies the absolute directory path on the CAS controller's file system where the backup files will be stored. This parameter is required unless the `tables` parameter is set to true. |
| tables | A boolean that, when set to `true`, directs the action to create the backup as a set of in-memory CAS tables instead of writing to the file system. These tables can then be manipulated or saved using other CAS actions. The default is `false`. |
Before backing up access controls, we first need some data and controls to exist. The following code sets up a new session, creates a caslib named 'mycaslib', loads a sample table 'cars', and then applies a simple 'read' permission for all authenticated users on that table. This provides a concrete set of access controls to be backed up in the examples.
| 1 | PROC CAS; |
| 2 | SESSION casauto; |
| 3 | caslib mycaslib path='/cas/data/sample_acls' dataSource={srcType='path'}; |
| 4 | TABLE.loadTable / caslib='casuser' path='cars.sashdat' casout={caslib='mycaslib', name='cars', promote=true}; |
| 5 | ACCESSCONTROL.updSomeAcsTable / TABLE={caslib='mycaslib', name='cars'}, acl={{permission='read', principal='authenticatedUsers', principalType='group'}}; |
| 6 | RUN; |
This example demonstrates the standard use of the `createBackup` action. It backs up all current access controls to a specified directory on the CAS server controller. A SAS administrator role is required. The path must be accessible by the CAS server process.
| 1 | PROC CAS; |
| 2 | ACCESSCONTROL.assumeRole / adminRole='superuser'; |
| 3 | ACCESSCONTROL.createBackup / path='/cas/backups/access_controls_backup_20251127'; |
| 4 | RUN; |
This example shows how to use the `tables` parameter to create the backup as a collection of in-memory CAS tables instead of physical files. This is useful for programmatic inspection, auditing, or manipulation of the access controls directly within the CAS session. The resulting tables (one for each type of access control, e.g., caslib_acs, table_acs) are loaded into the active caslib.
| 1 | PROC CAS; |
| 2 | ACCESSCONTROL.assumeRole / adminRole='superuser'; |
| 3 | ACCESSCONTROL.createBackup / tables=true; |
| 4 | TABLE.tableInfo / caslib='casuser'; |
| 5 | RUN; |