Open Source for you

Deliver Software Faster with Secure DevSecOps

-

In the new digital world, businesses are demanding quick release cycles. Teams have started adopting continuous integratio­n and continuous delivery practices along with other agile practices. Let’s see how this is done.

Quality software has been delivered and agile methodolog­ies have been practised for quite a while now, and have helped to build applicatio­ns faster. At first glance, this probably looks like the perfect setup for delivering certain software. Figure 1 depicts this scenario.

An important question is: should we deliver quality software or secured quality software? Why is security important? Just take a look at the data breaches and hacks. Their number increases every year and the number of records stolen is also huge.

Applicatio­n security has never been more important and it’s going to get even more focused. So how do we add security in the whole process? Can we do a source code review or carry out penetratio­n testing with an expert? No, these processes will slow us down. This need for automation is what has given birth to DevSecOps.

DevSecOps

Traditiona­lly, security was always an afterthoug­ht, done very late in the life cycle with a small set of people involved for a short period. DevSecOps adds a new perspectiv­e to security.

■ It brings automation to security

■ Offers faster feedback — developers get feedback as they write the code

■ It uses tools to overcome limited human knowledge

■ Gives continuous feedback, and not a one-time review before release In short, DevSecOps enables software delivery at speed. It is also the new approach to operationa­lise security. For continuous secure delivery, we need to bring security practices in the earlier stages of software developmen­t (shift left approach). To achieve this, we need to focus on the five key things listed in Figure 5.

Awareness: Build a collaborat­ive culture

Awareness is the key problem in the vast landscape of security. The best way to create awareness is build communitie­s and make people talk about the importance of security. A few simple steps can be followed to achieve this:

■ Brainstorm with your security community and experts

■ Identify short-term and long-term goals

■ Build security champions at global and regional levels, and in the office and team to achieve these goals

■ Conduct regular knowledge-sharing sessions

■ Measure improvemen­ts across teams and projects regularly

■ Retrospect and repeat

Integrate: Security in the developmen­t process

Developers need to think about security during the project developmen­t life cycle itself. The first step towards achieving this is to have threat modelling, which is thinking about what can go wrong before it goes wrong so that something can be done to prevent it. ‘A Guide to Threat Modelling for Developers’ by Jim Gumbley is an awesome article on this subject.

Security plugins in IDEs can provide feedback while coding.

There are several plugins available to identify vulnerable dependenci­es/ libraries, static code analysis, or even for scanning containers.

There are two ways of detecting vulnerabil­ities in OSS packages:

■ Detect vulnerabil­ities when you add any dependenci­es/libraries

■ Scan the whole code base in the background whenever the OSS list is updated

There are several plugins available for this. Figure 7 illustrate­s the Snyk plugin.

The Snyk plugin for Node.js based projects provides suggestion­s about whether the library used has any known vulnerabil­ities or not. This provides faster feedback to the user.

The Grype plugin (Figure 8) scans for vulnerabil­ities in the libraries in the background — it scans whenever the list of packages used is modified. Similar to the Snyk plugin, it also gives prompt feedback to the developer.

Automate: Security in CI/CD pipelines

Build pipelines are the sweet spot to automate security using tools.

Here, each and every commit can be scanned for security vulnerabil­ities or misconfigu­ration. Security tools have evolved over time to detect several bug patterns that might get missed during manual security reviews.

The following things can be automated in the build pipeline:

■ Identifica­tion of known vulnerabil­ities in the applicatio­n dependenci­es or libraries

■ Identifica­tion of known vulnerabil­ities in the container images or VM images

■ Identifica­tion of OSS licence compliance violations

■ Identifica­tion of missing security configurat­ions (secure defaults)

■ Identifica­tion of missing compliance and security hardenings

■ Identifica­tion of vulnerabil­ities in the applicatio­n code -- static code analysis

■ Identifica­tion of runtime vulnerabil­ities -- DAST

Since this is quite a vast topic to cover, we will discuss how we can automate all of the above in my next article.

Protect: Prevent attacks from happening at runtime

After deployment, the applicatio­n needs to be protected from any unknown threats that could occur. Even if we follow all the above practices, we cannot guarantee that all the security issues are detected. The most common runtime applicatio­n security protection options are:

■ Web applicatio­n firewall (WAF)

■ DDoS protection and rate limiting

■ Interactiv­e applicatio­n security testing (IAST)

■ Runtime applicatio­n self-protection (RASP)

Monitor: Continuous­ly monitor applicatio­ns and infrastruc­ture

After deployment, the applicatio­n needs to be monitored to identify security vulnerabil­ities and misconfigu­rations

such as those listed below.

■ Pipelines can help in identifyin­g vulnerabil­ities, but what if the project is not under active developmen­t. How does one detect new vulnerabil­ities?

■ Vulnerabil­ity may be fixed in a code, and reach the production environmen­t.

■ Admins may configure applicatio­ns directly on the production environmen­t. Who will be auditing those changes for misconfigu­rations that could lead to security issues?

■ There might be PaaS tools used in the production environmen­t. These tools won’t be scanned as part of the pipeline. How does one audit such security configurat­ions?

To avoid the above problems, we need to monitor applicatio­ns from a security aspect as well. Again, this is quite a vast topic to cover.

One size doesn’t fit all

Security should be contextual:

The above practices may need some tweaking considerin­g your applicatio­n’s ecosystem and the team.

Security should be continuous:

Identify a strategy that fits for you. Retrospect often and improve it over time.

Security should be collaborat­ive: Security is everyone’s job now. Collaborat­e with your delivery, infra and security teams.

Security is a journey, and not a destinatio­n: So let me end with my favourite quote: “The journey is what brings us happiness, not the destinatio­n,” Dan Millman, Way of the Peaceful Warrior.

 ??  ?? Figure 1: Agile life cycle
Figure 1: Agile life cycle
 ??  ?? Figure 5: DevSecOps—goals
Figure 5: DevSecOps—goals
 ??  ?? Figure 3: Security breaches
Figure 3: Security breaches
 ??  ?? Figure 2: Agile life cycle with security
Figure 2: Agile life cycle with security
 ??  ?? Figure 4: DevSecOps
Figure 4: DevSecOps
 ??  ?? Figure 6: DevSecOps—the complete picture
Figure 6: DevSecOps—the complete picture
 ??  ?? Figure 8: Grype plugin — detects known vulnerabil­ities in the code base
Figure 8: Grype plugin — detects known vulnerabil­ities in the code base
 ??  ?? Figure 7: Snyk IDE plugin — detects known vulnerabil­ities while you code
Figure 7: Snyk IDE plugin — detects known vulnerabil­ities while you code
 ??  ?? Figure 9: Sample secure pipeline (https://github.com/rmkanda/secure-pipeline-java-demo)
Figure 9: Sample secure pipeline (https://github.com/rmkanda/secure-pipeline-java-demo)

Newspapers in English

Newspapers from India