Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement DevSecOps through GitHub's Dependabot and CodeQL #305

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
02cb9dd
add Pipeline Foundation templates
aleks-ivanov Feb 24, 2021
210d630
Add CodeQL and Dependabot
aleks-ivanov Feb 24, 2021
d892865
add the dotnet clean to fix the dotner restore cache bug
aleks-ivanov Feb 24, 2021
38d86af
add the dotnet clean to fix the dotner restore cache bug
aleks-ivanov Feb 24, 2021
0850dda
add the dotnet clean to fix the dotner restore cache bug
aleks-ivanov Feb 24, 2021
deed7dd
add security-and-qualtiy queries to CodeQL
aleks-ivanov Feb 24, 2021
a431f98
Merge pull request #1 from aleks-ivanov/feature/add-dependabot-codeql
kulov Feb 25, 2021
f1e271d
add Pipeline Foundation templates
aleks-ivanov Feb 24, 2021
85156d7
Add CodeQL and Dependabot
aleks-ivanov Feb 24, 2021
d5ad9b7
add the dotnet clean to fix the dotner restore cache bug
aleks-ivanov Feb 24, 2021
70e8eb0
add the dotnet clean to fix the dotner restore cache bug
aleks-ivanov Feb 24, 2021
1c7bcbc
add the dotnet clean to fix the dotner restore cache bug
aleks-ivanov Feb 24, 2021
5fe834f
add security-and-qualtiy queries to CodeQL
aleks-ivanov Feb 24, 2021
9bf7b00
Merge branch 'devsecops' of https://github.com/pipeline-foundation/Mo…
aleks-ivanov Mar 10, 2021
8722756
Merge branch 'master' into devsecops
aleks-ivanov Apr 20, 2021
50af828
Merge branch 'master' into devsecops
aleks-ivanov Feb 13, 2022
5b7d2c5
Merge branch 'master' into devsecops
aleks-ivanov May 29, 2022
3b30152
Merge branch 'master' into devsecops
aleks-ivanov May 30, 2022
1e4c2ad
Merge branch 'master' into devsecops
aleks-ivanov Jun 19, 2022
1b45b16
Merge branch 'master' into devsecops
aleks-ivanov Jun 26, 2022
0e27700
Merge branch 'master' into devsecops
aleks-ivanov Jul 10, 2022
52bb30e
Merge branch 'master' into devsecops
aleks-ivanov Jul 11, 2022
fb5ebb4
Merge branch 'master' into devsecops
aleks-ivanov Sep 26, 2022
c347d73
Merge branch 'master' into devsecops
aleks-ivanov Sep 27, 2022
4ad853d
Merge branch 'master' into devsecops
aleks-ivanov Nov 7, 2022
b9200e3
Merge branch 'master' into devsecops
aleks-ivanov Nov 8, 2022
a2cd447
Merge branch 'master' into devsecops
aleks-ivanov Nov 9, 2022
9dcf66e
Merge branch 'master' into devsecops
aleks-ivanov Nov 10, 2022
516dfeb
Merge branch 'master' into devsecops
aleks-ivanov Nov 11, 2022
f8034ae
Merge branch 'master' into devsecops
aleks-ivanov Nov 12, 2022
a7ad5fa
Merge branch 'master' into devsecops
aleks-ivanov Nov 15, 2022
4d967fd
Merge branch 'master' into devsecops
aleks-ivanov Nov 17, 2022
5e2a017
Merge branch 'master' into devsecops
aleks-ivanov Oct 16, 2023
71f43ac
Merge branch 'master' into devsecops
aleks-ivanov Oct 18, 2023
8fdbd28
Merge branch 'master' into devsecops
aleks-ivanov Oct 19, 2023
f2d0a22
Merge branch 'master' into devsecops
aleks-ivanov Oct 20, 2023
c561036
Merge branch 'master' into devsecops
aleks-ivanov Oct 21, 2023
73fdcc3
Merge branch 'master' into devsecops
aleks-ivanov Oct 23, 2023
a3dcbdb
Merge branch 'master' into devsecops
aleks-ivanov Oct 24, 2023
8f77bb9
Merge branch 'master' into devsecops
aleks-ivanov Oct 25, 2023
8c4fa26
Merge branch 'master' into devsecops
aleks-ivanov Oct 26, 2023
eafad49
Merge branch 'master' into devsecops
aleks-ivanov Oct 28, 2023
5da695d
Merge branch 'master' into devsecops
aleks-ivanov Nov 1, 2023
0d1f4fd
Merge branch 'master' into devsecops
aleks-ivanov Nov 3, 2023
052d750
Merge branch 'master' into devsecops
aleks-ivanov Nov 6, 2023
bec31ce
Merge branch 'master' into devsecops
aleks-ivanov Nov 8, 2023
e4cd4e0
Merge branch 'master' into devsecops
aleks-ivanov Nov 9, 2023
99418a1
Merge branch 'master' into devsecops
aleks-ivanov Nov 10, 2023
bcbe579
Merge branch 'master' into devsecops
aleks-ivanov Nov 11, 2023
62eb9e4
Merge branch 'master' into devsecops
aleks-ivanov Nov 12, 2023
f241ccb
Merge branch 'master' into devsecops
aleks-ivanov Nov 13, 2023
8d761fa
Merge branch 'master' into devsecops
aleks-ivanov Nov 14, 2023
8915a61
Merge branch 'master' into devsecops
aleks-ivanov Nov 15, 2023
f358ccd
Merge branch 'master' into devsecops
aleks-ivanov Nov 17, 2023
7370b1e
Merge branch 'master' into devsecops
aleks-ivanov Nov 18, 2023
278c0ce
Merge branch 'master' into devsecops
aleks-ivanov Nov 19, 2023
cccacdc
Merge branch 'master' into devsecops
aleks-ivanov Nov 20, 2023
403928b
Merge branch 'master' into devsecops
aleks-ivanov Nov 21, 2023
eb46b60
Merge branch 'master' into devsecops
aleks-ivanov Nov 23, 2023
510741e
Merge branch 'master' into devsecops
aleks-ivanov Nov 24, 2023
87d8b10
Merge branch 'master' into devsecops
aleks-ivanov Nov 25, 2023
368f1f0
Merge branch 'master' into devsecops
aleks-ivanov Nov 27, 2023
4357326
Merge branch 'master' into devsecops
aleks-ivanov Nov 29, 2023
0f651ad
Merge branch 'master' into devsecops
aleks-ivanov Nov 30, 2023
3805cef
Merge branch 'master' into devsecops
aleks-ivanov Dec 2, 2023
347c4ac
Merge branch 'master' into devsecops
aleks-ivanov Dec 3, 2023
c0c20e1
Merge branch 'master' into devsecops
aleks-ivanov Dec 4, 2023
7c6eb80
Merge branch 'master' into devsecops
aleks-ivanov Dec 5, 2023
4be932c
Merge branch 'master' into devsecops
aleks-ivanov Dec 7, 2023
952e28b
Merge branch 'master' into devsecops
aleks-ivanov Dec 8, 2023
d31f36d
Merge branch 'master' into devsecops
aleks-ivanov Dec 9, 2023
05b3e88
Merge branch 'master' into devsecops
aleks-ivanov Dec 10, 2023
306b1d6
Merge branch 'master' into devsecops
aleks-ivanov Dec 11, 2023
c927cba
Merge branch 'master' into devsecops
aleks-ivanov Dec 12, 2023
b05e2c5
Merge branch 'master' into devsecops
aleks-ivanov Dec 14, 2023
62f6bd4
Merge branch 'master' into devsecops
aleks-ivanov Dec 15, 2023
a0c03e2
Merge branch 'master' into devsecops
aleks-ivanov Dec 16, 2023
04a1a45
Merge branch 'master' into devsecops
aleks-ivanov Dec 17, 2023
9e809eb
Merge branch 'master' into devsecops
aleks-ivanov Dec 19, 2023
2acf501
Merge branch 'master' into devsecops
aleks-ivanov Mar 14, 2024
eacb049
Merge branch 'master' into devsecops
aleks-ivanov Mar 15, 2024
0028f6c
Merge branch 'master' into devsecops
aleks-ivanov Mar 16, 2024
01aa789
Merge branch 'master' into devsecops
aleks-ivanov Mar 17, 2024
c43a80b
Merge branch 'master' into devsecops
aleks-ivanov Mar 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "github-actions"
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "nuget"
# location of package manifests
directory: "/"
schedule:
interval: "daily"

# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
54 changes: 54 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CodeQL Analysis

on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 8 * * *'

jobs:
analyze:
name: codeql-analysis
runs-on: windows-latest
steps:
- name: Setup .NET
id: setup_dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Checkout repository
id: checkout_repo
uses: actions/checkout@v2

- name: Clean .NET cache
id: clean_dotnet_cache
shell: pwsh
run: |
dotnet clean ./ModernWpf.sln --configuration Release
dotnet nuget locals all --clear

- name: Install dependencies
id: dotnet_restore
shell: pwsh
run: |
dotnet restore

- name: Initialize CodeQL
id: init_codeql
uses: github/codeql-action/init@v1
with:
queries: security-and-quality

- name: Build
id: dotnet_build
shell: pwsh
run: |
dotnet build --configuration Release --no-restore

- name: Perform CodeQL Analysis
id: analyze_codeql
uses: github/codeql-action/analyze@v1

# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
67 changes: 67 additions & 0 deletions CI-CD_DOCUMENTATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# ModernWpf CI/CD documentation

## 1. Set up Dependabot

Dependabot is a GitHub native security tool that goes through the dependencies in the project and creates alerts, and PRs with updates when a new and/or non-vulnerable version is found.

- for PRs with version updates, this pipeline comes pre-configured for all current dependency sources in the project, so at "Insights" tab -> "Dependency graph" -> "Dependabot", you should be able to see all tracked sources of dependencies, when they have been checked last and view a full log of the last check

