How to secure cloud-native applications

This article is based on the Elephant in AppSec podcast episode with Mihir Shah, a Senior Staff Application Security Engineer at ForgeRock, and the author of the Cloud Native Software Security Handbook.

How to secure cloud-native applications

Welcome to the Elephant in AppSec, the podcast to explore, challenge, and boldly face the AppSec Elephants in the room.

In this article, we'll cover the main takeaways from our conversation with Mihir Shah, a cloud-native applications security expert. Our goal is to help you understand how to secure your cloud-native applications. Dive right in!

Mihir's background

Mihir Shah is a Senior Staff Application Security Engineer at ForgeRock, specializing in architecting secure cloud-based Identity & Access Management services hosted using Kubernetes and Google Cloud Platform.

He is also the author of the Cloud Native Software Security Handbook, a comprehensive guide on securing cloud-native applications and services.

Additionally, he serves as an Industry Mentor at Stanford University's Advanced Cybersecurity Program and holds two patents on defense against cloud-native infrastructure.

Mihir is passionate about learning and sharing his knowledge on cloud-native security, software development security, and serverless computing. He is a frequent speaker and trainer at security conferences such as BlackHat, DefCon, and OWASP. Moreover, he has published multiple articles on Medium covering various security topics, such as hacking Windows machines, scanning vulnerable Docker images, and compromising Windows systems.

Listen now on Spotify and YouTube. The Elephant in AppSec caters to all: Whether you prefer listening or watching, we have something for everyone 😌


How to secure cloud-native applications: A practical approach

The shift towards cloud-native applications has introduced both challenges and opportunities in application security within recent years. As organizations migrate their systems to the cloud, understanding how to effectively secure these applications is paramount.

The importance of a secure SDLC

The security of cloud-native applications begins with the Secure Software Development Life Cycle (SDLC). This process integrates security from the initial stages of architectural design, employing threat modeling and various security tools to identify and mitigate potential risks. Despite the change in deployment environments, the core application security vulnerabilities remain largely consistent with traditional applications.

Cloud-native applications are no different in that regard, right? It's still intuitively, it's still an application, it's just that you're deploying it on the cloud. So, the application security vulnerabilities still remain to be the same for the most part of it...- Mihir Shah

Cloud-native considerations

While cloud-native applications share many security concerns with traditional applications as we mentioned above, they also introduce unique challenges due to their dynamic and distributed nature. For instance, the use of microservices, containers, and serverless architectures in cloud-native applications requires specific security measures tailored to these technologies.

Here are some key points Mihir Shah highlights regarding cloud-native security:

Inherent cloud platform security

Cloud-native applications are built to run in cloud environments, which means they inherit both the strengths and weaknesses of the cloud platform's security. Understanding the security features and potential vulnerabilities of the cloud service provider is essential. This includes configurations for access control, encryption, network security, and compliance with industry standards.

Infrastructure as Code (IaC)

With cloud-native applications, infrastructure is often provisioned and managed through code. IaC allows for the automation of infrastructure deployment, but it also means that security must be considered in the code that defines the infrastructure. Tools for scanning and validating IaC for security issues are an important part of the security toolkit.

Microservices and container security

Cloud-native applications frequently utilize microservices architecture, often deployed in containers. Each microservice and container needs to be secured, which includes managing container vulnerabilities, securing inter-service communication, and ensuring that containers are only given the minimum necessary privileges.

Serverless function security

Serverless computing is another common pattern in cloud-native applications. Security in a serverless environment involves securing the functions themselves, managing permissions and access controls, and ensuring that the event triggers and data sources that invoke serverless functions are secure.

API security

Cloud-native applications often expose functionality through APIs. Securing these APIs against attacks such as injection, broken authentication, and sensitive data exposure is critical. This includes implementing and securing API gateways, rate limiting, monitoring API traffic for suspicious behavior, and using automated API security tools.

Identity and Access Management (IAM)

Effective IAM is crucial in cloud-native environments to ensure that only authorized users and services can access resources. This involves managing user identities, roles, permissions, and policies that govern what actions can be taken on resources within the cloud environment.

Continuous monitoring and response

The dynamic nature of cloud-native applications requires continuous monitoring to detect and respond to security incidents in real time. This includes collecting and analyzing logs, setting up alerts for suspicious activities, and having an incident response plan in place.

Compliance and Governance

Cloud-native applications must comply with relevant regulations and standards. This involves implementing governance policies that enforce compliance requirements and regularly auditing the environment to ensure adherence to these policies.

By addressing these cloud-native security considerations, organizations can better protect their applications from potential threats and ensure the integrity, confidentiality, and availability of their services in the cloud.

Bridging theory and practice

A common pitfall in application security is the disconnect between theoretical knowledge and practical implementation. Security professionals must focus on pragmatic solutions that can be integrated into the development pipeline. This includes leveraging tools that automate security checks and enforce policies as code is pushed to the cloud.

Here's a practical checklist for securing cloud-native applications:

1. Incorporate security in the design phase

  • Conduct threat modeling: Identify potential threats and vulnerabilities early in the design process.
  • Define security requirements: Establish clear security goals and requirements based on the threat model.

