{'fraction_non_alphanumeric': 0.03017745709828393, 'fraction_numerical': 0.0047776911076443055, 'mean_word_length': 5.219830200121286, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
DevSecOps in Robotics

Quality in software is often understood as"execution according to design purpose"whereas security means that"software will not put data or computing systems at risk of unauthorized access."There seems to be a connection between these two aspects but, how do we integrate both of them in the robotics development cycle? In this article we introduce DevSecOps in Robotics, a set of best practices designed to help roboticists implant security deep in the heart of their development and operations processes. First, we briefly describe DevOps, introduce the value added with DevSecOps and describe and illustrate how these practices may be implemented in the robotics field. We finalize with a discussion on the relationship between security, quality and safety, open problems and future research questions.


Introduction
Where waterfall development once dictated the process of "handing off" from developers to Quality Assurance (QA) to operations, these responsibilities now have blurred borders with most engineers' skill sets spanning multiple disciplines. Enter DevOps, a set of practices that combine software development (Dev) with Information Technology operations (Ops). They aim to shorten the development life cycle and provide continuous delivery while ensuring the quality of the software (Quality Assurance or QA) [1]. Most sources [2,3] agree that this idea began around 2008, with a discussion between Patrick Debois and Andrew Clay Shafer, concerning the concept of agile infrastructure. According to Roche [4], no standard definition exists for DevOps. What seems clear is that the design phase has been replaced by a less cyclic and more integrated flow evolution from development to demonstrations.
In Robotics, as in many other areas closely connected to Computer Science, there is a set of adopted common practices, including DevOps. Figure 1 pictures the DevOps cycle most roboticists use and split into 4 phases: Development, Deployment, Production and Post-Production. In the DevOps philosophy, these phases are all connected in a continuous, never-ending, loop. The waterfall is now a river; development and operations flow together but, where is security in such a landscape? As pointed out by the UK's National Cyber Security Center [5], having a secure approach to development has never been so critical, when it comes to cyberphysical systems and, of course, robotics. The way roboticists build software and systems is rapidly evolving, becoming more and more automated and integrated. Many roboticists today define, prototype and develop an entire robotics system architecture in simulation and tie it to tooling which will automate both testing and deployment.
Over the last couple of years we have seen big changes on the arrival of cloud services to robotics and to 'robot infrastructure as a service' including simulation, fleet management systems, or teleoperation capabilities among others. The promise is that robots of almost any size and complexity can be called into virtual life, changed, or terminated without leaving the desktop. On top of these new capabilities, a process of quick and regular deployments has evolved. Often referred to as Continuous Delivery, this iterative approach is powerful, flexible and efficient, but these strengths bring new sets of risks which your security practices must address. To do so, roboticists will need to consider security as a primary concern throughout your development and deployment processes.
To the best of our knowledge, while there is some prior work studying DevOps in the embedded systems field [6], there is no literature available to date formalizing the adoption of DevSecOps in the robotics domain. In this article we introduce DevSecOps in Robotics as a set of best practices designed to help roboticists implant security deep in the heart of their development and operations processes. The content provided below is not an in-depth guidance on how to avoid implementation vulnerabilities in the code you write, this topic is covered by other pieces of research and we kindly refer the reader to [7,8,9,10]. The principles provided below are intended to help secure the entire process of software development in robotics, from establishing a security-friendly culture in your organisation through implementation and ongoing management. It must be noted, however, that using these principles do not guarantee a secure final robot, but should help you gain confidence and insights that the code you deploy is built with a security mindset.

From DevOps to DevSecOps
Roche [4] argues that developers work mostly on code while operations people work mostly with systems. Security, well identified as a continuous process, needs to be applied individually to each one of these phases and then holistically to the complete system. Security is a challenge and with each interface, the complexity increases.
DevOps is presented with a mix of the two skill sets mentioned above, developers and operations people. When adding security to the DevOps tuple we dive into DevSecOps. Often times called "Rugged DevOps" or "security at speed", DevSecOps is a set of best practices designed to help organizations implant security deep in their DevOps development and operations processes [11,12]. DevSecOps, also known as SecDevOps and DevOpsSec, seeks to embed security inside the development process as deeply as DevOps does with operations.
Turning again into robotics, security -identified as a process that needs to be continuously assessed both in hardware and software-is a highly time and resource-consuming task. As was proven before in Computer Science, including security -across the development, deployment, production, and postproduction phases-results in a more secure output. Figure 2 depicts our view on how DevSecOps could be implemented in robotics. We list phases, tasks, and activities while providing descriptions to further clarify the effort required.

Development phase
Plan task • Threat modeling: Threat modeling is the use of abstractions to aid in thinking about risks.
A threat model identifies security threats that apply to the robot and/or its components (both software and hardware) while providing means to address or mitigate them in the context of a use case and ideally, during development.
• Quality Assurance requirements: Quality Assurance (QA) requirements imply capturing the quality metrics and aspects that will be later used to measure a code's compliance. The requirements captured in this activity are later translated into actionable tests.
• Unit, integration and functional tests: Unit testing is the practice of testing small pieces of code, typically individual functions, alone and in an isolated manner. Integration testing involves checking whether different modules perform when combined together as a group. Finally, functional testing verifies the functionality of a given software composition, that is to confirm that the corresponding source code provides the expected behavior. In line with Test-Driven Development and other groups' practices [13], it is encouraged to write tests before coding. Particularly, we encourage to a) write the general code skeleton, classes, and public methods and to b) write the test cases for the logic to implement 1 .

Code task
• IDE checks: Many vulnerabilities in products and systems could be avoided if better, more secure coding practices were in place. A number of Integrated Development Environment (IDE) plugins exist, which help developers check for security flaws while they code [14].
• Peer code review: Peer Code Review, is the act of consciously and systematically analyzing fellow programmers' code to check each other's mistakes. Bosu et al. produced two interesting studies [15,16] that researched vulnerabilities in code-while-in-development where they concluded that: a) the most experienced contributors authored the majority of the Vulnerable Code Changes (VCCs), b) Less experienced authors wrote fewer VCCs, but their code changes were 1.5 to 8 times more likely to be vulnerable, and c) employees of organizations sponsoring OSS (Open Source Software) projects were more likely to write VCCs. Coherently, peer code review is identified as an effective improvement practice for reducing security vulnerabilities.  • Static Application Security Testing (SAST): Static Application Security Testing, or static analysis, is the study of software without executing it and by simply looking at its structure and content. SAST is a testing methodology that analyzes source code to find security vulnerabilities.
• Alert on high-risk code changes: As a general recommendation, when the delta of code changes is above a certain pre-defined boundary, alerts should be generated.
• Build (compilation) checks: CI systems generally involve one or more building process. Compilation output can deliver valuable input and should be accounted for. It is good practice to monitor a compiler's output and file tickets for review in the warnings that remain. This can be easily automated and tickets can be filed to a centralized flaw management system like the Robot Vulnerability Database (RVD) [17]. An open prototype of such a flaw management system, integrated with Github, is available at https://github.com/aliasrobotics/RVD including the necessary tooling to manage it.

