SAP Authorization Trace – Transaction STUSOBTRACE

The SAP authorization trace is a valuable tool for analyzing authorization checks and maintaining authorization default values in SU24. Unlike the shorter-term system trace using transactions STAUTHTRACE and ST01, the authorization trace is a system-wide, long-term trace. The data collected by the trace can be evaluated using transaction STUSOBTRACE. 

In this article, you’ll learn everything about the value of the authorization trace, what preparations you should make before starting it, and how to get the most out of evaluating the trace results. 

What is the SAP Authorization Trace and why do I need it?

The SAP authorization trace is a cross-client, cross-instance, long-term trace in SAP. Its main purpose is to log and evaluate authorization checks and their values. With the associated transaction STUSOBTRACE, you can evaluate the collected data in a structured way. 

Authorization proposals are the linchpin of proper role building. They form the foundation of your authorization concept, whether you’re still on SAP ECC or already on SAP S/4HANA with, for example, SAP Fiori. 

Info: Switching from SAP ECC to SAP S/4HANA 

SAP S/4HANA, introduced in 2015, is the successor to SAP ERP 6.0 (also known as SAP ECC). SAP has announced that customers using SAP ERP 6.0 must migrate to SAP S/4HANA by december of 2027, although individual deadlines may vary depending on their support agreements and circumstances. 

That makes migrating to SAP S/4HANA unavoidable if you want to keep using SAP to support your company’s growth.

Analysis via the authorization trace is possible for all menu objects, such as transactions, RFC function modules, OData services, and more, and using these authorization default values greatly simplifies the effort involved in role maintenance. 

Necessary System Settings for Starting the Authorization Trace

Before you can start maintaining your authorization default values via the authorization trace, you first need to activate the required profile parameter. 

 Figure 1 illustrates how to temporarily change the required profile parameter auth/authorization_trace using transaction RZ11. Setting the parameter to “F” activates the Authorization Trace. 

However, the trace first needs to be restricted to a specific scenario using an appropriate filter in transaction STUSOBTRACE (for example, execution by user X or by authorization object) before data is collected. There are also the options “Y” (activate trace) and “N” (deactivate trace). 

SAP screen displaying metadata for the profile parameter auth/authorization_trace, including type, parameter group, and value hierarchy Caption: Displaying the metadata and value hierarchy for the profile parameter
Figure 1 – Setting the profile parameter auth/authorization_trace

 

Note that when the authorization trace is activated with a filter, only up to 5 users or authorization objects can be filtered. We recommend running this trace with a filter to prevent potential performance issues. It also shouldn’t run continuously, but only during predefined test periods. 

The Authorization Trace at a Glance

The data collected by the long-term trace is stored in the database table USOB_AUTHVALTRC. Since this is a database table rather than a system file, the data is not overwritten using a ring-buffer mechanism. 

It’s worth noting that, per authorization check, the trace collects data for one application at a time. In other words, this doesn’t produce a user-specific evaluation; instead, the focus is on the application itself. That makes sense here, since you’re using this tool to maintain your authorization default values and check indicators, not authorization data for roles and end users (more on that in the article on the SAP user trace via STUSERTRACE). 

Displaying the SAP Authorization Trace

The way authorization trace results are displayed is similar to the system trace. Here, too, you can: 

  • delete specific records 
  • jump to the source code 
  • jump to CDS access control, or 
  • further process or save the data using the upload and download functions (Figure 2) 
SAP authorization trace table USOB_AUTHVALTRC showing eight hits with transaction types, application names, and authorization objects
Figure 2 – Result display of the authorization trace

Unlike the system trace,  this trace doesn’t include return codes. The simple reason is that this information isn’t needed, since you’re maintaining the data in transaction SU24 per application. 

Note: 

Not all the values listed here need to be maintained, since not every authorization check is inherently meaningful or necessary for successfully calling a transaction. You don’t necessarily need to maintain this so-called “background noise” within transaction SU24. This can save you valuable time.

Maintaining Authorization Default Values via Transaction STUSOBTRACE – Practical Example in 4 Steps

To show you how to use the authorization trace via transaction STUSOBTRACE and what it can do, we’ll walk you through a common use case. 

Starting Situation

 Xiting’s internal security officer needs to maintain or update the list of forbidden passwords for the SAP system. For security reasons, they should not have full access to all SAP tables through transactions SE16 or SM30. Instead, their access should be limited to table USR40, with authorization to display and maintain only that specific table. 

Therefore it´s up to the system or authorization administrators to create a new function in the form of a suitable parameter transaction, and then maintain the necessary authorization values in transaction SU24 for this new transaction code.  

The administrator uses the authorization trace for this as follows: 

1. Starting the SAP Authorization Trace

First, the administrator (XITING) activates the profile parameter auth/authorization_trace with the value “F” on the target system, so the authorization trace is switched on with a filter. They then set the filter in transaction STUSOBTRACE for the test user (X_FI) and set the application type to “transaction” (Figure 3).

SAP evaluate authorization trace screen showing an active trace filtered by application type transaction and user X_FI
Figure 3 – Person-specific authorization trace for transactions

This means the authorization trace only collects the relevant application data for transactions run by user X_FI. 

2. Running the SAP Authorization Trace with a Test User

Using the test user, they now run the new parameter transaction ZSM30_PASSWORDS. This takes the user directly via transaction SM30 into table USR40, without being able to access the initial maintenance screen of transaction SM30 in any way. They can now maintain a few test entries to simulate everyday work as closely as possible and then end the test activity. 

Info: SAP Authorization Trace on Production Systems 

A sensible approach for maintaining authorization default values is also to switch on the authorization trace in the production system (PRD) and let it collect the  business-relevant data for specific applications, especially custom developments. You can then evaluate that data and maintain it sensibly for specific applications based on everyday business use. 

