Implementation of DevSecOps by Integrating Static and Dynamic Security Testing in CI CD Pipelines
Implementation of DevSecOps by Integrating Static and Dynamic Security Testing in CI CD Pipelines
[email protected] [email protected]
Abstract— Problems at the build, test, and deploy stages are more attention to security threats [2]. Therefore there is a need
standard in the development lifecycle of systems with Agile. for security integration as a need for security in DevOps,
They are time-consuming and cause releases to fall behind namely DevSecOps. DevSecOps aims to integrate security
schedule. DevSecOps provide the solution to this problem. This controls and processes into the DevOps software development
study delivers a build, test, and deployment automation solution life cycle with collaboration among the security, development,
for those working in an Agile SDLC environment. This study is and operations teams.
an approach to implementing DevSecOps on an information
system's Agile SDLC, a web-based software developed with the
Node.js and Dart programming languages, Express.js, and
Flutter frameworks. The process carried out in this study uses
GitLab and Docker tools, consisting of five stages: continuous
development, continuous testing, continuous integration,
continuous deployment, and continuous monitoring. This
approach shortens the time and streamlines the build, testing,
and deployment, whereas previously, the process of system Fig. 1. Differences in Design, Coding, Testing, and Deploy in Agile
development was done manually. It took up to several hours to and DevOps
Source: reprocessed from [1]
only take 3-4 minutes after automation was applied to the
deployment process. In addition, we conduct a combination of In this study, auto deploys to the server will be carried out
automated static and dynamic security testing to help ensure the to speed up and streamline the release process using GitLab
system's security by obtaining results related to vulnerabilities. CI/CD. It performs automated static and dynamic security
automation testing before auto-deploy the system through the
Keywords—Build, Deploy, Docker, Test, DevSecOps, DevOps git commit mechanism. So the DevSecOps method is
expected to be a solution for developing an information
I. INTRODUCTION system.
Most information systems use the Agile development life
cycle in their development and maintenance. Agile is a II. RELATED WORKS
relatively modern method because it emphasizes Shajadi, Abdollah [16] conducted the research on
improvisation and adaptation. Even so, the Agile method Automating Security Tests For Web Applications In
workflow still applies the traditional systematic pattern. In Continuous Integration And Deployment Environments. In
Agile work environments, there are frequent issues with the his study, the tools and process mechanisms were developed
build and deploy phases, which are time-consuming and lead to implement automated security tests for web applications.
to unscheduled release times. The technology used is the Burp Suite Pro tool, the Python
DevOps (Development and Operations) is a new method programming language, and the GitLab CI/CD tool. The
that takes a collaborative and integrative approach between results show that a Python script named Skinner performs
the development team (Dev) and the software operations team automated security testing with Burp Suite Pro on the GitLab
(Ops) in the process of developing and delivering software to CI pipeline using the DevSecOps implementation procedure.
infrastructure [1]. The DevOps method is proven to be able to The second study was conducted by Tohirin et al. [1]. In
reduce some of the development stages that exist in the old his study, DevOps was implemented on the SDLC Agile
method. DevOps is able to shorten the time between software Scrum web-based Covid-19 e-Screening application
development and operation without compromising the quality developed with the PHP programming language and the
of the software itself. DevOps is capable of delivering early- Laravel framework. This research results show that DevOps
release software with a high frequency. The build, test, and can be implemented well in the development process of e-
deployment processes can detect problems earlier, so the code Screening Covid-19 applications. Its code merging occurs
can be rolled back if there is an error during an update. The quickly, daily builds are smooth, and code health and
auto-deploy process can make earlier and more effective feasibility checks occur every time the developer commits and
releases for software requiring a high update frequency. pushes. Tohirin et al. [1] use the DevSecOps method to the
Figure 1 shows Agile's coding and testing process and how it Dart and Node.js programming languages with the Flutter and
compares with DevOps. Express.js frameworks, which are applied to an information
Technological advances such as Continuous Engineering, system based on mobile and web applications.
specifically DevOps, allow some organizations to gain a The third research is conducted by Shama, Abriza
competitive advantage. However, security concerns have Mahandis, and Dian W. Chandra [17]. In this research, a
increased due to security breaches, such as large-scale data DevSecOps system was created for automation to speed up
breaches, which have forced organizations worldwide to pay developer work and improve code quality. The result of this
• Continuous Development
The plan is the stage where the planning process is carried
out in a job [1]. At this stage, we use GitLab tools because
CI/CD tools can do CI/CD storage and code management Fig. 3. GitLab cloning and remote process
in the same place. Code is the stage where developers
Authorized licensed use limited to: Universitas Indonesia. Downloaded on August 31,2023 at 04:16:39 UTC from IEEE Xplore. Restrictions apply.
Then the data in the local repository is committed and
pushed to GitLab using git bash. All data in the local
repository is automatically executed to the GitLab repository.
Authorized licensed use limited to: Universitas Indonesia. Downloaded on August 31,2023 at 04:16:39 UTC from IEEE Xplore. Restrictions apply.
SAST: and other software modules run with the same privileges as
stage: test1 the application are vulnerable to exploitation [19].
image: python
script: C. Continuous Integration
- njsscan . --html -o report.html || Continuous integration includes a configuration process
exit 0 coordinated by GitLab CI/CD with the deployment server. At
allow_failure: true this stage, register the GitLab runner on the GitLab project that
artifacts:
has been created. GitLab Runner is registered on the server for
when: always
untracked: false
deployment. In addition, the deployment server is needed to
expire_in: 30 days auto-deploy and as a place to run Docker applications on the
paths: server. The server is built using the Amazon Web Service
- report.html (AWS) platform with the configuration requirements, which
tags: can be seen in table III as follows.
- agung TABLE III. CONFIGURATION ON AMAZON MACHINE IMAGE
The following is a dynamic testing configuration using No Type Information
OWASP-ZAP. 1 Software Image
Ubuntu Server 20.04 LTS (HVM),
DAST: Canonical, amd64 focal image, 64-bit (x86)
Virtual
stage: test2 2 Tipe t2.medium, 2 vCPU, 4 GB Memory
Server/Instance
image: owasp/zap2docker-stable:latest 3 Storage SSD Volume 8 GB
script: 4 Private Key RSA type, .pem file format
- docker run -i owasp/zap2docker-
stable zap-cli quick-scan --self- The key pair allows connecting to the instance securely.
contained --start-options '-config When prompted, store the private key in a secure, accessible
api.disablekey=true' location on the local machine to connect to the instance. RSA
http://$SERVER_ADDRESS:8080 > encrypted private and public keys. The private key .pem file
zapreport.html format is used with OpenSSH. The server is accessed remotely
allow_failure: true from the local machine using the SSH (Secure Shell)
artifacts: command by applying the SSH key added by the security
when: always
settings on the server. SSH is used to access remote servers
untracked: false
expire_in: 30 days
over the internet securely.
paths: D. Continuous Deployment
- zapreport.html
tags: The continuous deployment phase includes the
- agung deployment process, which is carried out with push images to
servers operated via the GitLab CI/CD pipeline and Docker
In running the testing process, the job pipeline also containers. The server is connected to the local machine by
automatically generates artifacts. The artifact contains using the SSH command and the server IP address, which is
information related to the application code scanning test the public IP address, and adding username credentials as
results regarding the vulnerabilities contained in the authentication to connect to the server. After initialization, the
application. configuration is done by installing Docker on the server to be
TABLE II. RESULT OF SECURITY TESTING ARTIFACT able to run the Docker container in the process of deploying
the Docker image to the server.
RULE ID node_insecure_random_generator
In the pipeline configuration, a new stage called "deploy"
CWE-327: Use of a Broken or Risly
CWE
Cryptographic Algorithm
is added by creating a new job. The steps taken are using the
SSH command locally, and GitLab Runner was starting the
A9: Using Components with Known container for the deploy job. The "docker run" command is
OWASP-WEB
Vulnerabilities
executed to run Docker on the deployment server. The
Crypto.pseudoRandomBytes()/Math.random() is a
DESCRIPTION cryptographically weak random number
application runs on port 8080, which is exposed on the host.
generator. Before executing the "docker run" command, stop and delete
existing containers or stop containers running on port 8080 so
SEVERITY WARNING
that new containers can be created on each subsequent
File app/utils/telebot.js execution run.
Match
264 - 227 - docker pull $CONTAINER_RELEASE_IMAGE
Position
FILES Line - docker stop $(docker ps -a -q) || true &&
24 docker rm -f $(docker ps -a -q) || true
Number(s)
Match String let message = ‘\n${name} - docker run -d -p 8080:8080
$CONTAINER_RELEASE_IMAGE
It can be seen in table II that there is a security gap based
on CWE-327, namely the Use of a Broken or Risky Deployment validation can be performed via the GitLab
Cryptographic Algorithm, which is an unnecessary risk that CI/CD pipeline, inspecting Docker containers running
can result in the disclosure of sensitive information [18]. In through the server and accessing the application via a web
addition, there are also security holes based on OWASP-WEB browser. Figure 8 shows the job status completed on CI/CD
A9 regarding Using Components with Known Vulnerabilities, pipeline.
where components such as libraries, frameworks, websites,
Authorized licensed use limited to: Universitas Indonesia. Downloaded on August 31,2023 at 04:16:39 UTC from IEEE Xplore. Restrictions apply.
Therefore, compared with the development process on an
information system that still applies the Agile system
development life cycle, the results of the implementation of
DevSecOps in this study can meet the needs in the application
Fig. 8. Job status-completed on pipeline of system automation and shorten the work process in an
information system. A comparison of the work process in an
E. Continuous Monitoring information system with the system applied in this study can
In the continuous monitoring stage, the monitoring process be seen in table IV.
is carried out on the GitLab CI/CD pipeline as a place to run
TABLE IV. COMPARISON OF WORK PROCESS
deployment automation commands and on the server, which
No The work process in an The work process applied to the
includes collection, reporting, CPU usage storage, memory information system research
usage, RAM allocation, and pipeline modifications used in
The process of deploying to Deploy process to a server
system development. Server services must be accessible and 1
the server manually automatically with CI/CD system
run appropriately without experiencing interference, so server
monitoring is needed so that the server's performance can run The deployment work The deployment process takes 3-4
2
process takes 2-3 hours minutes
normally.
There is no security testing
3 There is a security testing process
process
Not deploying Docker Implementing a Docker container
4
containers on the system on the system
Authorized licensed use limited to: Universitas Indonesia. Downloaded on August 31,2023 at 04:16:39 UTC from IEEE Xplore. Restrictions apply.
[4] B. A. Skurla, “DevOps Integration of Security Practices,” p. 55, 2020. [17] “DevSecOps: Incorporate Security into DevOps to Reduce Software
[5] A. Agarwal, S. Gupta, and T. Choudhury, “Continuous and Integrated Risk,” Agile Connection.
Software Development using DevOps,” in 2018 International https://www.agileconnection.com/article/devsecops-incorporate-
Conference on Advances in Computing and Communication security-devops-reduce-software-risk (accessed Jan. 11, 2022).
Engineering (ICACCE), Paris, Jun. 2018, pp. 290–293. [18] Y. He, R. S. Camacho, H. Soygazi, and C. Luo, “Attacking and
[6] C. Ebert, G. Gallardo, J. Hernantes, and N. Serrano, “DevOps,” IEEE Defence Pathways for Intelligent Medical Diagnosis System (IMDS),”
Softw., vol. 33, no. 3, pp. 94–100, May 2016. International Journal of Medical Informatics, vol. 148, no. 104415,
2021.
[7] S. Sharma, “DevOps For Dummies,” the knowledge, p. 76, 2015.
[19] H. Tupsamudre, M. Sahu, K. Vidhani, and S. Lodha, “Fixing the Fixes:
[8] J. Van Baarsen, GitLab Cookbook: over 60 hands-on recipes to
Assessing the Solutions of SAST Tools for Securing Password
efficiently self-host your own Git repository using GitLab. Birmingham
Storage,” International Conference on Financial Cryptography and
Mumbai: Packt Publishing, 2014.
Data Security, pp. 192–206, Springer, Cham, 2020.
[9] S. Chacon and B. Straub, “Pro Git Second Edition,” Apress.
[20] N. Vendor, B. Mosolygo, and P. Hegelus, “Comparing ML-Based
[10] Anonymous, “How to convince leadership to adopt CI CD,” GitLab. Predictions and Static Analyzer Tools for Vulnerability Detection,”
https://page.gitlab.com/2021_eBook_leadershipCICD.html (accessed International Conference on Computational Science and Its
Dec. 28, 2021). Applications, pp. 92-105, Springer, Cham, 2022.
[11] A. Mardan, "Express.js Guide," Leanpub, 2014. [21] D. Hariyadi, F. E. Nastiti, “Analisis Keamanan Sistem Informasi
[12] B. B. Rad, H. J. Bhatti, and M. Ahmadi, "An introduction to docker and Menggunakan Sudomy dan OWASP ZAP di Universitas Duta Bangsa
analysis of its performance," International Journal of Computer Surakarta,” Jurnal Komtika (Komputasi dan Informatika), vol. 5, no. 1,
Science and Network Security (IJCSNS), vol. 17, no. 3, p. 228, 2017. pp. 35–42, 2021.
[13] I. Miell, A. Sayers, "Docker in practice," Simon and Schuster, 2019. [22] S. Chalishhafshejani and B. K. Pham, "Automated software security
[14] D. Sagar, S. Kukreja, J. Brahma, S. Tyagi, and P. Jain, "Studying open activities in a continuous delivery pipeline," Faculty of Science and
source vulnerability scanners for vulnerabilities in web applications," Technology, Springer semester, 2021.
IIOAB JOURNAL, vol. 9, no.2, pp. 43-49, 2018. [23] Fathurrahman and Ester, "Automatic Scanner Tools Analysis As A
[15] F. Holik, and S. Neradova, "Vulnerabilities of modern web Website Penetration Testing," Jurnal Mantik, vol. 4 no. 2, pp. 1138-
applications," 2017 40th International Convention on Information and 1144, 2020.
Communication Technology, Electronics and Microelectronics [24] T. Rangnau, R. v. Buijtenen, F. Fransen and F. Turkmen, "Continuous
(MIPRO), pp. 1256-1261) IEEE, May 2017. Security Testing: A Case Study on Integrating Dynamic Security
[16] A. Shajadi, “Automating Security Tests For Web Applications In Testing Tools in CI/CD Pipelines," EDOC Conference, IEEE, 2020.
Continuous Integration And Deployment Environment,” p. 64.
Authorized licensed use limited to: Universitas Indonesia. Downloaded on August 31,2023 at 04:16:39 UTC from IEEE Xplore. Restrictions apply.