2. Implement security in the development pipeline

  • Integrate security tools: Use Static Application Security Testing (SAST) and Dynamic Application Security Testing (DAST) tools within the CI/CD pipeline. Learn here what's the difference between SAST and DAST.
  • Code review: Perform regular code reviews with a focus on security, and consider using automated tools to assist in the process.
  • Dependency scanning: Regularly scan dependencies for known vulnerabilities using tools like OWASP Dependency-Check.

3. Secure deployment and runtime environments

  • Configuration management: Ensure that cloud environments are configured securely, following best practices and guidelines from cloud providers.
  • Secrets management: Use tools like HashiCorp Vault or AWS Secrets Manager to securely store and manage sensitive information.
  • Implement Least Privilege Access: Assign minimal permissions necessary for services and users to operate.

4. Monitor and log

  • Enable logging: Collect and monitor logs for abnormal activities using tools like Elasticsearch, Fluentd, and Kibana (EFK stack).
  • Implement monitoring solutions: Use monitoring tools to track the health and security of applications in real-time.

5. Automate security responses

  • Automate incident response: Develop automated responses for common security incidents.
  • Regularly update security rules: Keep security rules for firewalls, intrusion detection/prevention systems, and other security tools up-to-date.

6. Educate and train the team

7. Perform regular security assessments

  • Conduct penetration testing: Regularly test your applications and infrastructure for vulnerabilities.
  • Security audits: Perform periodic security audits to ensure compliance with security policies and standards.

8. Plan for incident response

  • Develop an incident response plan: Have a clear plan in place for responding to security incidents.
  • Conduct incident response drills: Regularly practice the incident response plan to ensure readiness.

9. Stay informed and adapt

  • Keep abreast of security trends: Stay updated on the latest security threats and trends.
  • Continuously improve: Regularly review and update security practices based on new information and insights.

By following this checklist, you can secure your cloud-native applications. Remember, security is an ongoing process that requires continuous attention and improvement.

The role of security in product engineering

Product security engineering goes beyond running through checklists to identify vulnerabilities. It involves designing and implementing security solutions that enhance the overall security posture of cloud-native applications. This proactive approach ensures that security is baked into the product, rather than being an afterthought.

Mihir also touches on the idea that security is not solely the responsibility of a dedicated security team. Developers, operations, and other stakeholders must all play a role in maintaining the security of the application. This shared responsibility model ensures that security is integrated into every aspect of the application's development and operation.

The shift from on-premises to cloud-native

Applications not originally designed with cloud-native principles in mind are often more susceptible to vulnerabilities when migrated to the cloud. For instance, issues like Server-Side Request Forgery (SSRF) can have more severe consequences in a cloud environment compared to an on-premises deployment. Therefore, it's crucial to consider cloud-specific security concerns during the design and development phases.

The future of cloud-native application security

The future of securing cloud-native applications lies in the integration of static and dynamic analysis tools, combined with real-time monitoring and automated response mechanisms. By leveraging open-source tools and building upon them, security engineers can create scalable solutions that address security challenges across the entire application landscape.

In conclusion, securing cloud-native applications requires a blend of solid software engineering skills, a deep understanding of cloud platforms, and a proactive approach to security. By staying current with industry trends, engaging with the community, and continuously learning, security professionals can effectively protect their cloud-native applications against emerging threats.

Learning resources for aspiring security professionals

For those looking to deepen their understanding of cloud-native security, there are numerous resources available. From comprehensive handbooks to industry conferences and articles, the key is to engage with materials that offer both theoretical insights and practical advice.

Mihir Shah highlighted several learning resources for those interested in cloud-native application security and software development security. Here's a summary of the resources he mentioned:

  1. OWASP (Open Web Application Security Project): A nonprofit foundation that works to improve the security of software. OWASP provides free resources, including documentation, tools, and forums, to help organizations develop secure applications. OWASP Web Security Testing Guide provides information on web application security testing. Software Assurance Maturity Model (SAMM), OWASP framework to help organizations formulate and implement a strategy for software security that is tailored to the specific risks facing the organization.
  2. CTFs (Capture The Flag) competitions: These are security competitions where participants solve security-related challenges to find a "flag." CTFs are excellent for hands-on learning and for understanding the attacker's mindset.
  3. Cloud Native Computing Foundation (CNCF): CNCF hosts a range of projects that are integral to the cloud-native landscape, including Kubernetes. They also provide resources and tools related to cloud-native security.
  4. Security Books:
  1. Bug Bounty Programs: Participating in bug bounty programs can provide practical experience in finding and reporting security vulnerabilities in real-world applications.
  2. Cloud Vendor Documentation and Blogs: Reading the documentation and engineering blogs from cloud service providers like AWS, GCP, and Azure can provide insights into best practices for securing cloud-native applications.
  3. Meetups and Conferences: Attending industry meetups and conferences is a great way to network with professionals and stay updated on the latest trends and best practices in cloud-native security.
  4. Security Technical Advisory Group at CNCF: A group that provides expertise and advice to the CNCF on security-related matters.
  5. Hackathons: Participating in hackathons can be a practical way to apply security knowledge and collaborate with others on security projects.

By engaging with these resources, you can build a strong foundation in cloud-native application security.

💡 Want to discover other episodes? Check it out below: