<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marek „Netbe” Lampart </title>
    <description>The latest articles on DEV Community by Marek „Netbe” Lampart  (@cyberbezpieczenstwo).</description>
    <link>https://dev.to/cyberbezpieczenstwo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4016285%2F765dbd3e-d62f-4d3b-afa7-101393c54515.jpg</url>
      <title>DEV Community: Marek „Netbe” Lampart </title>
      <link>https://dev.to/cyberbezpieczenstwo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cyberbezpieczenstwo"/>
    <language>en</language>
    <item>
      <title>AI-Powered Linux Security: How AI Is Changing the Role of System Administrators</title>
      <dc:creator>Marek „Netbe” Lampart </dc:creator>
      <pubDate>Thu, 30 Jul 2026 09:42:51 +0000</pubDate>
      <link>https://dev.to/cyberbezpieczenstwo/ai-powered-linux-security-how-ai-is-changing-the-role-of-system-administrators-3g</link>
      <guid>https://dev.to/cyberbezpieczenstwo/ai-powered-linux-security-how-ai-is-changing-the-role-of-system-administrators-3g</guid>
      <description>&lt;p&gt;Linux administrators have always worked at the intersection of reliability, performance and security.&lt;/p&gt;

&lt;p&gt;Managing modern infrastructure means dealing with thousands of events every day:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;authentication attempts,&lt;/li&gt;
&lt;li&gt;system logs,&lt;/li&gt;
&lt;li&gt;application failures,&lt;/li&gt;
&lt;li&gt;network activity,&lt;/li&gt;
&lt;li&gt;vulnerability reports.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The challenge is no longer only collecting security data.&lt;/p&gt;

&lt;p&gt;The challenge is understanding it quickly enough to respond.&lt;/p&gt;

&lt;p&gt;This is where Artificial Intelligence is starting to change Linux security operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Linux Security Is Becoming More Complex
&lt;/h2&gt;

&lt;p&gt;Traditional security practices are still essential:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;firewall configuration,&lt;/li&gt;
&lt;li&gt;access control,&lt;/li&gt;
&lt;li&gt;system updates,&lt;/li&gt;
&lt;li&gt;vulnerability scanning,&lt;/li&gt;
&lt;li&gt;monitoring.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, modern attacks increasingly rely on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;stolen credentials,&lt;/li&gt;
&lt;li&gt;automation,&lt;/li&gt;
&lt;li&gt;social engineering,&lt;/li&gt;
&lt;li&gt;persistent access techniques.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Security teams need tools that can analyze large amounts of information and highlight what actually matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  How AI Can Support Linux Security
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Intelligent Log Analysis
&lt;/h3&gt;

&lt;p&gt;Linux systems generate huge volumes of logs.&lt;/p&gt;

&lt;p&gt;AI can help administrators identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;unusual authentication patterns,&lt;/li&gt;
&lt;li&gt;suspicious processes,&lt;/li&gt;
&lt;li&gt;abnormal system behavior,&lt;/li&gt;
&lt;li&gt;unexpected configuration changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of manually searching thousands of log entries, administrators can use AI-assisted analysis to find important security events faster.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. AI-Assisted System Hardening
&lt;/h2&gt;

&lt;p&gt;Linux hardening requires reviewing many configuration areas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSH settings,&lt;/li&gt;
&lt;li&gt;user permissions,&lt;/li&gt;
&lt;li&gt;firewall rules,&lt;/li&gt;
&lt;li&gt;running services,&lt;/li&gt;
&lt;li&gt;kernel parameters.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI can assist by identifying potential weaknesses and suggesting improvements.&lt;/p&gt;

&lt;p&gt;The administrator still makes the final decision, but security reviews become faster.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Faster Incident Response
&lt;/h2&gt;

&lt;p&gt;During a security incident, speed matters.&lt;/p&gt;

&lt;p&gt;AI can assist with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;summarizing alerts,&lt;/li&gt;
&lt;li&gt;correlating events,&lt;/li&gt;
&lt;li&gt;analyzing suspicious activity,&lt;/li&gt;
&lt;li&gt;suggesting investigation steps.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This creates a new workflow:&lt;/p&gt;

&lt;p&gt;Human expertise + automation + AI assistance.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI Does Not Replace Linux Administrators
&lt;/h2&gt;

&lt;p&gt;There is a common misconception that AI will replace system administrators.&lt;/p&gt;

&lt;p&gt;In reality, the most valuable administrators will be those who combine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux knowledge,&lt;/li&gt;
&lt;li&gt;cybersecurity skills,&lt;/li&gt;
&lt;li&gt;automation,&lt;/li&gt;
&lt;li&gt;AI tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI can process information quickly, but understanding infrastructure and making security decisions still requires human experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  New Risks of AI Security Tools
&lt;/h2&gt;

&lt;p&gt;AI-powered security also creates new challenges:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sensitive data exposure,&lt;/li&gt;
&lt;li&gt;incorrect recommendations,&lt;/li&gt;
&lt;li&gt;over-reliance on automation,&lt;/li&gt;
&lt;li&gt;security of AI systems themselves.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI should be treated as another security tool that requires proper implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Future of Linux Security
&lt;/h2&gt;

&lt;p&gt;Linux remains one of the most important platforms in modern infrastructure.&lt;/p&gt;

&lt;p&gt;As environments become more complex, AI will likely become a standard assistant for administrators, helping them detect threats, automate repetitive tasks and improve security visibility.&lt;/p&gt;

&lt;p&gt;I recently created a more detailed technical guide covering AI-powered Linux security, including threat detection, hardening, vulnerability management and security automation.&lt;/p&gt;

&lt;p&gt;Full guide:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://netbe.pl/ai-powered-linux-security-a-practical-guide-for-system-administrators/" rel="noopener noreferrer"&gt;AI-Powered Linux Security: A Practical Guide for System Administrators&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Part of the &lt;strong&gt;Netbe Linux Security Guide&lt;/strong&gt; series.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>ai</category>
      <category>security</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>AI-Powered Cybersecurity: How AI Is Changing Linux Security Administration</title>
      <dc:creator>Marek „Netbe” Lampart </dc:creator>
      <pubDate>Tue, 28 Jul 2026 16:24:35 +0000</pubDate>
      <link>https://dev.to/cyberbezpieczenstwo/ai-powered-cybersecurity-how-ai-is-changing-linux-security-administration-9dj</link>
      <guid>https://dev.to/cyberbezpieczenstwo/ai-powered-cybersecurity-how-ai-is-changing-linux-security-administration-9dj</guid>
      <description>&lt;p&gt;Artificial intelligence is changing many areas of technology, and cybersecurity is one of the fields experiencing the biggest transformation.&lt;/p&gt;

&lt;p&gt;For decades, Linux administrators have relied on traditional security tools: firewalls, log analysis, intrusion detection systems, vulnerability scanners, and manual system audits.&lt;/p&gt;

&lt;p&gt;Today, AI is adding a new layer of intelligence to these processes.&lt;/p&gt;

&lt;p&gt;AI-powered security tools can analyze large amounts of system data, detect unusual behavior, automate repetitive tasks, and help administrators respond faster to potential threats.&lt;/p&gt;

&lt;p&gt;Linux remains one of the most important platforms in cybersecurity, and combining Linux administration with artificial intelligence creates new possibilities for protecting modern infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Linux Is Important in Cybersecurity
&lt;/h2&gt;

&lt;p&gt;Linux powers a large part of today's digital infrastructure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cloud servers,&lt;/li&gt;
&lt;li&gt;Kubernetes clusters,&lt;/li&gt;
&lt;li&gt;web applications,&lt;/li&gt;
&lt;li&gt;security appliances,&lt;/li&gt;
&lt;li&gt;development environments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Security professionals use Linux because it provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;powerful command-line tools,&lt;/li&gt;
&lt;li&gt;detailed system control,&lt;/li&gt;
&lt;li&gt;advanced networking capabilities,&lt;/li&gt;
&lt;li&gt;flexible automation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, securing Linux environments requires continuous monitoring and analysis.&lt;/p&gt;

&lt;p&gt;Modern infrastructure generates huge amounts of data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;authentication logs,&lt;/li&gt;
&lt;li&gt;firewall events,&lt;/li&gt;
&lt;li&gt;system activity,&lt;/li&gt;
&lt;li&gt;application logs,&lt;/li&gt;
&lt;li&gt;network traffic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Manually analyzing all this information is becoming increasingly difficult.&lt;/p&gt;

&lt;p&gt;This is where AI can help.&lt;/p&gt;

&lt;h1&gt;
  
  
  AI for Linux Log Analysis
&lt;/h1&gt;

&lt;p&gt;One of the most practical applications of AI in Linux security is log analysis.&lt;/p&gt;

&lt;p&gt;Traditional monitoring systems often rely on predefined rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;failed SSH login attempts,&lt;/li&gt;
&lt;li&gt;unusual ports,&lt;/li&gt;
&lt;li&gt;suspicious processes,&lt;/li&gt;
&lt;li&gt;privilege escalation attempts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI can analyze patterns instead of only looking for known signatures.&lt;/p&gt;

&lt;p&gt;For example, AI can help identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;unusual login locations,&lt;/li&gt;
&lt;li&gt;abnormal user behavior,&lt;/li&gt;
&lt;li&gt;unexpected system changes,&lt;/li&gt;
&lt;li&gt;suspicious command execution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of asking:&lt;/p&gt;

&lt;p&gt;"Did this exact attack happen before?"&lt;/p&gt;

&lt;p&gt;AI can help answer:&lt;/p&gt;

&lt;p&gt;"Does this activity look unusual compared to normal system behavior?"&lt;/p&gt;

&lt;h2&gt;
  
  
  AI-Assisted Threat Detection
&lt;/h2&gt;

&lt;p&gt;Linux systems produce many security signals every day.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;repeated authentication failures,&lt;/li&gt;
&lt;li&gt;unexpected root access,&lt;/li&gt;
&lt;li&gt;modified system files,&lt;/li&gt;
&lt;li&gt;new user accounts,&lt;/li&gt;
&lt;li&gt;unusual network connections.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI models can help correlate these events.&lt;/p&gt;

&lt;p&gt;A single failed login may not be important.&lt;/p&gt;

&lt;p&gt;However:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;hundreds of failed SSH attempts,&lt;/li&gt;
&lt;li&gt;followed by successful authentication,&lt;/li&gt;
&lt;li&gt;followed by privilege escalation,&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;creates a much more suspicious pattern.&lt;/p&gt;

