You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 1, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: responses/01_find-vulnerabilities.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
## Finding vulnerable dependencies
2
2
3
-
Security vulnerabilities can cause a range of problems for your project or the people who use it. A vulnerability could affect the confidentiality, integrity, or availability of a project. Sometimes vulnerabilities aren't in the code you write, but in the code your project depends on. Staying up-to-date with the most recent versions is the best line of defense.
3
+
Security vulnerabilities can cause a range of problems for your project or the people who use it. A vulnerability could affect the confidentiality, integrity, or availability of a project. Sometimes vulnerabilities aren't in the code you write, but in the code your project depends on. Staying up-to-date with the most recent versions is the best line of defense, but has the potential to cause integration issues, so GitHub alerts you of the safest next-version of a dependency.
4
4
5
5
This repository has some existing dependencies which will need updating to stay secure.
6
6
7
7
<details>
8
8
<summary>How can we identify dependencies and if they are vulnerable?</summary>
9
9
<hr>
10
10
11
-
This repository is a Node.js project utilizing NPM. Because of that, the `package.json`defines this repository's dependencies. For our time together, we'll be focusing on these JavaScript dependencies. Keep in mind that different programming languages may have different dependency files. You might work with a `Gemfile`, `Gemfile.lock`, `*.gemspec`, `requirements.txt`, `pipfile.lock`, or other files.
11
+
This repository is a Node.js project utilizing NPM. Because of that, [`package.json`]({{ repoUrl }}/blob/master/package.json) defines this repository's dependencies. For our time together, we'll be focusing on these JavaScript dependencies. Keep in mind that different programming languages may have different dependency manifests. You might work with a `Gemfile`, `Gemfile.lock`, `*.gemspec`, `requirements.txt`, `pipfile.lock`, or other files.
12
12
13
-
How can we know these dependencies are secure? It's not always easy, but GitHub is watching out.
13
+
How can we know these dependencies are secure? GitHub monitors a number of reputable [data sources](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies#data-sources-for-security-alerts) to track vulnerabilities across projects.
14
14
15
15
<hr>
16
16
</details>
@@ -21,9 +21,9 @@ You may notice some alerts from GitHub about this repository. You may get an ema
GitHub tracks public vulnerabilities in Ruby gems, NPM, Python, Java, and .Net packages.
24
+
GitHub tracks vulnerabilities for a number of [supported languages](https://help.github.com/en/github/visualizing-repository-data-with-graphs/listing-the-packages-that-a-repository-depends-on#supported-languages) and their associated package managers, including RubyGems, NPM, Python PIP, Maven, and Nuget.
25
25
26
-
GitHub receives a notification of a newly-announced vulnerability. Next, we check for repositories that use the affected version of that dependency. We send security alerts to a set of people within those affected repositories. The owners are contacted by default. But, it's possible to configure specific teams or individuals to get these important notifications.
26
+
GitHub receives a notification of a newly-announced vulnerability. Next, we check for repositories that use the affected version of that dependency. We send security alerts to a set of people within those affected repositories. The owners are contacted by default and it's possible to configure specific teams or individuals to get these important notifications.
27
27
28
28
**GitHub never publicly discloses identified vulnerabilities for any repository.**
Copy file name to clipboardExpand all lines: responses/03_good-pr.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Great job, @{{ user.username }}, your pull request looks good. Thank you for fixing the vulnerable dependency!
4
4
5
-
_Note: You might notice that this repository has a `package.json` file, but no `package-lock.json` file. We are doing all parts of this activity on GitHub.com. If you work with other repositories, you might notice some differences. Regardless of what dependency files you use, the main concepts of this course still apply._
5
+
_Note: You might notice that this repository has a `package.json` file, but no `package-lock.json` file. In production code it's a good idea to have both files to avoid conflicts resolving the proper version of a dependency. For simplicity, we'll use only `package.json`, but GitHub monitors both files in addition to the gamut of supported languages and packages_
Copy file name to clipboardExpand all lines: responses/03_update-dependency.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Next, we'll go through the GitHub Flow to make some changes. If you aren't sure how to do this, try the [Introduction to GitHub course](https://lab.github.com/githubtraining/introduction-to-github) and then come back to give it another try.
4
4
5
-
> _Note: Before doing this with real world code, make sure that the upgraded package works with your code. Good unit tests and CI (continuous integration) will help you update with confidence._
5
+
> _Note: For production code, it's a good idea to do some integration testing to make sure that the upgraded package works with your code. Good unit tests and Continuous Integration (CI) will help you update with confidence. The Learning Lab course [GitHub Actions: Continuous Integration](https://lab.github.com/githubtraining/github-actions:-continuous-integration) can teach you how to set up CI!_
6
6
7
7
## Step 4: Updating dependency versions
8
8
@@ -12,5 +12,5 @@ Now that you know the recommended version, it's time to edit the `package.json`
12
12
13
13
1. Within this pull request, go to **Files changed**.
14
14
1. Click the ellipsis (`...`) in the right upper corner and click **Edit file** to edit the `package.json` file.
15
-
1. Fix the vulnerability by updating to the latest version of the dependency that you took note of earlier.
15
+
1. Fix the vulnerability by updating to the latest version of the dependency that you took note of earlier, version `2.6.9` of `debug`.
Dependabot creates pull requests to keep your dependencies secure and up-to-date!
10
10
11
11
### How does Dependabot work?
12
12
13
-
1. Dependabot scans your repository and checks for updates or insecure requirements
13
+
Dependabot is the actor for GitHub's automated security fixes.
14
+
15
+
1. GitHub uses the dependency graph and security alerts to scan your repository and notify you of potential dependency updates
14
16
1. If any dependencies are out-of-date, Dependabot opens a pull request to update each one
15
17
1. If tests pass, and the updated version looks good, you simply merge the pull request
16
18
@@ -22,16 +24,16 @@ You can enable automated security fixes for any repository that uses security al
22
24
23
25
Here, we have a security alert on the **debug** dependency. Clicking on **debug** will show you the pull request created by Dependabot to update the dependency. We just updated to `2.6.9` but Dependabot noticed we are still outdated.
24
26
25
-
Feel free to [**approve and merge this pull request**]({{ repoUrl }}/pull/4).
27
+
If you navigate to your [pull requests]({{ repoUrl }}/pulls), you'll notice Dependabot has done its job and is trying to bump, or update, the version of `debug`. Feel free to **approve and merge the pull request**.
26
28
27
29
<details>
28
30
<summary>How to Install Dependabot if not enabled through automated security fixes</summary>
29
31
30
-
- Navigate to Dependabot on the [GitHub Marketplace](https://github.com/marketplace/dependabot-preview)
31
-
- Click the "Install it for free" button
32
-
- Follow on-screen instructions to add Dependabot to your GitHub profile
33
-
- When installing Dependabot, choose `Only select repositories` and choose this repository, {{ repoUrl }}
34
-
- On `app.dependabot.com`, under `repos you want to add`, select {{ repoUrl }} and click the `Add selected` button
32
+
- Navigate to Dependabot on the [GitHub Marketplace](https://github.com/marketplace/dependabot-preview)
33
+
- Click the "Install it for free" button
34
+
- Follow on-screen instructions to add Dependabot to your GitHub profile
35
+
- When installing Dependabot, choose `Only select repositories` and choose this repository, {{ repoUrl }}
36
+
- On `app.dependabot.com`, under `repos you want to add`, select {{ repoUrl }} and click the `Add selected` button
Copy file name to clipboardExpand all lines: responses/05_add-security-policy.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,17 +8,17 @@ This gives collaborators the important security information they need, but it al
8
8
9
9
Just like a `README.md` file, it really depends on your repository and the requirements and workflows. Here are a few common topics that are documented in a security policy:
10
10
11
-
1. Supported versions
12
-
1. How to responsibly report a security vulnerability
13
-
1. Security related configuration
14
-
1. Known security gaps and future enhancements
11
+
- Supported versions
12
+
- How to responsibly report a security vulnerability
13
+
- Security related configuration
14
+
- Known security gaps and future enhancements
15
15
16
16
17
17
## Step 6: Add a SECURITY.md file
18
18
19
19
1. Navigate to the [Security]({{ repoUrl }}/network/alerts) tab
20
20
1. Click on Policy located in the left sidebar
21
-
1. Click the `Start Setup` button
21
+
1. Click the **Start Setup** button
22
22
1. Commit the template security policy to the new branch as selected `{{ user.username }}-patch-1`
23
23
1. Commit the new file and create the pull request
Copy file name to clipboardExpand all lines: responses/06_remove-sensitive-commit.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
## Removing sensitive information
2
2
3
-
A contributor opened a pull request to add a new image to the memory game. However, it appears that this contributor also committed a sensitive `.env` file that shouldn't be included. Contributors may commit sensitive information by accident or by purpose without knowing the consequences of these actions.
3
+
A contributor opened a pull request to add a new image to the memory game. However, it appears that this contributor also committed a sensitive `.env` file that shouldn't be included. Contributors may commit sensitive information by accident or on purpose without knowing the consequences of these actions.
4
4
5
5
Before we approve this pull request and merge it in, we need to remove this sensitive `.env` file from the pull request.
6
6
7
7
## Step 8: Remove sensitive data in a pull request
8
8
9
-
We can do this by cloning down this repository to our local computer, and then running a few local Git commands before pushing up a fix on the contributor's branch on GitHub.
9
+
We can do this by cloning this repository to our computer, and then running a few local Git commands before pushing up a fix on the contributor's branch on GitHub.
10
10
11
11
1. Clone this repository locally by running `git clone {{ repoUrl }}.git`
12
12
1. CD into your newly cloned repository with `cd security-strategy-essentials`
Copy file name to clipboardExpand all lines: responses/08_add-gitignore.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
Removing the previous `.env` file from a random pull request is great, but how can we make sure other contributions don't include sensitive files by mistake? We can do this by adding a `.gitignore` file to our repository.
1
+
Removing the previous `.env` file from the branch is great, but it's reactive. We need to ensure future contributions don't include sensitive files by mistake. We can do this by adding a `.gitignore` file to our repository.
2
2
3
3
## Taking advantage of the `.gitignore` file
4
4
@@ -8,7 +8,7 @@ From time to time, there are files you don't want Git to check in to GitHub. You
8
8
9
9
Git uses a file called `.gitignore` to decide which files and directories to ignore when committing. Keep files containing sensitive data, like configuration or `.env` files, out of your repositories. This is one way to promote security best practices.
10
10
11
-
The `.gitignore` file can, and should, be committed into your repository. By sharing this file and making it part of your code, it will also help others. Other users that contribute to the repository will also avoid committing sensitive data. There are many examples of `.gitignore` files available for you to use in your own repositories. You can find them in the [gitignore](https://github.com/github/gitignore) repository.
11
+
The `.gitignore` file can, and should, be committed into your repository. By sharing this file and making it part of your code, future contributors to the repository will avoid committing sensitive data. There are many examples of `.gitignore` files available for you to use in your own repositories. You can find them in the [gitignore](https://github.com/github/gitignore) repository.
0 commit comments