SAP
Nova manages accounts – called users in SAP – and their roles in SAP ABAP systems. To do so, Nova calls standard BAPIs and the function module RFC_READ_TABLE via RFC.
Prerequisite: SAP NetWeaver RFC SDK
For RFC, Nova uses the Python library pyrfc, which requires the SAP NetWeaver RFC SDK. Nova does not ship the SDK; the operator obtains it from SAP. Without the SDK, the SAP functions are not available.
Connection
One target system stands for one SAP system with one client. The fields: “SID”, “Application Server Host”, “System number”, “Client”, “User” and “Password” of the RFC user, and “Language”. Under “Advanced” are “Message server host”, “Message server port” and “Logon group” for load balancing, and the “SAP router string”. “Check status” calls RFC_PING.
Accounts
| Action | Function module |
|---|---|
| Create | BAPI_USER_CREATE1 |
| Change address data | BAPI_USER_CHANGE |
| Lock, unlock | BAPI_USER_LOCK, BAPI_USER_UNLOCK |
| Delete | BAPI_USER_DELETE |
Nova commits every change with BAPI_TRANSACTION_COMMIT. For SAP, first and last name must be available separately; Nova does not split a full name itself. After creating an account and after name changes, Nova reads the name fields back and reports any deviation.
Nova passes passwords as initial passwords, not as productive passwords. SAP therefore requires a dialog user to choose a new password at the first logon. If Nova creates an account without a password, password logon is deactivated. Passwords that Nova generates for SAP have at most 40 characters and start neither with “!” or “?” nor with three identical characters.
Nova reads the last logon from table USR02.
Roles
Nova supports single and composite roles. A job of type “Import SAP Roles” reads the role catalogue, optionally filtered (for example Z*). Nova recognises composite roles by their flag in AGR_FLAGS, reads their single roles from AGR_AGRS and short texts in German and English from AGR_TEXTS. If SAP returns the role structure incompletely, the import stops and leaves the previously imported definitions unchanged. Roles are scoped to their target system: roles with the same name in two SAP systems remain separate entitlements.
Validity
SAP manages validity periods of role assignments itself (FROM_DAT, TO_DAT). Nova passes on the start and end date of every assignment, even when it only begins in the future. Without a start date, Nova uses the current date; without an end date, 31 December 9999. If the same role has several periods with a gap in between for one account, Nova writes nothing and reports an error instead of bridging the gap.
Writing and reading back
SAP only accepts role assignments as a complete list (BAPI_USER_ACTGROUPS_ASSIGN). Nova therefore sends the account's complete target role set, with its periods, on every change.
Before the first assignment to an existing account, import the role catalogue and reconcile with the target system as the leading side; otherwise SAP removes the account's roles that Nova does not know. In future, roles that Nova does not manage stay untouched when Nova assigns roles. planned
After the commit, Nova reads the account's roles back and compares names and periods with the target state, taking the single roles of a composite role into account. If anything differs, the change counts as failed and Nova names the roles concerned. Nova records the changes it detects per role in the change journal.
One role for many accounts
A background job of type “Bulk SAP account roles” grants one SAP role to many accounts or revokes it from them, with an optional validity period. Accounts are selected through filters such as identity type or department; without a status filter, Nova selects only active identities, and never AI agents. A run covers at most 500 accounts.
Nova processes the accounts one after another and writes and checks each of them as described above. The job does not revoke roles that a valid business role of the identity requires. Nova collects errors of individual accounts in the result without aborting the run. A cancellation by an administrator takes effect between two accounts.
Reading authorisation data
For the risk check at the object level, Nova reads what the SAP roles of a system authorise. The job “Read SAP authorization values” reads, for all roles of the system that Nova manages as entitlements:
- the maintained authorisation values of the roles – without inactive authorisations, with the role's organisational levels;
- the generated profiles of the roles – to compare them with the role maintenance and for the view “according to the SAP profile”;
- the role menus with their Fiori catalogs and OData services and, from the launchpad cache of the system, which apps each catalog contains.
Nova stores one state per SAP system. The risk register, the identity risk analysis, the simulation and the check of access requests work with it; during a check Nova does not ask the SAP system. Which tables the job reads is listed under Authorisations Nova needs in the SAP system.
Starting and scheduling. “Read now” under “Risk Analysis” → “Policy” → “SAP authorization data” starts the read. Nova creates one job of the type “Read SAP authorization values” per system; its runs are listed under “Monitoring” → “Jobs”. Nova sets up no schedule by itself: after the first successful read the policy offers “Set up nightly read” as long as the system has no schedule; that gives the job a daily schedule at 02:45. One read runs per system at a time; a second start does not wait but ends at once. The policy shows the state per system and warns when it is missing, when the last read failed or was not stored, when it is older than seven days, or when it is to be read again after an update – see Policy.
Complete or not at all. A read replaces the state of a system in one step, so a check never sees half a state.
- If SAP does not deliver a table, or not completely, the run fails and names the table; Nova keeps working with the last state.
- A cancelled run writes nothing. If the cancel arrives only while Nova is writing the state, Nova finishes the write and closes the run as completed; a stored state never counts as cancelled.
- Every call to the SAP system has a time limit of 300 seconds. If SAP does not answer within it, the run fails and names the table.
- If the process of a read ends before the read is done – through a restart, for example –, the read counts as failed once no run of it is alive any more; the policy and everyone who reads risks see this as a warning.
- Plausibility limit. If SAP lacks more than 20 % of the stored roles Nova asks it for – with at least 20 roles stored –, Nova writes nothing; the run ends with a status of its own, which the policy shows as “Read not stored”. This keeps a read against the wrong client from deleting the whole state. Roles Nova no longer manages for the system do not count here: every read removes their values without asking. If the change is intended, administrators repeat the read with an explicit confirmation; the policy offers that in this state with “Store anyway”.
- If a value of a role contains a character Nova cannot store, Nova leaves out this one role and names the role and the table, never the value. Everything else is stored; the run states how many roles were left out. A role left out counts as not read.
- Nova compares role names as the provisioning does: in upper case and without blanks at the edges.
What a read triggers. Nova rewrites only roles whose content changed and re-evaluates their holders – see Analysis on change. A role that no longer exists in the SAP system drops out of the state.
After an update of Nova. If an update changes how Nova evaluates or reads authorisation data, Nova recomputes the risk register once in full shortly after the start – also while “Analyse on change” is switched off. If it changes how Nova reads, the stored state also counts as “to be read again” until the system is read again; until then Nova keeps working with it, and the policy shows this as a warning. An update does not start the read itself.
Role maintenance and profile. Per role Nova notes whether its generated profile matches the role maintenance. Nova marks roles without a profile and roles whose profile differs in the identity risk analysis and on access requests – see Value source.
Fiori content. Which apps a catalog contains is held in the launchpad cache of the SAP system. If more than a fifth of the catalogs the role menus name are missing there – after the cache was emptied, for example –, Nova keeps the menu values read last and notes the read as incomplete; Nova then refuses a take-over from SAP GRC until a complete read has been made. Nova cannot evaluate catalogs from another system, catalogs missing from the cache and OData services without a determinable name, and names them in the identity risk analysis.
Never read for this check are user master records, passwords and fields with the name of the person who made the last change. Logs and run results name tables, counts and times, never values.
Planned planned – the accounts' actual role assignments, directly assigned profiles and the lock and validity status of the accounts from the SAP system, each only for accounts Nova already knows; also reading only the changed roles between two complete runs.
Authorisations Nova needs in the SAP system
The SAP connector calls the following function modules. The SAP Basis team can derive a role for the RFC user from them; the SAP example roles show a template.
| Function module | Purpose |
|---|---|
RFC_PING | connection test |
BAPI_USER_GETLIST | list accounts (import) |
BAPI_USER_GET_DETAIL | read address, lock status and roles |
BAPI_USER_CREATE1 | create accounts |
BAPI_USER_CHANGE | change address data, set passwords |
BAPI_USER_LOCK, BAPI_USER_UNLOCK | lock, unlock |
BAPI_USER_DELETE | delete accounts |
BAPI_USER_ACTGROUPS_ASSIGN | assign roles |
BAPI_TRANSACTION_COMMIT | commit changes |
RFC_READ_TABLE | read tables, see below |
EM_GET_NUMBER_OF_ENTRIES | count the rows of large tables before the job “Read SAP authorization values” or the take-over from SAP GRC reads them |
| Table | Fields read | Purpose |
|---|---|---|
AGR_DEFINE | AGR_NAME, PARENT_AGR | role catalogue |
AGR_FLAGS | AGR_NAME, FLAG_TYPE, FLAG_VALUE | recognise composite roles |
AGR_AGRS | AGR_NAME, CHILD_AGR | single roles of a composite role |
AGR_TEXTS | AGR_NAME, SPRAS, TEXT | role texts |
USR02 | BNAME, TRDAT, LTIME | last logon |
For orientation: SAP usually checks such calls through the authorisation objects S_RFC (function modules), S_USER_GRP (user maintenance), S_USER_AGR (role assignment) and S_TABU_NAM or S_TABU_DIS (reading tables). Which objects and values a system actually checks is decided by the SAP Basis team.
Authorisation data
The job “Read SAP authorization values” (see Reading authorisation data) also reads:
| Table | Fields read | Purpose |
|---|---|---|
AGR_1251 | AGR_NAME, OBJECT, AUTH, FIELD, LOW, HIGH, DELETED | the roles' authorisation values |
AGR_1252, USORG | AGR_NAME, VARBL, LOW, HIGH; VARBL | organisational levels |
AGR_AGRS | also ATTRIBUTES | single roles of a composite role |
AGR_1016, AGR_TIME, AGR_TIMEB | AGR_NAME, COUNTER, PROFILE; AGR_NAME, CREATE_DAT, CREATE_TIM, CHANGE_DAT, CHANGE_TIM | the roles' generated profiles and how current they are |
USR10, UST10C, UST10S, UST12 | PROFN, TYP, MODDA, MODTI; PROFN, SUBPROF; PROFN, OBJCT, AUTH; OBJCT, AUTH, FIELD, VON, BIS | the content of the profiles |
AGR_HIER, AGR_BUFFI, AGR_HIERT | AGR_NAME, OBJECT_ID, REPORT, ATTRIBUTES; AGR_NAME, OBJECT_ID, URL; AGR_NAME, OBJECT_ID, TEXT | role menus: catalogs and OData services |
/UI2/PB_C_PAGE, /UI2/PB_C_PAGEM, /UI2/PB_C_TM, /UI2/PB_C_TMM | ID, OUTDATED; ID, PARENTID, SEM_OBJ, SEM_ACT, REFERENCECHIPID | the catalogs' Fiori apps in the launchpad cache |
USOBHASH, /IWFND/I_MED_SRH | NAME, TYPE, OBJECT, OBJ_NAME; SRV_IDENTIFIER, NAMESPACE, SERVICE_NAME | names of the OData services |
Rule sets from SAP GRC
The take-over from SAP GRC reads, read-only, the rule tables of SAP GRC Access Control and what the system knows of the rule set's values:
| Table | Fields read | Purpose |
|---|---|---|
GRACRULESET, GRACRULESETT | RULESETID; LANGU, DESCN | rule sets and their texts |
GRACSODRISK, GRACSODRISKT, GRACSODRISKRS, GRACSODRISKFUNC | RISKID, RISKTYPE, RISKLEVEL, ACTIVE, BZPRCID; LANG, DESCN; RULESETID; FUNCTID | risks with texts, rule sets and functions |
GRACFUNC, GRACFUNCT, GRACFUNCACT | FUNCTID, SCOPE, BZPRCID; LANGU, DESCN; ACTION, CONNECTOR, ACTIVE | functions and their actions |
GRACFUNCPRM, GRACFUNCPRMEXTN | FUNCTID, ACTION, CONNECTOR, SEQUENCE, RESOURCEID, RESOURCEEXTN, FROMVAL, TOVAL, SEARCHTYPE, ACTIVE, INACTIVE; FUNCTIDEXTN | permission rows and extension groups |
GRACBPROC, GRACBPROCT | BPROC; LANGU, DESCN | business processes |
GRFNCONNGRP, GRFNCONNGRPT, GRFNCGRPCONLK | CONNECTOR_GRP, CONNECTION_TYPE; LANGU, CONNECTOR_GRP_T; CONNECTOR | connector groups and their connectors |
IGRCACTRULERL, IGRCARRULERL | RISKLEVEL, DESCN | texts of the risk levels |
GRACACTRULHDR | RISKID, ACTIVE | number of generated rules per risk, for the note on outdated rules |
GRACCONFIG, GRACCONFIGSET | PARAMID, DEFAULT_VALUE; PARAMID, SEQUENCE, PARAM_VALUE | five settings of SAP GRC's risk analysis |
TOBJ, TSTC | OBJCT, FIEL1 to FIEL0; TCODE | the system's authorisation objects with their fields and its transactions, for repairs and notes |
The take-over also reads the launchpad cache (/UI2/PB_C_*, see above) once more. Nova reads texts in German and English. If the texts of the risk levels or one of the check tables are missing, Nova takes over all the same and says so; if a rule table is missing, the take-over stops and names the table.
Only counted, never read – through EM_GET_NUMBER_OF_ENTRIES – are the tables of extended objects, org and supplementary rules, critical roles and profiles, mitigating control assignments and owners. Nova reads from no table the field with the name of the person who made the last change.