1
2
Fork
You've already forked server-configurations
1

Add fail2ban and firewall. #1

Merged
daviwil merged 3 commits from apoorv569/server-configurations:basic-hardening into master 2025年03月01日 05:24:44 +01:00
Contributor
Copy link

This PR adds fail2ban-service-type with a sshd jail setup and iptables-service-type with some basic rules which blocks all incoming traffic by default and only allow certain things like ssh on port 2222, HTTP on 80 and HTTPS 443.

This also adds a couple more options to openssh-service-type to disable root-login and password-authentication, so you can only login via a valid ssh key.

This PR adds `fail2ban-service-type` with a `sshd` jail setup and `iptables-service-type` with some basic rules which blocks all incoming traffic by default and only allow certain things like `ssh` on port `2222`, `HTTP` on `80` and `HTTPS` `443`. This also adds a couple more options to `openssh-service-type` to disable `root-login` and `password-authentication`, so you can only login via a valid `ssh` key.

Thanks a lot for putting this together! I'll merge and deploy it now so that we can minimize some of the spam on the server.

Thanks a lot for putting this together! I'll merge and deploy it now so that we can minimize some of the spam on the server.
Author
Contributor
Copy link

@daviwil wrote in #1 (comment):

Thanks a lot for putting this together! I'll merge and deploy it now so that we can minimize some of the spam on the server.

No problem. Let me know if you face some issue with the changes. Also don't forget to copy your ssh key before you apply these changes otherwise you will be locked out, as these changes disable password authentication.

@daviwil wrote in https://codeberg.org/SystemCrafters/server-configurations/pulls/1#issuecomment-2887063: > Thanks a lot for putting this together! I'll merge and deploy it now so that we can minimize some of the spam on the server. No problem. Let me know if you face some issue with the changes. Also don't forget to copy your `ssh` key before you apply these changes otherwise you will be locked out, as these changes disable password authentication.
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
SystemCrafters/server-configurations!1
Reference in a new issue
SystemCrafters/server-configurations
No description provided.
Delete branch "apoorv569/server-configurations:basic-hardening"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?