-
Notifications
You must be signed in to change notification settings - Fork 0
[Fix] 취약점 스캐닝, 크롤링 방지 장기 대응 작업 #200
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,156 @@ | ||
| resource "aws_wafv2_web_acl" "this" { | ||
| name = "${var.project_name}-web-acl" | ||
| scope = "REGIONAL" | ||
|
|
||
| default_action { | ||
| allow {} | ||
| } | ||
|
|
||
| # Rate-based Rule (HTTP Flood) | ||
| rule { | ||
| name = "Rate-Limit-Rule" | ||
| priority = 1 | ||
| action { | ||
| block {} | ||
| } | ||
| statement { | ||
| rate_based_statement { | ||
| limit = var.request_threshold | ||
| aggregate_key_type = "IP" | ||
| } | ||
| } | ||
| visibility_config { | ||
| cloudwatch_metrics_enabled = true | ||
| metric_name = "rate-limit-rule" | ||
| sampled_requests_enabled = true | ||
| } | ||
| } | ||
|
|
||
| # AWS Managed Core Rule Set | ||
| rule { | ||
| name = "AWS-Managed-Core-Rule-Set" | ||
| priority = 10 | ||
| override_action { | ||
| none {} | ||
| } | ||
| statement { | ||
| managed_rule_group_statement { | ||
| vendor_name = "AWS" | ||
| name = "AWSManagedRulesCommonRuleSet" | ||
| } | ||
| } | ||
| visibility_config { | ||
| cloudwatch_metrics_enabled = true | ||
| metric_name = "aws-managed-common" | ||
| sampled_requests_enabled = true | ||
| } | ||
| } | ||
|
|
||
| # Scanners & Probes Protection | ||
| rule { | ||
| name = "AWS-Managed-Known-Bad-Inputs-Rule-Set" | ||
| priority = 20 | ||
| override_action { | ||
| none {} | ||
| } | ||
| statement { | ||
| managed_rule_group_statement { | ||
| vendor_name = "AWS" | ||
| name = "AWSManagedRulesKnownBadInputsRuleSet" | ||
| } | ||
| } | ||
| visibility_config { | ||
| cloudwatch_metrics_enabled = true | ||
| metric_name = "aws-managed-bad-inputs" | ||
| sampled_requests_enabled = true | ||
| } | ||
| } | ||
|
|
||
| # Reputation Lists Protection | ||
| rule { | ||
| name = "AWS-Managed-Amazon-IP-Reputation-List" | ||
| priority = 30 | ||
| override_action { | ||
| none {} | ||
| } | ||
| statement { | ||
| managed_rule_group_statement { | ||
| vendor_name = "AWS" | ||
| name = "AWSManagedRulesAmazonIpReputationList" | ||
| } | ||
| } | ||
| visibility_config { | ||
| cloudwatch_metrics_enabled = true | ||
| metric_name = "aws-managed-ip-rep" | ||
| sampled_requests_enabled = true | ||
| } | ||
| } | ||
|
|
||
| # Bad Bot Protection | ||
| rule { | ||
| name = "AWS-Managed-Bot-Control-Rule-Set" | ||
| priority = 40 | ||
| override_action { | ||
| none {} | ||
| } | ||
| statement { | ||
| managed_rule_group_statement { | ||
| vendor_name = "AWS" | ||
| name = "AWSManagedRulesBotControlRuleSet" | ||
| } | ||
| } | ||
| visibility_config { | ||
| cloudwatch_metrics_enabled = true | ||
| metric_name = "aws-managed-bot-control" | ||
| sampled_requests_enabled = true | ||
| } | ||
| } | ||
|
|
||
| # Anonymous IP list | ||
| rule { | ||
| name = "AWS-Managed-Anonymous-IP-List" | ||
| priority = 50 | ||
| override_action { | ||
| none {} | ||
| } | ||
| statement { | ||
| managed_rule_group_statement { | ||
| vendor_name = "AWS" | ||
| name = "AWSManagedRulesAnonymousIpList" | ||
| } | ||
| } | ||
| visibility_config { | ||
| cloudwatch_metrics_enabled = true | ||
| metric_name = "aws-managed-anonymous-ip" | ||
| sampled_requests_enabled = true | ||
| } | ||
| } | ||
|
|
||
| # SQL database | ||
| rule { | ||
| name = "AWS-Managed-SQLi-Rule-Set" | ||
| priority = 60 | ||
| override_action { | ||
| none {} | ||
| } | ||
| statement { | ||
| managed_rule_group_statement { | ||
| vendor_name = "AWS" | ||
| name = "AWSManagedRulesSQLiRuleSet" | ||
| } | ||
| } | ||
| visibility_config { | ||
| cloudwatch_metrics_enabled = true | ||
| metric_name = "aws-managed-sql-db" | ||
| sampled_requests_enabled = true | ||
| } | ||
| } | ||
|
|
||
| visibility_config { | ||
| cloudwatch_metrics_enabled = true | ||
| metric_name = "${var.project_name}-web-acl" | ||
| sampled_requests_enabled = true | ||
| } | ||
|
|
||
| tags = var.tags | ||
| } | ||
This file contains hidden or 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,3 @@ | ||
| output "web_acl_arn" { | ||
| value = aws_wafv2_web_acl.this.arn | ||
| } |
This file contains hidden or 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,12 @@ | ||
| variable "project_name" { | ||
| type = string | ||
| } | ||
|
|
||
| variable "request_threshold" { | ||
| type = number | ||
| description = "Rate-Limit 규칙에 적용할 5분당 IP별 최대 요청 수" | ||
| } | ||
|
|
||
| variable "tags" { | ||
| type = map(string) | ||
| } |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Verification inconclusive
Bot Control 규칙의 비용 영향을 고려하세요.
Bot Control은 추가 비용이 발생하는 기능으로, 월 $1의 구독료 외에도 요청당 추가 요금이 부과됩니다. Common Bot Control은 첫 1천만 요청이 무료이지만, Targeted Bot Control은 첫 100만 요청만 무료입니다.
Bot Control 기능의 필요성과 예상 비용을 검토하시기 바랍니다. 트래픽 볼륨에 따라 상당한 비용이 발생할 수 있습니다:
🌐 Web query:
💡 Result:
Short answer — pricing (as of AWS pricing page):
Practical notes:
Sources: AWS WAF pricing and AWS WAF cost guidance. [1][2]
Bot Control 규칙 비용 검토
File: terraform/common/waf/main.tf (Lines 89–107)
AWS WAF Bot Control은 Web ACL당 월 구독료 $10(시간 단위 비례 청구)과 다음 요청당 요금을 부과합니다:
트래픽 규모에 따라 비용이 크게 증가할 수 있으므로 scope-down statement를 도입해 검사 대상을 제한하는 등 Bot Control 기능의 필요성과 예상 비용을 꼼꼼히 검토하세요.
🤖 Prompt for AI Agents