Skip to content

Hardening

Overview

Data Controller's own security model - groups, MPE_SECURITY, column and row level rules - is described in Security and Groups. This page covers the layer underneath it: the permissions the platform puts on the deployed appLoc folder, which decide who can execute a Data Controller service directly, without the app being involved at all.

That layer matters because a service can always be executed outside the frontend. On SAS 9 there is a URL for every stored process; on Viya every Job is visible in SAS Studio; on SASjs Server every service is a route. Anything a caller can reach that way runs under the shared system account, so folder permissions are the only control that applies before Data Controller's own code runs.

AppLoc folder permissions

The deployment creates one folder per service group under services/. Rather than permission each service or folder individually, apply three group permissions to the appLoc:

Folder Group Why
services/public public Services the app calls for every user, before that user's own security is known - startupservice, getcols, getcolvals, getgroups, viewtables, viewdata. The settings program also sits in this folder (on Viya, at services/settings.sas).
services/admin admins The administrative services - exportconfig, exportdb, refreshcatalog, and the deploy screen's dirlist / writecheck. The same group as the Data Controller admin group, plus the identity that runs deployments.
everything else editors editors, approvers, auditors, hooks, validations, usernav (and lineage / metanav on SAS 9). These assume the caller is a Data Controller user and check MPE_SECURITY per table and group.

The three groups are a recommendation, not a requirement - what matters is that they are three levels, and that the middle one is small.

Why public is public

The public services answer the questions the app asks on load: what libraries can I see, what columns does this table have, is this user in a group. They are gated internally on the caller's own permissions, so being able to execute them does not expose anything the caller could not already see in the app - viewdata and getrawdata return rows only for tables the caller's groups may access. They do not write.

Making the folder public to authenticated users is what allows the app to start for a new user with no group membership yet - which is also why settings.sas (holding the admin group name and the control library location) must be readable by everyone who can open the app.

Why admin is restricted

Most admin services check &mpeadmins (the admin group, read from MPE_CONFIG) as their first action, so the folder permission is a second layer rather than the only one. Two of them cannot carry that check: dirlist and writecheck answer the deploy screen's questions before the control library exists, so there is no group configured yet to check the caller against. They allow any caller with execute on the folder to enumerate the folders the SAS session can read, and to create and remove a probe file wherever that session can write.

So on services/admin the folder permission is the only control. Grant it to the administrator group and to the deployment identity, and to nothing else.

Warning

An appLoc deployed without this permission leaves services/admin open to whoever the platform allows to execute services in it - including the two ungated deploy services above - for the life of the appLoc.

How to apply it

SAS 9

Set folder-level ACT on the deployed metadata folders:

  • Open SAS Management Console and navigate to the appLoc folder under Folders
  • Right click -> Properties -> Authorization -> Add
  • Grant ReadMetadata on appLoc/services, so the folder is visible in the tree
  • Grant Read and Execute on appLoc/services/public (public group) and on appLoc/services/admin (admins group)

The same page is where the appLoc is write-protected (RM denied) once the deployment is complete.

SAS Viya

Add a folder rule per folder under SAS Environment Manager -> Folders:

  • Right click the folder -> Edit Authorization -> Add rule
  • ReadMetadata on appLoc/services, so the folder tree is visible
  • Read on appLoc/services/public (public group) and on appLoc/services/admin (admins group) - a Job can be run by anyone who can read it

SASjs Server

Execution is governed by permission rules on the service routes rather than by folder ACLs, so the same three levels are expressed as a rule set: the public group granted the services/public programs and the admins group the services/admin programs.

Re-check the permissions after a re-deploy, and after any deploy into a new appLoc - a deployment replaces the contents of the folders, so a new location starts with the defaults.

Deployment account

The identity that runs the deployment needs write access to the metadata folders and to the physical appLoc for the duration of the deploy, and execute on services/admin for the deploy screen's folder and write checks. Keeping that identity in the admins group, rather than granting it wider access, keeps the deploy window as small as the rest of the appLoc.

See SAS 9 STP Hardening for running Data Controller under a dedicated stored process server account, which is the recommended way to keep write access to the libraries out of the general user population.