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

Enhance HTTP Server Configuration and File Permissions in file.go #65

Merged
merged 4 commits into from
May 9, 2024

Conversation

naveensrinivasan
Copy link
Contributor

HTTP Timeout

Mitigation of Slowloris Attacks: By introducing read and write timeouts to the HTTP server configuration, we mitigate potential Slowloris attacks. Slowloris is a denial-of-service attack where a client holds as many connections to the server open as possible for a long time, effectively tying up all available connections and preventing legitimate users from accessing the server. By limiting how long the server will wait for a complete request (ReadTimeout) or a complete response (WriteTimeout), we ensure that resources are not tied up indefinitely, thus reducing the effectiveness of Slowloris attacks.

File Permission

Prevention of Unauthorized File Access: The file permissions for storing files have been updated to 0600 (read and write permissions for the owner only). AFAIK this shouldn't be an issue for the server functionality.

gosec

Included gosec as one of the linters.

These were reported by gosec

@jkjell
Copy link
Member

jkjell commented Nov 20, 2023

Hey Naveen, finally got all the pipeline stuff worked out. Can you rebase this? Thanks!

Mitigation of Slowloris Attacks: By introducing read and write timeouts to the HTTP server configuration, we mitigate potential Slowloris attacks. Slowloris is a type of Denial of Service attack where a client holds as many connections to the server open as possible for a long time, effectively tying up all available connections and preventing legitimate users from accessing the server. By setting a limit on how long the server will wait for a complete request (ReadTimeout) or a complete response (WriteTimeout), we ensure that resources are not tied up indefinitely, thus reducing the effectiveness of Slowloris attacks.

Prevention of Unauthorized File Access: The file permissions for storing files have been updated to 0600 (read and write permissions for the owner only). This change is important for security reasons. By restricting access to the owner only, we reduce the risk of unauthorized access or manipulation of the stored files. This is particularly important when the files contain sensitive data, as it prevents potential data leaks or unauthorized modifications.

These were reported by gosec

Signed-off-by: naveensrinivasan <[email protected]>
@naveensrinivasan
Copy link
Contributor Author

Hey Naveen, finally got all the pipeline stuff worked out. Can you rebase this? Thanks!

👍

Copy link

codecov bot commented May 2, 2024

Codecov Report

Attention: Patch coverage is 5.88235% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 1.49%. Comparing base (a035c62) to head (6bbc0a7).
Report is 73 commits behind head on main.

Files Patch % Lines
internal/objectstorage/filestore/file.go 10.00% 9 Missing ⚠️
cmd/archivista/main.go 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #65       +/-   ##
==========================================
- Coverage   82.40%   1.49%   -80.91%     
==========================================
  Files          10     117      +107     
  Lines         358   28645    +28287     
==========================================
+ Hits          295     429      +134     
- Misses         43   28159    +28116     
- Partials       20      57       +37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jkjell jkjell merged commit 851d161 into in-toto:main May 9, 2024
12 of 14 checks passed
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.

2 participants