&lt;p&gt;AI can help security teams identify these relationships faster.&lt;/p&gt;

&lt;h2&gt;
  
  
  Automating Linux Security Audits
&lt;/h2&gt;

&lt;p&gt;Linux administrators regularly perform security checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;checking open ports,&lt;/li&gt;
&lt;li&gt;reviewing users,&lt;/li&gt;
&lt;li&gt;verifying permissions,&lt;/li&gt;
&lt;li&gt;checking updates,&lt;/li&gt;
&lt;li&gt;analyzing firewall configuration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI can assist by automating parts of these processes.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;h3&gt;
  
  
  User and Permission Analysis
&lt;/h3&gt;

&lt;p&gt;AI can help identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;unnecessary privileged accounts,&lt;/li&gt;
&lt;li&gt;excessive sudo permissions,&lt;/li&gt;
&lt;li&gt;suspicious ownership changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Configuration Review
&lt;/h3&gt;

&lt;p&gt;AI can analyze:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSH configuration,&lt;/li&gt;
&lt;li&gt;firewall rules,&lt;/li&gt;
&lt;li&gt;system services,&lt;/li&gt;
&lt;li&gt;security policies.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Vulnerability Assessment
&lt;/h3&gt;

&lt;p&gt;AI can help prioritize vulnerabilities by considering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;severity,&lt;/li&gt;
&lt;li&gt;system exposure,&lt;/li&gt;
&lt;li&gt;possible impact.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is not replacing administrators, but reducing repetitive work.&lt;/p&gt;

&lt;h1&gt;
  
  
  AI and Linux Command Assistance
&lt;/h1&gt;

&lt;p&gt;Linux administration often requires remembering complex commands and configurations.&lt;/p&gt;

&lt;p&gt;AI assistants can help administrators:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;understand commands,&lt;/li&gt;
&lt;li&gt;explain system behavior,&lt;/li&gt;
&lt;li&gt;generate scripts,&lt;/li&gt;
&lt;li&gt;troubleshoot errors.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;A junior administrator can ask:&lt;/p&gt;

&lt;p&gt;"Why is this SSH configuration insecure?"&lt;/p&gt;

&lt;p&gt;or:&lt;/p&gt;

&lt;p&gt;"Explain this firewall rule."&lt;/p&gt;

&lt;p&gt;AI can provide explanations and suggest improvements.&lt;/p&gt;

&lt;p&gt;However, every recommendation still requires verification.&lt;/p&gt;

&lt;p&gt;Running unknown commands generated by AI on production servers is dangerous.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI-Powered Security Automation With Scripts
&lt;/h2&gt;

&lt;p&gt;Automation is already a key part of Linux administration.&lt;/p&gt;

&lt;p&gt;Combining scripts with AI can create more intelligent security workflows.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;automated security reports,&lt;/li&gt;
&lt;li&gt;suspicious activity detection,&lt;/li&gt;
&lt;li&gt;compliance checks,&lt;/li&gt;
&lt;li&gt;system health monitoring.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A traditional script may say:&lt;/p&gt;

&lt;p&gt;"SSH root login is enabled."&lt;/p&gt;

&lt;p&gt;An AI-enhanced system could provide:&lt;/p&gt;

&lt;p&gt;"SSH root login is enabled. This increases the risk of brute-force attacks. Recommended action: disable root login and use key-based authentication."&lt;/p&gt;

&lt;p&gt;The difference is context.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Risks of Using AI in Security Administration
&lt;/h2&gt;

&lt;p&gt;AI can improve cybersecurity, but it also introduces new risks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Incorrect Recommendations
&lt;/h3&gt;

&lt;p&gt;AI models can generate inaccurate answers.&lt;/p&gt;

&lt;p&gt;A wrong firewall rule or insecure configuration suggestion can create new vulnerabilities.&lt;/p&gt;

&lt;h3&gt;
  
  
  Data Privacy Issues
&lt;/h3&gt;

&lt;p&gt;Sending sensitive information to external AI services may expose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;server configurations,&lt;/li&gt;
&lt;li&gt;logs,&lt;/li&gt;
&lt;li&gt;internal architecture details.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Organizations must carefully control what data is shared.&lt;/p&gt;

&lt;h3&gt;
  
  
  Attackers Also Use AI
&lt;/h3&gt;

&lt;p&gt;Cybercriminals are using AI to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;automate phishing,&lt;/li&gt;
&lt;li&gt;generate malware,&lt;/li&gt;
&lt;li&gt;discover vulnerabilities,&lt;/li&gt;
&lt;li&gt;improve social engineering attacks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Security professionals must assume that attackers have access to similar technologies.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Future of Linux Security Administration
&lt;/h1&gt;

&lt;p&gt;The future Linux administrator will likely work together with AI systems.&lt;/p&gt;

&lt;p&gt;The role will shift from manually checking every event to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;designing security automation,&lt;/li&gt;
&lt;li&gt;validating AI recommendations,&lt;/li&gt;
&lt;li&gt;improving detection systems,&lt;/li&gt;
&lt;li&gt;managing secure infrastructure.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI will not replace Linux administrators.&lt;/p&gt;

&lt;p&gt;Instead, administrators who understand both Linux and AI will have a significant advantage.&lt;/p&gt;

&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;AI is becoming an important part of modern cybersecurity.&lt;/p&gt;

&lt;p&gt;For Linux administrators, artificial intelligence offers new ways to analyze threats, automate security tasks, and improve system protection.&lt;/p&gt;

&lt;p&gt;However, AI should be treated as an assistant, not an autonomous security solution.&lt;/p&gt;

&lt;p&gt;The strongest approach combines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux expertise,&lt;/li&gt;
&lt;li&gt;cybersecurity knowledge,&lt;/li&gt;
&lt;li&gt;automation,&lt;/li&gt;
&lt;li&gt;artificial intelligence.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The future of Linux security will belong to professionals who can combine human judgment with AI-powered tools.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>cybersecurity</category>
      <category>ai</category>
      <category>devops</category>
    </item>
    <item>
      <title>Linux Hardening: Building a Secure Server from the Kernel to the Application Layer</title>
      <dc:creator>Marek „Netbe” Lampart </dc:creator>
      <pubDate>Thu, 23 Jul 2026 17:55:36 +0000</pubDate>
      <link>https://dev.to/cyberbezpieczenstwo/linux-hardening-building-a-secure-server-from-the-kernel-to-the-application-layer-29eb</link>
      <guid>https://dev.to/cyberbezpieczenstwo/linux-hardening-building-a-secure-server-from-the-kernel-to-the-application-layer-29eb</guid>
      <description>&lt;h2&gt;
  
  
  Practical security checklist for production Linux environments
&lt;/h2&gt;

&lt;p&gt;Linux is everywhere.&lt;/p&gt;

&lt;p&gt;It powers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cloud infrastructure,&lt;/li&gt;
&lt;li&gt;web servers,&lt;/li&gt;
&lt;li&gt;Kubernetes nodes,&lt;/li&gt;
&lt;li&gt;databases,&lt;/li&gt;
&lt;li&gt;network appliances,&lt;/li&gt;
&lt;li&gt;security platforms.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many administrators believe that Linux is secure by default.&lt;/p&gt;

&lt;p&gt;The reality is different.&lt;/p&gt;

&lt;p&gt;Linux provides powerful security mechanisms, but they must be correctly configured.&lt;/p&gt;

&lt;p&gt;A fresh installation is only the beginning.&lt;/p&gt;

&lt;p&gt;A production server should go through a hardening process:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Fresh Linux Installation

        ↓

System Updates

        ↓

Kernel Security

        ↓

User Management

        ↓

Network Protection

        ↓

Service Hardening

        ↓

Monitoring

        ↓

Continuous Auditing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  What is Linux Hardening?
&lt;/h1&gt;

&lt;p&gt;Linux hardening is the process of reducing the attack surface of a Linux system.&lt;/p&gt;

&lt;p&gt;The goal is simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Allow only required functionality and block everything unnecessary.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A hardened server should follow:&lt;/p&gt;

&lt;h2&gt;
  
  
  Principle of Least Privilege
&lt;/h2&gt;

&lt;p&gt;Every user, process and service receives only the permissions it needs.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Bad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Web Application

↓

root privileges

↓

Entire system access
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Better:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Web Application

↓

Dedicated user

↓

Limited permissions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  1. Keep the System Updated
&lt;/h1&gt;

&lt;p&gt;The first security layer is patch management.&lt;/p&gt;

&lt;p&gt;Check available updates:&lt;/p&gt;

&lt;p&gt;Debian/Ubuntu:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt update

apt upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;RHEL/Fedora:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dnf update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;For production environments:&lt;/p&gt;

&lt;p&gt;Do not update randomly.&lt;/p&gt;

&lt;p&gt;Use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Testing

↓

Staging

↓

Production
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A security update should improve protection without breaking applications.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Remove Unnecessary Services
&lt;/h1&gt;

&lt;p&gt;Every running service is a potential entry point.&lt;/p&gt;

&lt;p&gt;Check running services:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl list-units &lt;span class="nt"&gt;--type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;A server hosting a website probably does not need:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Bluetooth

Printing service

Avahi discovery

Unused databases
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Disable unnecessary services:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl disable service_name

systemctl stop service_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Security rule:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If a service is not required, remove it.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  3. Secure SSH Access
&lt;/h1&gt;

&lt;p&gt;SSH is one of the most attacked services on Linux servers.&lt;/p&gt;

&lt;p&gt;Basic hardening:&lt;/p&gt;

&lt;p&gt;Edit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/etc/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Disable root login:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PermitRootLogin no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Disable password authentication:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PasswordAuthentication no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use keys:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Public Key Authentication
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Modern SSH authentication should look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User

↓

SSH Key

↓

Server Verification

↓

Access Granted
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  4. Protect SSH Against Brute Force
&lt;/h1&gt;

&lt;p&gt;Install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;fail2ban
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;fail2ban
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Architecture:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Failed Login Attempts

        ↓

Fail2ban

        ↓

Firewall Rule

        ↓

IP Block
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;However, blocking attackers is only one layer.&lt;/p&gt;

&lt;p&gt;The better approach:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;disable passwords,&lt;/li&gt;
&lt;li&gt;use MFA,&lt;/li&gt;
&lt;li&gt;restrict access by firewall.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  5. Configure Firewall Rules
&lt;/h1&gt;

&lt;p&gt;A server should not expose unnecessary ports.&lt;/p&gt;

&lt;p&gt;Check listening services:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ss &lt;span class="nt"&gt;-tulpn&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;22/tcp    SSH

