<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Documentation - Category - arleo.eu</title><link>https://www.arleo.eu/en/categories/documentation/</link><description>Documentation - Category - arleo.eu</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Sun, 12 Apr 2026 21:25:00 +0200</lastBuildDate><atom:link href="https://www.arleo.eu/en/categories/documentation/" rel="self" type="application/rss+xml"/><item><title>Infrastructure Documentation</title><link>https://www.arleo.eu/en/documentation/</link><pubDate>Sun, 12 Apr 2026 21:25:00 +0200</pubDate><author>Jmr</author><guid>https://www.arleo.eu/en/documentation/</guid><description><![CDATA[<h2 id="1-security-architecture-10-layers">1. Security Architecture (10 layers)</h2>
<table>
  <thead>
      <tr>
          <th>#</th>
          <th>Layer</th>
          <th>Technology</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>1</td>
          <td>DNS</td>
          <td>DNSSEC ECDSA P256-SHA256</td>
      </tr>
      <tr>
          <td>2</td>
          <td>Cloud CDN + WAF</td>
          <td>Cloudflare WAF + DDoS + AI Crawl Control</td>
      </tr>
      <tr>
          <td>3</td>
          <td>Network</td>
          <td>CrowdSec nftables Bouncer</td>
      </tr>
      <tr>
          <td>4</td>
          <td>Firewall</td>
          <td>Netgear PR60X SPI</td>
      </tr>
      <tr>
          <td>5</td>
          <td>Local WAF</td>
          <td>ModSecurity + OWASP CRS 4.x</td>
      </tr>
      <tr>
          <td>6</td>
          <td>IDS/IPS</td>
          <td>CrowdSec Agent + SSH/HTTP scenarios</td>
      </tr>
      <tr>
          <td>7</td>
          <td>HTTPS</td>
          <td>TLS 1.3 + HSTS preload</td>
      </tr>
      <tr>
          <td>8</td>
          <td>DNS-TLS</td>
          <td>DoH port 853</td>
      </tr>
      <tr>
          <td>9</td>
          <td>Application</td>
          <td>Grav CMS + CSP + Secure cookies</td>
      </tr>
      <tr>
          <td>10</td>
          <td>Monitoring</td>
          <td>BetterStack + CrowdSec poller + Vector</td>
      </tr>
  </tbody>
</table>
<hr>
<h2 id="2-crowdsec--cloudflare-sync-crowdsec-cf-syncpy">2. CrowdSec → Cloudflare Sync (<code>crowdsec-cf-sync.py</code>)</h2>
<p><strong>Location:</strong> <code>/usr/local/bin/crowdsec-cf-sync.py</code>
<strong>Service:</strong> <code>crowdsec-cf-sync.service</code>
<strong>Logs:</strong> <code>/var/log/crowdsec/cf-sync.log</code></p>]]></description></item><item><title>Infrastructure Scripts</title><link>https://www.arleo.eu/en/scripts/</link><pubDate>Sun, 12 Apr 2026 21:25:00 +0200</pubDate><author>Jmr</author><guid>https://www.arleo.eu/en/scripts/</guid><description><![CDATA[<h2 id="1-crowdsec-cf-syncpy">1. crowdsec-cf-sync.py</h2>
<p><strong>Location:</strong> <code>/usr/local/bin/crowdsec-cf-sync.py</code>
<strong>Systemd service:</strong> <code>crowdsec-cf-sync.service</code>
<strong>Logs:</strong> <code>/var/log/crowdsec/cf-sync.log</code></p>
<h3 id="installation">Installation</h3>
<div class="code-block code-line-numbers open" data-start="0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">cp crowdsec-cf-sync.py /usr/local/bin/
</span></span><span class="line"><span class="cl">chmod +x /usr/local/bin/crowdsec-cf-sync.py
</span></span><span class="line"><span class="cl">systemctl <span class="nb">enable</span> crowdsec-cf-sync
</span></span><span class="line"><span class="cl">systemctl start crowdsec-cf-sync</span></span></code></pre></div></div>
<h3 id="features">Features</h3>
<ul>
<li>Syncs active CrowdSec bans → Cloudflare IP Access Rules (tag <code>crowdsec-local-ban</code>)</li>
<li>Reports banned IPs → AbuseIPDB (48h window, deduplicated)</li>
<li><strong>Repeat-offender escalation</strong>: 1st CrowdSec ban handles | 2nd → 24h | 3rd+ → 7d (7d window)</li>
<li><strong>ModSecurity</strong> score ≥ 5 → immediate 2h CF ban (tag <code>modsec-ban</code>) + AbuseIPDB report</li>
<li><strong>Automatic /24 ban</strong>: 2+ IPs from same block in 7d → CF + CrowdSec ban 24h (tag <code>crowdsec-cidr-ban</code>)</li>
</ul>
<h3 id="bug-fixes-april-2026">Bug fixes (April 2026)</h3>
<ul>
<li><code>cs_origin</code> vs <code>origin</code> in <code>get_recent_local_bans()</code> — the JSON field is <code>cs_origin</code></li>
<li>REST API pagination <code>/v1/decisions?limit=1000</code> misses <code>cscli</code> bans → replaced with <code>cscli decisions list --origin</code></li>
<li><code>Items</code> → <code>items</code> (lowercase) in CrowdSec allowlist JSON parsing</li>
</ul>
<blockquote>
<p>⚠️ <strong>Important</strong>: real tokens (<code>CF_API_TOKEN</code>, <code>CF_ZONE_ID</code>, <code>CS_API_KEY</code>, <code>ABUSEIPDB_KEY</code>) must be stored in <code>/etc/secrets/</code> with <code>chmod 600</code> and loaded via environment variables, not hardcoded in the script. The <code>VOTRE_*</code> values below are placeholders.</p>]]></description></item></channel></rss>