3. Evaluating the SAP Authorization Trace

The administrator then starts transaction STUSOBTRACE again to evaluate the test. As shown in Figure 4, they restrict the trace to the transaction code ZSM30_PASSWORDS.

SAP restrictions for evaluation screen with transaction code ZSM30_PASSWORDS and a maximum of 500 hits configured
Figure 4 – Application-specific authorization trace evaluation

Using the “Evaluate” button, they then reach the results screen. The result is clear (Figure 5). 

SAP authorization trace table USOB_AUTHVALTRC showing two hits for transaction ZSM30_PASSWORDS with authorization objects S_TABU_CLI and S_TABU_NAM
Figure 5 – Results list for transaction ZSM30_PASSWORDS

Transaction ZSM30_PASSWORDS accesses a client-independent table, so the authorization object S_TABU_CLI with the field value “X” for the authorization field CLIIDMAINT is also required. In addition, the authorization object S_TABU_NAM (table access via generic standard tools) is needed with the authorization field values 02 (change) for ACTVT and USR40 for TABLE, in order to open the table at all or change data in it. 

It’s also possible not only to evaluate the missing authorization proposals directly via transaction STUSOBTRACE, but also to maintain them through the integrated trace function in transaction SU24. There, you can adopt the appropriate authorizations directly into transaction SU24 for the respective application (or, technically speaking, into tables USOBT_C and USOBX_C) with a click. 

However, you first need to make sure the required authorization objects are stored (Figure 6). 

SAP SU24 maintenance screen for ZSM30_PASSWORDS showing the option to add an authorization object from the local authorization trace
Figure 6 – Maintaining authorization objects via trace in transaction SU24

4. Applying the Findings from the Authorization Trace

Once that’s done, you can then maintain the authorization field values using the second integrated trace function, the “Trace” button (Figure 7). 

SAP S4T(1)/100 screen evaluating trace data for the authorization object S_TABU_NAM linked to transaction ZSM30_PASSWORDS
Figure 7 – Maintaining authorization field values using authorization trace data

Important! 

Be sure to click through the individual authorization objects in the upper selection area of Figure 7 and adopt the required authorization values per object for the respective application there. The proposal status “Y” (proposal with field values) should be selected in most cases. 

You don’t need to maintain the authorization object S_TCODE, since the SAP system automatically transfers this object into the role authorization profile, if you build roles properly via the role menu. You do not need to maintain authorization object S_TCODE, as the SAP system automatically transfers it to the role’s authorization profile when roles are properly built using the role menu.

SAP SU24 maintenance screen listing three authorization objects and their default values for transaction ZSM30_PASSWORDS
Figure 8 – SU24 maintenance for transaction ZSM30_PASSWORDS

Once you’ve maintained the required authorization proposals, you can use them by adding the transaction to the role menu (via the Profile Generator). To do this, you need to have maintained any open authorization fields in the role’s authorization profile and generated the new profile. 

Getting clean Authorization Trace Data and evaluating it easily with XAMS

In addition to SAP’s standard analysis tools, the Xiting Authorizations Management Suite (XAMS) offers far more functionality for evaluating authorization trace data in a targeted, clear way. For example, you can use our ‘Xiting SU24 Checkman,’ which shows you a wide variety of authorization default values in bulk and in a clear format, and lets you maintain any missing data directly from the results list with a click. 

The functions in SU24 just described can be carried out more conveniently and efficiently using the SU24 Checkman: 

Xiting Role Builder reporting screen filtering missing SU24 proposals for transaction code ZSM30_PASSWORDS using kernel data
Figure 9 – Xiting Role Builder in XAMS

Double-clicking the blue update arrow automatically stores the authorization default values from STUSOBTRACE in SU24: 

Figure 10 – Xiting SU24 Checkman

Our XAMS also offers an integrated allow-/denylist that flags the validation of background noise and critical authorizations, reliably alerting you to potential risks. 

Conclusion on the SAP Authorization Trace via Transaction STUSOBTRACE

With transaction STUSOBTRACE, you can quickly and easily update the authorization data for your custom developments, provided they include security-compliant AUTHORITY-CHECK statements in the source code. 

The authorization trace via transaction STUSOBTRACE significantly reduces the maintenance effort for your roles. Even SAP itself uses the authorization trace to maintain the necessary authorization data for applications in transaction SU24. 

Finally, it’s important to note that this tool should still be used with caution, since critical authorization objects are often checked that you may not actually need, so you should not simply adopt everything from the trace. 

Xiting’s XAMS software solution offers countless other innovative features for your everyday authorization work. We also have a broad portfolio of services and products to support you in maintaining your authorization landscape. 

>> Sign up today for a free, no-obligation initial consultation or Demo with our SAP security experts and find out how pleasant we can make managing your SAP landscape.

FAQ

What is the Difference between the Transactions STAUTHTRACE and STUSOBTRACE?

The main difference between transactions STAUTHTRACE and STUSOBTRACE lies in their duration and purpose: 

  • STAUTHTRACE is a short-term trace for detailed, temporary error analysis of authorization checks, and its logs are overwritten. 
  • STUSOBTRACE, on the other hand, is a long-term trace that stores data for maintaining authorization default values (SU24) in a database table. The focus is on collecting successfully checked authorizations, not on error analysis. 

STUSOBTRACE is user-independent and collects authorization data in the application context, primarily to maintain default values (SU24). STUSERTRACE is a specific user trace that specifically records the activities of individual users in order to validate their authorizations. It’s essentially a STUSOBTRACE filtered down to specific users. Both transactions are long-term traces. 

Melden Sie sich jetzt an!

Get in touch now!

Nehmen Sie jetzt Kontakt auf!