80/tcp    HTTP

443/tcp   HTTPS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything else should be reviewed.&lt;/p&gt;




&lt;p&gt;Example using nftables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nft list ruleset
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Security model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Internet

↓

Firewall

↓

Allowed Services Only

↓

Application
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  6. Use Mandatory Access Control
&lt;/h1&gt;

&lt;p&gt;Traditional permissions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User

↓

Group

↓

File permissions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;are not always enough.&lt;/p&gt;

&lt;p&gt;Linux provides:&lt;/p&gt;

&lt;h2&gt;
  
  
  SELinux
&lt;/h2&gt;

&lt;p&gt;Common in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Red Hat Enterprise Linux,&lt;/li&gt;
&lt;li&gt;CentOS,&lt;/li&gt;
&lt;li&gt;Fedora.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;getenforce
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  AppArmor
&lt;/h2&gt;

&lt;p&gt;Common in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ubuntu,&lt;/li&gt;
&lt;li&gt;Debian.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check profiles:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aa-status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;These systems answer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What is a process allowed to do, even if it is compromised?&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  7. Kernel Hardening
&lt;/h1&gt;

&lt;p&gt;The Linux kernel is the foundation.&lt;/p&gt;

&lt;p&gt;Check kernel version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;uname&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Important mechanisms:&lt;/p&gt;

&lt;h2&gt;
  
  
  Kernel parameters
&lt;/h2&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/etc/sysctl.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Disable IP forwarding:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;net.ipv4.ip_forward=0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Protect against SYN attacks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;net.ipv4.tcp_syncookies=1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sysctl &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  8. Secure User Accounts
&lt;/h1&gt;

&lt;p&gt;Review users:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/passwd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find accounts with shells:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/passwd | &lt;span class="nb"&gt;grep &lt;/span&gt;bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remove unused accounts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;userdel username
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Check sudo privileges:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/sudoers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Avoid:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ALL=(ALL) ALL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;for unnecessary users.&lt;/p&gt;




&lt;h1&gt;
  
  
  9. Filesystem Security
&lt;/h1&gt;

&lt;p&gt;Important directories:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/etc

/bin

/usr

/var

/home
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check permissions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Sensitive files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/etc/shadow
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;should be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-rw-r-----
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;not:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-rw-rw-rw-
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  10. Use Secure Mount Options
&lt;/h1&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Temporary filesystem:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/tmp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;can use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nodev

nosuid

noexec
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Meaning:&lt;/p&gt;

&lt;h2&gt;
  
  
  nodev
&lt;/h2&gt;

&lt;p&gt;No device files.&lt;/p&gt;

&lt;h2&gt;
  
  
  nosuid
&lt;/h2&gt;

&lt;p&gt;Ignore SUID bits.&lt;/p&gt;

&lt;h2&gt;
  
  
  noexec
&lt;/h2&gt;

&lt;p&gt;Prevent execution.&lt;/p&gt;




&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/dev/sdb1 /tmp ext4 defaults,nodev,nosuid,noexec
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  11. Audit System Activity
&lt;/h1&gt;

&lt;p&gt;Security without visibility is impossible.&lt;/p&gt;

&lt;p&gt;Linux provides:&lt;/p&gt;

&lt;h2&gt;
  
  
  auditd
&lt;/h2&gt;

&lt;p&gt;Install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;auditd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl status auditd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Example events:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User login

↓

File modification

↓

Privilege change

↓

Audit record
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  12. Centralize Logs
&lt;/h1&gt;

&lt;p&gt;System logs are critical.&lt;/p&gt;

&lt;p&gt;Modern Linux uses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemd-journald
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Examples:&lt;/p&gt;

&lt;p&gt;SSH logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;-u&lt;/span&gt; ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Kernel messages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;-k&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Production environments usually forward logs to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SIEM,&lt;/li&gt;
&lt;li&gt;Elasticsearch,&lt;/li&gt;
&lt;li&gt;Graylog,&lt;/li&gt;
&lt;li&gt;Splunk.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  13. Container Security on Linux Hosts
&lt;/h1&gt;

&lt;p&gt;Modern Linux servers often run containers.&lt;/p&gt;

&lt;p&gt;Docker security should include:&lt;/p&gt;

&lt;h2&gt;
  
  
  Rootless containers
&lt;/h2&gt;

&lt;p&gt;Instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root

↓

Docker daemon

↓

Container
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User

↓

Rootless Docker

↓

Container
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Seccomp
&lt;/h2&gt;

&lt;p&gt;Limit system calls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Allowed:

read()

write()

open()


Blocked:

mount()

ptrace()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  cgroups v2
&lt;/h2&gt;

&lt;p&gt;Control:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CPU,&lt;/li&gt;
&lt;li&gt;RAM,&lt;/li&gt;
&lt;li&gt;processes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Container

↓

Memory limit

↓

Host protection
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  14. Backup and Recovery
&lt;/h1&gt;

&lt;p&gt;Security is incomplete without recovery.&lt;/p&gt;

&lt;p&gt;A ransomware attack changes the question:&lt;/p&gt;

&lt;p&gt;Not:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Can we prevent every attack?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How quickly can we recover?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Backup strategy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Production

↓

Backup

↓

Offline Copy

↓

Recovery Test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  15. Automated Security Auditing
&lt;/h1&gt;

&lt;p&gt;Manual checks are not enough.&lt;/p&gt;

&lt;p&gt;Useful tools:&lt;/p&gt;

&lt;h2&gt;
  
  
  Lynis
&lt;/h2&gt;

&lt;p&gt;Linux security auditing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lynis audit system
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  OpenSCAP
&lt;/h2&gt;

&lt;p&gt;Compliance scanning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CIS Benchmarks,&lt;/li&gt;
&lt;li&gt;security policies.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Docker Bench Security
&lt;/h2&gt;

&lt;p&gt;Container security auditing.&lt;/p&gt;




&lt;h1&gt;
  
  
  Linux Hardening Checklist
&lt;/h1&gt;

&lt;h2&gt;
  
  
  System
&lt;/h2&gt;

&lt;p&gt;✅ Updates enabled&lt;br&gt;
✅ Unused packages removed&lt;br&gt;
✅ Services reviewed&lt;br&gt;
✅ Time synchronization configured&lt;/p&gt;


&lt;h2&gt;
  
  
  Authentication
&lt;/h2&gt;

&lt;p&gt;✅ SSH keys&lt;br&gt;
✅ Root login disabled&lt;br&gt;
✅ MFA where possible&lt;br&gt;
✅ Password policies&lt;/p&gt;


&lt;h2&gt;
  
  
  Network
&lt;/h2&gt;

&lt;p&gt;✅ Firewall enabled&lt;br&gt;
✅ Minimal open ports&lt;br&gt;
✅ Network monitoring&lt;/p&gt;


&lt;h2&gt;
  
  
  Kernel
&lt;/h2&gt;

&lt;p&gt;✅ sysctl hardening&lt;br&gt;
✅ Secure parameters&lt;br&gt;
✅ Updated kernel&lt;/p&gt;


&lt;h2&gt;
  
  
  Filesystem
&lt;/h2&gt;

&lt;p&gt;✅ Correct permissions&lt;br&gt;
✅ Secure mounts&lt;br&gt;
✅ Encryption where required&lt;/p&gt;


&lt;h2&gt;
  
  
  Monitoring
&lt;/h2&gt;

&lt;p&gt;✅ auditd&lt;br&gt;
✅ journald&lt;br&gt;
✅ Central logging&lt;br&gt;
✅ Alerts&lt;/p&gt;


&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Linux is not secure because it is Linux.&lt;/p&gt;

&lt;p&gt;Linux is secure because it provides the tools required to build a secure system.&lt;/p&gt;

&lt;p&gt;The difference between a normal Linux server and a production security-grade server is configuration.&lt;/p&gt;

&lt;p&gt;A mature security approach combines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Linux Hardening

+

Firewall

+

SELinux/AppArmor

+

Audit Logging

+

Container Security

+

Monitoring

+

Regular Testing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Security is not a single command.&lt;/p&gt;

&lt;p&gt;It is a continuous process of reducing risk, monitoring changes and improving the system over time.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Tags:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#Linux&lt;/code&gt;&lt;br&gt;
&lt;code&gt;#CyberSecurity&lt;/code&gt;&lt;br&gt;
&lt;code&gt;#DevSecOps&lt;/code&gt;&lt;br&gt;
&lt;code&gt;#LinuxSecurity&lt;/code&gt;&lt;br&gt;
&lt;code&gt;#SystemAdministration&lt;/code&gt;&lt;br&gt;
&lt;code&gt;#Hardening&lt;/code&gt;&lt;br&gt;
&lt;code&gt;#InfrastructureSecurity&lt;/code&gt;&lt;br&gt;
&lt;code&gt;#CloudSecurity&lt;/code&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>linux</category>
    </item>
    <item>
      <title>Building an AI Linux Security Assistant: From SSH Logs to Automated Threat Detection</title>
      <dc:creator>Marek „Netbe” Lampart </dc:creator>
      <pubDate>Thu, 16 Jul 2026 12:12:16 +0000</pubDate>
      <link>https://dev.to/cyberbezpieczenstwo/building-an-ai-linux-security-assistant-from-ssh-logs-to-automated-threat-detection-878</link>
      <guid>https://dev.to/cyberbezpieczenstwo/building-an-ai-linux-security-assistant-from-ssh-logs-to-automated-threat-detection-878</guid>
      <description>&lt;h1&gt;
  
  
  Building an AI Linux Security Assistant: From SSH Logs to Automated Threat Detection
&lt;/h1&gt;

&lt;p&gt;Linux powers a huge part of today's infrastructure.&lt;/p&gt;

&lt;p&gt;Web servers, cloud environments, containers, enterprise systems and development platforms often rely on Linux because of its flexibility, stability and security capabilities.&lt;/p&gt;

&lt;p&gt;However, securing Linux systems requires visibility.&lt;/p&gt;

&lt;p&gt;Administrators need to answer important questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Who is accessing the server?&lt;/li&gt;
&lt;li&gt;Are there brute-force attacks?&lt;/li&gt;
&lt;li&gt;Which IP addresses are suspicious?&lt;/li&gt;
&lt;li&gt;Are security configurations correct?&lt;/li&gt;
&lt;li&gt;What actions should be taken after detecting a threat?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Manual analysis works well for a small number of systems.&lt;/p&gt;

&lt;p&gt;It becomes much harder when you manage multiple servers and thousands of security events.&lt;/p&gt;

