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

Improve README #47

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
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
62 changes: 57 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,63 @@
# seccamp z3 redos
# ReDoS脆弱性検出プログラム

セキュリティ・キャンプ全国大会2020 オンライン
## 本プロジェクトについて

\[Z-Ⅲ\] ReDoSの検出プログラムの作成とOSSへの適用
本プロジェクトは「セキュリティ・キャンプ全国大会2020 オンライン」にて行われた、集中開発コースのZトラックのⅢにあたる「ReDoSの検出プログラムの作成とOSSへの適用」講義で、受講生が制作したプロジェクトです。
講義受講生を中心として、講師、チューターらも本プロジェクトに関与しています。

## Usage
セキュリティ・キャンプについては[こちら](https://www.ipa.go.jp/jinzai/camp/)
セキュリティ・キャンプ全国大会2020 オンラインについては[こちら](https://www.ipa.go.jp/jinzai/camp/2020/zenkoku2020_index.html)
講義「ReDoSの検出プログラムの作成とOSSへの適用」については[こちら](https://www.ipa.go.jp/jinzai/camp/2020/zenkoku2020_program_list.html#list_s-z3)
Comment on lines +8 to +10
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

末尾に空白を入れて改行するようにしてるみたいですが、このようにしたいのであれば素直にリストを使った方が良いと思います。


## ReDoSとは?

ReDoS (Regular expression Denial of Service) とは、正規表現が原因で起こるDoS攻撃のことです。

例えば `/^(a|a)*$/` や `/^a*a*$/` のような正規表現には、マッチング処理に文字列の長さの指数時間や二乗時間かかる攻撃文字列が存在し、多大な負荷がかかってしまう可能性があります。

本プロジェクトでは、このような正規表現の脆弱性を検出するプログラムを実装し、JavaScriptの静的解析ツールであるESLintに組み込みます。そしてそれを実際のOSSのソースコードに適用して脆弱性を探し出し、見つけた脆弱性を報告することでOSSに貢献するのが目的です。

## 発表資料

<!-- ここに発表スライドのサムネイルとURL -->

## 使い方

### ブラウザで確認する

ブラウザで正規表現から作られるオートマトンを確認できます。

https://n4o847.github.io/seccamp-redos/

### ESLintプラグインとして使う

このツールをESLintプラグインとして使えるようにしたものが公開されています。

https://github.com/Neccolini/seccampZ3-linter

### ライブラリとして使う

```bash
$ npm install n4o847/seccamp-redos
```

```javascript
const redos = require('seccamp-redos');

const re = /(a|a)*/;
console.log(redos.detectReDoS(re.source, re.flags));
// { status: 'Vulnerable', message: 'Detected EDA.' }
```
npm start

### ローカルで動かす

```bash
~/$ git clone https://github.com/n4o847/seccamp-redos.git
~/$ cd seccamp-redos
~/seccamp-redos$ npm install
~/seccamp-redos$ npx ts-node src/test.ts
```

## 動作に必要なもの

- npm
Comment on lines +61 to +63
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これが末尾あるのは違和感があります。あまり重要でもないので削除するか、そうでなければ「使い方」の先頭に持っていった方がいいと思います