You are on page 1of 6

Column | Security Strategies

This article appeared in the Jan Feb Mar 2017 issue


of SAPinsider (www.SAPinsiderOnline.com) and appears
here with permission from the publisher, WIS Publishing.

Jrgen Adolf
(juergen.adolf@sap.com)
has been working in the
Secure Your ABAP
security space since
2003. Since 2013, he
has been a Product
Code Against Attack
Manager for Security
at SAP SE. His focuses Whats New with the 7.51 Release of SAP NetWeaver
include identity manage-
ment, access logging,
Application Server, Add-On for Code Vulnerability Analysis
source code security,
Modern business landscapes are increasingly large, heterogeneous, and complex. This trend
RFC security, and
SAP Enterprise Threat has made securing enterprise software a challenging endeavor. Adding to this challenge is
Detection. the need to quickly adjust to rapidly changing business requirements. To meet new needs as
they arise, many organizations use custom code to extend the functionality of their business
software, such as SAP Business Suite, which increases the amount, and complexity, of the
code that needs to be tested and secured.
The stakes are high SAP systems hold valuable data, and insecure software is a common
cause of cyberattacks, which can have dire consequences, including negative publicity, penal-
ties, and lost revenue. Unfortunately, many organizations become aware of vulnerabilities
only after a breach has occurred. Securing custom code after the fact is extremely expensive
according to studies, it costs 30 times more to fix security issues after a breach than to
build security into your code at the beginning of the design process.1
To prevent cyberattacks and avoid costly remediation, organizations must adopt reliable
methods for testing new or altered code during development, before a breach occurs. To
help with this task, SAP provides customers with a powerful, integrated tool as part of SAP
NetWeaver Application Server (SAP NetWeaver AS) ABAP that scans ABAP source code for
vulnerabilities: SAP NetWeaver AS, add-on for code vulnerability analysis.
This article looks at how SAP NetWeaver AS, add-on for code vulnerability analysis lever-
ages integration into the ABAP development infrastructure to make it easy to scan, analyze,
and secure your ABAP source code, and then examines the latest enhancements delivered
with SAP NetWeaver AS ABAP 7.51 including remote code analysis and baseline function-
ality to help you minimize risks and errors and ensure overall quality in productive system
landscapes. You will also get a sneak peek at some upcoming features for addressing evolving
threats to your code.

An Integrated Approach to Securing Custom Code


SAP NetWeaver AS, add-on for code vulnerability analysis analyzes user input and data flow
in source code to find vulnerabilities that can cause issues down the road, and provides guid-
ance on how to address identified issues. Originally created by the SAP development team for
internal testing, the tool was released to SAP customers in September 2013 (see the sidebar
Software Testing at SAP on the next page for more on how SAP secures its application

Alan Pearson, Why Its Important To Squash Vulnerabilities Early In The Software Development Lifecycle,
1

TheSecurity Innovation Europe Blog, March 6, 2014, http://bit.ly/2fVblmo.

Subscribe today. Visit SAPinsiderOnline.com.


source code). SAP NetWeaver AS, add-on for code ABAP Test Cockpits streamlined quality assur-
vulnerability analysis is a separately licensed tool ance processes and tight integration with ABAP
that is available for use with SAP NetWeaver AS development tools. This tight integration enables
ABAP.2 developers to easily launch code checks includ-
SAP NetWeaver AS, add-on for code vulnerability ing the security checks provided by SAP NetWeaver
analysis is seamlessly integrated into the ABAP Test AS, add-on for code vulnerability analysis from
Cockpit, which is a central, extensible infrastructure tools such as the ABAP Workbench (transaction
for performing functional, performance, and secu- SE80), the ABAP Editor (transaction SE38), and
rity code checks on ABAP development objects. the Eclipse-based ABAP development tools for SAP
Based on the Code Inspector, and integrated into NetWeaver (ABAP in Eclipse).
the ABAP development environment, the ABAP SAP NetWeaver AS, add-on for code vulnerabil-
Test Cockpit comprises a set of check variants that ity analysis provides a range of features for secur-
run smoothly alongside one another (see Figure 1). ing source code. Developers can launch checks for
SAP NetWeaver AS, add-on for code vulnerabil- single objects or groups of objects. Quality assurance
ity analysis is used via the ABAP Test Cockpit and teams can schedule automated test runs, enable
has access to all ABAP Test Cockpit features, such as automatic test failure notifications, and aggregate
new features included in SAP NetWeaver AS ABAP test results for analysis. Developers can also adjust
7.51. It allows developers to take advantage of the the priority of each check to meet test run or risk
policy requirements, or to follow a phased approach
2
The tool is available for use with the following releases: SAP to enabling checks, which can help increase accep-
NetWeaver AS ABAP 7.0, enhancement package 2, support
package 14; SAP NetWeaver AS ABAP 7.0, enhancement tance and use of the checks. Once an issue is found,
package 3, support package 09; SAP NetWeaver AS ABAP developers can navigate directly to documentation
7.3, enhancement package 1, support package 09; SAP
NetWeaver AS ABAP 7.4, support package 05 and later;
that explains how to fix it and avoid it in the future
and SAP NetWeaver AS ABAP 7.51. (see Figure 2), or to workflow functionality to