&lt;p&gt;This is why I started building &lt;strong&gt;AI Linux Security Assistant&lt;/strong&gt; — an open-source project designed to help Linux administrators analyze security events and understand potential threats faster.&lt;/p&gt;

&lt;p&gt;GitHub repository:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/cyberbezpieczenstwo" rel="noopener noreferrer"&gt;https://github.com/cyberbezpieczenstwo&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Project Goals
&lt;/h1&gt;

&lt;p&gt;The first version focuses on a simple but important security problem:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analyzing Linux SSH authentication logs.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SSH is one of the most important services in Linux environments.&lt;/p&gt;

&lt;p&gt;It is also one of the most common attack targets.&lt;/p&gt;

&lt;p&gt;Attackers frequently use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;brute-force attacks&lt;/li&gt;
&lt;li&gt;password spraying&lt;/li&gt;
&lt;li&gt;stolen credentials&lt;/li&gt;
&lt;li&gt;automated scanning tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal of the project is to transform raw Linux logs into understandable security information.&lt;/p&gt;




&lt;h1&gt;
  
  
  Version 0.1 Features
&lt;/h1&gt;

&lt;p&gt;The first release includes:&lt;/p&gt;

&lt;p&gt;✅ Python-based CLI application&lt;br&gt;
✅ SSH authentication log parser&lt;br&gt;
✅ Failed login detection&lt;br&gt;
✅ Successful login tracking&lt;br&gt;
✅ Suspicious IP identification&lt;br&gt;
✅ Markdown security reports&lt;/p&gt;

&lt;p&gt;The current workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Linux auth.log

        |
        v

SSH Log Parser

        |
        v

Security Analyzer

        |
        v

Security Report
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Example: Detecting SSH Brute Force Attempts
&lt;/h1&gt;

&lt;p&gt;A typical Linux authentication log may contain entries like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;Failed password for invalid user admin
from 192.168.1.50 port 52221 ssh2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The analyzer extracts important information:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;Source IP&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="s"&gt;192.168.1.50&lt;/span&gt;

&lt;span class="na"&gt;Event&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="s"&gt;Failed SSH authentication&lt;/span&gt;

&lt;span class="na"&gt;Risk&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="s"&gt;Medium&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of manually searching through log files, administrators receive a structured security report.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why SSH Logs Matter
&lt;/h1&gt;

&lt;p&gt;SSH is often exposed directly to the internet.&lt;/p&gt;

&lt;p&gt;A poorly configured SSH service can become an entry point for attackers.&lt;/p&gt;

&lt;p&gt;Common security issues include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;allowing root login&lt;/li&gt;
&lt;li&gt;using password authentication only&lt;/li&gt;
&lt;li&gt;weak passwords&lt;/li&gt;
&lt;li&gt;outdated SSH configurations&lt;/li&gt;
&lt;li&gt;missing brute-force protection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Security monitoring should start with understanding what is happening on the system.&lt;/p&gt;




&lt;h1&gt;
  
  
  From Logs to Security Recommendations
&lt;/h1&gt;

&lt;p&gt;Raw logs are useful, but they are not always easy to interpret.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="err"&gt;sshd:&lt;/span&gt; &lt;span class="err"&gt;Failed&lt;/span&gt; &lt;span class="err"&gt;password&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A security assistant can transform this into:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Possible SSH brute-force attack detected.

Recommended actions:

1. Disable SSH root login
2. Use SSH keys instead of passwords
3. Enable Fail2Ban
4. Review exposed services
5. Check authentication history
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The goal is not only detection.&lt;/p&gt;

&lt;p&gt;The goal is helping administrators make better security decisions.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Add AI?
&lt;/h1&gt;

&lt;p&gt;Traditional security tools are excellent at collecting data.&lt;/p&gt;

&lt;p&gt;The challenge is understanding that data.&lt;/p&gt;

&lt;p&gt;Modern systems generate huge amounts of information:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;authentication logs&lt;/li&gt;
&lt;li&gt;firewall events&lt;/li&gt;
&lt;li&gt;application logs&lt;/li&gt;
&lt;li&gt;vulnerability reports&lt;/li&gt;
&lt;li&gt;container events&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI can help summarize technical information and provide context.&lt;/p&gt;

&lt;p&gt;Future versions of this project will explore:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI-powered explanations&lt;/li&gt;
&lt;li&gt;security recommendations&lt;/li&gt;
&lt;li&gt;MITRE ATT&amp;amp;CK mapping&lt;/li&gt;
&lt;li&gt;local LLM integration&lt;/li&gt;
&lt;li&gt;automated incident summaries&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Security Automation Is the Future
&lt;/h1&gt;

&lt;p&gt;Modern cybersecurity already depends heavily on automation.&lt;/p&gt;

&lt;p&gt;Security teams use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SIEM platforms&lt;/li&gt;
&lt;li&gt;vulnerability scanners&lt;/li&gt;
&lt;li&gt;configuration management tools&lt;/li&gt;
&lt;li&gt;detection rules&lt;/li&gt;
&lt;li&gt;automated response systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI assistants are another step in this evolution.&lt;/p&gt;

&lt;p&gt;They can help engineers analyze incidents faster while keeping humans responsible for final decisions.&lt;/p&gt;




&lt;h1&gt;
  
  
  Roadmap
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Version 0.1
&lt;/h2&gt;

&lt;p&gt;Current release:&lt;/p&gt;

&lt;p&gt;✅ Project structure&lt;br&gt;
✅ SSH log analysis&lt;br&gt;
✅ Authentication event detection&lt;br&gt;
✅ Markdown reports&lt;/p&gt;

&lt;h2&gt;
  
  
  Version 0.2
&lt;/h2&gt;

&lt;p&gt;Planned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux user auditing&lt;/li&gt;
&lt;li&gt;sudo permission analysis&lt;/li&gt;
&lt;li&gt;password policy checks&lt;/li&gt;
&lt;li&gt;inactive account detection&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Version 0.3
&lt;/h2&gt;

&lt;p&gt;Planned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;firewall analysis&lt;/li&gt;
&lt;li&gt;open port detection&lt;/li&gt;
&lt;li&gt;service security checks&lt;/li&gt;
&lt;li&gt;Docker security module&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Version 1.0
&lt;/h2&gt;

&lt;p&gt;Future:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI assistant integration&lt;/li&gt;
&lt;li&gt;local LLM support&lt;/li&gt;
&lt;li&gt;advanced threat explanations&lt;/li&gt;
&lt;li&gt;security dashboard&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Open Source Security Project
&lt;/h1&gt;

&lt;p&gt;AI Linux Security Assistant is an ongoing open-source project focused on Linux security automation.&lt;/p&gt;

&lt;p&gt;The goal is simple:&lt;/p&gt;

&lt;p&gt;Make Linux security analysis easier, faster and more understandable.&lt;/p&gt;

&lt;p&gt;Security should not only identify problems.&lt;/p&gt;

&lt;p&gt;It should help people fix them.&lt;/p&gt;




&lt;h1&gt;
  
  
  Author
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Marek "Netbe" Lampart&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cybersecurity Engineer focused on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux security&lt;/li&gt;
&lt;li&gt;network security&lt;/li&gt;
&lt;li&gt;infrastructure hardening&lt;/li&gt;
&lt;li&gt;cybersecurity automation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;More projects and articles:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://netbe.pl" rel="noopener noreferrer"&gt;https://netbe.pl&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/cyberbezpieczenstwo" rel="noopener noreferrer"&gt;https://github.com/cyberbezpieczenstwo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>python</category>
      <category>cybersecurity</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Hardening SSH Server on Linux: A Practical Security Guide</title>
      <dc:creator>Marek „Netbe” Lampart </dc:creator>
      <pubDate>Mon, 13 Jul 2026 15:44:56 +0000</pubDate>
      <link>https://dev.to/cyberbezpieczenstwo/hardening-ssh-server-on-linux-a-practical-security-guide-3bkk</link>
      <guid>https://dev.to/cyberbezpieczenstwo/hardening-ssh-server-on-linux-a-practical-security-guide-3bkk</guid>
      <description>&lt;p&gt;SSH is one of the most important services in Linux administration.&lt;/p&gt;

&lt;p&gt;It allows administrators to remotely manage servers, deploy applications, troubleshoot systems, and maintain cloud infrastructure.&lt;/p&gt;

&lt;p&gt;However, exposing SSH directly to the internet also makes it a common target for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;brute-force attacks,&lt;/li&gt;
&lt;li&gt;password spraying,&lt;/li&gt;
&lt;li&gt;automated scanners,&lt;/li&gt;
&lt;li&gt;stolen credentials,&lt;/li&gt;
&lt;li&gt;unauthorized access attempts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A default SSH installation is functional, but it is not always secure.&lt;/p&gt;

&lt;p&gt;This guide shows practical steps to harden an OpenSSH server.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Update Your Linux Server First
&lt;/h2&gt;

&lt;p&gt;Before changing SSH configuration, make sure your system is updated.&lt;/p&gt;

&lt;p&gt;Debian / Ubuntu:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check your OpenSSH version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-V&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running outdated software increases the risk of known vulnerabilities.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Create a Dedicated Administrator Account
&lt;/h1&gt;

&lt;p&gt;Avoid using root directly.&lt;/p&gt;

&lt;p&gt;Create a new user:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;adduser admin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add administrator privileges:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;admin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now connect using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh admin@server-ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;for administrative tasks.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. Disable Root Login
&lt;/h1&gt;

&lt;p&gt;Open SSH configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PermitRootLogin yes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PermitRootLogin no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart SSH:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now attackers cannot attempt direct root authentication.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Use SSH Keys Instead of Passwords
&lt;/h1&gt;

&lt;p&gt;Passwords are vulnerable to brute-force attacks.&lt;/p&gt;

&lt;p&gt;Generate an SSH key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy it to the server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-copy-id admin@server-ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Test login:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh admin@server-ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After successful authentication disable passwords:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PasswordAuthentication no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart SSH:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your server now accepts cryptographic authentication.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. Change the Default SSH Port
&lt;/h1&gt;

&lt;p&gt;The default SSH port is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;22
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Changing it does not replace security controls, but it reduces automated scanning.&lt;/p&gt;

&lt;p&gt;Edit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Port 2222
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Update firewall:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 2222/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  6. Configure Firewall Rules
&lt;/h1&gt;

&lt;p&gt;Do not expose unnecessary services.&lt;/p&gt;

&lt;p&gt;Example using UFW:&lt;/p&gt;

