<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Meghdad Mahfouz on Medium]]></title>
        <description><![CDATA[Stories by Meghdad Mahfouz on Medium]]></description>
        <link>https://medium.com/@meghdad.mahfouz?source=rss-c4cb4be73b93------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*bvxYVG940_0J7u_d</url>
            <title>Stories by Meghdad Mahfouz on Medium</title>
            <link>https://medium.com/@meghdad.mahfouz?source=rss-c4cb4be73b93------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 13:49:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@meghdad.mahfouz/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cloud Comparison Cheat Sheet]]></title>
            <link>https://medium.com/@meghdad.mahfouz/cloud-comparison-cheat-sheet-57ac89624521?source=rss-c4cb4be73b93------2</link>
            <guid isPermaLink="false">https://medium.com/p/57ac89624521</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[oracle-cloud]]></category>
            <dc:creator><![CDATA[Meghdad Mahfouz]]></dc:creator>
            <pubDate>Wed, 07 Feb 2024 17:46:29 GMT</pubDate>
            <atom:updated>2024-02-07T17:46:29.502Z</atom:updated>
            <content:encoded><![CDATA[<p>Explore the dynamic world of cloud computing with my latest cheat sheet comparing top public cloud service providers! Unveiling insights into AWS, Azure, Google Cloud, and Oracle, this visual guide breaks down key features such as compute services, storage options, networking, databases, security, pricing, and ecosystem integration. Stay informed and make informed decisions as you navigate the vast landscape of cloud services. Check out the nuances that set each provider apart and find the perfect fit for your needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*b2sCCeIZ9eHzyVb8V5vGaQ.jpeg" /><figcaption>Cloud Comparison Cheat Sheet</figcaption></figure><p>#CloudComparison #AWS #Azure #GoogleCloud #OracleCloud</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57ac89624521" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Right Storage Solution in the AWS]]></title>
            <link>https://medium.com/@meghdad.mahfouz/right-storage-solution-in-the-aws-5eb6ba8c9978?source=rss-c4cb4be73b93------2</link>
            <guid isPermaLink="false">https://medium.com/p/5eb6ba8c9978</guid>
            <category><![CDATA[storage-solutions]]></category>
            <category><![CDATA[cloud-storage]]></category>
            <category><![CDATA[well-architected]]></category>
            <category><![CDATA[aws-solutions-architect]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Meghdad Mahfouz]]></dc:creator>
            <pubDate>Fri, 15 Dec 2023 15:36:24 GMT</pubDate>
            <atom:updated>2023-12-15T15:36:24.538Z</atom:updated>
            <content:encoded><![CDATA[<h3>The optimal storage solution for a system varies based on the following:</h3><ul><li>Type of access method (block, file, or object)</li><li>Patterns of access (random or sequential)</li><li>Required throughput</li><li>Frequency of access (online, offline, archival)</li><li>Frequency of update (WORM, dynamic)</li><li>Availability and durability constraints</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FQeAtN6k44unJwJcmMbu2w.png" /><figcaption><strong>Figure 1–1: AWS Storage services portfolio</strong></figcaption></figure><p>The AWS Well-Architected systems use multiple storage solutions and enable different features to improve performance and use resources efficiently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6vvUozKMfDmR3p2fO8DKbw.png" /></figure><h3>Storage characteristics and requirements</h3><p>You must understand the different characteristics of your application or workflow that are required to select the services that best fit your workload. Example characteristics are shareable, file size, cache size, access patterns, latency, throughput, and persistence of data. Those characteristics can lead you toward the best storage solution, such as block storage, file storage, or object storage.</p><p>To optimize storage, the first step is to understand the performance profile for each of your workloads. Conduct a performance analysis to measure input/output operations per second (IOPS), throughput, and other variables. Define your storage performance requirements. Identify your workload’s most important storage performance metrics. Use those metrics to set boundaries. Implement improvement strategies as part of a data-driven approach, using benchmarking or load testing. Use this data to identify where your storage solution is or can be constrained. Examine storage and configuration options to improve the solution.</p><p>AWS storage services are optimized for different storage scenarios. No single data storage option is ideal for all workloads. When evaluating your storage requirements, consider data storage options for each workload separately.</p><p>Determine the expected growth rate for your workload and choose a storage solution that will meet those rates. Object and file storage solutions, such as Amazon S3 and Amazon Elastic File System, enable unlimited storage.</p><h3>Questions to help determine storage requirements</h3><p>The following questions help you to segment data within each of your workloads and determine your storage requirements:</p><ul><li><em>How often and how quickly do you need to access your data?</em> AWS offers storage options and pricing tiers for frequently accessed, less frequently accessed, and infrequently accessed data.</li><li><em>Does your data store require high IOPS or throughput?</em> AWS provides categories of storage that are optimized for performance and throughput. Understanding IOPS and throughput requirements will help you provision the right amount of storage and avoid overpaying.</li><li><em>What storage access protocols are required?</em> Pre-existing applications are often developed based on specific operating systems. The operating system can affect the access protocol. For example, Linux-based applications that require file system access usually require NFS. Windows-based applications require SMB as the protocol.</li><li><em>How critical (durable) is your data?</em> Critical or regulated data must be retained at almost any expense and tends to be stored for a long time.</li><li><em>How sensitive is your data?</em> Highly sensitive data must be protected from accidental and malicious changes, not only data loss or corruption. Durability, cost, and security are equally important to consider.</li><li><em>How large is your dataset?</em> Knowing the total size of the dataset helps in estimating storage capacity and cost.</li><li><em>How transient is your data?</em> Transient data is short-lived and typically does not require high durability. (<strong>Note: </strong>Durability refers to average annual expected data loss.) Clickstream and Twitter data are good examples of transient data.</li><li><em>How much are you prepared to pay to store the data?</em> Setting a budget for data storage will inform your decisions about storage options.</li></ul><h3>Evaluate available configuration options</h3><p>Evaluate the various characteristics and configuration options and how they relate to storage. Understand where and how to use the following elements to optimize storage space and performance for your workload:</p><ul><li>Provisioned IOPS</li><li>Solid state drives (SSD)</li><li>Hard disk drives (HDD)</li><li>Object storage</li><li>Archival storage</li><li>Ephemeral (temporary) storage</li></ul><h3>Determine storage characteristics</h3><p>When you evaluate a storage solution, determine the available storage characteristics, such as the following:</p><ul><li>Ability to share the storage</li><li>Ideal file size and maximum file size</li><li>Storage cache size</li><li>Average or expected latency</li><li>Maximum throughput</li><li>Maximum IOPS</li><li>Persistence of data</li></ul><p>Then match your requirements to the AWS service that best fits your needs.</p><h3>Make decisions based on access patterns and metrics</h3><p>Choose storage systems based on your workload’s access patterns. Configure them by determining how the workload accesses data. You can sometimes increase storage efficiency or performance metrics by choosing a different storage type. Configure the storage options you choose to match your data access patterns.</p><ul><li><strong>Optimize your storage usage and access patterns </strong>— Choose storage systems based on your workload’s access patterns and the characteristics of the available storage options. Determine the best place to store data so that you can meet your requirements while reducing overhead. Use performance optimizations and access patterns when configuring and interacting with data based on the characteristics of your storage (for example, striping volumes or partitioning data).</li><li><strong>Select appropriate metrics for storage options</strong> — Ensure that you select the appropriate storage metrics for the workload. Each storage option offers various metrics to track how your workload performs over time. Make sure that you are measuring against any storage metrics indicating peak performance and trends. For fixed-sized storage systems, such as Amazon Elastic Block Store (Amazon EBS) or Amazon FSx, ensure that you are monitoring the amount of storage used against the overall storage size. Create automation when possible to increase the storage size when reaching a threshold.</li><li><strong>Monitor metrics</strong> — Amazon CloudWatch can collect metrics across the resources in your architecture. You can also collect and publish custom metrics to surface business metrics or derived metrics. Use CloudWatch or third-party solutions to set alarms that indicate when thresholds are breached.</li></ul><p>For additional information about AWS Well-Architected systems, refer to the <a href="https://aws.amazon.com/architecture/well-architected/?wa-lens-whitepapers.sort-by=item.additionalFields.sortDate&amp;wa-lens-whitepapers.sort-order=desc">AWS Well-Architected</a> page on the AWS website.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5eb6ba8c9978" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure Your Rocky Linux Server]]></title>
            <link>https://medium.com/@meghdad.mahfouz/secure-your-rocky-linux-server-26cf85f43ac7?source=rss-c4cb4be73b93------2</link>
            <guid isPermaLink="false">https://medium.com/p/26cf85f43ac7</guid>
            <category><![CDATA[rockylinux]]></category>
            <category><![CDATA[secure]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[hardening]]></category>
            <dc:creator><![CDATA[Meghdad Mahfouz]]></dc:creator>
            <pubDate>Tue, 28 Nov 2023 18:28:17 GMT</pubDate>
            <atom:updated>2024-02-08T23:15:50.506Z</atom:updated>
            <content:encoded><![CDATA[<p>Securing your Rocky Linux server is of paramount importance in today’s digital landscape, where cyber threats and attacks are becoming increasingly sophisticated.</p><p>Whether you are running a blog or hosting critical business applications, ensuring the security of your server is essential to protect sensitive data, maintain privacy, and prevent unauthorized access.</p><p>Servers often store valuable information that could be detrimental if compromised, including personal information, financial records, or confidential business data. A security breach can lead to data theft, identity theft, financial losses, and reputational damage for both individuals and organizations.</p><p>Securing Rocky Linux is also essential for ensuring the smooth and uninterrupted functioning of critical applications and services. A compromised server may experience downtime, leading to disruptions in services, loss of productivity, and customer dissatisfaction. By implementing robust security measures, server administrators can decrease the risk of downtime and maintain a reliable and secure environment for their users.</p><p>Next, a compromised server can be utilized for malicious purposes for further attacks, such as distributed denial-of-service (DDoS) attacks or spreading malware to other connected systems and acting as bot machines centrally managed by bad actors. By securing Rocky Linux, administrators not only protect their own infrastructure but also contribute to overall internet safety by preventing the server from being exploited in cybercriminal activities.</p><p>In this tutorial, we will walk you through the best practices and essential security steps to secure your Rocky Linux server.</p><p>We must note that the steps covered here are not exhaustive, and you should always stay updated with the latest security recommendations and patches to maintain a robust security posture.</p><h3>Step 1: Log in to your Rocky Linux server via SSH</h3><p>For this step, you need to make sure that you have a terminal or SSH (Secure Shell) client installed on your local machine. If you’re using Linux or macOS, you can use the built-in terminal application. For Windows users, you will most likely use the PuTTY SSH client.</p><p>Open the terminal and type the following command replacing username and server_ip_address with your own.</p><p>ssh username@server_ip_address</p><p>After you enter your password you will be logged into to your server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*lOdEK_ucbWyIXpuG.png" /></figure><h3>Step 2: Update the server packages and set automatic security updates</h3><p>It is very important to keep your server up to date, especially since there are often security updates that minimize the risk of breach or potential system crash.</p><p>We have the option to manually update packages in Rocky Linux and that allows you to carefully review and test updates before applying them to your system, ensuring compatibility and stability. Also, it is always a good idea to update your system manually when you boot a new server that you will use.</p><p>In order to check available updates on your system, you can run the following command:</p><p>sudo dnf check-update</p><p>You will get a similar output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*Ui3Uk1hEmsNAoQRE.png" /></figure><p>If you are on a new system, you can proceed with updating all listed packages by running the following command:</p><p>sudo dnf update</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*XeI1T-4SswqmeaXe.png" /></figure><p>Press y and hit Enter to continue.</p><p>This process will download all the necessary packages from the designated repositories, upgrade to new versions, remove old packages, and perform cleanup for the package cache.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*2a0K91_DOE2OLLau.png" /></figure><p>If you have a system where you already have various packages installed, specific versions that could potentially have issues if upgraded to the latest version, or that may conflict with your other packages, the better solution is to perform the minimal upgrade by running the following command:</p><p>sudo dnf upgrade-minimal</p><p>You can use this command only if you want to perform updates for packages that have essential bug fixes and various security patches, without the risk of breaking changes.</p><p>Next, we can enable automatic updates and use the special package designed to automate the installation of security patches and other crucial upgrades for your Rocky Linux server.</p><p>To set up the automatic update process, we need to install the dnf-automatic package which is not available by default on your Rocky Linux server.</p><p>This command requires higher permissions so make sure you execute it with your sudo or root user:</p><p>sudo dnf install dnf-automatic</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*m2O-rlWD82LV_XNy.png" /></figure><p>Once the installation is complete, we need to edit the config file related to it:</p><p>sudo vi /etc/dnf/automatic.conf</p><p>In your configuration file under /etc/dnf/automatic.conf, find the line that starts with upgrade_type, and press the i key in order to enter the edit mode in your Vi editor and replace the value from default to security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*khZuc3nVuioqUk2f.png" /></figure><p>Since it is recommended to modify the default behavior to only include security upgrades, this will ensure automatic updates will not introduce breaking changes for your packages.</p><p>In order to write the changes and exit the file using Vi, press Shift and : then type wq and press Enter.</p><p>Finally, we need to make sure that dnf-automatic service is enabled by default the next time we start or reboot our system.</p><p>We can do that by running the following command:</p><p>sudo systemctl enable dnf-automatic-install.timer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*JxdlVRl4vAli9o5w.png" /></figure><p>The dnf-automatic-install.timer is a systemd timer unit that runs our dnf-automatic-install service. By default, it is scheduled to activate every day at 6 a.m., with a randomized delay of up to one hour.</p><h3>Step 3: Add sudo users</h3><p>When you boot the system for the first time, by default the root user has full control and unrestricted access to all system resources. Running daily tasks with the root user is not ideal as there is a high probability that any mistake or malicious command executed by the root user can have drastic consequences for your system. In order to minimize these risks, the concept of sudo users was introduced which gives more granular control over access potential actions that a user can run on Linux servers.</p><p>You can start by adding a new user to your Rocky Linux server:</p><p>adduser jumpcloud</p><p>Next, we will run the command so we can create a strong password for our newly created user:</p><p>passwd jumpcloud</p><p>After that, you can make sure that your user exists and has its own group if you run the <em>id</em> command:</p><p>id jumpcloud</p><p>You can see a similar output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*2JJsjwEv6kmYfhwn.png" /></figure><p>The next step consists of elevating the permissions of our <em>jumpcloud</em> user so it can execute sudo commands.</p><p>sudo usermod -aG wheel jumpcloud</p><p>In this case, the user “jumpcloud” will be added to the “wheel” group, providing it administrative privileges on the system.</p><p>If you’d like more details on creating sudo users and managing sudo access on Rocky Linux, check out the following tutorial: <a href="https://jumpcloud.com/blog/how-to-create-sudo-users-on-rocky-linux">How to Create Sudo Users for Rocky Linux</a>.</p><h3>Step 4: Secure SSH</h3><p>SSH (Secure Shell) provides remote access to your server and is often targeted by attackers. To <a href="https://jumpcloud.com/support/configure-ssh-settings">enhance SSH security</a> we can implement certain security measures.</p><p>First, we can change the default port for our SSH server by changing the config file related to it.</p><p>We advise you to create a backup of your configuration file if it gets corrupted, so you can run the following command:</p><p>sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config_backup</p><p>Next, we will edit the configuration file.</p><p>sudo vi /etc/ssh/sshd_config</p><p>SSH typically operates on the well-known port 22, making it a prime target for attackers, mainly due to the rise of highly automated attacks in recent times. To enhance security, consider changing the default SSH port. This simple step adds an extra layer of obscurity, making it harder for attackers to find and target your SSH service. By choosing an unused port between 1024 and 65535, you can significantly reduce the number of automated attacks directed at your server.</p><p>Alternatively, you could opt to set up a <a href="https://jumpcloud.com/blog/jump-servers-obsolete">hardened jump box</a>, also known as a jump host. Additional hardening and security can be layered onto the jump box instead of directly opening up ports on your server to the web.</p><p>In our case we will use port 2222, so you can scroll down and find Port 22 line:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*U-pT2hmC4Sr0cHjh.png" /></figure><p>Press i for edit, uncomment that line, and instead of 22, replace with 2222.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*9DUcKjRNl_OdBCT3.png" /></figure><p>Press Escape and type :wq to write the changes and exit the file.</p><p>Just above the port number configuration, note that changing the SSH port requires updating the SELinux configuration. SELinux, which originates from Red Hat, is enabled by default on Rocky Linux. Its main purpose is to restrict actions that Linux processes and users can perform on the system, as that will minimize the impact of security breaches or unauthorized access. SELinux follows the principle of least privilege, granting processes and users only the essential permissions required for their intended tasks.</p><p>However, it is worth noting that the semanage command might not be readily available on Rocky Linux. To verify the necessary dependencies, we can run a check:</p><p>yum provides /usr/sbin/semanage</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*RLNFO558Oy339gE-.png" /></figure><p>From here we can see that we need to install additional Python libraries, and we can do so by running the following command:</p><p>sudo yum install policycoreutils-python-utils</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*11U843H72VGRzOl2.png" /></figure><p>Type y, and hit Enter which will install the package.</p><p>Next, you can use this command which tells SELinux that the SSH service is now running on the new port 2222.</p><p>sudo semanage port -a -t ssh_port_t -p tcp 2222</p><p>Now, we need to add an exception to our firewall so we don’t get a connection refused error.</p><p>Rocky Linux uses firewalld, so we can add the rule:</p><p>sudo firewall-cmd — zone=public — add-port=2222/tcp — permanent</p><p>Next, we should reload the firewall so it starts using the new rule we added:</p><p>firewall-cmd –reload</p><p>Now, let’s give our SSH server a restart to implement the updated configuration and initiate SSH logging via port 2222. It’s time to apply the changes and get started with enhanced security.</p><p>sudo systemctl restart sshd</p><p>Now you can try and log in to your Rocky Linux server by adding the -p option and adding our new port number.</p><p>ssh -p 2222 username@server_ip_address</p><p>We can use <a href="https://jumpcloud.com/blog/what-are-ssh-keys">SSH key</a> authorization in order to secure our server further. We will also disable logging with the password in our SSH configuration.</p><p>By following this method, the possibility of brute force attacks on passwords is completely eradicated, guaranteeing that only users that possess the matching private keys gain access to the system.</p><p>In case you don’t already have an SSH key pair on your local machine, you can create one.</p><p>To start, open a terminal on your local machine and enter the following command:</p><p>ssh-keygen -t rsa</p><p>This command will ask you to select a location to save the keys and set an optional passphrase for added security. The passphrase is also recommended.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*SOUNYIOC_GKnxvsr.png" /></figure><p>Once you have generated your SSH key pair, you need to copy the public key to your Rocky Linux server. You can use the ssh-copy-id command to do this.</p><p>In our case we will run the following command:</p><p>ssh-copy-id -p 2222 -i ~/.ssh/jumpcloud_rockylinux.pub jumpcloud@194.195.240.58</p><p>You will get a similar output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*LNkIFrhA6dfjnOcC.png" /></figure><p>Next, this command will prompt you to enter your user password on the remote server. Once you provide the password, the public key will be copied to the ~/.ssh/authorized_keys file on the server.</p><p>Before we can log into the server, we need to change the permissions to our key file and assign them permissions with the value 400.</p><p>We can do so by running the following command in our local terminal:</p><p>chmod 400 ~/.ssh/jumpcloud_rockylinux</p><p>Next, we will connect with our server:</p><p>ssh -i ~/.ssh/jumpcloud_rockylinux -p 2222 jumpcloud@194.195.240.58</p><p>This command will load the private key through the specified path on the local machine and also use the custom port that we set.</p><p>You should be able to log in without entering a password because the server is now configured to use SSH keys for authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*d-9p5xVmTqZOb9D7.png" /></figure><p>We can disable password logging and use only SSH keys by editing the configuration file again:</p><p>sudo vi /etc/ssh/sshd_config</p><p>We need to uncomment the part related to the PubkeyAuthentication and set it to yes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*TQN7BIQ1iAasICTR.png" /></figure><p>Next, we need to change the PasswordAuthentication to no:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*jOmCyJQUld8batav.png" /></figure><p>We can also disable SSH logging with the root username:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/0*UTPt_EfvY2fqKjPa.png" /></figure><p>This will also enhance the security of your SSH, but keep in mind that you need to have at least one sudo user already so you don’t get locked out or become unable to perform higher privilege tasks.</p><p>Save the file, and then restart the SSH service so it loads the new configuration.</p><p>sudo systemctl restart sshd</p><p>With key-based authentication now enforced, the need to enter a password during login should be eliminated. This security enhancement ensures that only users with the appropriate SSH keys can access the server.</p><h3>Step 5: Install and configure Fail2Ban</h3><p>Fail2Ban is a very useful tool for protecting your Rocky Linux server from brute force attacks and unauthorized access attempts. By monitoring log files and automatically banning suspicious IP addresses, Fail2Ban adds an extra layer of security to your system.</p><p>Fail2Ban is not included in the default software repositories of Rocky Linux. Nevertheless, you can easily access it through the <a href="https://docs.fedoraproject.org/en-US/epel/">Enhanced Packages for Enterprise Linux (EPEL) repository</a>, a source for third-party packages on Red Hat and Rocky Linux. If you haven’t yet added the EPEL repository to your system’s package sources, you can easily incorporate the repository using dnf, similar to installing any other package.</p><p>sudo dnf install epel-release -y</p><p>After this step, we need to install the Fail2Ban service. We can do so by running the following command:</p><p>sudo dnf install fail2ban</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*Ev-yibcSnqyddaHS.png" /></figure><p>This will install various dependencies also related to modules that work together with SELinux, Sendmail, or the firewalld service.</p><p>Next, we can create a new file called “jail.local” where we will store our custom configuration:</p><p>sudo vi /etc/fail2ban/jail.local</p><p>Here we can build our custom config where we will override default values:</p><p>[DEFAULT]<br># here you can overwrite some defaults:<br>[sshd]<br>enabled = true<br>port = ssh,2222<br>filter = sshd<br>bantime = 30m<br>findtime = 5m<br>maxretry = 3</p><p>We will change the default values from the original jail.conf file.</p><p>The bantime parameter defines the duration that an IP address will be banned after multiple failed login attempts. By default, it is set to 10 minutes. We can adjust this value to 30 minutes.</p><p>bantime = 30m</p><p>The findtime parameter specifies the time window during which repeated failed login attempts will be counted. The default value is 10 minutes. Setting findtime to more than 10 minutes (600 seconds) can be beneficial in scenarios where you want to be less sensitive to temporary spikes in failed login attempts. For instance, if you have legitimate users who sometimes mistype their passwords, a longer findtime allows them more time to reattempt without getting banned.</p><p>On the other hand, setting findtime to less than 10 minutes can make Fail2Ban more responsive to potential attacks. If there’s a rapid and sustained increase in failed login attempts within a short time, a shorter findtime can trigger the ban sooner, reducing the attack surface and blocking the malicious attempts more promptly.</p><p>In our case, we will reduce the time to five minutes.</p><p>findtime = 5m</p><p>The maxretry parameter defines the number of consecutive failed login attempts allowed before banning an IP address. By default, it is set to 5. We can adjust it so that it is limited to three attempts.</p><p>maxretry = 3</p><p>After editing and saving the configuration file, we can enable the service so that it starts every time we boot the system:</p><p>sudo systemctl enable fail2ban</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*8o8IBeFUh3jBrT_8.png" /></figure><p>We can start the service by running the following command:</p><p>sudo systemctl start fail2ban</p><p>While we are logged in to our SSH session, we can use another terminal and try to log in with some non-existent username and without an SSH key:</p><p>ssh -p 2222 jumpcloud3@194.195.240.58</p><p>After three bad attempts, our IP address will be banned temporarily for further login attempts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*a4WLcwbavvVtT9vB.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*vHOQy80gAolh2mUA.png" /></figure><p>For the last attempt, we get the “Connection refused” error, which is clearly the ban action of our service that honors our configuration parameters.</p><p>By default, the log file related to the Fail2Ban service is stored in /var/log/fail2ban.log and we can check the latest Fail2Ban events:</p><p>sudo tail /var/log/fail2ban.log</p><p>We can see logged events about our IP address and the exact timestamp when the Fail2Ban service banned our IP address from further attempts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*hJUPHaeZQptNb_qo.png" /></figure><p>The ban applies to subsequent connection attempts from that IP address. For test purposes, if you are still logged into the server from your initial SSH session, it will not be affected by the ban. However, if you log out and try to establish a new SSH connection, the new connection attempt might be blocked by the ban.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26cf85f43ac7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Architecture for High-Performance DDoS Protection at William Hill]]></title>
            <link>https://medium.com/@meghdad.mahfouz/aws-architecture-for-high-performance-ddos-protection-at-william-hill-2fd1539a9c12?source=rss-c4cb4be73b93------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fd1539a9c12</guid>
            <category><![CDATA[ddos-protection]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[solution-architect]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-security]]></category>
            <dc:creator><![CDATA[Meghdad Mahfouz]]></dc:creator>
            <pubDate>Sun, 29 Oct 2023 14:37:23 GMT</pubDate>
            <atom:updated>2023-10-29T14:37:23.706Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Abstract:</strong></p><p>This paper provides an overview of the AWS architecture implemented by William Hill to protect their applications from high-performance Distributed Denial of Service (DDoS) attacks. It outlines the key components and strategies employed by William Hill to ensure the availability and security of their gaming applications.</p><p><strong>1. Introduction</strong></p><p>William Hill is a globally recognized betting and gaming company, offering gaming applications on various platforms worldwide. In 2016, the company faced a significant DDoS attack, prompting them to enhance their security posture by migrating to the AWS cloud environment. This paper explores the architecture designed to mitigate DDoS threats effectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*lSSyQsmw-JwDpWBi1fGhqA.png" /></figure><p><strong>2. The Architecture</strong></p><p><strong>2.1 CloudFront and Shield Advanced</strong></p><p>In front of all applications, William Hill deploys Amazon CloudFront, a content delivery network (CDN). AWS Shield Advanced is employed to combat various DDoS attacks, including Layer 3 and Layer 7 attacks such as SYN floods, ACK floods, and low-complexity Layer 7 attacks like HTTP floods.</p><p><strong>2.2 WAF (Web Application Firewall)</strong></p><p>For complex Layer 7 attacks, AWS Web Application Firewall (WAF) is utilized. Custom filters are created within WAF to block advanced attacks, bolstering security further.</p><p><strong>2.3 Route 53</strong></p><p>Traffic from CloudFront is directed to Amazon Route 53, AWS’s scalable DNS web service. William Hill maintains two separate Route 53 hosted zones, one for non-sensitive and one for sensitive traffic.</p><p><strong>2.4 EC2 Instance with F5 BIG-IP</strong></p><p>Sensitive traffic is routed to an EC2 instance hosting F5 BIG-IP, providing an additional layer of protection against a broader range of attack variations.</p><p><strong>2.5 VPC and Segregation</strong></p><p>Traffic traverses a Virtual Private Cloud (VPC) and VPC peering before reaching one of their seven different AWS accounts housing applications. This setup enables developers to create applications with built-in DDoS protection.</p><p><strong>2.6 Direct Connect</strong></p><p>While transitioning to the cloud, on-premises application servers are maintained. Traffic from EC2 instances and Virtual Load Balancers (VLB) passes through AWS Direct Connect, ensuring low-latency, high-bandwidth connectivity between the cloud environment and on-premises data centers.</p><p><strong>2.7 Additional Services for Analysis</strong></p><p>To enhance DDoS protection, traffic logs from CloudFront are sent to an Amazon S3 bucket. Logs are analyzed on on-premises servers using proprietary and third-party analytics. Identified malicious traffic is sent back to AWS, where IP addresses are stored in a DynamoDB instance.</p><p><strong>2.8 DynamoDB and Lambda Function</strong></p><p>DynamoDB maintains a table of IP addresses with expiration times, allowing for dynamic updates. A Lambda function continuously monitors this table for new or expired entries, updating WAF filters, accordingly, ensuring an adaptive and responsive security strategy.</p><p><strong>3. Conclusion</strong></p><p>William Hill’s AWS architecture demonstrates a comprehensive and adaptive approach to safeguarding their applications against high-performance DDoS attacks. By leveraging multiple AWS services and maintaining a blend of on-premises and cloud resources, they ensure the availability and security of their betting and gaming applications.</p><p>This architecture prioritizes continuous improvement and adaptive security measures, aligning with the evolving landscape of DDoS threats.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fd1539a9c12" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Architecture for A Classic Web Hosting Architecture]]></title>
            <link>https://medium.com/@meghdad.mahfouz/aws-architecture-for-a-classic-web-hosting-architecture-b25f1811a63d?source=rss-c4cb4be73b93------2</link>
            <guid isPermaLink="false">https://medium.com/p/b25f1811a63d</guid>
            <category><![CDATA[web-hosting]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws-architecture]]></category>
            <category><![CDATA[solution-architect]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Meghdad Mahfouz]]></dc:creator>
            <pubDate>Wed, 25 Oct 2023 18:21:31 GMT</pubDate>
            <atom:updated>2023-10-25T18:25:45.255Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, I provided content that clearly explains how AWS services are used in a web hosting architecture. I’ll add more context to each point and include some additional services and features to enhance the description:</p><p>This architecture outlines the integration of various AWS services to design a resilient, scalable, and secure web application hosting environment. Leveraging AWS not only optimizes performance but also ensures a high degree of reliability and security for web applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EiDz-9vwQrY31oERN1eJjw.png" /></figure><p><strong>Architecture:</strong></p><p><strong>1. DNS services with Amazon Route 53:</strong> Beyond domain management, Route 53 ensures a smooth domain name system service with health checks, traffic flow, and domain registration capabilities. This ensures users can access your web application reliably.</p><p><strong>2. Edge caching with Amazon CloudFront:</strong> By utilizing CloudFront, web applications can distribute content globally, with reduced latency. The content is delivered from the nearest edge location, optimizing speed and user experience.</p><p><strong>3. Edge security for Amazon CloudFront with AWS WAF:</strong> AWS WAF doesn’t just filter out malicious traffic and offers real-time metrics and logging to ensure visibility into attack patterns.</p><p><strong>4. Load balancing with Elastic Load Balancing (ELB):</strong> ELB is essential for ensuring application availability. It also integrates seamlessly with other AWS services, like EC2 Auto Scaling, which allows for dynamic adjustment of instance count based on traffic load.</p><p><strong>5.DDoS protection with AWS Shield:</strong> AWS Shield, especially the Shield Advanced variant, offers 24/7 DDoS response, cost protection, and threat intelligence, ensuring holistic protection against larger and more sophisticated attacks.</p><p><strong>6. Firewalls with security groups:</strong> Security groups act as virtual firewalls to control the inbound and outbound traffic. They can be easily configured and can be associated with multiple instances, providing a granular level of security.</p><p><strong>7. Caching with Amazon ElastiCache:</strong> Utilizing ElastiCache, web applications can significantly improve data retrieval speeds, enhancing overall responsiveness. It supports Redis (for complex data structures) and Memcached (for simpler use cases).</p><p><strong>8. Managed database with Amazon RDS:</strong> With RDS, not only can you choose from six different database engines, but you also benefit from automated backups, patch management, and seamless scaling capabilities.</p><p><strong>9.Static storage and backups with Amazon S3:</strong> S3 isn’t just a storage solution. It’s designed for 99.999999999% (11 9’s) of durability, and integrates with AWS Lambda, allowing automatic processing of stored data.</p><p><strong>Additional Considerations:</strong></p><p><strong>10. Infrastructure as Code with AWS CloudFormation:</strong> Automate and standardize the creation of resources using templates. This ensures repeatability and consistency across different environments.</p><p><strong>11. Monitoring with Amazon CloudWatch:</strong> Monitor the health and performance of your resources in real-time. Set alarms, visualize logs, and optimize your application’s performance based on the insights.</p><p><a href="https://www.linkedin.com/in/meghdadmahfouz/">https://www.linkedin.com/in/meghdadmahfouz/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b25f1811a63d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>