![Dependabot_tab](/CI-CD_DOCUMENTATION/Dependabot_tab.png)

![Dependabot_log_page](/CI-CD_DOCUMENTATION/Dependabot_log_page.png)

### Set up security alerts and updates
##### - GitHub, through Dependabot, also natively offers a security check for vulnerable dependencies

1. Go to the project's GitHub repository and click on the **Settings** tab

2. Go to **Security & analysis** section

3. Click "Enable" for both "Dependabot alerts" and "Dependabot security updates"

- By enabling "Dependabot alerts", you would be notified for any vulnerable dependencies in the project. At "Security" tab -> "Dependabot alerts", you can manage all alerts. By clicking on an alert, you would be able to see a detailed explanation of the vulnerability and a viable solution.

![Dependabot_alerts_page](/CI-CD_DOCUMENTATION/Dependabot_alerts_page.png)

![Dependabot_alert_page](/CI-CD_DOCUMENTATION/Dependabot_alert_page.png)

- By enabling "Dependabot security updates", you authorize Dependabot to create PRs specifically for **security updates**

![Dependabot_PRs](/CI-CD_DOCUMENTATION/Dependabot_PRs.png)

### Set up Dependency graph
##### - The "Dependency graph" option should be enabled by default for all public repos, but in case it isn't:

1. Go to the project's GitHub repository and click on the **Settings** tab

2. Go to **Security & analysis** section

3. Click "Enable" for the "Dependency graph" option

- this option enables the "Insights" tab -> "Dependency graph" section -> "Dependencies" tab, in which all the dependencies for the project are listed, under the different manifests they are included in

![Dependabot_dependency_graph](/CI-CD_DOCUMENTATION/Dependabot_dependency_graph.png)

NOTE: **screenshots are only exemplary**

<br>

## 2. CodeQL

CodeQL is GitHub's own industry-leading semantic code analysis engine. CodeQL requires no setup, because it comes fully pre-configured by us.

To activate it and see its results, only a push commit or a merge of a PR to the default branch of your repository, is required.

We've also configured CodeQL to run on schedule, so every day at 8:00AM UTC, it automatically tests the code.

- you can see the results here at **Security** tab -> **Code scanning alerts** -> **CodeQL**:

![CodeQL_results](/CI-CD_DOCUMENTATION/CodeQL_results.png)

- on the page of each result, you can see an explanation of what the problem is and also one or more solutions:

![CodeQL_alert_page](/CI-CD_DOCUMENTATION/CodeQL_alert_page.png)

#

Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
Binary file added CI-CD_DOCUMENTATION/CodeQL_alert_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CI-CD_DOCUMENTATION/CodeQL_results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CI-CD_DOCUMENTATION/Dependabot_PRs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CI-CD_DOCUMENTATION/Dependabot_alert_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CI-CD_DOCUMENTATION/Dependabot_alerts_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CI-CD_DOCUMENTATION/Dependabot_log_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CI-CD_DOCUMENTATION/Dependabot_tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.