Test and simulate task
• Dynamic Application Security Testing (DAST): Dynamic Application Security Testing (DAST) is a practice to detect conditions indicative of a security vulnerability in an application or software in its running state. The software is tested from the outside, that is, no access to the source code is assumed to be provided and thereby falls into the black-box security testing methodologies (against SAST, which requires access to the source code and is thereby considered a white-box security testing methodology).

• Deep Static Application Security Testing (Deep SAST):
Past studies have shown [18,19,20,21] that it is possible to predict both code quality and security flaws using machine learning approaches. Deep Static Application Security Testing (Deep SAST) leverages on the the effectiveness of using machine learning-based static analysis to predict security flaws.
• Fuzz testing: Fuzz testing or fuzzing, is a semi-automated testing technique for software that consists of injecting data in search for errors. It involves providing invalid, unexpected, or random data as input. The software is then monitored for exceptions such as crashes, failing code assertions, or potential memory leaks. Similar to DAST, fuzzing is a black-box security testing methodology (no access to the source code).
• Penetration Testing (PT or pentesting): Penetration testing or pentesting, is the practice of simulating a cyber attack against a given system (with a well defined scope) to check for exploitable vulnerabilities and determining its severity. Pentesting aims to find as many vulnerabilities and configuration issues as possible, in the time allotted, to then try exploit those to determine the risk of the vulnerability. A pentesting activity can be conducted as a white-box activity (complete access to source code), black-box (no access to sources or prior knowledge of the system) or gray-box (limited knowledge of the system available). Some penetration testing schemes are applicable to robotics, such as Robot Security Framework [22].

