Set Cloudflare WAF rules with Fail2Ban actions

Cloudflare offers API access to it’s WAF IP access rules, which can be a great tool to ban bots on a “edge” level, reducing load on each instance. So once a server bans an IP for repeatedly failing auth, it will be blocked on the CF level, unable to bother other servers. My old script…

AWS IAM Policies & Roles

Policies are stored in AWS as JSON documents with several policy elements. When creating a policy, it is required to have each of the following elements inside a policy statement. Element Description Required Example Effect Specifies whether the statement results in an allow or an explicit deny ✔ “Effect”: “Deny” Action Describes the specific actions…

AWS Security Basics

AWS Shared Security Model: https://d1.awsstatic.com/security-center/Shared_Responsibility_Model_V2.59d1eccec334b366627e9295b304202faf7b899b.jpg AWS is responsible for security of the cloud. This means AWS is required to protect and secure the infrastructure that runs all the services offered in the AWS Cloud. AWS is responsible for: The level of responsibility AWS has depends on the service. You’re responsible for security in the cloud.…

Get an Email notification for successful SSH logins

This is an email alert that is triggered once a SSH login succeeds First we will create the script itself in the ssh folder /etc/ssh/login-notify.sh: Make the file executable, then add the following line to the end of the sshd pam file in /etc/pam.d/sshd It’s set to optional for testing, as it would prevent login…