Skip to content

Add new rule for Slowloris Attack#809

Merged
ccojocar merged 3 commits intosecurego:masterfrom
yunwei37:master
Apr 30, 2022
Merged

Add new rule for Slowloris Attack#809
ccojocar merged 3 commits intosecurego:masterfrom
yunwei37:master

Conversation

@yunwei37
Copy link
Copy Markdown
Contributor

@yunwei37 yunwei37 commented Apr 29, 2022

fix #807

Hi! This PR add a new rule to detect if ReadHeaderTimeout is configured in the http.Server. If it's not configured, an issue will be reported.

The rule is mapped to CWE-400: Uncontrolled Resource Consumption, I've used google to search "cwe Slowloris Attack", and it came out this....I'm new to the CWE set so I'm not quite sure about that.

@ccojocar
Copy link
Copy Markdown
Member

@yunwei37 Thanks for this contribution! Please could you fix the lint warning?

This patch detects if ReadHeaderTimeout is configured in the http.Server
to  prevent a potential Slowloris Attack.
@yunwei37
Copy link
Copy Markdown
Contributor Author

@ccojocar Thank you very much for the review! The lint warning should be fixed now.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #809 (c415680) into master (a64cde5) will increase coverage by 0.16%.
The diff coverage is 90.62%.

@@            Coverage Diff             @@
##           master     #809      +/-   ##
==========================================
+ Coverage   74.20%   74.37%   +0.16%     
==========================================
  Files          48       49       +1     
  Lines        3059     3091      +32     
==========================================
+ Hits         2270     2299      +29     
- Misses        725      727       +2     
- Partials       64       65       +1     
Impacted Files Coverage Δ
cwe/data.go 90.00% <ø> (ø)
issue.go 76.92% <ø> (ø)
rules/slowloris.go 90.32% <90.32%> (ø)
rules/rulelist.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a64cde5...c415680. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a rule for Slowloris Attack

4 participants