Flaw management task
• Flaw management activity: Formally [23], flaw management is the cyclical practice of identifying, classifying, re-mediating, and mitigating flaws. Flaw management is at the center of security activity. It refers to the process of how security researchers, suppliers, and end user organizations manage bugs and vulnerabilities, making systems more secure.
Flaw management requires a holistic, risk-based approach to security and combines the input received from other phases and tasks in the security process (e.g. SAST, DAST, build warnings, pentesting, fuzzing, etc.). The amount of flaws is often bigger than the engineering resources to manage them, thereby flaws should be prioritized. This is often done using a preliminary risk assessment, which is typically performed by using severity scoring mechanisms such as CVSS [24] or RVSS [25], the latter more specific for robotics and accounting for safety hazards.

Deployment phase
• Configuration and system integration task: Deals with system integration and configuration of all parts previously developed and conforming the robotic system. It is one of the most sensitive tasks from a security perspective. It is critical to define secure deployment mechanisms and employ strong systematic configuration practices to ensure no flaws are presented during this task.
Production phase • Monitor: This task deals with the continuous monitoring of the system and should oversee the systems' performance, errors, and other relevant information. A common good practice is to employ elements that record all activity, securely, for potential future forensics research.

Post-production phase
Analyze task • Vulnerability Scans: Vulnerability scans provide results on new vulnerabilities affecting your system and provides solid data on their levels of severity. This data should be fed into the Flaw Management system and prioritized based on common scoring mechanisms.
• Red Teaming: Red teaming is a full-scope, holistic, multi-layered, and targeted (specific goals) attack simulation designed to measure how well a company's systems, people, networks, and physical security controls can withstand an attack. Opposed to Penetration Testing, a red teaming activity does not seek to find as many vulnerabilities as possible to risk-assess them, instead it has a specific goal to look for vulnerabilities that will maximize damage and meet the goal. The ultimate objective of a red teaming activity is to test organization/system detection and response capabilities in production.
• Bug Bounties: A Bug Bounty program is a coordinated and well scoped effort to encourage security research in a particular system rewarding (with bounties) those researchers who help find bugs. Bug Bounty programs utilize a pay for results model, favour competition and often leverage the crowd sourced model. Bug bounty programs can be self hosted or coordinated by third parties. There are several online providers that offer support organizing the programs. When compared to other actions such as red teaming, bug bounty programs are generally result-oriented and add more diversity on the testers side (crowd-sourcing). On the down side, bug bounty programs do not generally have highly skilled security researchers and they require extensive program management (either on you or hired).

