mirror of
https://github.com/goldbergyoni/nodebestpractices.git
synced 2025-10-27 19:17:13 +08:00
translate 6.11 into japanese
This commit is contained in:
@ -867,15 +867,15 @@ null == undefined; // true
|
||||
|
||||
<br/><br/>
|
||||
|
||||
## ![✔] 6.11. Support blacklisting JWTs
|
||||
## ![✔] 6.11. JWT のブラックリスト化をサポートする
|
||||
|
||||
<a href="https://www.owasp.org/index.php/Top_10-2017_A2-Broken_Authentication" target="_blank"><img src="https://img.shields.io/badge/%E2%9C%94%20OWASP%20Threats%20-%20A9:Broken%20Authentication%20-green.svg" alt=""/></a>
|
||||
|
||||
**TL;DR:** When using JSON Web Tokens (for example, with [Passport.js](https://github.com/jaredhanson/passport)), by default there's no mechanism to revoke access from issued tokens. Once you discover some malicious user activity, there's no way to stop them from accessing the system as long as they hold a valid token. Mitigate this by implementing a blacklist of untrusted tokens that are validated on each request.
|
||||
**TL;DR:** JSON Web Token を(例えば [Passport.js](https://github.com/jaredhanson/passport) などを用いて)利用する場合、デフォルトでは、発行されたトークンからのアクセスを無効にする仕組みはありません。悪意のあるユーザーのアクティビティを発見したとしても、そのユーザーが有効なトークンを持っている限り、システムへのアクセスを止めることはできません。各リクエストで検証される、信頼されていないトークンのブラックリストを実装することで、この問題をを緩和することができます。
|
||||
|
||||
**Otherwise:** Expired, or misplaced tokens could be used maliciously by a third party to access an application and impersonate the owner of the token.
|
||||
**さもないと:** 期限切れや、誤って配置されたトークンは、アプリケーションにアクセスしたり、トークンの所有者になりすますために、サードパーティによって悪意を持って利用される可能性があります。
|
||||
|
||||
🔗 [**Read More: Blacklist JSON Web Tokens**](/sections/security/expirejwt.md)
|
||||
🔗 [**さらに読む: JSON Web Token のブラックリスト**](/sections/security/expirejwt.japanese.md)
|
||||
|
||||
<br/><br/>
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
# Support blacklisting JWTs
|
||||
# JWT の ブラックリスト化をサポートする
|
||||
|
||||
### One Paragraph Explainer
|
||||
### 一段落説明
|
||||
|
||||
By design, JWTs (JSON Web Tokens) are completely stateless, so once a valid token is signed by an issuer, the token may be verified as authentic by the application. The problem this leads to is the security concern where a leaked token could still be used and unable to be revoked, due to the signature remaining valid as long as the signature provided by the issues matches what the application is expecting.
|
||||
Due to this, when using JWT authentication, an application should manage a blacklist of expired or revoked tokens to retain user's security in the case a token needs to be revoked.
|
||||
設計上、JWTs (JSON Web Tokens) は完全にステートレスであるため、一度有効なトークンが発行者によって署名されると、恐らくそのトークンはアプリケーションによって本物であると判断されるでしょう。このことが引き起こす問題として、発行者によって施された署名がアプリケーションの要求と一致する限り署名は有効であると判断されるため、漏洩したトークンが使用され、そのトークンを無効にすることができないというセキュリティ上の懸念があります。
|
||||
そのため、JWT 認証を利用する場合は、トークンが無効化される必要があるケースにおいてユーザーのセキュリティを維持するために、アプリケーションは期限切れや無効なトークンのブラックリストを管理する必要があります。
|
||||
|
||||
### `express-jwt-blacklist` example
|
||||
### `express-jwt-blacklist` の例
|
||||
|
||||
An example of running `express-jwt-blacklist` on a Node.js project using the `express-jwt`. Note that it is important to not use the default store settings (in-memory) cache of `express-jwt-blacklist`, but to use an external store such as Redis to revoke tokens across many Node.js processes.
|
||||
`express-jwt` を利用した Node.js プロジェクトで、`express-jwt-blacklist` を実行する例です。ここで、`express-jwt-blacklist` のデフォルトストア設定である(インメモリ)キャッシュを利用せず、複数の Node.js プロセスをまたいでトークンを無効化できるように、Redis のような外部のストアを利用することが重要であることに注意してください。
|
||||
|
||||
```javascript
|
||||
const jwt = require('express-jwt');
|
||||
@ -38,7 +38,7 @@ app.get('/logout', (req, res) => {
|
||||
});
|
||||
```
|
||||
|
||||
### What other bloggers say
|
||||
### 他のブロガーが言っていること
|
||||
|
||||
From the blog by [Marc Busqué](http://waiting-for-dev.github.io/blog/2017/01/25/jwt_secure_usage/):
|
||||
> ...add a revocation layer on top of JWT, even if it implies losing its stateless nature.
|
||||
[Marc Busqué](http://waiting-for-dev.github.io/blog/2017/01/25/jwt_secure_usage/) のブログより:
|
||||
> ...たとえそれがステートレス性を損なったとしても、JTW 上に無効化レイヤを追加してください。
|
||||
|
||||
Reference in New Issue
Block a user