generated from lemoncloud-io/just-the-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add jwt-signature-verification docs
- Loading branch information
yeeun kang
committed
Nov 15, 2024
1 parent
2c49028
commit d30455b
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
layout: default | ||
title: JWT Signature Verification | ||
parent: Tips | ||
--- | ||
# Research on Efficient JWT Signature Verification in Serverless Microservices | ||
|
||
## ๐ Abstract | ||
|
||
์ด ์ฐ๊ตฌ๋ ์๋ฒ๋ฆฌ์ค ๋ง์ดํฌ๋ก์๋น์ค ์ํคํ ์ฒ(MSA)์์ ํจ์จ์ ์ธ JWT ์๋ช ๊ฒ์ฆ ๋ฐฉ๋ฒ์ ์ ์ํ๊ณ ์ ํฉ๋๋ค. ๋ค์ํ AWS Lambda ๋ฉ๋ชจ๋ฆฌ ์ค์ ๊ณผ ์๋ช ์๊ณ ๋ฆฌ์ฆ(RS256, RS512)์ ์ฌ์ฉํ์ฌ JWT ๊ฒ์ฆ ์ฑ๋ฅ์ ๋ถ์ํ์์ผ๋ฉฐ, AWS KMS ๊ธฐ๋ฐ ๊ฒ์ฆ๊ณผ ์์ฒด ์๋ช ๊ฒ์ฆ ๋ฐฉ์์ ๋น๊ตํ์์ต๋๋ค. | ||
|
||
## ๐ ๏ธ Experimental Setup | ||
|
||
### 1. Environment Configuration | ||
- **Infrastructure**: AWS Lambda | ||
- **Automation Tools**: Terraform, Serverless Framework | ||
- **Runtime**: Node.js 18 | ||
- **Memory Settings**: 128MB, 256MB, 512MB, 1024MB, 2048MB | ||
|
||
### 2. JWT Verification Methods | ||
- **No Verification**: ๊ฒ์ฆ์ ์ํํ์ง ์๋ ๋์กฐ๊ตฐ | ||
- **KMS Verification**: AWS KMS๋ฅผ ์ฌ์ฉํ ์๋ช ๊ฒ์ฆ | ||
- **Self-Signing Verification**: ๊ณต๊ฐ ํค๋ฅผ ์ฌ์ฉํ ์์ฒด ์๋ช ๊ฒ์ฆ | ||
|
||
### 3. Signature Algorithms | ||
- **RS256**: RSA-SHA256 ์๊ณ ๋ฆฌ์ฆ | ||
- **RS512**: RSA-SHA512 ์๊ณ ๋ฆฌ์ฆ | ||
|
||
## ๐ Results Analysis | ||
|
||
![Response Time by Algorithm](assets/images/response-time-by-algorithm.png) | ||
### 1. Verification Method Comparison | ||
- **Self-Signing Verification** ๋ฐฉ์์ ๋คํธ์ํฌ ํต์ ์ด ์์ด ๊ฐ์ฅ ๋น ๋ฅด๊ณ ์์ ์ ์ธ ์ฑ๋ฅ์ ๋ณด์์ต๋๋ค. | ||
- ํ๊ท ์๋ต ์๊ฐ์ด ๊ฐ์ฅ ๋ฎ์์ผ๋ฉฐ, ์ค์ฐจ ๋ฒ์(MAD)๋ ์์ ๊ณ ๋น๋ ์์ฒญ์ด ๋ฐ์ํ๋ ํ๊ฒฝ์์ ํจ์จ์ ์ ๋๋ค. | ||
- **KMS Verification** ๋ฐฉ์์ ๋์ ๋ณด์์ฑ์ ์ ๊ณตํ์ง๋ง, AWS KMS API ํธ์ถ๋ก ์ธํ ๋คํธ์ํฌ ์ง์ฐ๊ณผ ์ค๋ฒํค๋๋ก ์ธํด ์๋ต ์๊ฐ์ด ์ฆ๊ฐํ๊ณ ๋ณ๋์ฑ์ด ์ปธ์ต๋๋ค. | ||
|
||
### 2. Signature Algorithm Performance | ||
- **RS256**๊ณผ **RS512** ์๊ณ ๋ฆฌ์ฆ ๊ฐ ์ฑ๋ฅ ์ฐจ์ด๋ ๋ฏธ๋ฏธํ์ผ๋, **RS512**๊ฐ ๋ ์ผ๊ด๋ ์ฑ๋ฅ์ ๋ณด์์ต๋๋ค. | ||
- RS512๋ ๋ ๊ฐ๋ ฅํ ์ํธํ ์๊ณ ๋ฆฌ์ฆ์ด์ง๋ง, ํจ์จ์ ์ธ ์๋ช ๊ฒ์ฆ ๊ณผ์ ๋๋ถ์ ์์ ์ ์ธ ์๋ต ์๊ฐ์ ๊ธฐ๋กํ์ต๋๋ค. | ||
- ๋ณด์ ์๊ตฌ ์ฌํญ์ด ๋์ ํ๊ฒฝ์์๋ RS512 ์๊ณ ๋ฆฌ์ฆ์ด ์ ํฉํ ์ ํ์ ๋๋ค. | ||
|
||
![Response Time by Memory](assets/images/response-time-by-memory.png) | ||
### 3. Memory Allocation Impact | ||
- ๋ฉ๋ชจ๋ฆฌ ์ฉ๋์ด **128MB**์ผ ๋, ๋ชจ๋ ๊ฒ์ฆ ๋ฐฉ์์์ ๊ฐ์ฅ ๊ธด ์๋ต ์๊ฐ์ ๊ธฐ๋กํ์์ผ๋ฉฐ, ํนํ **KMS Verification**์์ ์ฑ๋ฅ ์ ํ๊ฐ ๋๋๋ฌ์ก์ต๋๋ค. | ||
- **512MB** ์ด์์ ๋ฉ๋ชจ๋ฆฌ ํ ๋น์์๋ ์์ ์ ์ธ ์ฑ๋ฅ์ ๋ณด์์ผ๋ฉฐ, ๋ฉ๋ชจ๋ฆฌ ์ฆ๊ฐ์ ๋ฐ๋ฅธ ์ฑ๋ฅ ๊ฐ์ ํจ๊ณผ๋ ๋ฏธ๋ฏธํ์ต๋๋ค. | ||
- **2048MB** ๋ฉ๋ชจ๋ฆฌ ์ค์ ์์๋ ๊ฐํ์ ์ฑ๋ฅ ์คํ์ดํฌ๊ฐ ๊ด์ฐฐ๋์์ผ๋ฉฐ, ์ด๋ ๋คํธ์ํฌ ์ํ๋ AWS ๋ด๋ถ ์ฒ๋ฆฌ ์ง์ฐ์ ์ํฅ์ผ๋ก ๋ถ์๋ฉ๋๋ค. | ||
- **512MB** ๋ฉ๋ชจ๋ฆฌ ์ค์ ์ด ์ฑ๋ฅ๊ณผ ๋น์ฉ์ ๊ท ํ์ ๋ง์ถ ์ ์๋ ํจ์จ์ ์ธ ์ ํ์ผ๋ก ๋ํ๋ฌ์ต๋๋ค. | ||
|
||
![Response Time Change Over Load Increase](assets/images/response-time-change-over-load-increase.png) | ||
### 4. Load Testing Analysis | ||
- Artillery๋ฅผ ์ฌ์ฉํ ๋ถํ ํ ์คํธ์์, ์์ฒญ๋ ์ฆ๊ฐ์ ๋ฐ๋ผ **Self-Signing Verification** ๋ฐฉ์์ด ๊ฐ์ฅ ์ผ๊ด๋ ์ฑ๋ฅ์ ๋ณด์์ต๋๋ค. | ||
- **KMS Verification** ๋ฐฉ์์ ๋คํธ์ํฌ ์ง์ฐ๊ณผ AWS API ํธ์ถ๋ก ์ธํด ์ฑ๋ฅ ๋ณ๋์ด ์ปธ์ต๋๋ค. | ||
|
||
## ๐ Key Findings | ||
- **KMS Verification** ๋ฐฉ์์ ๋์ ๋ณด์์ ์ ๊ณตํ์ง๋ง, ๋คํธ์ํฌ ์ง์ฐ๊ณผ ๋์ ๋ฆฌ์์ค ์ฌ์ฉ์ผ๋ก ์ธํด ์ฑ๋ฅ ์ ํ๊ฐ ๋ฐ์ํ ์ ์์ต๋๋ค. | ||
- **Self-Signing Verification** ๋ฐฉ์์ ๋น๊ต์ ๋ฎ์ ์๋ต ์๊ฐ๊ณผ ์ผ๊ด๋ ์ฑ๋ฅ์ ์ ๊ณตํ์ฌ, ๋ณด์ ์๊ตฌ ์ฌํญ์ด ๋ฎ์ ๊ฒฝ์ฐ ํจ์จ์ ์ธ ์ ํ์ด ๋ ์ ์์ต๋๋ค. | ||
- **RS512** ์๊ณ ๋ฆฌ์ฆ์ ๋ ๊ฐ๋ ฅํ ์ํธํ์๋ ๋ถ๊ตฌํ๊ณ ์์ ์ ์ธ ์๋ต ์๊ฐ์ ๊ธฐ๋กํ์์ต๋๋ค. | ||
- ๋ฉ๋ชจ๋ฆฌ ํ ๋น์ด 512MB ์ด์์ผ ๋, ์ฑ๋ฅ๊ณผ ๋น์ฉ์ ๊ท ํ์ ๋ง์ถ ์ ์๋ ์ต์ ์ ํ๊ฒฝ์ ์ ๊ณตํ์์ต๋๋ค. |