&lt;p&gt;Install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;ufw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Allow SSH:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 22/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable firewall:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw &lt;span class="nb"&gt;enable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For additional security, allow SSH only from trusted IP addresses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow from YOUR_IP to any port 22
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  7. Install Fail2Ban
&lt;/h1&gt;

&lt;p&gt;Fail2Ban monitors authentication logs and blocks suspicious IP addresses.&lt;/p&gt;

&lt;p&gt;Install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;fail2ban
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;fail2ban
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start fail2ban
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;fail2ban-client status sshd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  8. Limit SSH Users
&lt;/h1&gt;

&lt;p&gt;Not every Linux user needs remote access.&lt;/p&gt;

&lt;p&gt;Restrict SSH:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AllowUsers admin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AllowGroups sshusers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This reduces the attack surface.&lt;/p&gt;




&lt;h1&gt;
  
  
  9. Disable Empty Passwords
&lt;/h1&gt;

&lt;p&gt;Never allow passwordless accounts.&lt;/p&gt;

&lt;p&gt;In:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/etc/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;set:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PermitEmptyPasswords no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  10. Improve SSH Cryptography
&lt;/h1&gt;

&lt;p&gt;Modern OpenSSH supports strong encryption algorithms.&lt;/p&gt;

&lt;p&gt;Example configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com

MACs hmac-sha2-512,hmac-sha2-256
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Avoid outdated algorithms whenever possible.&lt;/p&gt;




&lt;h1&gt;
  
  
  11. Monitor SSH Logs
&lt;/h1&gt;

&lt;p&gt;Security requires visibility.&lt;/p&gt;

&lt;p&gt;Check authentication events:&lt;/p&gt;

&lt;p&gt;Debian / Ubuntu:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;journalctl &lt;span class="nt"&gt;-u&lt;/span&gt; ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo cat&lt;/span&gt; /var/log/auth.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;repeated login failures,&lt;/li&gt;
&lt;li&gt;unknown usernames,&lt;/li&gt;
&lt;li&gt;unusual login times,&lt;/li&gt;
&lt;li&gt;unexpected successful sessions.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  12. Add Multi-Factor Authentication
&lt;/h1&gt;

&lt;p&gt;SSH keys are strong, but MFA provides another security layer.&lt;/p&gt;

&lt;p&gt;Possible solutions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TOTP applications,&lt;/li&gt;
&lt;li&gt;hardware security keys,&lt;/li&gt;
&lt;li&gt;FIDO2 devices.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For critical servers, MFA should be considered mandatory.&lt;/p&gt;




&lt;h1&gt;
  
  
  SSH Hardening Checklist
&lt;/h1&gt;

&lt;p&gt;Before exposing a Linux server:&lt;/p&gt;

&lt;p&gt;✅ Update OpenSSH&lt;br&gt;
✅ Disable root login&lt;br&gt;
✅ Use SSH keys&lt;br&gt;
✅ Disable password authentication&lt;br&gt;
✅ Configure firewall&lt;br&gt;
✅ Install Fail2Ban&lt;br&gt;
✅ Restrict SSH users&lt;br&gt;
✅ Remove weak algorithms&lt;br&gt;
✅ Monitor logs&lt;br&gt;
✅ Enable MFA&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;SSH is not insecure by design.&lt;/p&gt;

&lt;p&gt;Most successful attacks happen because of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;weak passwords,&lt;/li&gt;
&lt;li&gt;poor configuration,&lt;/li&gt;
&lt;li&gt;outdated systems,&lt;/li&gt;
&lt;li&gt;excessive permissions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A hardened SSH configuration is one of the first steps in building a secure Linux server.&lt;/p&gt;

&lt;p&gt;Security is not a single setting. It is a continuous process of improving, monitoring, and reducing risk.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;About NetBe&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;NetBe publishes practical guides about Linux administration, cybersecurity, server hardening, cloud computing, and modern infrastructure.&lt;/p&gt;

&lt;p&gt;More technical articles:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://netbe.pl" rel="noopener noreferrer"&gt;https://netbe.pl&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>linux</category>
      <category>security</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Building a Linux Security Audit Toolkit with Bash: From Firewall Checks to SSH Hardening</title>
      <dc:creator>Marek „Netbe” Lampart </dc:creator>
      <pubDate>Fri, 10 Jul 2026 15:31:53 +0000</pubDate>
      <link>https://dev.to/cyberbezpieczenstwo/building-a-linux-security-audit-toolkit-with-bash-from-firewall-checks-to-ssh-hardening-331o</link>
      <guid>https://dev.to/cyberbezpieczenstwo/building-a-linux-security-audit-toolkit-with-bash-from-firewall-checks-to-ssh-hardening-331o</guid>
      <description>&lt;h1&gt;
  
  
  Building a Linux Security Audit Toolkit with Bash: A Practical Approach to System Hardening
&lt;/h1&gt;

&lt;p&gt;Linux is widely considered a secure operating system. However, security does not come automatically after installing a distribution.&lt;/p&gt;

&lt;p&gt;A properly configured Linux system can be very secure, but a system with weak configuration, unnecessary services, outdated packages, or excessive privileges can still become an easy target.&lt;/p&gt;

&lt;p&gt;One of the most important steps in cybersecurity is visibility.&lt;/p&gt;

&lt;p&gt;Before improving security, you need to understand what is happening inside your system.&lt;/p&gt;

&lt;p&gt;Which services are running?&lt;/p&gt;

&lt;p&gt;Who has administrative privileges?&lt;/p&gt;

&lt;p&gt;Are there unnecessary open ports?&lt;/p&gt;

&lt;p&gt;Is SSH configured securely?&lt;/p&gt;

&lt;p&gt;Are file permissions correct?&lt;/p&gt;

&lt;p&gt;To answer these questions, I created a lightweight &lt;strong&gt;Linux Security Audit Toolkit written in Bash&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The goal was not to replace enterprise security scanners, but to build a simple, transparent tool that Linux administrators, students, and security enthusiasts can use to perform basic security checks.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Build a Security Audit Toolkit?
&lt;/h1&gt;

&lt;p&gt;There are many professional security auditing solutions available:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lynis&lt;/li&gt;
&lt;li&gt;OpenSCAP&lt;/li&gt;
&lt;li&gt;Nessus&lt;/li&gt;
&lt;li&gt;CIS security scanners&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These tools are extremely valuable, especially in enterprise environments.&lt;/p&gt;

&lt;p&gt;However, sometimes you need something simpler.&lt;/p&gt;

&lt;p&gt;A small Bash-based toolkit has several advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;no complicated installation,&lt;/li&gt;
&lt;li&gt;easy to understand source code,&lt;/li&gt;
&lt;li&gt;works directly from the terminal,&lt;/li&gt;
&lt;li&gt;easy to customize,&lt;/li&gt;
&lt;li&gt;useful for learning Linux security fundamentals.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The idea behind this project was simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Security starts with understanding your system.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  Project Architecture
&lt;/h1&gt;

&lt;p&gt;The toolkit is divided into independent security modules.&lt;/p&gt;

&lt;p&gt;Each script focuses on a specific area of Linux security.&lt;/p&gt;

&lt;p&gt;Example structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;linux-security-audit/

├── run.sh
├── VERSION
├── README.md
│
└── scripts/
    ├── system-security-check.sh
    ├── firewall-check.sh
    ├── users-audit.sh
    ├── permissions-check.sh
    ├── updates-check.sh
    └── ssh-hardening.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The main launcher executes all modules and creates a final security report.&lt;/p&gt;




&lt;h1&gt;
  
  
  Firewall Security Audit
&lt;/h1&gt;

&lt;p&gt;The firewall is one of the first layers protecting a Linux system.&lt;/p&gt;

&lt;p&gt;The toolkit checks common firewall technologies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;UFW&lt;/li&gt;
&lt;li&gt;Firewalld&lt;/li&gt;
&lt;li&gt;nftables&lt;/li&gt;
&lt;li&gt;iptables&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also reviews listening network services.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ss &lt;span class="nt"&gt;-tulnp&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command helps identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;active network services,&lt;/li&gt;
&lt;li&gt;open ports,&lt;/li&gt;
&lt;li&gt;applications listening for connections.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A common mistake is leaving services exposed even though they are no longer needed.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;A server running a database service should not expose that database directly to the internet unless there is a specific reason.&lt;/p&gt;

&lt;p&gt;Reducing the attack surface is one of the simplest security improvements.&lt;/p&gt;




&lt;h1&gt;
  
  
  User Account Security Audit
&lt;/h1&gt;

&lt;p&gt;User management is a critical part of Linux security.&lt;/p&gt;

&lt;p&gt;The toolkit checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;users with UID 0,&lt;/li&gt;
&lt;li&gt;sudo users,&lt;/li&gt;
&lt;li&gt;locked accounts,&lt;/li&gt;
&lt;li&gt;active login shells,&lt;/li&gt;
&lt;li&gt;SSH authorized keys.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="nt"&gt;-F&lt;/span&gt;: &lt;span class="s1"&gt;'$3 == 0 {print $1}'&lt;/span&gt; /etc/passwd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;UID 0 accounts have root privileges.&lt;/p&gt;

&lt;p&gt;Normally, only the root account and intentionally configured administrative accounts should have this level of access.&lt;/p&gt;

&lt;p&gt;Unexpected privileged users may indicate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;incorrect configuration,&lt;/li&gt;
&lt;li&gt;forgotten accounts,&lt;/li&gt;
&lt;li&gt;potential compromise.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Linux File Permissions Review
&lt;/h1&gt;

&lt;p&gt;Linux permissions are powerful, but incorrect permissions can create serious security problems.&lt;/p&gt;

&lt;p&gt;The audit checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SUID files,&lt;/li&gt;
&lt;li&gt;SGID files,&lt;/li&gt;
&lt;li&gt;world-writable files,&lt;/li&gt;
&lt;li&gt;insecure directories,&lt;/li&gt;
&lt;li&gt;files without owners,&lt;/li&gt;
&lt;li&gt;files without groups.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find / &lt;span class="nt"&gt;-perm&lt;/span&gt; &lt;span class="nt"&gt;-4000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SUID binaries deserve special attention.&lt;/p&gt;

&lt;p&gt;A vulnerable SUID application can sometimes allow privilege escalation from a normal user to root.&lt;/p&gt;

&lt;p&gt;This does not mean every SUID file is dangerous.&lt;/p&gt;

&lt;p&gt;Many system components require this functionality.&lt;/p&gt;

&lt;p&gt;The important part is knowing what exists on your system.&lt;/p&gt;




