API Security: The First Steps Toward a Fortified Backend
Introduction: Why the series? Hi everyone. I am Victor and I'm glad to have you here. I have decided to make my contribution to solving a problem that currently plagues everyone in one way, shape or form. The problem of security. This is the beginning of a series of posts relating to DevSecOps. In this series, we will go through what it takes to implement a fully functional DevSecOps pipeline while comprehensively securing our API. We will build out a simple Todo API (Might do the front-end later) while integrating security every step of the way. We will revise various security implementations as the project matures. Essentially, I want to build the most secure backend possible. Disclaimer: This is my first time blogging, but you should see improvement over time. I will illustrate various concepts using various tools and will implement this API following the defense-in-depth principle at all levels. Without much further ado, let's dive into it! For the API, I will use the Django framework and other supporting libraries. What is "Defense In Depth" and why is it important? This is a cybersecurty strategy that uses multiple layers of security controls to protect assets. This way, if one measure 'fails', another can cover for this shortfall. This, however, is not to be confused with layered security as this is largely viewed as the practical implementation of Defense-in-depth. Some will describe layered security as multiple implementations of solutions that are geared towards achieving the same thing e.g. multiple firewalls. We can use the analogy of securing a house. You have door locks everywhere, a gate, perhaps even a dog, security guard and a highly sophisticated alarm system with CCTV cameras and other gizmos. By applying this approach, it becomes harder to attack and infiltrate the house. This series will focus on three core layers of security: API Security - Authentication, Authorization, Auditing, rate limiting, input validation (and other items we may need to consider) Data Protection - Encryption, secure storage, data integrity Network Security - Firewalls, DDOS protection, intrusion detection. The First Layer: Secure API Design Principles Before writing a single line of code, we need to establish guiding security principles:

Introduction: Why the series?
Hi everyone. I am Victor and I'm glad to have you here. I have decided to make my contribution to solving a problem that currently plagues everyone in one way, shape or form. The problem of security.
This is the beginning of a series of posts relating to DevSecOps. In this series, we will go through what it takes to implement a fully functional DevSecOps pipeline while comprehensively securing our API. We will build out a simple Todo API (Might do the front-end later) while integrating security every step of the way. We will revise various security implementations as the project matures. Essentially, I want to build the most secure backend possible.
Disclaimer: This is my first time blogging, but you should see improvement over time.
I will illustrate various concepts using various tools and will implement this API following the defense-in-depth principle at all levels. Without much further ado, let's dive into it!
For the API, I will use the Django framework and other supporting libraries.
What is "Defense In Depth" and why is it important?
This is a cybersecurty strategy that uses multiple layers of security controls to protect assets. This way, if one measure 'fails', another can cover for this shortfall. This, however, is not to be confused with layered security as this is largely viewed as the practical implementation of Defense-in-depth. Some will describe layered security as multiple implementations of solutions that are geared towards achieving the same thing e.g. multiple firewalls.
We can use the analogy of securing a house. You have door locks everywhere, a gate, perhaps even a dog, security guard and a highly sophisticated alarm system with CCTV cameras and other gizmos.
By applying this approach, it becomes harder to attack and infiltrate the house.
This series will focus on three core layers of security:
- API Security - Authentication, Authorization, Auditing, rate limiting, input validation (and other items we may need to consider)
- Data Protection - Encryption, secure storage, data integrity
- Network Security - Firewalls, DDOS protection, intrusion detection.
The First Layer: Secure API Design Principles
Before writing a single line of code, we need to establish guiding security principles: