<?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: Павел Бардин</title>
    <description>The latest articles on DEV Community by Павел Бардин (@pabit).</description>
    <link>https://dev.to/pabit</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%2F4264362%2Fa80dbcf8-7dc3-490b-8ae2-9c0be1d5045b.jpg</url>
      <title>DEV Community: Павел Бардин</title>
      <link>https://dev.to/pabit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pabit"/>
    <language>en</language>
    <item>
      <title>A SOC for a 20-PC company: what to automate and what to leave to a human</title>
      <dc:creator>Павел Бардин</dc:creator>
      <pubDate>Wed, 25 Nov 2026 09:30:11 +0000</pubDate>
      <link>https://dev.to/pabit/a-soc-for-a-20-pc-company-what-to-automate-and-what-to-leave-to-a-human-3b6i</link>
      <guid>https://dev.to/pabit/a-soc-for-a-20-pc-company-what-to-automate-and-what-to-leave-to-a-human-3b6i</guid>
      <description>&lt;p&gt;In a company of 20–50 people, security usually belongs to a part-time sysadmin. There's an antivirus, backups, and, with luck, domain controller logs that nobody reads. A classic SOC with analysts on shift is out of reach: one tier-1 analyst costs more than the company's entire IT budget.&lt;/p&gt;

&lt;p&gt;We're the team at Pabit, and we build a monitoring platform for exactly these companies. Along the way we had to answer the question every small SOC faces: which parts of an analyst's job can rules and playbooks take over, and where do you still need a person? Below is where we ended up, with thresholds, feed lists and code. It should be useful even if you're building your own stack on Wazuh and Shuffle.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a SOC actually does
&lt;/h2&gt;

&lt;p&gt;Strip away the buzzwords and a SOC does seven things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Collects events&lt;/strong&gt; from workstations, servers and network gear.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Correlates&lt;/strong&gt; them, turning thousands of events into one readable alert (SIEM).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Protects endpoints&lt;/strong&gt;: sees processes, blocks malware, isolates a host (EDR/XDR).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Watches for leaks&lt;/strong&gt;: where documents and personal data go (DLP).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Checks against threat feeds&lt;/strong&gt;: IPs, domains and hashes (Threat Intelligence).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Responds&lt;/strong&gt;: runs the standard steps for an incident (SOAR).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reports&lt;/strong&gt;: what happened and what needs a manager's decision.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The first six are mostly repetitive work. Look up an IP in the feeds, block an address after a brute-force attempt, quarantine a file, tell the manager about a leak. A tier-1 analyst does this dozens of times per shift, following the same script every time. Those scripts are what you automate first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Correlation: the thresholds we settled on
&lt;/h2&gt;

&lt;p&gt;The most common event in a small network is password guessing. RDP and SSH exposed to the internet get hammered around the clock, and a rule that fires on every failed login will bury the console under hundreds of alerts a day. So there are three rules, each with its own threshold.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Network brute force (RDP, SSH): 5 failures in 5 minutes from one address&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Brute Force Detection"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"threshold"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;windowMs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60_000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;threshold&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Local brute force (lock screen, login window, sudo)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Local Brute Force"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"threshold"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;windowMs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60_000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;threshold&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// A successful login right after a run of failures: not guessing anymore, a compromised account&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Successful Password Guess"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"account_compromise"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why the local threshold is higher: someone who mistyped their own password three times on a Monday morning is far more common than an attacker sitting at a stolen laptop. With the network threshold, the rule would page the admin every time someone forgot to switch keyboard layout.&lt;/p&gt;

&lt;p&gt;The third rule is the most valuable one. Brute force on its own means almost nothing; any server with an open port sees it. A successful login right after a dozen failures from the same source means the guessing worked. That event becomes an incident immediately, no threshold involved.&lt;/p&gt;

&lt;p&gt;The other baseline rules are simpler: malware execution, data exfiltration, a click on a phishing link, lateral movement, a policy hit in the AI gateway. Each produces an alert, and the XDR engine then groups alerts from the same host into one incident when they fall into the same time window. If EDR and DLP both fire on one machine, you get a single incident, "data leak from an infected host", instead of two alarms in two different places.&lt;/p&gt;

&lt;h2&gt;
  
  
  Playbooks: what runs without a human
&lt;/h2&gt;