&lt;h1&gt;
  
  
  System Update Verification
&lt;/h1&gt;

&lt;p&gt;Outdated software remains one of the most common security problems.&lt;/p&gt;

&lt;p&gt;The update module checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;available package updates,&lt;/li&gt;
&lt;li&gt;kernel version,&lt;/li&gt;
&lt;li&gt;package manager status.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Supported systems include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Debian,&lt;/li&gt;
&lt;li&gt;Ubuntu,&lt;/li&gt;
&lt;li&gt;Linux Mint,&lt;/li&gt;
&lt;li&gt;Fedora,&lt;/li&gt;
&lt;li&gt;RHEL-based distributions,&lt;/li&gt;
&lt;li&gt;Arch Linux,&lt;/li&gt;
&lt;li&gt;openSUSE.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Regular updates help protect against:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;known vulnerabilities,&lt;/li&gt;
&lt;li&gt;privilege escalation bugs,&lt;/li&gt;
&lt;li&gt;remote code execution issues.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Security is not only about installing tools.&lt;/p&gt;

&lt;p&gt;Maintenance is equally important.&lt;/p&gt;




&lt;h1&gt;
  
  
  SSH Security Audit
&lt;/h1&gt;

&lt;p&gt;SSH is one of the most important services on Linux servers.&lt;/p&gt;

&lt;p&gt;It is also one of the most commonly attacked.&lt;/p&gt;

&lt;p&gt;The toolkit checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSH service status,&lt;/li&gt;
&lt;li&gt;OpenSSH version,&lt;/li&gt;
&lt;li&gt;root login configuration,&lt;/li&gt;
&lt;li&gt;password authentication,&lt;/li&gt;
&lt;li&gt;empty passwords,&lt;/li&gt;
&lt;li&gt;SSH keys,&lt;/li&gt;
&lt;li&gt;failed login attempts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Recommended SSH configuration usually includes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PermitRootLogin no

PasswordAuthentication no

PermitEmptyPasswords no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using SSH keys instead of passwords provides stronger authentication and reduces the risk of brute-force attacks.&lt;/p&gt;

&lt;p&gt;Additional protections can include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fail2ban,&lt;/li&gt;
&lt;li&gt;firewall restrictions,&lt;/li&gt;
&lt;li&gt;VPN-only SSH access,&lt;/li&gt;
&lt;li&gt;multi-factor authentication.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Running the Security Audit
&lt;/h1&gt;

&lt;p&gt;Clone the repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/cyberbezpieczenstwo/linux-security-audit.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enter the directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;linux-security-audit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make scripts executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; +x run.sh scripts/&lt;span class="k"&gt;*&lt;/span&gt;.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the audit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; ./run.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result is a generated report:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;security-report-hostname-date.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The report contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;system information,&lt;/li&gt;
&lt;li&gt;firewall status,&lt;/li&gt;
&lt;li&gt;user audit results,&lt;/li&gt;
&lt;li&gt;permission findings,&lt;/li&gt;
&lt;li&gt;SSH recommendations,&lt;/li&gt;
&lt;li&gt;update status.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Security Auditing Is Not About Finding Fault
&lt;/h1&gt;

&lt;p&gt;A security audit should not be treated as a checklist where every warning means failure.&lt;/p&gt;

&lt;p&gt;The purpose is understanding risk.&lt;/p&gt;

&lt;p&gt;A good security process asks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is exposed?&lt;/li&gt;
&lt;li&gt;Who has access?&lt;/li&gt;
&lt;li&gt;What software is running?&lt;/li&gt;
&lt;li&gt;What can be removed?&lt;/li&gt;
&lt;li&gt;What needs monitoring?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Security is about reducing unnecessary risk.&lt;/p&gt;




&lt;h1&gt;
  
  
  Future Development
&lt;/h1&gt;

&lt;p&gt;The project is still evolving.&lt;/p&gt;

&lt;p&gt;Planned improvements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTML report generation,&lt;/li&gt;
&lt;li&gt;Docker security checks,&lt;/li&gt;
&lt;li&gt;SELinux and AppArmor analysis,&lt;/li&gt;
&lt;li&gt;CIS Benchmark integration,&lt;/li&gt;
&lt;li&gt;Fail2ban detection,&lt;/li&gt;
&lt;li&gt;network security module,&lt;/li&gt;
&lt;li&gt;automated recommendations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is to transform a collection of Bash scripts into a practical Linux security baseline tool.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Linux gives administrators excellent control and visibility.&lt;/p&gt;

&lt;p&gt;But visibility only helps when you use it.&lt;/p&gt;

&lt;p&gt;A secure system is not created by installing one security application.&lt;/p&gt;

&lt;p&gt;It is built through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;regular auditing,&lt;/li&gt;
&lt;li&gt;proper configuration,&lt;/li&gt;
&lt;li&gt;updates,&lt;/li&gt;
&lt;li&gt;monitoring,&lt;/li&gt;
&lt;li&gt;understanding the environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even a simple Bash script can help reveal problems before they become security incidents.&lt;/p&gt;

&lt;p&gt;Security starts with knowing what is running on your machine.&lt;/p&gt;




&lt;p&gt;Project repository:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/cyberbezpieczenstwo/linux-security-audit" rel="noopener noreferrer"&gt;https://github.com/cyberbezpieczenstwo/linux-security-audit&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Author:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Marek "Netbe" Lampart&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Linux | Cybersecurity | Infrastructure&lt;/p&gt;

</description>
      <category>automation</category>
      <category>linux</category>
      <category>security</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>DNS Security: Why Your Domain Configuration Can Become a Cybersecurity Problem</title>
      <dc:creator>Marek „Netbe” Lampart </dc:creator>
      <pubDate>Tue, 07 Jul 2026 16:22:41 +0000</pubDate>
      <link>https://dev.to/cyberbezpieczenstwo/dns-security-why-your-domain-configuration-can-become-a-cybersecurity-problem-1olc</link>
      <guid>https://dev.to/cyberbezpieczenstwo/dns-security-why-your-domain-configuration-can-become-a-cybersecurity-problem-1olc</guid>
      <description>&lt;p&gt;When people think about cybersecurity, they usually focus on passwords, malware, vulnerabilities, and firewalls.&lt;/p&gt;

&lt;p&gt;DNS is rarely the first thing that comes to mind.&lt;/p&gt;

&lt;p&gt;However, DNS is one of the most important components of modern infrastructure. Almost every web application, API, email system, and cloud service depends on correct DNS configuration.&lt;/p&gt;

&lt;p&gt;A small DNS mistake can create serious security problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is DNS and why does it matter?
&lt;/h2&gt;

&lt;p&gt;DNS (Domain Name System) translates human-readable domain names into IP addresses.&lt;/p&gt;

&lt;p&gt;Instead of remembering:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;142.250.xxx.xxx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;users can access:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But DNS does more than just resolve domains.&lt;/p&gt;

&lt;p&gt;It also tells the internet:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;where your website is hosted,&lt;/li&gt;
&lt;li&gt;where your email servers are located,&lt;/li&gt;
&lt;li&gt;which services exist,&lt;/li&gt;
&lt;li&gt;which external providers are trusted.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because of this, DNS becomes part of your security perimeter.&lt;/p&gt;




&lt;h1&gt;
  
  
  Common DNS security problems
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1. Forgotten subdomains
&lt;/h2&gt;

&lt;p&gt;One of the most common problems is abandoned subdomains.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dev.example.com
test.example.com
old.example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A company may stop using a service but leave the DNS record behind.&lt;/p&gt;

&lt;p&gt;If that service is removed but the DNS entry remains, attackers may attempt a &lt;strong&gt;subdomain takeover&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The problem is simple:&lt;/p&gt;

&lt;p&gt;DNS says:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dev.example.com → external-service.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;but nobody controls that external resource anymore.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Missing SPF, DKIM and DMARC records
&lt;/h1&gt;

&lt;p&gt;Email security heavily depends on DNS.&lt;/p&gt;

&lt;p&gt;Without proper email authentication, attackers can spoof your domain.&lt;/p&gt;

&lt;p&gt;Common protections:&lt;/p&gt;

&lt;h3&gt;
  
  
  SPF
&lt;/h3&gt;

&lt;p&gt;Defines which servers can send email for your domain.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;example.com TXT

v=spf1 include:_spf.google.com ~all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  DKIM
&lt;/h3&gt;

&lt;p&gt;Adds cryptographic signatures to emails.&lt;/p&gt;

&lt;h3&gt;
  
  
  DMARC
&lt;/h3&gt;

&lt;p&gt;Defines what receivers should do when SPF or DKIM checks fail.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_dmarc.example.com TXT

v=DMARC1; p=quarantine
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These mechanisms do not stop every phishing attempt, but they significantly improve domain protection.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. Exposed internal information
&lt;/h1&gt;

&lt;p&gt;DNS records can reveal information about infrastructure.&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vpn.example.com
admin.example.com
backup.example.com
dev.example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This does not automatically mean a vulnerability exists.&lt;/p&gt;

&lt;p&gt;However, attackers use DNS information during reconnaissance.&lt;/p&gt;

&lt;p&gt;Before attacking systems, they first try to understand the environment.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Weak DNS configuration
&lt;/h1&gt;

&lt;p&gt;Common configuration mistakes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;outdated nameservers,&lt;/li&gt;
&lt;li&gt;missing DNSSEC,&lt;/li&gt;
&lt;li&gt;incorrect TTL values,&lt;/li&gt;
&lt;li&gt;forgotten records,&lt;/li&gt;
&lt;li&gt;publicly exposed development environments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A domain can work perfectly and still have security problems.&lt;/p&gt;




&lt;h1&gt;
  
  
  DNSSEC - protecting DNS integrity
&lt;/h1&gt;

&lt;p&gt;DNS itself was not originally designed with strong authentication.&lt;/p&gt;

&lt;p&gt;DNSSEC adds cryptographic verification to DNS responses.&lt;/p&gt;

&lt;p&gt;It helps protect against attacks where someone tries to modify DNS responses and redirect users somewhere else.&lt;/p&gt;

&lt;p&gt;DNSSEC does not encrypt DNS traffic.&lt;/p&gt;

&lt;p&gt;Its purpose is integrity and authenticity.&lt;/p&gt;




&lt;h1&gt;
  
  
  How to perform a basic DNS security audit
&lt;/h1&gt;

&lt;p&gt;A simple audit should check:&lt;/p&gt;

&lt;h2&gt;
  
  
  Domain records
&lt;/h2&gt;

