Test your memory.
All the images from https://octodex.github.com/.
This was originally a Pen created at CodePen.io. You can find this one at https://codepen.io/JasonEtco/pen/yobKqg.
:octocat: Github Learning Lab A robot powered training repository 🤖
Home Page: https://lab.github.com/githubtraining/securing-your-workflows
License: MIT License
Test your memory.
All the images from https://octodex.github.com/.
This was originally a Pen created at CodePen.io. You can find this one at https://codepen.io/JasonEtco/pen/yobKqg.
JavaScript library for DOM operations
Library home page: https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js
Path to dependency file: Github-Learning-Lab--security-on-github/index.html
Path to vulnerable library: Github-Learning-Lab--security-on-github/index.html
Dependency Hierarchy:
Found in HEAD commit: 0210ef12e666d707ab80782a358be3846df65669
Found in base branch: main
In jQuery versions greater than or equal to 1.0.3 and before 3.5.0, passing HTML containing elements from untrusted sources - even after sanitizing it - to one of jQuery's DOM manipulation methods (i.e. .html(), .append(), and others) may execute untrusted code. This problem is patched in jQuery 3.5.0.
Publish Date: 2020-04-29
URL: CVE-2020-11023
Base Score Metrics:
Type: Upgrade version
Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11023
Release Date: 2020-04-29
Fix Resolution: jquery - 3.5.0
Step up your Open Source Security Game with WhiteSource here
セキュリティの脆弱性によって、プロジェクトやそのプロジェクトを使っている人に様々な問題を引き起こします。脆弱性によってプロジェクトの機密性、完全性、可用性が損なわれる可能性があります。あなたのプロジェクトのコード自体には脆弱性がなかったとしても、プロジェクトの依存関係の中に脆弱性があるかもしれないのです。そのため、常に最新のバージョンを使用することが、プロジェクトを安全に保つ上で大切です。
このリポジトリの依存関係には、セキュアに保つためにアップデートが必要なものがいくつかあります。
このリポジトリはNPMを使ったNode.jsのプロジェクトです。そのため、package.json
ファイルにリポジトリの依存関係が定義されています。今回はこのJavaScriptの依存関係を扱います。他のプログラミング言語では他の依存関係を定義したファイルがあります。実際のプロジェクトでは、Gemfile
、Gemfile.lock
、*.gemspec
、requirements.txt
、pipfile.lock
といったファイルを使っているかもしれません。
これらの依存関係が安全であるとどのように確かめるのが良いでしょうか?それは簡単なことではありませんが、GitHubであればこの問題を解決することが出来ます。
このリポジトリに対してGitHubから警告が来ている事にお気づきかもしれません。メールで通知を受け取っているかもしれませんし、もしくはpackage.json
ファイルに黄色のバーが表示されているのを見つけたかもしれません。
GitHubは公になっているRuby gems、NPM、Python、Java、.NETのパッケージの脆弱性情報を追跡しています。
GitHubは新しく公開された脆弱性の通知を受け取り、その依存関係の脆弱性が含まれているバージョンを使っているリポジトリを探します。そして、その影響のあるリポジトリに関連する方々にセキュリティアラートを送信します。リポジトリのオーナーに対してはデフォルトで通知が送られます。しかし、この重要な通知を他のチームやメンバーが受け取るように設定することも可能です。
GitHubはどのようなリポジトリにおいても、そのリポジトリにおける脆弱性の情報を公開することは致しません。
GitHubのセキュリティアラートを使って、脆弱なNPMの依存関係を見つけてみましょう。
debug
という名前の依存関係までスクロールダウンし、黄色のdebug
の右側をクリックGitHub Enterprise Serverのみ: GitHub Enterprise ServerではGitHub Connectを使うことで脆弱性アラートを使うことが出来ます。アラートが投げられるまでは1時間ほどかかることがあります。一定時間以上待ってもDependency Graphに黄色のバーが表示されない場合は、管理者に確認してみてください。問題が解決するまでの間、コースを進めるためにヒントを差し上げましょう - 推奨されたアップグレードバージョンは
2.6.9
です。
このコースの手順はQuick Reference Guideにもまとまっています。
このコースでは、GitHub上でリポジトリを安全に保つ方法を学ぶことが出来ます。リポジトリを安全に保つことは多くの理由で重要です。
このコースでは、下記の内容を学びます:
.gitignore
ファイルを使うことで機密データを保護するというベストプラクティスのやり方このコースでは、GitHub Flowに事前に習熟している必要があります。GitHub Flowをご存じない方は、Introduction to GitHubコースを御覧ください。
このコースではGitHub Pagesにデプロイされた記憶ゲームを題材に使用します。
main
を選択し、Saveをクリックこのコースの手順はQuick Reference Guideにもまとまっています。
GitHub Pagesを有効化すると、リポジトリの内容をデプロイします。デプロイが完了するまで待つ必要があるので、次のコメントまで1分ほどお待ち下さい。
時々、追加のコメントが書き込まれないことがあります!正しい操作をしたにも関わらず何のコメントも書き込まれない場合は、数秒待ってからこのペ
ージを再読込してください。
the bare-bones internationalization library used by yargs
Library home page: https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz
Path to dependency file: /tmp/ws-scm/security-on-github/package.json
Path to vulnerable library: /tmp/ws-scm/security-on-github/node_modules/npm/node_modules/y18n/package.json
Dependency Hierarchy:
Found in HEAD commit: 0210ef12e666d707ab80782a358be3846df65669
Found in base branch: main
This affects the package y18n before 3.2.2, 4.0.1 and 5.0.5. PoC by po6ix: const y18n = require('y18n')(); y18n.setLocale('proto'); y18n.updateLocale({polluted: true}); console.log(polluted); // true
Publish Date: 2020-11-17
URL: CVE-2020-7774
Base Score Metrics:
Type: Upgrade version
Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7774
Release Date: 2020-11-17
Fix Resolution: 5.0.5
Step up your Open Source Security Game with WhiteSource here
Node.js path.parse() ponyfill
Library home page: https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz
Path to dependency file: Github-Learning-Lab--security-on-github/package.json
Path to vulnerable library: Github-Learning-Lab--security-on-github/node_modules/npm/node_modules/path-parse/package.json
Dependency Hierarchy:
Found in HEAD commit: 5442765fd58bf881690bd63767c3084b5b10c20d
Found in base branch: main
All versions of package path-parse are vulnerable to Regular Expression Denial of Service (ReDoS) via splitDeviceRe, splitTailRe, and splitPathRe regular expressions. ReDoS exhibits polynomial worst-case time complexity.
Publish Date: 2021-05-04
URL: CVE-2021-23343
Base Score Metrics:
Step up your Open Source Security Game with WhiteSource here
JavaScript library for DOM operations
Library home page: https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js
Path to dependency file: Github-Learning-Lab--security-on-github/index.html
Path to vulnerable library: Github-Learning-Lab--security-on-github/index.html
Dependency Hierarchy:
Found in HEAD commit: 0210ef12e666d707ab80782a358be3846df65669
Found in base branch: main
jQuery before 3.4.0, as used in Drupal, Backdrop CMS, and other products, mishandles jQuery.extend(true, {}, ...) because of Object.prototype pollution. If an unsanitized source object contained an enumerable proto property, it could extend the native Object.prototype.
Publish Date: 2019-04-20
URL: CVE-2019-11358
Base Score Metrics:
Type: Upgrade version
Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-11358
Release Date: 2019-04-20
Fix Resolution: 3.4.0
Step up your Open Source Security Game with WhiteSource here
JavaScript library for DOM operations
Library home page: https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js
Path to dependency file: Github-Learning-Lab--security-on-github/index.html
Path to vulnerable library: Github-Learning-Lab--security-on-github/index.html
Dependency Hierarchy:
Found in HEAD commit: 0210ef12e666d707ab80782a358be3846df65669
Found in base branch: main
In jQuery versions greater than or equal to 1.2 and before 3.5.0, passing HTML from untrusted sources - even after sanitizing it - to one of jQuery's DOM manipulation methods (i.e. .html(), .append(), and others) may execute untrusted code. This problem is patched in jQuery 3.5.0.
Publish Date: 2020-04-29
URL: CVE-2020-11022
Base Score Metrics:
Type: Upgrade version
Origin: https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/
Release Date: 2020-04-29
Fix Resolution: jQuery - 3.5.0
Step up your Open Source Security Game with WhiteSource here
おめでとう、@Neko7sora、無事にこのコースを完了できました!
リポジトリのセキュリティを考える際には、私のようなインストールするアプリについても考えましょう。リポジトリにインストールされているアプリは何らかのあなたのデータにアクセスすることが出来ます。たとえそれががいのないもの(私のように)であったとしても、定期的にリポジトリのインストール済みアプリや連携をチェックしてリストから余計なものを削除するのは良い考えです。今も使っているものかどうか、必要以上にアクセス権限を渡しているものがないかどうかをチェックしましょう。
お別れを言うのは悲しいですが、このリポジトリから私をアンインストールしてもらいたいと思います。アンインストールしたあとではおめでとうを伝えることは出来ませんが、あなたが前進しているのを嬉しく思います。
GitHubのドキュメントのガイドラインに従って認可されたOAuthアプリやGitHubアプリのレビューをしましょう。もし試しにやってみたいのであれば、このリポジトリからLearning Labアプリをアンインストールしましょう。
さようならを言う前に、このリポジトリで達成したタスクを振り返ってみましょう:
.gitignore
ファイルを使って機密情報ををリポジトリから除外リポジトリを安全に保つ他の選択肢も学習したいですか?セキュリティアラートのドキュメントやセキュリティ関連のGitHubアプリはコードを安全に保つ上で参考になります。
学び続けたいですか?他のコースもチェックしてみましょう。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.