
Setting up a secure CI/CD pipeline is crucial for any Azure DevSecOps environment. This involves integrating security into every stage of the pipeline, from code to deployment.
Azure provides a range of tools to help you achieve this, including Azure Pipelines, Azure Security Center, and Azure Monitor. These tools work together to provide a comprehensive security framework.
A secure CI/CD pipeline helps to detect and prevent security vulnerabilities early on, reducing the risk of costly security breaches.
Enterprise DevOps Environment
An Enterprise DevOps environment is a secure setup of tools and practices that harden developer, DevOps platform, and application environments.
By integrating security early in the development cycle, you can detect potential security vulnerabilities automatically at code review time. This is achieved by using Microsoft Visual Studio and GitHub to incorporate security thinking in the earliest stages of development.
Using third-party code and open-source software for your applications can be a challenge, but with Azure and GitHub products and services, you can achieve better control of your software supply chain. These services inspect your code in production and trace third-party components in use for increased security.
Readers also liked: Azure vs Azure Devops
With Azure, you can run your code on managed application platforms, including Kubernetes, and use trusted services to manage your keys, tokens, and secrets more securely. This increases confidence in the security of your environment.
A well-designed Enterprise DevOps environment also includes tight access control, which is achieved with Azure's leading identity services for your organization's internal users and external consumers who access your applications.
Security as Company Culture
Security as company culture is a vital aspect of Azure DevSecOps. Emilio Escobar, Chief Information Security Officer at Datadog, emphasizes that security should be everyone's responsibility, just like functionality and quality of the product.
To achieve this, companies should adopt a shift-left strategy, where security best practices are integrated from the beginning of development, rather than auditing at the end. This approach is the core of DevSecOps in Azure, which ensures that custom or client data is managed and secured from the start.
Establishing a culture of security requires effective communication and interaction among teams. Engineers, product managers, and other stakeholders should all care about security, just as they do about functionality and quality. By making security a shared responsibility, companies can create a culture where everyone is invested in ensuring the security of their products and services.
Here are some key takeaways for establishing a security culture:
- Shift-left strategy: Integrate security best practices from the beginning of development.
- DevSecOps in Azure: Ensure security from the start, especially when managing custom or client data.
- Shared responsibility: Make security a shared responsibility among teams, just like functionality and quality.
Development and Deployment
Developers are responsible for writing the application code, committing it to a designated repository, and authoring scripts for automated testing to ensure the code works as intended.
In the development phase, adopting secure coding best practices and using IDE tools and plugins for code analysis can help address security issues earlier in the development lifecycle.
Developers define and script the building of container images as part of the automation pipeline, and they're also responsible for committing application code to a corporate-owned and governed GitHub Enterprise repository.
Related reading: Azure Repository
To ensure secure deployment credentials, use OpenID Connect (OIDC) to let GitHub Action workflows access resources in Azure without storing Azure credentials as long-lived GitHub secrets.
Here's a breakdown of the development and deployment process:
By following this process, you can ensure that your application is deployed securely and efficiently, and that any security issues are addressed early on in the development lifecycle.
Container Security
Container security is crucial to protect your Azure DevSecOps environment from potential threats. You can start by securing your container images, which involves using lightweight images with a minimal OS footprint to reduce the surface-attack area.
Using Alpine or distroless images that only contain your application and its associated runtime can help achieve this. Mariner, the Microsoft open-source Linux distribution, is a lightweight, hardened distribution designed for AKS to host containerized workloads.
To further secure your images, use only trusted base images when building your containers, and retrieve them from a private registry that is frequently scanned for vulnerabilities. You can also use developer tools to evaluate image vulnerabilities locally.
Preventing root user access/context for an image is also essential, as containers run as root by default. Here are some trusted registries you can use: Private registriesMicrosoft Container RegistryAmazon AWS Elastic Container Registry (ECR)
Regularly scanning your workload images in container registries can also help identify known vulnerabilities. You can use Defender for Containers to scan the containers in Container Registry and Amazon AWS Elastic Container Registry (ECR) to notify you if there are known vulnerabilities in your images.
Container Registry
Container Registry is a crucial component of container security. It's a centralized location where you store and manage your container images.
To secure your container images, use a registry like Azure Container Registry, which has integrated security with Microsoft Defender for Cloud. This provides streamlined container lifecycle orchestration and management.
A registry like Azure Container Registry helps developers manage container images across multiple geographical locations, automatically build and patch containers. It also serves as a function of task scheduling and base image updates.
Here are some benefits of using a registry like Azure Container Registry:
- Automatically build and patch containers
- Manage container images across multiple geographical locations
- Provide streamlined container lifecycle orchestration and management
- Integrate security with Microsoft Defender for Cloud
By using a registry like Azure Container Registry, you can ensure that your container images are secure and up-to-date. This is especially important when deploying container images from trusted registries only, as recommended by best practices.
Managing AKS Clusters
Managing AKS Clusters is a crucial aspect of Container Security. Cluster operators are responsible for configuring and managing the cluster infrastructure, using infrastructure as code (IaC) best practices and frameworks like GitOps.
They use various monitoring tools like Azure Monitor Container insights and Prometheus/Grafana to monitor overall cluster health. This helps identify potential security risks early on.
Cluster operators are also responsible for patching and cluster upgrades, permissions/RBAC, and ensuring that the clusters meet the security requirements of the team. They work closely with the security team to create those standards.
To keep your Kubernetes clusters updated, it's essential to have a lifecycle management strategy in place. This involves upgrading AKS worker nodes more frequently, with weekly OS and runtime updates that can be applied automatically or through the Azure CLI.
Here are some best practices for managing AKS clusters:
- Kubernetes releases are rolled out frequently. It's essential to have a lifecycle management strategy in place to ensure you don't fall behind and out of support.
- Apply policy definitions to your cluster and verify those assignments are being enforced.
- Enable DNS query logging by applying documented configuration in your CoreDNS custom ConfigMap.
By following these best practices and using tools like Azure Policy and Gatekeeper, you can secure and govern your AKS clusters effectively. This will help prevent security risks and ensure compliance with industry-specific or regional standards.
Deployment and Operations
In Azure DevSecOps, deployment and operations are critical phases that require careful planning and execution. Securely reducing deployment time at DevOps speed is crucial for businesses, which is why CDT implemented Azure and GitHub for their DevSecOps processes, CI/CD, and infrastructure.
This enables their teams to collaborate and release code faster and more securely. By using Azure and GitHub, teams can automate deployment processes and reduce the risk of human error.
To ensure secure deployment credentials, it's essential to use OpenID Connect (OIDC) to let your GitHub Action workflows access resources in Azure without needing to store the Azure credentials as long-lived GitHub secrets. This adds an extra layer of security to your deployment process.
Using environments for deployment is also a best practice, as it allows you to configure environments with protection rules and secrets. This ensures that sensitive information is not exposed during deployment.
During the operate phase, operation monitoring and security monitoring tasks are performed to proactively monitor, analyze, and alert on potential security incidents. This includes running continual scanning to detect drift in the vulnerability state of your application and implementing a process to patch and replace the vulnerable images.
Automated configuration monitoring for operating systems is also crucial, as it helps identify potential security issues before they become major problems. Conducting a vulnerability assessment for images stored in Container Registry is another essential task, as it helps ensure that all images are up-to-date and secure.
See what others are reading: Azure Credentials
Here are some key tasks to perform during the operate phase:
- Run continual scanning to detect drift in the vulnerability state of your application and implement a process to patch and replace the vulnerable images.
- Implement automated configuration monitoring for operating systems.
- Conduct a vulnerability assessment for images stored in Container Registry.
Operational Security
Operational Security is a critical phase in the DevSecOps process, where operation monitoring and security monitoring tasks are performed to proactively monitor, analyze, and alert on potential security incidents. During this phase, you should use production observability tools like Azure Monitor and Microsoft Sentinel to monitor and ensure compliance with enterprise security standards.
Run continual scanning to detect drift in the vulnerability state of your application and implement a process to patch and replace the vulnerable images. This is especially important in a multicloud environment, where security can be a challenge.
Implement automated configuration monitoring for operating systems, so you can quickly identify any potential security issues. Conduct a vulnerability assessment for images stored in Container Registry to ensure they are secure.
Here are some key tasks to perform during the Operate phase:
- Run continual scanning to detect drift in the vulnerability state of your application and implement a process to patch and replace the vulnerable images.
- Implement automated configuration monitoring for operating systems.
- Conduct a vulnerability assessment for images stored in Container Registry.
Monitoring and Alerting
Monitoring and Alerting is a crucial part of Azure DevSecOps, and it's essential to have the right tools in place to ensure your applications, infrastructure, and network are running smoothly.
Azure Monitor provides full observability into your applications, infrastructure, and network, giving you real-time insights into your apps' health.
You can use Azure Monitor to collect logs and metrics from AKS, gaining insights into the availability and performance of your application and infrastructure.
This also gives you access to signals to monitor your solution's health and spot abnormal activity early, which is critical for preventing issues before they become major problems.
Microsoft Defender for Cloud provides active threat monitoring on the AKS at the node level (VM threats) and for internals, giving you an added layer of security.
Defender for DevOps provides comprehensive visibility, giving security and operator teams a centralized dashboard for all your CI/CD pipelines.
Defender for Key Vault can detect unusual, suspicious attempts to access key vault accounts and alert administrators based on configuration.
Defender for Containers can alert on vulnerabilities found within your container images stored on Container Registry.
To connect AKS diagnostics logs to Microsoft Sentinel for centralized security monitoring based on patterns and rules, you can use data connectors.
This enables your DevSecOps team to gather, decompose, and make informed decisions based on telemetry collected in the cloud and on-prem, elevating performance and quickly spotting and mitigating emerging problems.
You might like: Azure App Insights vs Azure Monitor
Frequently Asked Questions
What does DevSecOps mean?
DevSecOps refers to the integration of security practices into the development and operations of software applications. It combines development, security, and operations to ensure secure and efficient software delivery.
Sources
- https://azure.microsoft.com/en-us/solutions/devsecops
- https://learn.microsoft.com/en-us/azure/architecture/solution-ideas/articles/devsecops-infrastructure-as-code
- https://learn.microsoft.com/en-us/azure/architecture/guide/devsecops/devsecops-on-aks
- https://www.infopulse.com/blog/devsecops-azure-aws
- https://azure.github.io/AKS-DevSecOps-Workshop/modules/Module0/intro.html
Featured Images: pexels.com