&lt;p&gt;Here's the default set. In our view, this is what's safe to do automatically in a company with nobody on shift.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Playbook&lt;/th&gt;
&lt;th&gt;Trigger&lt;/th&gt;
&lt;th&gt;Actions&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Malware Auto-Quarantine&lt;/td&gt;
&lt;td&gt;EDR found a malicious file&lt;/td&gt;
&lt;td&gt;quarantine file, kill process, scan host, notify&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Brute Force IP Block&lt;/td&gt;
&lt;td&gt;more than 5 failed logins in 5 minutes&lt;/td&gt;
&lt;td&gt;block address, notify&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Phishing Email Quarantine&lt;/td&gt;
&lt;td&gt;phishing email detected&lt;/td&gt;
&lt;td&gt;quarantine email, warn users&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lateral Movement Containment&lt;/td&gt;
&lt;td&gt;lateral movement chain&lt;/td&gt;
&lt;td&gt;isolate host, lock account, open incident&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DLP Violation — Manager Notify&lt;/td&gt;
&lt;td&gt;critical DLP violation&lt;/td&gt;
&lt;td&gt;notify the manager&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Threat Intel IoC Block&lt;/td&gt;
&lt;td&gt;match against a threat feed&lt;/td&gt;
&lt;td&gt;kill process, block address, notify&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Compromised Account Response&lt;/td&gt;
&lt;td&gt;login after a brute-force series&lt;/td&gt;
&lt;td&gt;block address, open incident, notify&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Host isolation appears in only one playbook, lateral movement. That's deliberate. Isolate the accountant's PC on a false positive on the day tax reports are due, and the company will remember it for a long time. With lateral movement, the cost of waiting beats the cost of a mistake: ransomware can walk every network share within an hour.&lt;/p&gt;

&lt;p&gt;An isolated host still keeps its link to the console: the agent leaves itself a channel to the management server so isolation can be lifted remotely. Without that, the first isolation of a remote employee's laptop would turn into a drive to their house. On Linux this is a separate iptables chain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;iptables -N PABION_ISOLATE
iptables -I OUTPUT 1 -j PABION_ISOLATE
iptables -A PABION_ISOLATE -o lo -j ACCEPT                 &lt;span class="c"&gt;# local services&lt;/span&gt;
iptables -A PABION_ISOLATE -p udp --dport 53 -j ACCEPT     &lt;span class="c"&gt;# DNS, to resolve the management server&lt;/span&gt;
iptables -A PABION_ISOLATE -p tcp --dport 53 -j ACCEPT
iptables -A PABION_ISOLATE -d &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;server address&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; -j ACCEPT   &lt;span class="c"&gt;# channel to the console&lt;/span&gt;
iptables -A PABION_ISOLATE -j DROP                         &lt;span class="c"&gt;# everything else&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To release the host, delete the chain. A dedicated chain also leaves alone whatever rules the admin already set up on the machine.&lt;/p&gt;

&lt;p&gt;The DLP playbook only notifies the manager and blocks nothing. Whether to fire a salesperson who copied the customer database to a USB stick is not a decision for an algorithm.&lt;/p&gt;

&lt;h2&gt;
  
  
  Threat feeds you can get for free
&lt;/h2&gt;

&lt;p&gt;Commercial feeds cost money, but open ones are enough for a small company. Here's what we currently pull:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Feodo Tracker&lt;/strong&gt; (abuse.ch): botnet C2 servers;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;URLhaus&lt;/strong&gt; (abuse.ch): URLs and domains distributing malware;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spamhaus DROP&lt;/strong&gt;: netblocks fully given over to malicious activity;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenPhish&lt;/strong&gt; and &lt;strong&gt;phishing-filter&lt;/strong&gt;: phishing URLs and domains;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IPsum&lt;/strong&gt;: addresses that appear on at least three blocklists;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;blocklist.de&lt;/strong&gt; and &lt;strong&gt;CINS Army&lt;/strong&gt;: addresses seen attacking;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Emerging Threats compromised IPs&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ThreatView&lt;/strong&gt;: high-confidence indicators;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tor exit node list&lt;/strong&gt;: for context, not for blocking.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feeds refresh twice a day. Two lessons learned:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Don't block everything.&lt;/strong&gt; From IPsum we take level 3 (the address is on at least three lists). Levels 1–2 include cloud provider addresses that perfectly legitimate services also use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tor is a reason to look closer, not to block.&lt;/strong&gt; A work machine talking to a Tor exit node is worth logging, but we wouldn't block it automatically.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  DLP without drowning in false positives
&lt;/h2&gt;