Software Testing at SAP


To ensure that ABAP-based SAP applications and code are static testing tools included in the ABAP development environ-
delivered to customers free of vulnerabilities, SAP standard ment to ensure secure code. These tools test the source code
software is developed using standard software testing pro- line by line to expose weaknesses in the software before it is
cedures and various SAP tools that are also available to SAP deployed. By detecting flaws in the code early in the process,
customers. weaknesses can be fixed before hackers detect them and they
become true vulnerabilities for an organization.
One procedure used at SAP is to perform dynamic applica-
tion testing (DAST), an outside-in approach in which you look These static testing tools, which are available to SAP customers
at the installed application to identify potential vulnerabilities as part of SAP NetWeaver Application Server (SAP NetWeaver
and then ensure the code is secure using various agile test- AS) ABAP, are offered via a testing framework called the
ing methods, such as exploratory testing. DAST tools analyze ABAP Test Cockpit. In the ABAP Test Cockpit, developers can
applications in real time while the application is running. This execute static checks and unit tests for their development
testing technique is typically performed as a gateway accep- objects using SAP tools such as the Code Inspector for check-
tance layer in the run-up to production deployment. SAPs ing repository objects, the Extended Program Check (trans-
development team primarily uses WebInspect Enterprise by action SLIN) for running in-depth syntax checks, checks for
ensuring a successful SAP HANA or SAP S/4HANA migration,*
HPE to perform dynamic scans during application development.
and SAP NetWeaver AS, add-on for code vulnerability analysis
Another approach is to perform static application security test- for scanning source code for vulnerabilities.
ing (SAST), an inside-out approach in which you examine the * For more on the checks used for SAP HANA and SAP S/4HANA migrations,
source code for security issues during development and then see the article Making the Move to SAP S/4HANA by Karl Kessler on page
use agile testing methods, such as pair programming, and 66 of this issue of SAPinsider.

Subscribe today. Visit SAPinsiderOnline.com.


ABAP Test Cockpit

Syntax checks These checks are used to ensure correct syntax of ABAP code
they verify that the syntax used follows the rules that define correctly
written ABAP code.

Standard Code Inspector checks These checks evaluate static ABAP coding and Data Dictionary
objects essentially all objects of the Object Repository for
functional correctness, performance, security, reliability, and
statistical information.

ABAP unit tests These tests are used for test-driven development. They verify the
intended program behavior.

Security checks (SAP NetWeaver These checks perform data-flow analysis to find security flaws in the
Application Server, add-on for evaluated ABAP code.
code vulnerability analysis)

Extended Program Check Transaction SLIN performs a complete check that includes the
(transaction SLIN) interfaces of external procedures called from the program for
example, checking whether the number and type of the interface
parameters in an external procedure call is correct. SLIN also
contains static security tests.

SAP HANA checks These checks, which are included in the Code Inspector check
variant FUNCTIONAL_DB, ensure a smooth migration of ABAP code
to SAP HANA and SAP S/4HANA.

Customer-specific checks The extensibility of the ABAP Test Cockpit allows the development of
custom checks for customer-specific needs.

Figure 1 The ABAP Test Cockpit comprises a set of testing tools including SAP NetWeaver AS, add-on for code
vulnerability analysis for performing checks on ABAP development objects

Figure 2 Once SAP NetWeaver AS, add-on for code vulnerability analysis identifies an issue, developers can navigate
directly to recommendations for how to address it