&lt;p&gt;Review:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A records&lt;/li&gt;
&lt;li&gt;AAAA records&lt;/li&gt;
&lt;li&gt;MX records&lt;/li&gt;
&lt;li&gt;NS records&lt;/li&gt;
&lt;li&gt;TXT records&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Email protection
&lt;/h2&gt;

&lt;p&gt;Verify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SPF&lt;/li&gt;
&lt;li&gt;DKIM&lt;/li&gt;
&lt;li&gt;DMARC&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Old resources
&lt;/h2&gt;

&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;unused subdomains,&lt;/li&gt;
&lt;li&gt;forgotten services,&lt;/li&gt;
&lt;li&gt;old cloud resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Nameserver security
&lt;/h2&gt;

&lt;p&gt;Check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;provider reliability,&lt;/li&gt;
&lt;li&gt;DNSSEC support,&lt;/li&gt;
&lt;li&gt;account protection.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Useful tools for DNS analysis
&lt;/h1&gt;

&lt;p&gt;Some commonly used tools:&lt;/p&gt;

&lt;h2&gt;
  
  
  dig
&lt;/h2&gt;

&lt;p&gt;Linux users can query DNS directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check MX records:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig MX example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check TXT records:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig TXT example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  nslookup
&lt;/h2&gt;

&lt;p&gt;A simpler alternative:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nslookup example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Online DNS checkers
&lt;/h2&gt;

&lt;p&gt;Online tools are useful for quick verification:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DNS record lookup&lt;/li&gt;
&lt;li&gt;MX verification&lt;/li&gt;
&lt;li&gt;SPF checking&lt;/li&gt;
&lt;li&gt;propagation testing&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  DNS is often forgotten security layer
&lt;/h1&gt;

&lt;p&gt;Many organizations invest heavily in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;endpoint protection,&lt;/li&gt;
&lt;li&gt;firewalls,&lt;/li&gt;
&lt;li&gt;monitoring,&lt;/li&gt;
&lt;li&gt;vulnerability scanners.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But DNS configuration is often treated as "just networking".&lt;/p&gt;

&lt;p&gt;That is a mistake.&lt;/p&gt;

&lt;p&gt;DNS controls how users and systems find your services.&lt;/p&gt;

&lt;p&gt;If DNS is wrong, everything built on top of it can become unreliable or unsafe.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final thoughts
&lt;/h1&gt;

&lt;p&gt;Security is not only about preventing attacks.&lt;/p&gt;

&lt;p&gt;It is also about reducing unnecessary exposure.&lt;/p&gt;

&lt;p&gt;A properly configured DNS environment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;reduces attack surface,&lt;/li&gt;
&lt;li&gt;improves email security,&lt;/li&gt;
&lt;li&gt;prevents accidental exposure,&lt;/li&gt;
&lt;li&gt;makes infrastructure easier to manage.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;DNS may look simple from the outside, but it is one of the foundations of modern cybersecurity.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Author&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Marek "Netbe" Lampart&lt;/p&gt;

&lt;p&gt;Cybersecurity | Linux | Networking | Infrastructure Security&lt;/p&gt;

&lt;p&gt;&lt;a href="https://netbe.pl" rel="noopener noreferrer"&gt;https://netbe.pl&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>Ransomware explained: how modern attacks really work in 2026 (not theory)</title>
      <dc:creator>Marek „Netbe” Lampart </dc:creator>
      <pubDate>Sun, 05 Jul 2026 15:09:19 +0000</pubDate>
      <link>https://dev.to/cyberbezpieczenstwo/ransomware-explained-how-modern-attacks-really-work-in-2026-not-theory-2em6</link>
      <guid>https://dev.to/cyberbezpieczenstwo/ransomware-explained-how-modern-attacks-really-work-in-2026-not-theory-2em6</guid>
      <description>&lt;p&gt;Ransomware is often explained in a very simple way:&lt;/p&gt;

&lt;p&gt;“It encrypts your files and demands payment.”&lt;/p&gt;

&lt;p&gt;That description is technically correct — but it hides how complex modern ransomware actually is.&lt;/p&gt;

&lt;p&gt;In 2026, ransomware is not just malware.&lt;br&gt;
It is a multi-stage cybercrime operation combining intrusion, persistence, data theft, and extortion.&lt;/p&gt;

&lt;p&gt;Let’s break it down realistically.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ransomware starts long before encryption&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most people think ransomware “just appears” and starts encrypting files.&lt;/p&gt;

&lt;p&gt;In reality, encryption is usually the final stage.&lt;/p&gt;

&lt;p&gt;Attackers first need access, which is typically gained through:&lt;/p&gt;

&lt;p&gt;🔹 Phishing&lt;br&gt;
fake login pages&lt;br&gt;
malicious attachments&lt;br&gt;
credential harvesting&lt;br&gt;
🔹 Exploited vulnerabilities&lt;br&gt;
unpatched VPNs&lt;br&gt;
exposed RDP services&lt;br&gt;
software zero-days&lt;br&gt;
🔹 Stolen credentials&lt;br&gt;
leaked passwords&lt;br&gt;
credential stuffing attacks&lt;br&gt;
reused passwords across services&lt;/p&gt;

&lt;p&gt;👉 At this stage, attackers are already inside the system — ransomware is just the final payload.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Initial execution and system analysis&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once inside, the ransomware binary is executed.&lt;/p&gt;

&lt;p&gt;Before doing anything destructive, it often:&lt;/p&gt;

&lt;p&gt;checks if it is running in a virtual machine&lt;br&gt;
detects security tools (Defender, EDR, sandbox)&lt;br&gt;
escalates privileges to admin/system level&lt;br&gt;
delays execution to avoid detection&lt;/p&gt;

&lt;p&gt;👉 This is why many infections are not immediately visible.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Network and file system reconnaissance&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Modern ransomware does not encrypt randomly.&lt;/p&gt;

&lt;p&gt;It first maps the environment:&lt;/p&gt;

&lt;p&gt;local drives (C:, D:)&lt;br&gt;
network shares&lt;br&gt;
backup locations&lt;br&gt;
cloud-synced folders&lt;/p&gt;

&lt;p&gt;It also identifies valuable file types:&lt;/p&gt;

&lt;p&gt;documents (.docx, .pdf)&lt;br&gt;
databases (.sql, .db)&lt;br&gt;
archives (.zip, .bak)&lt;/p&gt;

&lt;p&gt;👉 The goal is maximum impact with minimum effort.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The encryption model (hybrid cryptography)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Modern ransomware uses hybrid encryption, not simple file locking.&lt;/p&gt;

&lt;p&gt;Step 1: Fast encryption per file&lt;/p&gt;

&lt;p&gt;Each file is encrypted using:&lt;/p&gt;

&lt;p&gt;AES (Advanced Encryption Standard)&lt;br&gt;
ChaCha20 (in newer variants)&lt;/p&gt;

&lt;p&gt;This allows fast processing of large data volumes.&lt;/p&gt;

&lt;p&gt;Step 2: Key protection&lt;/p&gt;

&lt;p&gt;The AES keys are then encrypted using:&lt;/p&gt;

&lt;p&gt;RSA&lt;br&gt;
ECC (Elliptic Curve Cryptography)&lt;/p&gt;

&lt;p&gt;The attacker holds the private key.&lt;/p&gt;

&lt;p&gt;👉 Without the private key, recovery is practically impossible.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;File encryption in practice&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The ransomware loops through files and:&lt;/p&gt;

&lt;p&gt;opens file&lt;br&gt;
reads content into memory&lt;br&gt;
encrypts data&lt;br&gt;
overwrites or replaces original file&lt;br&gt;
renames file (often adding custom extension)&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;report.docx → report.docx.lockbit&lt;/p&gt;

&lt;p&gt;It usually avoids system-critical files to keep the OS running.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Destruction of recovery options&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To prevent easy recovery, ransomware often:&lt;/p&gt;

&lt;p&gt;deletes shadow copies&lt;br&gt;
disables system restore&lt;br&gt;
removes backup snapshots&lt;br&gt;
stops recovery tools&lt;br&gt;
clears event logs&lt;/p&gt;

&lt;p&gt;Example commands used in attacks:&lt;/p&gt;

&lt;p&gt;vssadmin delete shadows&lt;br&gt;
wbadmin delete catalog&lt;/p&gt;

&lt;p&gt;👉 This ensures victims cannot restore data easily.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Double extortion: the modern standard&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In 2026, encryption alone is not enough for attackers.&lt;/p&gt;

&lt;p&gt;Most groups now use double extortion:&lt;/p&gt;

&lt;p&gt;Step 1: Data theft&lt;/p&gt;

&lt;p&gt;Before encryption:&lt;/p&gt;

&lt;p&gt;files are copied&lt;br&gt;
sensitive databases extracted&lt;br&gt;
credentials stolen&lt;br&gt;
Step 2: Encryption&lt;/p&gt;

&lt;p&gt;System is locked locally.&lt;/p&gt;

&lt;p&gt;Step 3: Blackmail&lt;/p&gt;

&lt;p&gt;If ransom is not paid:&lt;/p&gt;

&lt;p&gt;stolen data is published or sold&lt;/p&gt;

&lt;p&gt;👉 Even backups do not fully protect against this model.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ransom note and communication system&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After encryption, victims typically see:&lt;/p&gt;

&lt;p&gt;ransom note files in folders&lt;br&gt;
changed desktop wallpaper&lt;br&gt;
instructions for payment&lt;/p&gt;

&lt;p&gt;Modern groups also use:&lt;/p&gt;

&lt;p&gt;Tor-based negotiation portals&lt;br&gt;
live chat systems&lt;br&gt;
“customer support” style communication&lt;/p&gt;

&lt;p&gt;👉 Ransomware gangs now operate like service platforms.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Why recovery is extremely difficult&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The key reason:&lt;/p&gt;

&lt;p&gt;👉 asymmetric cryptography&lt;/p&gt;

&lt;p&gt;AES/ChaCha20 = fast encryption&lt;br&gt;
RSA/ECC = locks decryption keys&lt;/p&gt;

&lt;p&gt;Without the private key:&lt;/p&gt;

&lt;p&gt;brute force is computationally impossible&lt;br&gt;
decryption is not realistic&lt;/p&gt;

&lt;p&gt;Even advanced recovery tools usually fail.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Real-world insight: ransomware is not just malware&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Modern ransomware is best understood as:&lt;/p&gt;

&lt;p&gt;a structured cybercrime business model combining intrusion, automation, encryption, and extortion&lt;/p&gt;

