API Security Checklist
API Security Checklist
co
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
API Security
Testing
Noname Security Special Edition
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
API Security Testing For Dummies®,
Noname Security Special Edition
Published by
John Wiley & Sons, Inc.
111 River St.
Hoboken, NJ 07030-5774
www.wiley.com
Copyright © 2023 by John Wiley & Sons, Inc., Hoboken, New Jersey
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any
form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise,
except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without
the prior written permission of the Publisher. Requests to the Publisher for permission should be
addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ
07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions.
Trademarks: Wiley, For Dummies, the Dummies Man logo, The Dummies Way, Dummies.com,
Making Everything Easier, and related trade dress are trademarks or registered trademarks of John
Wiley & Sons, Inc. and/or its affiliates in the United States and other countries, and may not be
used without written permission. All other trademarks are the property of their respective owners.
John Wiley & Sons, Inc., is not associated with any product or vendor mentioned in this book.
For general information on our other products and services, or how to create a custom For
Dummies book for your business or organization, please contact our Business Development
Department in the U.S. at 877-409-4177, contact [email protected], or visit www.wiley.com/go/
custompub. For information about licensing the For Dummies brand for products or services,
contact BrandedRights&[email protected].
Publisher’s Acknowledgments
Some of the people who helped bring this book to market include the
following:
Project Editor: Elizabeth Kuball Senior Client Account Manager:
Acquisitions Editor: Ashley Coffey Matt Cox
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Table of Contents
INTRODUCTION................................................................................................ 1
About This Book.................................................................................... 1
Foolish Assumptions............................................................................. 2
Icons Used in This Book........................................................................ 2
Beyond the Book................................................................................... 3
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Introduction
D
igital transformation initiatives have forced application
developers to move at an accelerated pace to meet enter-
prise goals and maintain market competitiveness. However,
this “death march” frequently leads to DevOps teams cutting cor-
ners to execute plans and meet deadlines. Oftentimes, code qual-
ity suffers and security vulnerabilities are exposed.
Introduction 1
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Each chapter is written to stand on its own, so if you see a topic
that piques your interest, feel free to jump ahead to that chapter.
You can read this book in any order that suits you.
Foolish Assumptions
It has been said that most assumptions have outlived their use-
lessness, but I assume a few things nonetheless!
This icon explains the jargon beneath the jargon and is the stuff
legends — well, legendary nerds — are made of.
Tips are appreciated but never expected, and I sure hope you’ll
appreciate these useful nuggets of information.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
These alerts point out the stuff your mother warned you about.
Well, probably not, but they do offer practical advice.
Introduction 3
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
IN THIS CHAPTER
»» Defining application programming
interfaces (APIs)
Chapter 1
Understanding
Application
Programming
Interfaces
T
his chapter starts with the basics: what APIs are, what they
do, and how they enable our digital world in both the pri
vate and public sectors.
What Is an API?
Application programming interfaces, or APIs, help make appli
cations and digital services easier to consume. APIs also make
it easier for developers to build, enhance, and maintain appli
cations. How exactly? In a nutshell, APIs are software interfaces
that dictate how software components interact with each other
and define how data is shared and modified.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
APIs can be written in practically any programming language
(such as Java, Go, or C#), and many API standards exist that use
Extensible Markup Language (XML), JavaScript Object Notation
(JSON), and so on as a data protocol, making it possible to seam
lessly transmit data between disparate systems (see Figure 1-1).
Source: Altexsoft
Some APIs even give software the ability to interact with physical
devices using specialized protocols.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
FIGURE 1-2: APIs allow applications to communicate with other applications
and services.
There are different types of APIs, some of which are used for com
munication between microservices. These types include Simple
Object Access Protocol (SOAP), Representational State Transfer
(REST), and Graph Query Language (GQL) APIs. Some APIs are
intended to manipulate data, such as create, read, update, delete
(CRUD) APIs.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
FIGURE 1-3: APIs and microservices.
The impact of APIs can be seen across all areas of the public sec
tor, including education, transportation, healthcare, social ser
vices, and law enforcement. APIs enable government agencies to
seamlessly share data across federal, state, and local levels. APIs
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
are also essential for ushering in advanced capabilities and new
functionality for citizens, veterans, and government personnel.
CUSTOMER SUCCESS
STORY: RAPYD
Rapyd is the fastest way to power local payments anywhere in the
world, enabling companies across the globe to access markets
quicker than ever before. By utilizing Rapyd’s unparalleled payments
network and Fintech as a Service (FaaS) platform, businesses and con-
sumers can engage in local and cross-border transactions in any mar-
ket. The Rapyd platform is unifying fragmented payment systems
worldwide by bringing together 900-plus payment methods in more
than 100 countries.
Challenges
Rapyd’s main product is its public payments API, which handles bil-
lions of dollars of transactions 24/7. Even minor instances of
(continued)
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
(continued)
Solution
Unlike other vendors and the “API security” features of their current
infrastructure, only Noname Security provided the combination of
comprehensive visibility from code to production, discoverability,
automation, integrations, and intelligent behavior-based anomaly
detection that Rapyd needed.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
After evaluating each vendor’s holistic combination of product and
team capabilities, Noname Security emerged as the clear leader. The
CISO’s team quickly deployed the Noname API Security Platform —
with posture management, runtime protection, and Active Testing in
one unified solution — across all its AWS regions globally.
Results
With the Noname API Security Platform, Rapyd can protect its APIs
and critical assets from cyberattacks with:
Rapyd can now confidently grow its global business both quickly and
securely, as real data from blocked attacks and production vulnerabili-
ties inform its development efforts and new code can be easily tested
before going live. Rapyd will also have full architectural freedom to
deploy Noname as fully cloud-based, fully on-premises, or any hybrid
combination as needed as it continues to expand into new markets
and regulatory environments.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
IN THIS CHAPTER
»» Surveying the burgeoning application
programming interface (API) attack
surface
Chapter 2
Exploring API Risks and
Vulnerabilities
T
his chapter explores the rapidly growing application pro-
gramming interface (API) attack surface, the top threats to
APIs, and other vulnerabilities that need to be addressed in
a robust API security program.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
According to The API Security Disconnect – API Security Trends in
2022, 76 percent of respondents suffered an API security incident
in the last 12 months.
»» Exploitability
»» Weakness prevalence
»» Weakness detectability
»» Technical impact
Each factor is given a score, with three being the most severe (see
Figure 2-1). A vulnerability that is easy to exploit, widespread,
and easily detectable with severe technical impact is the most
urgent to address. These dimensions allow API security risks to be
force-ranked in terms of severity.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
value that describes an object), resulting in a wide attack
surface in access level control. As a result, attackers may be
able to read, update, delete, or create data objects without
permission by exploiting broken object-level authorization
vulnerabilities. Thus, an attacker may be able to forge a ticket
that grants them unauthorized permissions, analogous to
forging a permission slip to go on a field trip in school.
Individual authorization checks are necessary for every
function that interacts with a data source.
Authentication verifies who you are (your identity).
Authorization verifies what you’re allowed to do (your
permissions).
»» Broken user authentication: Authentication is the process
of verifying that an individual, entity, or website is who it
claims to be. As part of the authentication process of web
applications, a user is usually required to submit a username
(or ID) and one or more items of private information that are
known only to the user. Authentication is more complex to
implement for APIs because multifactor authentication
(MFA) and other human-driven authentication options
aren’t possible. Also, authentication mechanisms are often
implemented incorrectly, allowing attackers to compromise
authentication tokens or to exploit implementation flaws to
take over other users’ identities temporarily or even perma-
nently. Thus, an attacker can impersonate an authorized user
or object to gain access to an API. Compromising the ability
to identify the user compromises overall API security.
»» Excessive data exposure: Sometimes, in an effort to be
able to do a lot, APIs say too much. To promote utility,
developers tend to expose all object properties without
considering their individual sensitivity, depending on clients
to filter the data before showing it to the user.
»» Lack of resource and rate limiting: In many cases, APIs do
not restrict the size or number of resources that can be
requested by the client in a session or a certain period of
time (that is, rate limiting). This means users can make huge
requests, either inadvertently or maliciously. This can not
only negatively impact API server performance, leading to
denial of service (DoS) attacks, but also leave the door open
to authentication flaws such as brute-force attacks.
»» Broken function-level authorization: Authorization flaws
tend to occur in complex access control policies with
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
hierarchies, roles, and groups, and an unclear distinction
between administrative and regular functions. An attacker
can gain access to other users’ resources or admin functions
by exploiting these weaknesses.
»» Mass assignment (also known as autobinding and object
injection): Various software frameworks allow developers to
automatically bind Hypertext Transfer Protocol (HTTP)
request parameters to objects or variables for ease of use.
However, this creates an opportunity for attackers, who
might modify object properties by guessing objects’ proper-
ties, exploring API endpoints, reading documentation, or
including additional object properties in request payloads.
Client-provided data (for example, JavaScript Object
Notation, or JSON) bound to data models without proper
properties filtering based on an allow list usually results in
mass assignment.
»» Security misconfiguration: Security misconfiguration is just
that — a misconfiguration in the security parameters of the
API, often found in relation to open cloud storage, insecure
default configurations, incomplete or ad-hoc configurations,
misconfigured HTTP headers, unnecessary HTTP methods,
permissive cross-origin resource sharing (CORS), and/or
verbose error messages containing sensitive information.
»» Injection: If data and code aren’t carefully separated,
problems arise. When untrusted data is sent to an interpreter
as part of a query or command, injection flaws — such as
Structured Query Language (SQL) and NoSQL — command
injection can occur. An attacker can manipulate malicious
data to trick the interpreter into performing unintended
commands or accessing information without authorization.
»» Improper assets management: Good API inventory and
documentation are essential because APIs expose more
endpoints than traditional web applications do.
»» Insufficient logging and monitoring: Most APIs weren’t
inherently designed to be good at reporting into top-level
security tools. When insufficient logging and monitoring is
coupled with ineffective integration to incident response,
hackers can further attack systems, maintain persistence,
and pivot to other systems to extract, tamper with, or
destroy data. It often takes more than 200 days for a breach
to be detected, and most breaches are detected by external
parties rather than by internal processes or monitoring.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Download the Mitigating OWASP Top 10 API Security Threats
e-book at https://nonamesecurity.com to learn more about the
OWASP Top 10 and how to remediate these vulnerabilities.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
versions of standard APIs are vulnerable to specific attack
vectors, and hackers will probe them to see whether those
exploits are live before launching their attacks. In addition,
bad actors are looking to exploit deployment and configura-
tion mistakes made by organizations and take advantage of
their misfortune when the opportunity strikes.
»» API discovery: API discovery tools help you locate every API
in your environment, including legacy and shadow APIs.
Based on that inventory, determine which APIs are critical to
the business.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
IN THIS CHAPTER
»» Analyzing source code with static
application security testing
Chapter 3
Recognizing the
Limitations of Existing
Tools and Approaches
T
his chapter explores existing application security testing
tools and approaches and explains why these tools aren’t
sufficient for application programming interface (API)
security testing.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
In white-box testing, the tester knows the internal structure,
design, and implementation of the component being tested.
SAST tools can analyze an entire code base much more rapidly
than humans can. It takes only minutes for SAST tools to scan
millions of lines of code to identify critical vulnerabilities. Ulti-
mately, these tools help organizations achieve key goals, such as
the following:
Because it can take place without code being executed and doesn’t
require a working application, SAST takes place very early in the
software development life cycle (SDLC). This helps developers
quickly resolve issues and identify vulnerabilities in the pro
ject’s initial stages without passing vulnerabilities on to the final
application.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Dynamic Application Security Testing
Dynamic application security testing (DAST) is an advanced testing
method for an application in an operating state. The process focuses
on testing the production environment and analyzing application
security at runtime. It tests how systems and components interact
in practice and identifies real-world vulnerabilities without much
need for insight into the provenance of any single component.
Although there are many benefits to using DAST, there are also
a number of limitations that would encourage developers to seek
other means of testing, including the following:
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
»» No API discovery: DAST can’t discover APIs, so you’re
missing asset management and API reachability validation
capabilities.
»» Minimal visibility: DAST lacks visibility into the application’s
code base, so DAST alone can’t offer comprehensive security
coverage or insight into problematic code for purposes of
remediation.
»» Time-consuming: DAST can be slow — according to
Forrester, DAST scans can last as long as five to seven days.
DAST scans often don’t detect vulnerabilities until they’re
more costly and time-consuming to fix, later in the SDLC.
Fuzzing (or fuzz testing) submits bad or malformed input into the
fields within an application to determine how the application will
respond (for example, entering an unknown state or crashing).
The fuzzing process is shown in Figure 3-1.
The best DAST software and other DAST tools simulate various
types of attacks to detect security vulnerabilities and test a broad
spectrum of endpoints, including hidden values. By simulating
malicious attacks on an application, automated DAST security
tools can help identify outcomes that are far outside the typical
user experience.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
DAST products function without getting into the source code, so
they require no prior knowledge of programming language. This
makes DAST software easy to use, and because DAST detects vul-
nerabilities at runtime, there is no need to rebuild an application
to test it for vulnerabilities.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
open-source software, allowing security analysts to identify pre-
cisely which libraries and components have been used in a piece
of software. Code is parsed automatically and scanned against a
known list of open-source vulnerabilities.
SCA tools can also be used to identify the licenses associated with
any open-source components integrated into a piece of delivered
software.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
software BOM. Sometimes, producing a software BOM is a
regulatory requirement — or a requirement that is defined
by potential customers.
»» Licensing: Your organization can avoid costly fines that
could be incurred by accidentally using open-source
components that require licenses that the organization
hasn’t acquired.
SCA tools may sound a lot like SAST tools. However, they’re two
distinct cybersecurity components with slightly different uses.
Some of the differences that mark the divide between SAST
and SCA:
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Recognizing the Need for
API Security Testing
The problem with SAST, DAST, IAST, and SCA is that these tools
don’t do much for API security testing. At least, they can’t do it
directly.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
IN THIS CHAPTER
»» Testing your application programming
interfaces (APIs) early and often
Chapter 4
Adopting a Shift-Left
Approach
T
his chapter explores the importance of testing APIs early
and often. You learn about Noname Security’s Active Testing
solution, and you discover the benefits of adopting a shift-
left approach.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Any one of these challenges can spell disaster for your environ-
ment. However, there is one overlooked aspect that could also
weaken your API security posture if not addressed, and that’s
testing APIs early in the development process.
FIGURE 4-1: In the shift-left model, API security and software testing tasks are
performed earlier in the SDLC.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
With security and testing baked into each step of the API develop-
ment or DevOps process, a shift-left approach ensures develop-
ers will be identifying and remediating vulnerabilities throughout
the SDLC. Shift-left principles enable security teams to increase
developer autonomy by providing support, expertise, and tooling
while still delivering the required level of oversight. Developers
can release more secure code at scale, build API security into their
designs, and make fixes early in the development process instead
of scrambling to fix them later. Code testers are able to evaluate
features as they’re created and help ensure higher quality.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
ensuring developers can monitor for vulnerabilities throughout
the life cycle. Developers can build API security into the design
and make fixes early.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Source: Jones, Capers. Applied Software Measurement: Global Analysis of Productivity and Quality.
FIGURE 4-2: Shift-left testing helps identify potential security issues earlier in
the API life cycle.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
IN THIS CHAPTER
»» Knowing how your business uses
application programming interfaces
(APIs)
Chapter 5
Five Keys to Rapidly
Delivering Secure
Applications and APIs
H
ere are five keys to help your organization succeed in rap-
idly delivering secure applications and application pro-
gramming interfaces, or APIs:
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
• What applications and data are potentially exposed by
the API and their communication flows
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
»» Continuously monitor trends in runtime and develop-
ment to deliver secure products. API security risks and
issues aren’t all discovered in source code alone. Observing
traffic behavior within the context of the network provides
the full context to derive risk findings. Blocking runtime API
threats requires an ability to protect data by leveraging more
context — information arising from an application-level
understanding of how each API is intended to be used.
These materials are © 2023 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
WILEY END USER LICENSE AGREEMENT
Go to www.wiley.com/go/eula to access Wiley’s ebook EULA.