Subscribe today. Visit SAPinsiderOnline.com.


create an exemption. The tools sophisticated data SAP NetWeaver AS system in your landscape that
flow analysis, performed at the compilation unit is running SAP_BASIS 700 or higher there is no
level, combined with the exemption feature ensures need to upgrade every single system to 7.51 to take
minimal false positives. advantage of the latest security checks. In addition to
A previous SAPinsider article provided a detailed reducing administrative overhead and saving time,
introduction to SAP NetWeaver AS, add-on for code this capability provides access to the features cus-
vulnerability analysis and how it works3 here, we tomers with older systems need to ensure the quality
explore some of the new features delivered with of their custom code and comply with increasingly
SAP NetWeaver AS ABAP 7.51 that enhance the complex corporate security requirements.
capabilities of this tool. So how exactly does a remote check scenario
work? Administrators simply deploy a remote
Whats New with 7.51? stub to each system to be checked (see SAP Note
SAP NetWeaver AS ABAP 7.51 delivers several new 2270689), which the central check system accesses
features for testing ABAP source code with the via a remote function call (RFC) connection (see
ABAP Test Cockpit, two of which are particularly Figure 3). These remote stubs return a model
useful when performing security checks with SAP of the custom code to the central check system,
NetWeaver AS, add-on for code vulnerability analy- where it is then analyzed using the checks pro-
sis the ability to perform remote code analysis vided for potential security vulnerabilities. The
and to define baselines for test runs. Lets take a check variant used to perform the checks, which
closer look at how these features can help you are RFC-enabled, is maintained by administrators
secure your code. in the central check system.4
In addition to providing a means to apply the
Remote Code Analysis latest checks to older systems, a remote code
Remote code analysis is a key new feature deliv- analysis scenario offers several other advantages. It
ered with SAP NetWeaver AS ABAP 7.51 for the enables a centralized approach to checking multi-
ABAP Test Cockpit. This functionality enables ple SAP systems and applying one quality standard
you to use the latest checks available in 7.51, across the entire system landscape, regardless of the
including the security checks of SAP NetWeaver release used in local development systems. It is also
AS, add-onfor code vulnerability analysis, to a low-effort, low-impact installation that will not
analyze custom-developed code in older SAP affect existing business processes.
NetWeaver systems a critical capability in the The remote code analysis functionality included
face of increasingly sophisticated and frequent with 7.51 is a valuable tool for quality assurance
cyberattacks. Prior to 7.51, code checks had to be teams working in the central check system going
performed locally on the system containing the forward, SAPs development team is working on
code, meaning that each and every system had to making this functionality available to developers
be upgraded to the latest SAP release or support working in remote systems as well. This capabil-
package level in order to use the latest checks and ity will enable developers to execute checks, view
functionalities for testing. This led to significant and correct findings, request exemptions, and check
administrative overhead. transports before release, all in the local develop-
With the new remote code analysis feature ment system.
delivered with 7.51, you need only set up one SAP
NetWeaver AS ABAP system, running SAP_BASIS Baseline Functionality
751 only, in your SAP system landscape to serve as a Another new feature delivered with 7.51 that adds
central check system. From this central system, you valuable functionality when using SAP NetWeaver
can run checks via the ABAP Test Cockpit on any AS, add-on for code vulnerability analysis is the abil-
ity to configure a baseline for static code analysis. This
For an introduction to SAP NetWeaver AS, add-on for
3 feature enables customers that have legacy debts in
code vulnerability analysis, see the article Start Your ABAP
Applications on Solid Ground by Patrick Hildenbrand 4
Additional details on configuring remote security checks with
in the October-December 2013 issue of SAPinsider ABAP 7.51 are available from the SAP Help Portal site at
(SAPinsiderOnline.com). http://bit.ly/RemoteChecks.

Subscribe today. Visit SAPinsiderOnline.com.


Central Check System (SAP_BASIS 751)

ABAP Test Cockpit

RFC RFC RFC

Remote Stub Remote Stub Remote Stub

Checked Checked Checked


System A System B System C
(700) (700) (700)

Customer Code Customer Code Customer Code

Figure 3 Remote code analysis is performed from a central check system via an RFC connection

