Skip to content

Commit fdbf68a

Browse files
Merge branch 'devopsshield:main' into main
2 parents ba117e4 + 5a99b6d commit fdbf68a

2 files changed

Lines changed: 43 additions & 34 deletions

File tree

labs/lab03.md

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,33 +37,30 @@ References:
3737

3838
## 3.2 Create new environments, variables, and secrets - advanced pipeline
3939

40-
1. Open the workflow file [environments-secrets.yml](/.github/workflows/environments-secrets.yml)
41-
2. Edit the file and copy the following YAML content between the test and prod jobs (before the `use-environment-prod:` line):
42-
```YAML
43-
44-
use-environment-uat:
45-
name: Use UAT environment
46-
runs-on: ubuntu-latest
47-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
48-
needs: use-environment-test
49-
50-
environment:
51-
name: UAT
52-
url: 'https://uat.github.com'
53-
54-
steps:
55-
- name: Step that uses the UAT environment
56-
run: echo "Deployment to UAT..."
57-
env:
58-
env_secret: ${{ secrets.MY_ENV_SECRET }}
59-
60-
```
61-
7. Inside the `use-environment-prod` job, replace `needs: use-environment-test` with:
62-
```YAML
63-
needs: use-environment-uat
40+
1. Try running the advanced pipeline and you will quickly see it fail
41+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/f415605a-e5b8-44bd-800b-abca9a0eb68a)
42+
3. You can immediately remedy this by running
43+
```POWERSHELL
44+
.\Create-GitHubEnvironments.ps1 -ghOwner emmanuel-knafo `
45+
-ghRepo devsecops-workshop `
46+
-dockerName crs001fwmpo7kn3hnty `
47+
-dockerPassword "Dgv*************************************************" `
48+
-defectDojoProductId 6 `
49+
-defectDojoToken "607*************************************" `
50+
-githubReadOnlyPersonalAccessTokenClassic "ghp_pPK*********************************" `
51+
-kubeConfigFileName "C:\Users\emmanuel.DEVOPSABCS\Downloads\wrkshp-001-student-001-config-aks-wrkshp-001-s-001"
6452
```
65-
8. Commit the changes into the `main` branch
66-
9. Go to `Actions` and see the details of your running workflow
67-
10. Review your deployment and approve the pending UAT job
68-
- [Reviewing deployments](https://docs.github.com/en/actions/managing-workflow-runs/reviewing-deployments)
69-
11. Go to `Settings` > `Environments` and update the `PROD` environment created to protect it with approvals (same as UAT)
53+
3. You can grab all the parameter values from the OneDrive file you received:
54+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/e8e19ef5-f2c0-475c-8980-c80c56bbf176)
55+
4. Or you can enter each environment secret and variable manually till you get something like:
56+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/064215a3-a8d8-4650-950e-d2c1cd93032e)
57+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/b8a1ecdc-f215-4d12-bc25-500113c05f87)
58+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/e866fe16-7770-4f57-9942-c500121ceb10)
59+
6. Then run the advanced pipeline again
60+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/87935f10-003c-4a46-a76c-3973b17e35fa)
61+
7. It should end like this:
62+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/50900633-57f7-43c5-ae5c-7b20fa5a4ae0)
63+
9. You can view the deployed app here: http://gh-pygoat.cad4devops.com or find the ip in the deployment such as http://20.175.206.146 :
64+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/ba4b6912-f616-4da9-b2ff-2eb1ab118afa)
65+
10. Pygoat App is a great way to learn more about DevSecOps
66+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/aea2bf6e-538e-465e-821b-6518b047ce92)

labs/lab04.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,26 @@ References:
1010

1111
## 4.1 Secret Scanning with Gitleaks
1212

13-
1. For a workflow to be reusable, the `on` must include the `workflow_call` event
14-
13+
1. For Gitleaks Secret Scanning, uncomment this action:
14+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/0894fb96-77a9-4d16-96ac-b17a20d325f6)
15+
1. Run the pipeline to see
16+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/db223fc0-ce46-422a-a564-04aa9573dc4a)
1517

1618
## 4.2 Software Composition Analysis with OWASP Dependency Check
1719

18-
1. Uncommant the action
20+
1. Uncomment the actions ```dependency-check/Dependency-Check_Action@main```
21+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/69843416-215b-440f-ba3a-b5c83f393ae5)
22+
1. See the pipeline run
23+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/5a573256-dd04-4783-b91d-18e3016595da)
1924

2025
## 4.3 Static Application Security Test with CodeQL
2126

22-
1. Enable
23-
27+
1. Enable CodeQL in GitHub security settings
28+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/49a1f30a-7485-4454-bf38-385d19660d32)
29+
3. Be sure to configure the tool
30+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/c2f5d15e-35dc-408c-9a34-bee0a70647e7)
31+
4. Click Enable CodeQL
32+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/d21d21dd-a839-4665-8807-9836172fcc1c)
33+
6. After a scan, you should see some security vulnerabilities
34+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/7bf6aeb6-5f64-4498-ab76-a166bb86c551)
35+
![image](https://github.com/devopsshield/devsecops-workshop/assets/112144174/d74ea483-e82e-4dcc-aae0-6bab275487d7)

0 commit comments

Comments
 (0)