Discussion and future work
With DevOps, engineering efforts now serve multiple masters. Where the focus used to be purely on precision, now longevity, scalability and security (with DevSecOps) hold equal footing in product requirement discussions. Where Quality Assurance (QA) had traditionally held the line on risk definition and maintainability, Security now has an equal, if not dominant, role. Quality (Quality Assurance or QA for short) and Security are often misunderstood when it comes to software. Ivers argues [26] that quality "essentially means that the software will execute according to its design and purpose" while "security means that the software will not put data or computing systems at risk of unauthorized access". Within [26] one relevant open question that arises is whether the quality problems are also security issues or vice versa. Ivers indicates that quality bugs can turn into security ones, provided they are exploitable, and addresses the question by remarking that quality and security are critical components to a broader notion: software integrity. Coming from the same group, Vamosi [27] argues that "quality code may not always be secure, but secure code must always be quality code". This somehow conflicts with the previous view and leads one to think that secure software is a subset of quality. The authors of this article reject this view and argue instead that Quality and Security remain two separate properties of software that may intersect on certain aspects (e.g. testing).
As nicely indicated by Lopez [28] for the DevOps scenario and extending it for security, in the De-vSecOps scenario, both security and QA integrate into the testing and development processes and take a collaborative approach. Quality and Security are ensured throughout the testing and delivery cycles and both the testing and development teams are responsible for them. In other words, compared to the traditional waterfall pattern where quality creeps in toward the end, with DevSecOps security and quality come in at every level.
In robotics there is a clear separation between Security and Quality that is best understood with scenarios involving robotic software components. For example, if one was building an industrial Automated Guided Vehicle (AGV), Autonomous Mobile Robots (AMRs) or a self-driving vehicle, often, she/he would need to comply with coding standards (e.g. MISRA [29] for developing safety-critical systems).
The same system's communications, however, regardless of its compliance with the coding standards, might rely on a channel that does not provide encryption or authentication and is thereby subject to eavesdropping and man-in-the-middle attacks. Security would be a strong driver here and as remarked by Vamosi [26], "neither security nor quality would be mutually exclusive, there will be elements of both".
Quality in robotics, still on its early stages [30] (though much more developed than security in the author's opinion), is often viewed as a pre-condition for Safety-critical systems. Similarly, as argued by several, safety can not be guaranteed without security [31,32]. Coding standards such as MISRA C have been extended [33,34] to become the "C coding standard" of choice for the automotive industry and for all industries developing embedded systems that are safety-critical and/or security-critical [32]. As introduced by ISO/IEC TS 17961:2013 "in practice, security-critical and safety-critical code have the same requirements". This statement is somehow supported by Goertzel [31] but emphasized the importance of software remaining dependable under extraordinary conditions and the interconnection between safety and security in software. This same argument was later extended by Bagnara [32] who acknowledges that having embedded systems, non-isolated anymore, plays a key role in the relationship between safety and security. According to Bagnara, "while safety and security are distinct concepts, when it comes to connected software" (non-isolated) "not having one implies not having the other", referring to integrity.
Acknowledging that both Security and QA are embed into the DevSecOps cycle brings us to question whether safety -connected to Quality-could also fit in. Myklebust et al. [35] argue that DevOps, with its frequent changes, make systems' maintainability -e.g., change impact analysis -a more challenging topic, which makes it more difficult to integrate safety within the DevOps cycle. They do acknowledge though that DevOps is also a considerable trend for non-critical systems and make an interesting connection between safety and security, which indirectly leads to DevSecOps. In a similar line of thought, Johnson [36] indicates that the time and cost involved in this process makes the DevOps paradigm of continuous release challenging for safety-critical software, especially in delivering to the end customer. He, however, points out that despite this, "aviation and defense teams have embraced the principles of DevOps, especially at the pre-certification stage, because of the potential for the higher overall quality it offers".
Altogether this leads us to the following questions: how do we apply safety-critical practices to the DevSecOps cycle in robotics? And more importantly, if safety and security coding (software) standards do not guarantee that the final robotic system will be secure, will it be safe given the safety and security connection? Some preliminary work [37,38] tackles the first question and indicates that Model-Driven Engineering (MDE) frameworks might allow a mix of DevSecOps with the functional safety process. Further research on these questions remains open for future efforts.