&lt;p&gt;The most painful part of a small SOC is DLP. A regex for "11 digits in a row" finds Russian SNILS numbers (the social insurance ID), and along with them phone numbers, order numbers and SKUs. The classic case: a "SNILS leak" that turns out to be a phone number in an email signature.&lt;/p&gt;

&lt;p&gt;Three things helped.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Checksums.&lt;/strong&gt; SNILS, INN (taxpayer ID) and card numbers all have check digits. Check them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;snilsOk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;\&lt;span class="no"&gt;D&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;/^&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;\&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;\&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;$&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// numbers up to 001-001-998 have no checksum and were never issued to people&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1001998&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;ctrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;101&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;101&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctrl&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ctrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;ctrl&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For cards it's the Luhn algorithm; for INN, the official weights for 10- and 12-digit numbers. A random 11-digit number passes the SNILS check roughly once in a hundred, so the checksum alone removes almost all accidental matches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Context around the match.&lt;/strong&gt; The number &lt;code&gt;+79203565057&lt;/code&gt; is 11 digits and could, by pure chance, pass the SNILS checksum. But the plus sign in front says it's a phone number. Ten digits in a row might be a passport, or might be an order number. So a passport only counts if words like "passport", "series", "issued by" or "department code" appear within 60 characters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s2"&gt;"snils"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="c1"&gt;// "+7…" is a phone number with a country code, not a SNILS&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;!/&lt;/span&gt;\&lt;span class="o"&gt;+&lt;/span&gt;\&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;$&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;before&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nf"&gt;snilsOk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s2"&gt;"passport"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;digitsOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;паспорт&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;passport&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;серия&lt;span class="o"&gt;|&lt;/span&gt;выдан&lt;span class="o"&gt;|&lt;/span&gt;код подразделения&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Validation in two places.&lt;/strong&gt; The same validator runs on the agent and on the server. The agent drops false positives before sending anything, and the server re-filters events from agents that haven't updated yet. Without the second check, every rule improvement would mean waiting until every machine updates.&lt;/p&gt;

&lt;p&gt;A small trap: &lt;code&gt;\b&lt;/code&gt; in JavaScript regexes doesn't treat Cyrillic as word characters. So &lt;code&gt;/\bинн\b/&lt;/code&gt; won't find the word "ИНН" in Russian text, and you have to spell out the boundary yourself: &lt;code&gt;(^|[^a-zа-яё])инн([^a-zа-яё]|$)&lt;/code&gt;. The same applies to any non-Latin script unless you use the &lt;code&gt;u&lt;/code&gt; flag with Unicode property escapes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where automation stops
&lt;/h2&gt;

&lt;p&gt;Not everything should be handed to rules. Here's where we think a human is required:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HR and legal decisions.&lt;/strong&gt; DLP can show that an employee exported the database. What to do about it is for the manager and maybe a lawyer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Isolating servers.&lt;/strong&gt; Auto-isolating a workstation is acceptable. Isolating the ERP server or the domain controller is a decision to stop the whole company.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Targeted attacks.&lt;/strong&gt; If a group is going after the company specifically, playbooks for typical scenarios won't stop it. That calls for an incident response team.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Critical infrastructure and government systems.&lt;/strong&gt; Regulated operators need certified tools and usually an in-house or commercial SOC. Automation doesn't replace that.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a company of up to a couple hundred people without those specifics, we think a platform that handles routine incidents on its own and calls a human only when it matters is enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you build it yourself
&lt;/h2&gt;

&lt;p&gt;You can reproduce all of this with open components:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Collection and correlation&lt;/strong&gt;: Wazuh, with agents for Windows, macOS and Linux, rules, and threat feed integration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Playbooks&lt;/strong&gt;: Shuffle or n8n on top of the Wazuh and firewall APIs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Threat feeds&lt;/strong&gt;: the open feeds listed above, directly or via MISP.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DLP&lt;/strong&gt;: We haven't found a good open-source option. You'll have to write your own agent or talk to a commercial vendor.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The main cost isn't money but the time to tune and maintain rules. Budget weeks at the start, then a few hours every week.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;We put everything above into one platform, Pabion: an agent for Windows, macOS and Linux plus a web console where SIEM, EDR/XDR, DLP, SOAR and threat feeds work together. The first computer is free if you want to try it on your own network: &lt;a href="https://pabit.ru/pabion?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=soc-20-pc" rel="noopener noreferrer"&gt;pabit.ru/pabion&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We'd love to hear your thresholds and playbooks in the comments, especially how you deal with DLP false positives.&lt;/p&gt;

</description>
      <category>security</category>
      <category>devops</category>
      <category>cybersecurity</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
