Shifting Left: From Secure Coding to Pentesting

Shifting left from secure coding to pentesting - Avatao blog

Shifting left and incorporating secure coding practices are essential for any organization to ensure the security of sensitive information and critical systems.

These practices help ensure that software is developed in a way that minimizes the risk of security exploits and vulnerabilities.

Let’s see the reasons why organizations should consider secure coding training in addition to penetration testing, and in general include security practices for the whole Software Development Lifecycle (SDLC).

Why to focus on pentesting - Avatao blog

Complementary Measures

Secure coding is complementary to pentesting services. In fact, pentesting services are very costly (as we will see later), so it’s important to make sure the baseline security practices are applied to allow pentesters to focus on the complex design and architectural issues.

You don’t want to burn expensive pentester time to find SQL injection vulnerabilities in the code or passwords stored in plain text.


Penetration testing is an important tool for identifying security vulnerabilities in software, but it is still just a reactive measure. Penetration tests are usually applied when the software is already written, or the product is ready for release or already in production. Secure coding practices are proactive measures that should be used to prevent security vulnerabilities from occurring in the first place.

Applying secure coding practices, especially in the design phase (such as threat modeling), can help organizations reduce the number of vulnerabilities that need to be identified and addressed through penetration testing.

With proper design, very costly architectural and design flaws can also be avoided. These are the most difficult to fix later.


Secure coding practices can be up to 5-10x more cost-effective than penetration testing.

Fixing security bugs is too late and costly - Avatao blog

Penetration testing can be expensive, especially when it needs to be done on a regular basis. Most security standards require annual penetration testing, but the efficiency is questionable, as pentesters only cover a subset of issues and new issues can easily crop up between annual pentests.

Secure coding practices, when applied consistently, can be implemented at the development stage, which can be an order of magnitude less expensive than identifying and addressing vulnerabilities through penetration testing. Additionally, organizations can save money by reducing the need for patching and other security maintenance activities.


Many organizations are required to comply with regulatory standards, such as HIPAA, PCI-DSS, or NIST. These standards require organizations to implement security controls to protect sensitive information and systems. Regular penetration testing is typically a fundamental requirement for such security standards, not because it is the most efficient control, but because it is easy to define and monitor.

Most compliance standards focus on the proof of work (aka. a checkmark that testing has been done), not on the outcome of the security tests and the improvement of security posture. This latter is very difficult to measure and to prescribe to organizations.

Secure coding practices are becoming a critical part of many security standards (mandatory in PCI-DSS and ISO27001, and highly recommended in SOC2 or FedRamp, achieved by compliance training) and can help organizations meet these requirements by ensuring that software is developed in a way that minimizes the risk of security vulnerabilities, or at least ensure that developers get the necessary security fundamentals down.


Secure coding training can help educate developers on how to write secure code. This education can help developers understand how to identify and avoid common security mistakes and how to implement secure coding practices.

Educating developers on secure coding practices, organizations can ensure that developers understand the importance of security and are equipped with the knowledge and skills to write secure code. Security bugs are just software bugs. Teaching developers about security bugs helps them understand general bugs and typically helps them avoid functional bugs as well.


Penetration testing is costly and can consume substantial resources as it is scaled to more products and lines of code. Secure coding practices can easily be scaled to fit the needs of an organization. As the organization’s software development needs change, secure coding practices can be adjusted to ensure that all new software is developed in a secure manner.

Moreover, basic security awareness training can easily be extended to multiple business units and product lines. When teams need special training, this can be scaled by establishing a security champion program and using continuous training to train the trainers (aka the security champions and the security teams).

We see that secure coding practices are an essential part of any organization’s security strategy. They are a cost-effective way to prevent security vulnerabilities, comply with regulatory standards, educate developers, and scale to the organization’s needs. Penetration testing is also important, but it should be considered a complementary measure to identify and address vulnerabilities in the software.

Organizations should implement both secure coding practices and penetration testing to ensure their software is as secure as possible. Secure coding fundamentals can greatly enhance the efficiency and usefulness of pentesting time.

It is also important to note that secure coding practices should be integrated into the software development process from the start, not just added as an afterthought. By incorporating secure coding practices into the development process, organizations can ensure that security is built into the software from the beginning, making it more difficult for attackers to exploit vulnerabilities.

As part of secure coding, organizations should also implement a robust code review process, including security which can help identify and address security issues early on in the development process. This can include both manual code reviews and automated tools that can check for common security vulnerabilities.

Another important aspect of secure coding training is that it should be regularly updated to keep developers up-to-date on new security threats and trends. It is very likely that it would help developers to be aware of the latest security risks and to be equipped with the knowledge and skills to address them.

Keeping the training content up-to-date is the biggest challenge for any secure coding training provider.


Secure coding training is a critical aspect of any organization’s security strategy. It is a proactive measure that can help prevent security vulnerabilities, reduce costs, comply with regulatory standards, and educate developers. In addition to secure coding training, organizations should also implement penetration testing to identify and address vulnerabilities in their software.

Implementing both secure coding training and penetration testing, organizations can ensure their software is as secure as possible.

Need advice to stay secure?

Our hands-on security training help your developers to deliver secure code faster that saves you time from debugging.

Share this post on social media!

Related Articles

JWT handling best practices

JWT handling best practices

The purpose of this post is to present one of the most popular authorization manager open standards JWT. It goes into depth about what JWT is, how it works, why it is secure, and what the most common security pitfalls are.

Ruby needs security

Ruby needs security

Every year, Ruby is becoming more and more popular thanks to its elegance, simplicity, and readability. Security, however, is an issue we can’t afford to neglect.

Python best practices and common issues

Python best practices and common issues

Python is a high-level, flexible programming language that offers some great features. To be as effective as possible, it is important to possess the knowledge to make the most out of coding with Python.