their existing code to ignore these expected findings baseline; Figure 5 on the next page shows the check
and instead focus their test runs on new or recently results list with the baseline selections reflected
changed code. This enables customers to start their in this case, added to the baseline with the findings
testing with clean code and create a separate project exempted.5
to work on the findings from their legacy coding. It The baseline is effective as long as the related
also allows for the development of new functional- code sections remain unchanged. If the code does
ities without an overload of code corrections. change, you will need to correct the coding and the
The baseline functionality enables the ABAP check will automatically become active again for
Test Cockpit to isolate errors found during the exe- the modified code section. You also have the option
cution of a check variant and exclude them from of adding or removing individual findings from the
subsequent test run results by adding them to the baseline as your needs change (if the immediate
baseline, where they are treated as a special kind removal of all SQL injection flaws becomes a high
of exemption. This approach helps developers priority, for instance) or even deleting the baseline
improve the efficiency of their testing processes entirely and resetting the test system to its origi-
by isolating the code that is most in need of atten- nal state (if the overall security testing concept is
tion, which is particularly useful when you need to renewed, for example).
secure business-critical applications against poten-
tial cyberattacks. Looking Ahead: New Security Checks
The baseline feature is accessed via the ABAP Regardless of how robust your security tools are, pro-
Test Cockpit administration tool (transaction ATC), tecting against cyberattacks is a moving target that
which displays a list of results of executed checks. To requires new ways of securing your code, and SAP
add a check result to the baseline, you simply select continues to add new features to support you in this
it from the list of results and then specify the han- task. Support package 1 for SAP NetWeaver AS 7.51,
dling for those results during subsequent test runs. due for release in January 2017, includes a variety of
You can choose to suppress the findings (exclude new security checks for use with SAP NetWeaver AS,
all findings from the check results list); exempt the add-on for code vulnerability analysis.
findings (include the findings in the check results Here is a look at a few of the planned features
list, marked as exempted); or assign a low priority to that will help keep your code safe from evolving
the findings (the findings will appear lower in the threats:
check results list).
5
Additional details on the baseline functionality delivered with
Figure 4 on the next page shows the handling ABAP 7.51 are available from the SAP Help Portal site at
options for a check result being added to the http://bit.ly/BaselineFeature.

Subscribe today. Visit SAPinsiderOnline.com.


Figure 4 Select a check result to add to the baseline and specify its handling

Figure 5 Rerunning the check shows the results of the baseline selections

Potential abuse of URL redirect: Vulnerabilities Call of a procedure with a hard-coded pass-
are introduced wherever external data (such as word: This checks if a method or function is
user input) is used as a source for URL redirects. called with a hard-coded password, which can
This check evaluates the potential for attackers to compromise system security anyone who can
direct victims to other websites. access the source code has access to the hard-
coded password.
Missing content check during HTTP
upload: This checks if the method IF_HTTP_ These are just some of the security checks
REQUEST~GET_DATA( ) is called without the planned for future release. SAP is continuously
parameter VSCAN_SCAN_ALWAYS, which can monitoring the security landscape and working to
lead to cross-site-scripting (XSS) attacks via file ensure that customers have the tools they need to
upload (MIME sniffing). More detail is available ensure the security of their software.
in the SAP NetWeaver Security Guide and in SAP
Note 1714836. Summary
While technology that provides a competitive edge
Potential infiltration of harmful SQL state-
is a business imperative, vulnerable software is a
ments or conditions when calling a specific
prime entry point for compromising an enterprise.
method: Security problems can occur when
With SAP NetWeaver AS, add-on for code vulnera-
external data, such as user input, is processed
bility analysis, and the powerful new features for the
unchecked. This check evaluates whether input
ABAP Test Cockpit delivered with SAP NetWeaver
validation is performed before data is processed.
AS ABAP 7.51, you can continue to develop innova-
SAP Note 1852318 provides further information
tive and effective software without worrying about
about how to protect against SQL injections.
introducing security risks to your organization.
Read access to sensitive database tables: This Learn more about how to ensure secure ABAP
checks if there is read access to database tables code in your SAP business systems with SAP
that are declared as sensitive. NetWeaver AS, add-on for code vulnerability analysis
Write access to sensitive database tables: This at https://wiki.scn.sap.com/wiki/display/Security/
checks if there is write access to database tables SAP+NetWeaver+Application+Server%2C+Add-
that are declared as sensitive. On+for+Code+Vulnerability+Analysis.

Subscribe today. Visit SAPinsiderOnline.com.

You might also like