Development Principles of Secure Microservices 2021
Development Principles of Secure Microservices 2021
Abstract
The subject matter of this article is to build secure applications using a microservices
architecture. The goal is to provide developers with useful guidance on already recognized
threats in microservices applications and how to detect, mitigate or prevent them. We also
aim to identify potential gaps in security research in microservices architecture. The tasks to
be solved are: identifying the most pressing threats for microservices and microservices
architecture in general; selection of the set of approaches and security mechanisms that are
used to detect, mitigate and prevent these threats. The methods used are: literature analysis,
microservices application testing. In this article, we conduct a systematic scoping study to
identify threats to microservices architecture and how to minimize them. We have
highlighted the most critical threats and proposed solutions and methodologies for dealing
with them from selected research studies. The following results were obtained. Methods for
protecting data during transition between microservices are proposed, possible measures to
ensure the security of data at rest in the database are considered. Some of the most vulnerable
and complex processes in a microservices application, namely authentication and
authorization, have been analyzed. Several approaches to authentication and authorization are
proposed, and the security weaknesses and advantages of each of them are highlighted. In
particular, approaches based on single-sign-on technology are considered. All approaches to
the development of microservices applications, which were presented in this article, were
tested during development of the microservices application and their positive impact on the
security of the application was proved. In addition, we discussed how the software
development practices, adopted by the development team, can affect the security of
microservices applications and how to organize the process of development of a secure
microservices application. Unfortunately, a review of scientific papers demonstrates that very
little attention is paid to this topic. The scientific novelty of the results obtained is as follows:
the most serious security problems encountered in the microservices architecture were
highlighted, and clear steps were given on how to develop a secure microservices application.
The relevance of the work lies in the fact that very little attention is paid to this topic, while
the number of possible vulnerabilities increases as microservices spread.
Keywords1
Microservices architecture, monolithic architecture, authentication, authorization, client
certificates, single-sign-on gateway.
CPITS-II-2021: Cybersecurity Providing in Information and Telecommunication Systems, October 26, 2021, Kyiv, Ukraine
EMAIL: [email protected] (O. Tereshchenko); [email protected] (N. Trintina)
ORCID: 0000-0003-0536-2708 (O. Tereshchenko); 0000-0001-6827-4030 (N. Trintina)
©️ 2022 Copyright for this paper by its authors.
Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR Workshop Proceedings (CEUR-WS.org)
11
1. Introduction
Microservices is a new architectural style that has become widespread in our time. Microservices offer
many advantages over older monolithic architectures. Big business is already moving to microservices
and this trend will continue, because the monolithic architecture cannot keep up with the requirements
and challenges of modern software, which is now quite large and complex [1].
From a technical point of view, microservices are a specialization of the approach to the
implementation of SOA (Service-Oriented Architecture), which is used to build flexible systems with
independent deployment [2]. Compared to alternative software methodologies, microservices are actually
a very cost-effective solution due to the limitations of older and more traditional software development
methods, such as monolithic architecture. Monolithic architecture cannot mimic microservices without
significant infrastructure costs and information unreliability. Despite the widespread use and rapid
development, scalability has become the main condition for the success of the current widespread use of
microservices technologies [2].
Data security is an important aspect of software development today. Ignoring this aspect will
undoubtedly lead to serious technological and legal problems, as some countries have strict legislation to
combat information leakage. An example of such legislation is the general personal data protection
regulation in the European Union.
With massive hacking attacks on companies such as Netflix and Amazon, which implemented
microservices architecture in their applications, security has become an urgent need. Several research
papers have noted the need to study the security of microservices applications [3, 4, 12]. However,
security threats are diverse and growing fast. Security proposals also increase and range from the
protection of individual microservices to the protection of infrastructure as a whole.
In this article, we conduct a systematic review to identify the main threats to the security of systems
based on microservices architecture. We analyze existing research on threats and solutions that facilitate
the security of microservices applications. The objectives of this study can be summarized as follows:
identification of the most severe threats to microservices and microservices architecture in general;
selection of the set of approaches and security mechanisms used to detect, mitigate and prevent
these threats.
2. Monolithic Architecture
Monolithic architecture is a traditional unified model for software development. The monolith in this
context means that the application is compiled into a single fragment. The monolithic program is
autonomous. In this case, the components of the program are interconnected and interdependent, rather
than weakly coupled, as is the case with modular programs.
As you can see in Figure 1, although this is a fairly simple model, the limitations are obvious and do
not stop at scalability. They go far beyond the most important modern aspect, namely security.
12
Figure 2: Monolithic architecture
When using a monolithic architecture, we have to compile the entire assembly with minor changes to
the code, which significantly slows down the deployment and delivery of updates. When using
microservices, you can change only one service and compile it, which is a more attractive solution.
Moreover, there is a risk factor that today's large vertical scaling programs can have serious crashes or
errors that compromise the operation of the entire application. In microservices, this risk levels, as the
architecture supports horizontal scaling. It is important to keep in mind the previous points, but they are
somewhat secondary to the possibility of stealing limited data due to their targeted and centralized
topology or budget problems related to the fact that monolithic development usually uses one specific
technology or supplier.
3. Microservices Architecture
In contrast to the monolithic architecture, which is a single unit, microservices architecture divides the
application into a collection of smaller independent units [5]. These blocks implement each business
process as a separate service. Therefore, all services have their own business logic and database. This
contributes to security by making it possible to use an unlimited number of programming languages,
APIs, and scaling resources in both directions when resources are needed or not. See Figure 2.
13
control. There is a need for a larger development management team, and its size depends on the number
of services involved, vendors, programming languages, databases used during the development process,
as well as the high complexity of testing. Dividing into several development teams is common for this
type of applications.
We need to realize that these are not all the advantages and challenges of microservices architecture,
so it should be borne in mind that for the successful use of this architecture we require a well-established
interaction between developers and architects [5-6].
4. Properties of Microservices
Microservices have very important characteristics, and some of these characteristics must be
considered in the development of secure services. So let's look at these characteristics in more details.
As an example of scaling along the Z axis, we can give an example of the division of large databases
into smaller parts, which can speed up and facilitate the management of the application [6]. In turn, this
process is the opposite of monolithic applications, which usually have a single database.
14
4.4. Multilingualism and Heterogeneity
Programmers have the right to choose which programming languages are most suitable for their
service, freely implementing innovations within the service [7]. Developers can quickly rewrite the
microservice code using the latest technologies and tools.
15
Problems with access control.
Security Misconfiguration.
Insecurity of sensitive data.
Dangerous direct links to objects.
Cross-site request forgery (CSRF).
Usage of the components with known vulnerabilities.
Problems with journaling and monitoring.
One aspect that deserves a more detailed description is SSRF (Server Side Request Forgery). This
aspect needs attention despite the apparently low risk [10].
In a typical SSRF attack, attackers can force the server to connect only to internal services in the
organization's infrastructure. In other cases, they may be able to force the server to connect to arbitrary
external systems, potentially stealing sensitive data, such as authorization credentials (Fig. 4) [11].
In microservices, inter-server requests are usually secure if deep-layer firewall defense or network
segregation is used. If these aspects are not met, you may end up with a server-side request forgery
situation in which an attacker can abuse trust between servers, bypass IP whitelists, authentication
services, and read resources that are not available to the public. Moreover, attacker can interact with API
or receive sensitive information, such as the IP address of a web server [11].
16
5.3.1. Usage of Single-Sign-on Technology in Microservices Architecture
A common approach to authentication and authorization is to use any of the single-sign-on solutions.
Relevant capabilities in this area are provided by the open authentication and authorization data exchange
standard SAML and the open decentralized authentication system standard OpenID Connect.
SAML is a standard based on the SOAP protocol, but it is considered quite complex, despite the
availability of a large number of libraries and tools. OpenID Connect is a standard that emerged as a
specific implementation of OAuth 2.0 and is based on the methods of managing single-sign-on
technology adopted by Google and a number of other companies. It uses simple REST calls [12].
A directory service can be any tool such as Active Directory or Lightweight Directory Access Protocol
(LDAP). These systems allow you to store information about the role of users in the system.
SAML and OpenID are ideal for authentication and authorization of users in the system, but have also
become widespread for authentication between services. It is extremely important to promote services and
mechanisms that force users, administrators and developers to use complex, unique passwords [13].
17
5.3.5. Usage of HMAC over HTTP
Excessive HTTPS traffic can cause additional load on servers. In addition, there are difficulties with
caching such traffic. An alternative way to sign a request is to use a hash-based message authentication
code (HMAC) [14].
When using HMAC, the request body is hashed with a private key and the received hash is sent with
the request. The server then uses its own copy of the private key and the request body to recreate the hash.
If the hashes coincide, the request is accepted. This eliminates the possibility that the request was forged.
An additional advantage of this method is that the traffic is much easier to cache and the cost of
generating hashes can be much lower than the processing of HTTPS traffic.
18
5.7. Human Factor
Everything described earlier in this article was related to the technical side of security. But the human
factor, which in most cases is the cause of security problems, cannot be ignored. Developers should be
taught to build security according to specific standards, such as ITIL, TOGAF, BSIMM or COBIT.
6. Conclusion
The purpose of this article was to describe the vulnerabilities and security requirements of the
microservices architecture and to analyze possible ways to build secure microservices applications. It is
important to remember that the study and implementation of security concepts is an important step in
building reliable information systems today. Unfortunately, when it comes to security, we can responsibly
say that there is no system that is completely safe and secure. Much is left out because of the enormous
possibilities of microservices architecture, and much of what has been discussed in this article is just the
tip of the iceberg, because of the enormous possibilities of microservices architecture, so this topic needs
further study.
7. References
19
Systems. 2019 IEEE International Scientific-Practical Conference Problems of Infocommunications,
Science and Technology (PIC S&T), 2019. https://doi.org/10.1109/picst47496.2019.9061551
20