> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Section 3 Topics

> This lesson strengthens CI/CD workflows by integrating security measures like testing stages and vulnerability scans.

Welcome to Section 3! In this lesson, we’ll strengthen our CI/CD workflow by:

* Connecting GitHub for source control
* Adding unit and integration testing stages
* Running vulnerability scans
* Performing dynamic application security testing (DAST)

<Frame>
  ![The image outlines a DevSecOps pipeline, detailing sections on introduction, a simple DevOps pipeline, adding security, and Kubernetes security, with specific tasks and tools listed under each section.](https://kodekloud.com/kk-media/image/upload/v1752873726/notes-assets/images/DevSecOps-Kubernetes-DevOps-Security-Section-3-Topics/devsecops-pipeline-introduction-security-kubernetes.jpg)
</Frame>

<Callout icon="lightbulb" color="#1CB2FE">
  Ensure you have a GitHub repository connected and a Jenkins server with the Kubernetes plugin installed.
</Callout>

## DevSecOps Pipeline Overview

Below is a high-level breakdown of each stage in our DevSecOps pipeline:

| Stage                                | Purpose                                             | Tool(s)                |
| ------------------------------------ | --------------------------------------------------- | ---------------------- |
| Source Control                       | Host and version application code                   | GitHub                 |
| Unit Testing                         | Validate individual functions and modules           | JUnit, pytest          |
| Integration Testing                  | Test interactions between services                  | Postman, Selenium      |
| Vulnerability Scanning               | Identify security flaws in code and dependencies    | OWASP Dependency-Check |
| Dynamic Application Security Testing | Simulate real-world attacks against the running app | OWASP ZAP              |

## 3.1 Verify Kubernetes Rollout Status

After deploying to Kubernetes, confirm that your pods have rolled out successfully:

```bash theme={null}
kubectl rollout status deployment/<your-deployment-name> -n <namespace>
```

If the rollout stalls or fails, troubleshoot with:

```bash theme={null}
kubectl describe deployment/<your-deployment-name> -n <namespace>
kubectl logs deployment/<your-deployment-name> -n <namespace>
```

## 3.2 Configure Jenkins for Slack Notifications

Keep your team informed by sending build alerts to Slack. Add the following to your Jenkinsfile:

```groovy theme={null}
pipeline {
  agent any
  stages {
    stage('Build') { /* build steps */ }
    stage('Test')  { /* test steps */ }
    // ... other stages ...
  }
  post {
    success {
      slackSend(
        channel: '#ci-cd', 
        message: "✅ Build successful: ${env.JOB_NAME} #${env.BUILD_NUMBER}"
      )
    }
    failure {
      slackSend(
        channel: '#ci-cd', 
        message: "❌ Build failed: ${env.JOB_NAME} #${env.BUILD_NUMBER}"
      )
    }
  }
}
```

<Callout icon="triangle-alert" color="#FF6B6B">
  Make sure the Slack plugin is installed in Jenkins and you have configured your Incoming Webhook URL under **Manage Jenkins → Configure System → Slack**.
</Callout>

## Next Steps

In Section 4, we’ll focus on Kubernetes security best practices: pod hardening, network policies, and runtime protection.

## Links and References

* [Kubernetes Rollout Commands](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#rollout)
* [Jenkins Slack Plugin](https://plugins.jenkins.io/slack/)
* [GitHub Documentation](https://docs.github.com/)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/devsecops-kubernetes-devops-security/module/877bd662-968c-40a5-bda6-a42b600ea957/lesson/c8161977-30b8-4880-815f-78800b7ece6e" />
</CardGroup>