&lt;p&gt;It is not random malware anymore — it is organized infrastructure.&lt;/p&gt;

&lt;p&gt;Final thoughts&lt;/p&gt;

&lt;p&gt;Ransomware in 2026 is no longer just about locking files.&lt;/p&gt;

&lt;p&gt;It is about:&lt;/p&gt;

&lt;p&gt;stealing data&lt;br&gt;
disabling recovery&lt;br&gt;
applying psychological pressure&lt;br&gt;
monetizing access in multiple ways&lt;/p&gt;

&lt;p&gt;And the key takeaway is simple:&lt;/p&gt;

&lt;p&gt;👉 once encryption starts, the real failure already happened earlier — at the access stage.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>infosec</category>
      <category>security</category>
    </item>
    <item>
      <title>How ransomware actually encrypts files (real-world explanation, not theory)</title>
      <dc:creator>Marek „Netbe” Lampart </dc:creator>
      <pubDate>Sun, 05 Jul 2026 14:48:24 +0000</pubDate>
      <link>https://dev.to/cyberbezpieczenstwo/how-ransomware-actually-encrypts-files-real-world-explanation-not-theory-4g1n</link>
      <guid>https://dev.to/cyberbezpieczenstwo/how-ransomware-actually-encrypts-files-real-world-explanation-not-theory-4g1n</guid>
      <description>&lt;p&gt;Ransomware is often described in a very simplified way: &lt;em&gt;“it encrypts your files and demands payment.”&lt;/em&gt;&lt;br&gt;
That explanation is correct, but completely useless if you want to understand what actually happens on a technical level.&lt;/p&gt;

&lt;p&gt;In this article, I’ll break down how modern ransomware really works in practice — based on real attack patterns used by families like LockBit, BlackCat, and others.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. Initial access – how ransomware gets into the system
&lt;/h1&gt;

&lt;p&gt;Before encryption even starts, attackers need access. This usually happens in one of these ways:&lt;/p&gt;

&lt;h3&gt;
  
  
  🔹 Phishing
&lt;/h3&gt;

&lt;p&gt;A user opens:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;malicious email attachment (PDF, DOCX, ZIP)&lt;/li&gt;
&lt;li&gt;fake login page&lt;/li&gt;
&lt;li&gt;macro-enabled document&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔹 Exploiting vulnerabilities
&lt;/h3&gt;

&lt;p&gt;Unpatched systems are often targeted:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;exposed RDP&lt;/li&gt;
&lt;li&gt;VPN vulnerabilities&lt;/li&gt;
&lt;li&gt;Windows zero-days&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔹 Stolen credentials
&lt;/h3&gt;

&lt;p&gt;Attackers log in directly using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;leaked passwords&lt;/li&gt;
&lt;li&gt;credential stuffing&lt;/li&gt;
&lt;li&gt;reused passwords&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 Important: ransomware is rarely “random”. It’s usually a &lt;strong&gt;planned intrusion&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Payload execution – the ransomware is launched
&lt;/h1&gt;

&lt;p&gt;Once inside, the attacker deploys the ransomware binary.&lt;/p&gt;

&lt;p&gt;At this stage, it typically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;checks system environment (VM detection, sandbox evasion)&lt;/li&gt;
&lt;li&gt;disables security tools (Defender, logs, recovery tools)&lt;/li&gt;
&lt;li&gt;escalates privileges (admin rights)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some variants even sleep for hours or days to avoid detection.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. Reconnaissance – mapping the system
&lt;/h1&gt;

&lt;p&gt;Before encryption, ransomware “explores”:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;drives (C:, D:, network shares)&lt;/li&gt;
&lt;li&gt;connected devices&lt;/li&gt;
&lt;li&gt;file types (documents, databases, backups)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It builds a target list in memory.&lt;/p&gt;

&lt;p&gt;👉 This is why network drives often get encrypted too.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Key generation – the most important part
&lt;/h1&gt;

&lt;p&gt;Modern ransomware uses &lt;strong&gt;hybrid encryption&lt;/strong&gt;:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Fast symmetric encryption
&lt;/h3&gt;

&lt;p&gt;Each file is encrypted with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AES (most common)&lt;/li&gt;
&lt;li&gt;ChaCha20 (in newer strains)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is fast and used for bulk encryption.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Public key encryption
&lt;/h3&gt;

&lt;p&gt;The symmetric keys are then encrypted using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RSA&lt;/li&gt;
&lt;li&gt;ECC (Elliptic Curve Cryptography)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The attacker keeps the private key.&lt;/p&gt;

&lt;p&gt;👉 This is why you cannot “reverse engineer” encryption easily.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. File-by-file encryption process
&lt;/h1&gt;

&lt;p&gt;Now the ransomware starts looping through files:&lt;/p&gt;

&lt;p&gt;For each file:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;open file&lt;/li&gt;
&lt;li&gt;read content into memory&lt;/li&gt;
&lt;li&gt;encrypt with AES/ChaCha20&lt;/li&gt;
&lt;li&gt;overwrite original file or create new encrypted copy&lt;/li&gt;
&lt;li&gt;rename file (often adding extension like &lt;code&gt;.lockbit&lt;/code&gt;, &lt;code&gt;.enc&lt;/code&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It usually targets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;documents (.docx, .pdf)&lt;/li&gt;
&lt;li&gt;databases (.sql, .db)&lt;/li&gt;
&lt;li&gt;backups&lt;/li&gt;
&lt;li&gt;archives (.zip, .rar)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It often avoids system-critical files to keep Windows running.&lt;/p&gt;




&lt;h1&gt;
  
  
  6. Deleting recovery options
&lt;/h1&gt;

&lt;p&gt;To make recovery harder, ransomware often:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;deletes shadow copies (&lt;code&gt;vssadmin delete shadows&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;disables recovery tools&lt;/li&gt;
&lt;li&gt;removes backups if accessible&lt;/li&gt;
&lt;li&gt;clears logs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is why system restore often stops working.&lt;/p&gt;




&lt;h1&gt;
  
  
  7. Ransom note delivery
&lt;/h1&gt;

&lt;p&gt;After encryption:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;text file is dropped in every folder&lt;/li&gt;
&lt;li&gt;desktop wallpaper is changed&lt;/li&gt;
&lt;li&gt;instructions are shown&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Usually includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tor payment site&lt;/li&gt;
&lt;li&gt;Bitcoin/Monero address&lt;/li&gt;
&lt;li&gt;countdown timer&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  8. Data exfiltration (modern ransomware trend)
&lt;/h1&gt;

&lt;p&gt;Many modern attacks are &lt;strong&gt;double extortion&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;Before encryption, attackers also:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;copy sensitive files&lt;/li&gt;
&lt;li&gt;steal databases&lt;/li&gt;
&lt;li&gt;exfiltrate credentials&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even if you restore backups, data can still be leaked.&lt;/p&gt;




&lt;h1&gt;
  
  
  9. Why recovery without key is nearly impossible
&lt;/h1&gt;

&lt;p&gt;Because of hybrid encryption:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AES/ChaCha20 = fast encryption per file&lt;/li&gt;
&lt;li&gt;RSA/ECC = protects AES keys&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without private key:&lt;br&gt;
👉 brute force is computationally impossible&lt;/p&gt;




&lt;h1&gt;
  
  
  10. Real-world insight (important)
&lt;/h1&gt;

&lt;p&gt;Ransomware is not “magic encryption malware”.&lt;/p&gt;

&lt;p&gt;It is closer to:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;a structured automated data destruction system combined with extortion logic&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Modern groups operate like companies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;affiliates&lt;/li&gt;
&lt;li&gt;infrastructure teams&lt;/li&gt;
&lt;li&gt;negotiation portals&lt;/li&gt;
&lt;li&gt;customer support (!)&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Final thoughts
&lt;/h1&gt;

&lt;p&gt;Understanding ransomware at this level shows something important:&lt;/p&gt;

&lt;p&gt;👉 prevention is far easier than recovery&lt;/p&gt;

&lt;p&gt;Because once encryption starts, the system is already compromised at multiple layers.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>infosec</category>
      <category>security</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Checker portów IP i DNS – jak sprawdzić bezpieczeństwo i konfigurację sieci online</title>
      <dc:creator>Marek „Netbe” Lampart </dc:creator>
      <pubDate>Sun, 05 Jul 2026 14:33:49 +0000</pubDate>
      <link>https://dev.to/cyberbezpieczenstwo/checker-portow-ip-i-dns-jak-sprawdzic-bezpieczenstwo-i-konfiguracje-sieci-online-55cf</link>
      <guid>https://dev.to/cyberbezpieczenstwo/checker-portow-ip-i-dns-jak-sprawdzic-bezpieczenstwo-i-konfiguracje-sieci-online-55cf</guid>
      <description>&lt;p&gt;W sieci działa ogromna liczba usług, które komunikują się ze sobą przez konkretne porty i rekordy DNS. W praktyce większość problemów z bezpieczeństwem infrastruktury nie wynika z zaawansowanych exploitów, tylko z prostych błędów konfiguracji — np. otwartych portów, nieświadomie wystawionych usług albo błędnych rekordów DNS.&lt;/p&gt;

&lt;p&gt;Dlatego narzędzia typu port checker / IP checker / DNS lookup stały się jednym z podstawowych sposobów szybkiej diagnostyki sieci.&lt;/p&gt;

&lt;p&gt;W tym artykule wyjaśniam, jak działają takie narzędzia i jak można je wykorzystać do analizy bezpieczeństwa własnej infrastruktury.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://netbe.pl/checker-portow-ip-i-dns-jak-sprawdzic-bezpieczenstwo-i-konfiguracje-sieci-online/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fnetbe.pl%2Fwp-content%2Fuploads%2F2026%2F07%2FChecker-portow-IP-i-DNS-%25E2%2580%2593-jak-sprawdzic-bezpieczenstwo-i-konfiguracje-sieci-online.webp" height="450" class="m-0" width="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://netbe.pl/checker-portow-ip-i-dns-jak-sprawdzic-bezpieczenstwo-i-konfiguracje-sieci-online/" rel="noopener noreferrer" class="c-link"&gt;
            Checker portów, IP i DNS – jak sprawdzić bezpieczeństwo i konfigurację sieci online
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Checker portów, IP i DNS – jak sprawdzić bezpieczeństwo i konfigurację sieci online
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fnetbe.pl%2Fwp-content%2Fuploads%2F2023%2F01%2Fcropped-favicon-32x32-1-32x32.png" width="32" height="32"&gt;
          netbe.pl
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
  </channel>
</rss>
