<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/" >

<channel>
	<title>Random thoughts</title>
	<atom:link href="https://random.sphere.ro/feed/" rel="self" type="application/rss+xml" />
	<link>https://random.sphere.ro</link>
	<description>for when you get older and memory does&#039;t help you further</description>
	<lastBuildDate>Sat, 04 Oct 2025 13:06:04 +0000</lastBuildDate>
	<language>en-AU</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.5</generator>
	<item>
		<title>VXLAN ipsec or wireguard</title>
		<link>https://random.sphere.ro/vxlan-ipsec-or-wireguard/</link>
					<comments>https://random.sphere.ro/vxlan-ipsec-or-wireguard/#respond</comments>
		
		<dc:creator><![CDATA[iulian]]></dc:creator>
		<pubDate>Sat, 04 Oct 2025 13:06:04 +0000</pubDate>
				<category><![CDATA[Uncategorised]]></category>
		<guid isPermaLink="false">https://random.sphere.ro/?p=169</guid>

					<description><![CDATA[<p>Transporting VLANs with VXLAN: Plain, WireGuard, and IPsec Compared It’s been a while since my last post, but I believe this comprehensive guide will be valuable for anyone looking to transport VLANs from point A to point B using VXLAN. This article compares three setups—Plain VXLAN, VXLAN with WireGuard, and VXLAN with IPsec—covering configurations, performance&#8230;</p>
<p class="read-more"><a class="readmore-btn" href="https://random.sphere.ro/vxlan-ipsec-or-wireguard/">Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/vxlan-ipsec-or-wireguard/">VXLAN ipsec or wireguard</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Transporting VLANs with VXLAN: Plain, WireGuard, and IPsec Compared</h1>
<p>It’s been a while since my last post, but I believe this comprehensive guide will be valuable for anyone looking to transport VLANs from point A to point B using VXLAN. This article compares three setups—Plain VXLAN, VXLAN with WireGuard, and VXLAN with IPsec—covering configurations, performance results, and recommendations for secure and efficient VLAN transport. Whether you’re in a lab or a production environment, this guide has you covered.</p>
<h2>Table of Contents</h2>
<ul>
<li><a href="#overview">Overview and Performance Results</a></li>
<li><a href="#plain-vxlan">Setup 1: Plain VXLAN (No Encryption)</a></li>
<li><a href="#vxlan-wireguard">Setup 2: VXLAN + WireGuard</a></li>
<li><a href="#vxlan-ipsec">Setup 3: VXLAN + IPsec (StrongSwan)</a></li>
<li><a href="#conclusion">Conclusion and Recommendations</a></li>
</ul>
<h2 id="overview">Overview and Performance Results</h2>
<p>I tested three VXLAN configurations to transport a VLAN between two points, evaluating throughput, retransmissions, and security. Below is a summary of the setups and their performance.</p>
<h3>Tested Configurations</h3>
<ul>
<li><strong>Plain VXLAN</strong>: Fastest but unsecure, ideal for private networks.</li>
<li><strong>VXLAN + WireGuard</strong>: Lightweight encryption with moderate performance overhead.</li>
<li><strong>VXLAN + IPsec</strong>: Robust encryption with near-plain performance due to hardware acceleration.</li>
</ul>
<h3>Performance Summary</h3>
<table style="width: 100%; border-collapse: collapse; margin: 20px 0; border: 1px solid #ddd;">
<thead style="background-color: #f4f4f4;">
<tr>
<th style="padding: 10px; border: 1px solid #ddd;">Setup</th>
<th style="padding: 10px; border: 1px solid #ddd;">Total Throughput</th>
<th style="padding: 10px; border: 1px solid #ddd;">Retransmissions</th>
<th style="padding: 10px; border: 1px solid #ddd;">Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding: 10px; border: 1px solid #ddd;">Plain VXLAN (no encryption)</td>
<td style="padding: 10px; border: 1px solid #ddd;">20.6–21.0 Mbit/s</td>
<td style="padding: 10px; border: 1px solid #ddd;">570</td>
<td style="padding: 10px; border: 1px solid #ddd;">Highest throughput; no encryption overhead. Normal retransmissions for UDP + VXLAN.</td>
</tr>
<tr>
<td style="padding: 10px; border: 1px solid #ddd;">VXLAN + WireGuard</td>
<td style="padding: 10px; border: 1px solid #ddd;">18.0–18.3 Mbit/s</td>
<td style="padding: 10px; border: 1px solid #ddd;">527</td>
<td style="padding: 10px; border: 1px solid #ddd;">~10–15% throughput drop; CPU handles WireGuard encryption.</td>
</tr>
<tr>
<td style="padding: 10px; border: 1px solid #ddd;">VXLAN + IPsec</td>
<td style="padding: 10px; border: 1px solid #ddd;">20.1–20.5 Mbit/s</td>
<td style="padding: 10px; border: 1px solid #ddd;">464</td>
<td style="padding: 10px; border: 1px solid #ddd;">Near-plain VXLAN performance; VTI + kernel crypto + AES-NI minimize overhead.</td>
</tr>
</tbody>
</table>
<h3>Key Observations</h3>
<ol>
<li><strong>Encryption Overhead</strong>
<ul>
<li><strong>WireGuard</strong>: CPU-intensive due to AES + UDP encapsulation.</li>
<li><strong>IPsec VTI</strong>: Lower overhead with kernel crypto and AES-NI hardware acceleration.</li>
</ul>
</li>
<li><strong>UDP vs. ESP</strong>
<ul>
<li><strong>WireGuard</strong>: UDP-based, leading to some packet loss and more retransmissions.</li>
<li><strong>IPsec ESP (L3 tunnel)</strong>: Minimal packet loss, near-plain VXLAN throughput.</li>
</ul>
</li>
<li><strong>Plain VXLAN</strong>
<ul>
<li>Fastest but unsecure, with low latency and maximum throughput.</li>
<li>Vulnerable to sniffing or traffic injection on public networks.</li>
</ul>
</li>
</ol>
<p><img fetchpriority="high" decoding="async" class="alignnone wp-image-178" src="https://random.sphere.ro/wp-content/uploads/2025/10/vxlan-300x200.png" alt="" width="357" height="238" srcset="https://random.sphere.ro/wp-content/uploads/2025/10/vxlan-300x200.png 300w, https://random.sphere.ro/wp-content/uploads/2025/10/vxlan-1024x683.png 1024w, https://random.sphere.ro/wp-content/uploads/2025/10/vxlan-768x512.png 768w, https://random.sphere.ro/wp-content/uploads/2025/10/vxlan-405x270.png 405w, https://random.sphere.ro/wp-content/uploads/2025/10/vxlan.png 1536w" sizes="(max-width: 357px) 100vw, 357px" /></p>
<h2 id="plain-vxlan">Setup 1: Plain VXLAN (No Encryption)</h2>
<p>Plain VXLAN offers the highest throughput but lacks encryption, making it suitable for private networks or lab environments.</p>
<h3>Server A Configuration</h3>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line=""># Bring up the network interface
ip link set ens192 up

# Create a bridge
sudo ip link add name br800 type bridge
sudo ip link set br800 up

# Create VXLAN tunnel
sudo ip link add vxlan800 type vxlan id 800 \
    local ip_public_serverA remote ip_public_serverB \
    dstport 4789 nolearning
sudo ip link set vxlan800 up

# Add interfaces to the bridge
sudo ip link set ens192 master br800
sudo ip link set vxlan800 master br800
</code></pre>
<h3>Server B Configuration</h3>
<p>Server B is behind NAT, so we use a dummy interface and connect to Server A’s public IP.</p>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line=""># Load dummy module
sudo modprobe dummy

# Create dummy interface
sudo ip link add name dummy800 type dummy
sudo ip link set dummy800 up

# Create a bridge
sudo ip link add name br800 type bridge
sudo ip link set br800 up

# Create VXLAN tunnel to Server A&#039;s public IP
sudo ip link add vxlan800 type vxlan id 800 \
    local ip_private_serverB remote ip_public_serverA \
    dstport 4789 nolearning
sudo ip link set vxlan800 up

# Add interfaces to the bridge
sudo ip link set dummy800 master br800
sudo ip link set vxlan800 master br800
sudo ip addr add 10.10.10.98/24 dev br800

</code></pre>
<h3>Testing Plain VXLAN</h3>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line=""># Test connectivity
ping -I br800 10.10.10.1

# Start iperf3 server
iperf3 -s -B 10.10.10.1  # On remote server ( you can consider it Server C )

# Run iperf3 client
iperf3 -c 10.10.10.1 -B 10.10.10.98 -P 4 -t 30
</code></pre>
<p><strong>Sample iperf3 Output</strong>:</p>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line="">[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-30.00  sec  19.5 MBytes  5.45 Mbits/sec  186             sender
[  5]   0.00-30.04  sec  19.0 MBytes  5.30 Mbits/sec                  receiver
[  7]   0.00-30.00  sec  17.9 MBytes  5.01 Mbits/sec  118             sender
[  7]   0.00-30.04  sec  17.7 MBytes  4.94 Mbits/sec                  receiver
[  9]   0.00-30.00  sec  18.6 MBytes  5.20 Mbits/sec  119             sender
[  9]   0.00-30.04  sec  18.4 MBytes  5.13 Mbits/sec                  receiver
[ 11]   0.00-30.00  sec  19.1 MBytes  5.34 Mbits/sec  147             sender
[ 11]   0.00-30.04  sec  18.8 MBytes  5.26 Mbits/sec                  receiver
[SUM]   0.00-30.00  sec  75.1 MBytes  21.0 Mbits/sec  570             sender
[SUM]   0.00-30.04  sec  73.8 MBytes  20.6 Mbits/sec                  receiver
</code></pre>
<p><strong>Performance</strong>: Plain VXLAN achieved 20.6–21.0 Mbit/s with 570 retransmissions, offering maximum throughput but no security.</p>
<h2 id="vxlan-wireguard">Setup 2: VXLAN + WireGuard</h2>
<p>This setup adds lightweight encryption with WireGuard, suitable for secure VLAN transport with a moderate performance hit (~10–15% lower throughput).</p>
<h3>Step 1: Install WireGuard</h3>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line="">sudo apt update
sudo apt install wireguard iproute2 -y
</code></pre>
<h3>Step 2: Generate WireGuard Keys</h3>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line="">wg genkey | tee privatekey | wg pubkey &gt; publickey
</code></pre>
<h3>Step 3: Configure WireGuard</h3>
<p><strong>Server A (/etc/wireguard/wg0.conf)</strong>:</p>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line="">[Interface]
Address = 100.64.0.1/30
PrivateKey = &lt;ServerA_privatekey&gt;
ListenPort = 51820

[Peer]
PublicKey = &lt;ServerB_publickey&gt;
AllowedIPs = 100.64.0.2/32
Endpoint = server_B_external_ip:51820
PersistentKeepalive = 25
</code></pre>
<p><strong>Server B (/etc/wireguard/wg0.conf)</strong>:</p>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line="">[Interface]
Address = 100.64.0.2/30
PrivateKey = &lt;ServerB_privatekey&gt;
ListenPort = 51820

[Peer]
PublicKey = &lt;ServerA_publickey&gt;
AllowedIPs = 100.64.0.1/32
Endpoint = Server_A_external_ip:51820
PersistentKeepalive = 25
</code></pre>
<h3>Step 4: Enable WireGuard</h3>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line="">sudo wg-quick up wg0
sudo systemctl enable wg-quick@wg0

# Verify connectivity
ping -c 2 100.64.0.2  # From Server A
ping -c 2 100.64.0.1  # From Server B
</code></pre>
<h3>Step 5: Configure VXLAN</h3>
<p><strong>Server A</strong>:</p>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line="">sudo ip link add vxlan800 type vxlan id 800 local 100.64.0.1 remote 100.64.0.2 dstport 4789 nolearning
sudo ip link set vxlan800 up

sudo ip link add name br800 type bridge
sudo ip link set br800 up
sudo ip link set vxlan800 master br800
sudo ip link set ens192 master br800
</code></pre>
<p><strong>Server B</strong>:</p>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line="">sudo ip link add vxlan800 type vxlan id 800 local 100.64.0.2 remote 100.64.0.1 dstport 4789 nolearning
sudo ip link set vxlan800 up

sudo ip link add name br800 type bridge
sudo ip link set br800 up
sudo ip link set vxlan800 master br800
sudo ip link add name dummy800 type dummy
sudo ip link set dummy800 up
sudo ip link set dummy800 master br800
sudo ip addr add 10.10.10.98/24 dev br800
</code></pre>
<h3>Step 6: Testing VXLAN + WireGuard</h3>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line=""># Test connectivity
ping -I br800 10.10.10.1

# Start iperf3 server
iperf3 -s -B 10.10.10.1  # On remote server ( you can consider it Server C )

# Run iperf3 client
iperf3 -c 10.10.10.1 -B 10.10.10.98 -P 4 -t 30
</code></pre>
<p><strong>Sample iperf3 Output</strong>:</p>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line="">[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-30.00  sec  15.9 MBytes  4.45 Mbits/sec  137             sender
[  5]   0.00-30.04  sec  15.6 MBytes  4.36 Mbits/sec                  receiver
[  7]   0.00-30.00  sec  16.2 MBytes  4.53 Mbits/sec  127             sender
[  7]   0.00-30.04  sec  15.9 MBytes  4.44 Mbits/sec                  receiver
[  9]   0.00-30.00  sec  15.5 MBytes  4.33 Mbits/sec  113             sender
[  9]   0.00-30.04  sec  15.3 MBytes  4.26 Mbits/sec                  receiver
[ 11]   0.00-30.00  sec  17.8 MBytes  4.99 Mbits/sec  150             sender
[ 11]   0.00-30.04  sec  17.5 MBytes  4.90 Mbits/sec                  receiver
[SUM]   0.00-30.00  sec  65.4 MBytes  18.3 Mbits/sec  527             sender
[SUM]   0.00-30.04  sec  64.3 MBytes  18.0 Mbits/sec                  receiver
</code></pre>
<p><strong>Performance</strong>: VXLAN + WireGuard achieved 18.0–18.3 Mbit/s with 527 retransmissions, showing a ~10–15% performance drop due to CPU-based encryption.</p>
<p>&nbsp;</p>
<h2 id="vxlan-ipsec">Setup 3: VXLAN + IPsec (StrongSwan)</h2>
<p>VXLAN over IPsec provides robust encryption with minimal performance overhead, leveraging VTI and AES-NI hardware acceleration.</p>
<h3>Step 1: Install StrongSwan</h3>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line="">apt install strongswan
</code></pre>
<h3>Server A Configuration</h3>
<h4>Step 2: Configure IPsec</h4>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line=""># /etc/ipsec.conf - strongSwan IPsec configuration file
config setup
    uniqueids = no

conn %default
    keyexchange=ikev2
    ike=aes128-sha256-modp2048
    esp=aes256-sha256
    dpdaction=clear
    dpddelay=300s
    fragmentation=yes

conn vxlan-ipsec
    left=ip_public_serverA
    leftid=ip_public_serverA
    leftsubnet=0.0.0.0/0
    leftupdown=/etc/strongswan.d/updown-vxlan.sh
    right=ip_public_serverB
    rightid=ip_private_serverB
    rightsubnet=0.0.0.0/0
    type=tunnel
    auto=start
    keyingtries=%forever
    authby=psk
    mark=10
</code></pre>
<h4>Step 3: Configure IPsec Secrets</h4>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line=""># /etc/ipsec.secrets
ip_private_serverB ip_public_serverA : PSK &quot;putsomething&quot;
</code></pre>
<h4>Step 4: Create Up/Down Script</h4>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line=""># /etc/strongswan.d/updown-vxlan.sh
#!/bin/bash
# Simple up/down script for VTI + VXLAN
case &quot;$PLUTO_VERB&quot; in
    up-client|up-host|up)
        logger &quot;[$PLUTO_CONNECTION] VPN UP: creating interfaces&quot;
        /usr/local/bin/create_vxlan.sh
        ;;
    down-client|down-host|down)
        logger &quot;[$PLUTO_CONNECTION] VPN DOWN: deleting interfaces&quot;
        /usr/local/bin/destroy_vxlan.sh
        ;;
esac
</code></pre>
<h4>Step 5: Create VXLAN Setup Script</h4>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line=""># /usr/local/bin/create_vxlan.sh
sudo ip link add ipsec0 type vti local ip_public_serverA remote ip_public_serverB key 10
sudo ip addr add 100.64.0.1/30 dev ipsec0
sudo ip link set ipsec0 up

sudo ip link add vxlan800 type vxlan id 800 local 100.64.0.1 remote 100.64.0.2 dstport 4789 nolearning
sudo ip link set vxlan800 up

sudo ip link add name br800 type bridge
sudo ip link set br800 up
sudo ip link set vxlan800 master br800
sudo ip link set ens192 master br800

sudo ip route del default table 220
</code></pre>
<h4>Step 6: Create VXLAN Teardown Script</h4>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line=""># /usr/local/bin/destroy_vxlan.sh
# Delete IPsec VTI
ip link del ipsec0

# Remove interfaces from bridge
sudo ip link set vxlan800 nomaster 2&gt;/dev/null
sudo ip link set ens192.800 nomaster 2&gt;/dev/null
sudo ip link set ens192 nomaster 2&gt;/dev/null

# Delete bridge and VXLAN
sudo ip link del vxlan800 2&gt;/dev/null
sudo ip link del br800 2&gt;/dev/null

# Delete VLAN subinterface if created
sudo ip link del ens192.800 2&gt;/dev/null
</code></pre>
<h3>Server B Configuration</h3>
<h4>Step 1: Configure IPsec</h4>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line=""># /etc/ipsec.conf - strongSwan IPsec configuration file
config setup
    uniqueids = no

conn %default
    keyexchange=ikev2
    ike=aes128-sha256-modp2048
    esp=aes256-sha256
    dpdaction=clear
    dpddelay=300s
    fragmentation=yes

conn vxlan-ipsec
    left=ip_private_serverB
    leftid=ip_private_serverB
    leftsubnet=0.0.0.0/0
    leftupdown=/etc/strongswan.d/updown-vxlan.sh
    right=ip_public_serverA
    rightid=ip_public_serverA
    rightsubnet=0.0.0.0/0
    type=tunnel
    auto=start
    keyingtries=%forever
    authby=psk
    mark=10
</code></pre>
<h4>Step 2: Configure IPsec Secrets</h4>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line=""># /etc/ipsec.secrets
ip_private_serverB ip_public_serverA : PSK &quot;putsomething&quot;
</code></pre>
<h4>Step 9: Create Up/Down Script</h4>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line=""># /etc/strongswan.d/updown-vxlan.sh
#!/bin/bash
# Simple up/down script for VTI + VXLAN
case &quot;$PLUTO_VERB&quot; in
    up-client|up-host|up)
        logger &quot;[$PLUTO_CONNECTION] VPN UP: creating interfaces&quot;
        /usr/local/bin/create_vxlan.sh
        ;;
    down-client|down-host|down)
        logger &quot;[$PLUTO_CONNECTION] VPN DOWN: deleting interfaces&quot;
        /usr/local/bin/destroy_vxlan.sh
        ;;
esac
</code></pre>
<h4>Step 3: Create VXLAN Setup Script</h4>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line=""># /usr/local/bin/create_vxlan.sh
sudo ip link add ipsec0 type vti local ip_private_serverB remote ip_public_serverA key 10
sudo ip addr add 100.64.0.2/30 dev ipsec0
sudo ip link set ipsec0 up

sudo ip link add vxlan800 type vxlan id 800 local 100.64.0.2 remote 100.64.0.1 dstport 4789 nolearning
sudo ip link set vxlan800 up

sudo ip link add name br800 type bridge
sudo ip link set br800 up
sudo ip link add name dummy800 type dummy
sudo ip link set dummy800 up
sudo ip link set vxlan800 master br800
sudo ip link set dummy800 master br800

sudo ip addr add 10.10.10.98/24 dev br800

sudo ip route del default table 220
</code></pre>
<h4>Step 4: Create VXLAN Teardown Script</h4>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line=""># /usr/local/bin/destroy_vxlan.sh
# Delete IPsec VTI
ip link del ipsec0

# Remove interfaces from bridge
sudo ip link set vxlan800 nomaster 2&gt;/dev/null
sudo ip link set dummy800 nomaster 2&gt;/dev/null

# Delete VXLAN, dummy, and bridge
sudo ip link del vxlan800 2&gt;/dev/null
sudo ip link del dummy800 2&gt;/dev/null
sudo ip link del br800 2&gt;/dev/null
</code></pre>
<h3>Testing VXLAN + IPsec</h3>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line=""># Test connectivity
ping -I br800 10.10.10.1

# Start iperf3 server
iperf3 -s -B 10.10.10.1

# Run iperf3 client
iperf3 -c 10.10.10.1 -B 10.10.10.98 -P 4 -t 30
</code></pre>
<p><strong>Sample iperf3 Output</strong>:</p>
<pre style="background-color: #f4f4f4; padding: 15px; border-radius: 5px;"><code class="" data-line="">[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-30.00  sec  20.7 MBytes  5.80 Mbits/sec  117             sender
[  5]   0.00-30.04  sec  20.4 MBytes  5.71 Mbits/sec                  receiver
[  7]   0.00-30.00  sec  17.0 MBytes  4.74 Mbits/sec  116             sender
[  7]   0.00-30.04  sec  16.7 MBytes  4.66 Mbits/sec                  receiver
[  9]   0.00-30.00  sec  18.8 MBytes  5.25 Mbits/sec  115             sender
[  9]   0.00-30.04  sec  18.5 MBytes  5.15 Mbits/sec                  receiver
[ 11]   0.00-30.00  sec  16.7 MBytes  4.67 Mbits/sec  116             sender
[ 11]   0.00-30.04  sec  16.5 MBytes  4.59 Mbits/sec                  receiver
[SUM]   0.00-30.00  sec  73.2 MBytes  20.5 Mbits/sec  464             sender
[SUM]   0.00-30.04  sec  72.0 MBytes  20.1 Mbits/sec                  receiver
</code></pre>
<p><strong>Performance</strong>: VXLAN + IPsec achieved 20.1–20.5 Mbit/s with 464 retransmissions, nearly matching plain VXLAN due to VTI and AES-NI acceleration.</p>
<p>&nbsp;</p>
<h2 id="conclusion">Conclusion and Recommendations</h2>
<ul>
<li><strong>Public Internet</strong>: Use <a href="#vxlan-ipsec">VXLAN + IPsec</a> for robust security and near-plain performance, or <a href="#vxlan-wireguard">VXLAN + WireGuard</a> for lightweight encryption.</li>
<li><strong>Private Networks/Labs</strong>: <a href="#plain-vxlan">Plain VXLAN</a> offers maximum throughput but no security.</li>
<li><strong>Performance</strong>: IPsec’s kernel-mode crypto and AES-NI support make it slightly faster than WireGuard in this setup.</li>
</ul>
<p>For detailed networking guides, explore our <a href="/category/networking">Networking Tutorials</a>.</p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/vxlan-ipsec-or-wireguard/">VXLAN ipsec or wireguard</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://random.sphere.ro/vxlan-ipsec-or-wireguard/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Power of Terraform</title>
		<link>https://random.sphere.ro/power-of-terraform/</link>
					<comments>https://random.sphere.ro/power-of-terraform/#respond</comments>
		
		<dc:creator><![CDATA[iulian]]></dc:creator>
		<pubDate>Thu, 05 Dec 2024 19:46:54 +0000</pubDate>
				<category><![CDATA[Uncategorised]]></category>
		<guid isPermaLink="false">https://random.sphere.ro/?p=142</guid>

					<description><![CDATA[<p>I was recently approached by the sales team to explain the benefits of the cloud and, more importantly, why automation is such a game-changer. It struck me that the concept of DevOps still isn&#8217;t fully understood by everyone. To put things into perspective, I remembered how, back in the day, setting up a LAMP stack&#8230;</p>
<p class="read-more"><a class="readmore-btn" href="https://random.sphere.ro/power-of-terraform/">Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/power-of-terraform/">Power of Terraform</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I was recently approached by the sales team to explain the benefits of the cloud and, more importantly, why automation is such a game-changer. It struck me that the concept of <strong>DevOps</strong> still isn&#8217;t fully understood by everyone.</p>
<p>To put things into perspective, I remembered how, back in the day, setting up a LAMP stack (Apache, MySQL, PHP) could easily take an entire day—especially if you were dealing with more challenging Linux distributions like Gentoo. Fast forward to today: thanks to tools like <strong>Terraform</strong> and platforms like <strong>AWS</strong>, that same setup can now be done in mere minutes.</p>
<p>But enough theory—let&#8217;s get practical. Below is the code that demonstrates the power of automation. This script will:</p>
<ol>
<li><strong>Create a VPC</strong></li>
<li><strong>Set up subnets</strong></li>
<li><strong>Add an Internet Gateway (IGW)</strong></li>
<li><strong>Configure security groups</strong></li>
<li><strong>Provision an RDS instance</strong></li>
<li><strong>Deploy an Ubuntu VM</strong> and configure it to present data from a database on a simple webpage.</li>
</ol>
<p>The speed and reliability that automation brings not only save time but also redefine how teams approach infrastructure and operations.</p>
<p>Please note this is a simple demo and does not goes in depth with security or containers. ( maybe in another episode)<br />
NB: for obvious reasons please use more complex passwords</p>
<pre><code class="language-javascript" data-line="">

resource &quot;aws_vpc&quot; &quot;demo_vpc&quot; {
  cidr_block = &quot;10.100.0.0/16&quot;
}

resource &quot;aws_subnet&quot; &quot;demo_subnet_a&quot; {
  vpc_id            = aws_vpc.demo_vpc.id
  cidr_block        = &quot;10.100.1.0/24&quot;
  availability_zone = &quot;eu-central-1a&quot;
  map_public_ip_on_launch = true
}

resource &quot;aws_subnet&quot; &quot;demo_subnet_b&quot; {
  vpc_id            = aws_vpc.demo_vpc.id
  cidr_block        = &quot;10.100.2.0/24&quot;
  availability_zone = &quot;eu-central-1b&quot;
  map_public_ip_on_launch = true
}

resource &quot;aws_security_group&quot; &quot;demo_sg&quot; {
  vpc_id = aws_vpc.demo_vpc.id

  ingress {
    from_port   = 80
    to_port     = 80
    protocol    = &quot;tcp&quot;
    cidr_blocks = [&quot;0.0.0.0/0&quot;]
  }

    ingress {
    from_port   = 22
    to_port     = 22
    protocol    = &quot;tcp&quot;
    cidr_blocks = [&quot;0.0.0.0/0&quot;]
  }

  ingress {
    from_port   = 3306
    to_port     = 3306
    protocol    = &quot;tcp&quot;
    cidr_blocks = [&quot;10.100.0.0/16&quot;] # Allow DB access from within the VPC
  }

  egress {
    from_port   = 0
    to_port     = 0
    protocol    = &quot;-1&quot;
    cidr_blocks = [&quot;0.0.0.0/0&quot;]
  }
}

resource &quot;aws_db_subnet_group&quot; &quot;demo_subnet_group&quot; {
  name       = &quot;demo-subnet-group&quot;
  subnet_ids = [
    aws_subnet.demo_subnet_a.id,
    aws_subnet.demo_subnet_b.id
  ]
}


# Create an Internet Gateway
resource &quot;aws_internet_gateway&quot; &quot;demo_igw&quot; {
  vpc_id = aws_vpc.demo_vpc.id
}

# Create a Route Table for the VPC
resource &quot;aws_route_table&quot; &quot;demo_route_table&quot; {
  vpc_id = aws_vpc.demo_vpc.id

  route {
    cidr_block = &quot;0.0.0.0/0&quot;
    gateway_id = aws_internet_gateway.demo_igw.id
  }
}

# Associate the Route Table with the Subnets
resource &quot;aws_route_table_association&quot; &quot;demo_subnet_a&quot; {
  subnet_id      = aws_subnet.demo_subnet_a.id
  route_table_id = aws_route_table.demo_route_table.id
}

resource &quot;aws_route_table_association&quot; &quot;demo_subnet_b&quot; {
  subnet_id      = aws_subnet.demo_subnet_b.id
  route_table_id = aws_route_table.demo_route_table.id
}

resource &quot;aws_db_instance&quot; &quot;demo_rds&quot; {
  allocated_storage    = 20
  engine               = &quot;mysql&quot;
  engine_version       = &quot;8.0.39&quot; # Replace with a supported version
  instance_class       = &quot;db.t3.micro&quot; # Use a valid instance class
  username             = &quot;root&quot;
  password             = &quot;password123&quot;
  publicly_accessible  = false
  vpc_security_group_ids = [aws_security_group.demo_sg.id]
  db_subnet_group_name = aws_db_subnet_group.demo_subnet_group.name
  skip_final_snapshot  = true
}

resource &quot;aws_instance&quot; &quot;demo_vm&quot; {
  ami           = &quot;ami-0745b7d4092315796&quot; # Ubuntu 22.04 AMI for us-east-1
  instance_type = &quot;t2.micro&quot;
  subnet_id     = aws_subnet.demo_subnet_a.id
  vpc_security_group_ids = [aws_security_group.demo_sg.id]
  associate_public_ip_address = true

  user_data = &lt;&lt;-EOF
    #!/bin/bash
    # Update package lists and install necessary packages
    apt-get update -y
    apt-get install -y apache2 php mysql-client php-mysql
    RDS_HOST=&quot;`echo ${aws_db_instance.demo_rds.endpoint} | cut -d &#039;:&#039; -f 1`&quot;

    # Enable and start Apache
    systemctl enable apache2
    systemctl start apache2

    # Create and populate the table
    mysql -h &quot;$RDS_HOST&quot; -u root -p&#039;password123&#039; -e &quot;
    CREATE DATABASE demo_db;
    USE demo_db;
    CREATE TABLE demo_table (id INT AUTO_INCREMENT PRIMARY KEY, value VARCHAR(255));
    INSERT INTO demo_table (value) VALUES (&#039;-- World --&#039;);
    &quot;

    # Create sample PHP application
    cat &lt; /var/www/html/index.php
    &lt;!--?php \$conn = new mysqli(&#039;${aws_db_instance.demo_rds.endpoint}&#039;, &#039;root&#039;, &#039;password123&#039;, &#039;demo_db&#039;); if (\$conn-&gt;connect_error) { die(&#039;Connection failed: &#039; . \$conn-&gt;connect_error); }
    \$result = \$conn-&gt;query(&#039;SELECT value FROM demo_table LIMIT 1&#039;);
    if (\$result-&gt;num_rows &gt; 0) {
      while(\$row = \$result-&gt;fetch_assoc()) { echo &#039;&lt;/p&gt;
&lt;h2&gt;&lt;center&gt;Hello &#039; . \$row[&#039;value&#039;]; echo &#039;&lt;/h2&gt;
&lt;p&gt;&lt;/center&gt;&#039;; }
    } else { echo &#039;No data found&#039;; }
    \$conn-&gt;close();
    ?--&gt;
    EOT

    # Adjust permissions
    chown -R www-data:www-data /var/www/html
    chmod -R 755 /var/www/html
    rm /var/www/html/index.html
  EOF

  tags = {
    Name = &quot;Demo-VM&quot;
  }
}

output &quot;ec2_public_ip&quot; {
  value = aws_instance.demo_vm.public_ip
}

output &quot;rds_endpoint&quot; {
  value = aws_db_instance.demo_rds.endpoint
}

</code></pre>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/power-of-terraform/">Power of Terraform</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://random.sphere.ro/power-of-terraform/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Nginx, Modsecurity and ELK stack</title>
		<link>https://random.sphere.ro/nginx-modsecurity-and-elk-stack/</link>
					<comments>https://random.sphere.ro/nginx-modsecurity-and-elk-stack/#respond</comments>
		
		<dc:creator><![CDATA[iulian]]></dc:creator>
		<pubDate>Mon, 04 Nov 2024 12:19:40 +0000</pubDate>
				<category><![CDATA[Uncategorised]]></category>
		<guid isPermaLink="false">https://random.sphere.ro/?p=127</guid>

					<description><![CDATA[<p>&#160; It has been a while since i have written here and lately i was kinda struggling to import and have meaningful modsecurity data in ELK. Long story short the easiest way is to convince Modsecurity to write the data in json format. In this way all the &#8220;parsing&#8221; and importing becomes more easier. Otherwise&#8230;</p>
<p class="read-more"><a class="readmore-btn" href="https://random.sphere.ro/nginx-modsecurity-and-elk-stack/">Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/nginx-modsecurity-and-elk-stack/">Nginx, Modsecurity and ELK stack</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>&nbsp;</p>
<p>It has been a while since i have written here and lately i was kinda struggling to import and have meaningful modsecurity data in ELK.<br />
Long story short the easiest way is to convince Modsecurity to write the data in json format. In this way all the &#8220;parsing&#8221; and importing becomes more easier. Otherwise regexp and grok might be your friend.<br />
But step by step.</p>
<p><strong>1. Let compile Modsecurity , Nginx module and do the necessaries.</strong></p>
<p><code class="" data-line=""><br />
cd /opt &amp;&amp; sudo git clone https://github.com/owasp-modsecurity/ModSecurity.git<br />
cd ModSecurity<br />
sudo git submodule init<br />
sudo git submodule update<br />
sudo ./build.sh<br />
sudo ./configure</code><br />
The most important thing is <strong>to have lib-yajl</strong> installed otherwise logs cannot be created in json format.<br />
<img decoding="async" class="alignnone size-full wp-image-128" src="https://random.sphere.ro/wp-content/uploads/2024/10/modsecurity1.png" alt="" width="769" height="831" srcset="https://random.sphere.ro/wp-content/uploads/2024/10/modsecurity1.png 769w, https://random.sphere.ro/wp-content/uploads/2024/10/modsecurity1-278x300.png 278w, https://random.sphere.ro/wp-content/uploads/2024/10/modsecurity1-250x270.png 250w" sizes="(max-width: 769px) 100vw, 769px" /><br />
<code class="" data-line=""><br />
sudo make<br />
sudo make install<br />
</code><br />
<strong>2. Download Modsecurity-nginx Connector</strong></p>
<p><code class="" data-line="">cd /opt &amp;&amp; sudo git clone https://github.com/owasp-modsecurity/ModSecurity-nginx.git</code></p>
<p><strong>3. Check Nginx version , download nginx and compile the mod-security module.</strong><br />
<code class="" data-line=""><br />
nginx -v<br />
nginx version: nginx/1.26.2</code><br />
<code class="" data-line=""><br />
cd /opt &amp;&amp; sudo wget http://nginx.org/download/nginx-1.26.2.tar.gz<br />
sudo tar -xzvf nginx-1.26.2.tar.gz<br />
cd nginx-1.26.2<br />
sudo ./configure --with-compat --add-dynamic-module=/opt/ModSecurity-nginx</code></p>
<p><code class="" data-line="">sudo make<br />
sudo make modules</code></p>
<p>Let&#8217;s copy the modules and the configurations<br />
<code class="" data-line="">sudo mkdir -p /etc/nginx/modules-enabled/<br />
sudo cp objs/ngx_http_modsecurity_module.so /etc/nginx/modules-enabled/<br />
sudo cp /opt/ModSecurity/modsecurity.conf-recommended /etc/nginx/modsecurity.conf<br />
sudo cp /opt/ModSecurity/unicode.mapping /etc/nginx/unicode.mapping</code></p>
<p>Add some configuration in Nginx and the vhost that you want to monitor.</p>
<p><code class="" data-line="">nano /etc/nginx/nginx.conf<br />
Add the fallowing line:<br />
load_module /etc/nginx/modules-enabled/ngx_http_modsecurity_module.so;</code></p>
<p>In the desired vhost add:<br />
<code class="" data-line=""><br />
server {<br />
........<br />
modsecurity on;<br />
modsecurity_rules_file /etc/nginx/modsecurity.conf;<br />
}<br />
</code></p>
<p>For the moment we will leave the <code class="" data-line=""> SecRuleEngine DetectionOnly</code> from <code class="" data-line="">/etc/nginx/modsecurity.conf</code> as is.<br />
Basically this will only logging and not rejecting once problem is found and we want this due to many false positive that we will have in the beginning. We&#8217;ll talk later(or in a different chapter is this become too long) about this subject.</p>
<p><strong>4. Install core rule set (CRS)</strong></p>
<p>There are two versions  which can be installed when i am writing this article: 3.3.7 or 4.8.0 . Up to you which flavor.<br />
<code class="" data-line=""><br />
cd /etc/nginx/<br />
sudo wget https://github.com/coreruleset/coreruleset/archive/refs/tags/v4.8.0.zip<br />
sudo wget https://github.com/coreruleset/coreruleset/archive/refs/tags/v3.3.7.zip<br />
sudo unzip v3.3.7.zip<br />
sudo mv coreruleset-3.3.7 owasp-crs<br />
mv owasp-crs/crs-setup.conf.example owasp-crs/crs-setup.conf<br />
</code><br />
Add CRS to modsecurity<br />
<code class="" data-line=""><br />
sudo nano /etc/nginx/modsecurity.conf<br />
Include owasp-crs/crs-setup.conf<br />
Include owasp-crs/rules/*.conf<br />
</code></p>
<p>Almost done. Now we should modify the modsecurity.conf file to have logs in json format.<br />
Add the fallowing(preferably in # &#8212; Audit log configuration section ). In this section comment the present settings related to the same topic.<br />
<code class="" data-line=""><br />
SecAuditEngine On<br />
SecAuditLogParts ABDEFHIJZ<br />
SecAuditLogType Serial<br />
SecAuditLog /var/log/modsec_audit.json<br />
SecAuditLogFormat JSON<br />
SecAuditEngine RelevantOnly<br />
SecAuditLogRelevantStatus &quot;^(?:5|4(?!04))&quot;<br />
</code></p>
<p>Check nginx configuration:<code class="" data-line=""> nginx -t </code> and restart the daemon.</p>
<p>If all the settings have been done correctly, you should already see logs coming in.<br />
<code class="" data-line=""><br />
tail -f /var/log/modsec_audit.json | jq<br />
</code></p>
<p><strong>5. Sending data to elastic search.</strong></p>
<p>There are many ways to do it. Deploying a fleet of Elastic Agents or if not possible using filebeat.<br />
Elastic agent are very powerful but if you have exotic Linux SO you are forced to running those in a dockerized environment and if you have restrictions regarding docker&amp;co than filebeat is your friend.</p>
<p>a. Install filebeat from repo ( most of the Linux OS has it included). I will not insist in this step.</p>
<p>b. Configure filebeat in this way:</p>
<p>On <code class="" data-line="">/etc/filebeat/filebeat.yml</code> on the <code class="" data-line="">filebeat.inputs:</code> add the fallowing:<br />
<code class="" data-line=""><br />
- type: log<br />
enabled: true<br />
paths:<br />
- /var/log/modsec_audit.json<br />
json.keys_under_root: true<br />
encoding: utf-8<br />
document_type: mod_security<br />
close_eof: true<br />
scan_frequency: 5s<br />
clean_*: true<br />
</code></p>
<p>In the same file on Elasticsearch Output section add the fallowing:<br />
<code class="" data-line=""><br />
output.elasticsearch:<br />
# Array of hosts to connect to.<br />
hosts: [&quot;your_ip:9200&quot;]</code><br />
<code class="" data-line=""><br />
# Protocol - either `http` (default) or `https`.<br />
protocol: &quot;https&quot;</code><br />
<code class="" data-line=""><br />
# Authentication credentials - either API key or username/password.<br />
#api_key: &quot;id:api_key&quot;<br />
username: &quot;elastic&quot;<br />
password: &quot;your_password&quot;<br />
</code><br />
And restart filebeat</p>
<p>Logs should start to become visible in elasticsearch and as you can see above we have 128 fields for which we can do log manipulation and create proper dashboards.<br />
<img decoding="async" class="alignnone size-full wp-image-140" src="https://random.sphere.ro/wp-content/uploads/2024/11/Capture_elastic_hidden.png" alt="" width="1926" height="831" srcset="https://random.sphere.ro/wp-content/uploads/2024/11/Capture_elastic_hidden.png 1926w, https://random.sphere.ro/wp-content/uploads/2024/11/Capture_elastic_hidden-300x129.png 300w, https://random.sphere.ro/wp-content/uploads/2024/11/Capture_elastic_hidden-1024x442.png 1024w, https://random.sphere.ro/wp-content/uploads/2024/11/Capture_elastic_hidden-768x331.png 768w, https://random.sphere.ro/wp-content/uploads/2024/11/Capture_elastic_hidden-1536x663.png 1536w, https://random.sphere.ro/wp-content/uploads/2024/11/Capture_elastic_hidden-604x261.png 604w" sizes="(max-width: 1926px) 100vw, 1926px" /></p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/nginx-modsecurity-and-elk-stack/">Nginx, Modsecurity and ELK stack</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://random.sphere.ro/nginx-modsecurity-and-elk-stack/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>qmail to exim migration (thoughts and not commands)</title>
		<link>https://random.sphere.ro/qmail-to-exim-migration-thoughts-and-not-commands/</link>
					<comments>https://random.sphere.ro/qmail-to-exim-migration-thoughts-and-not-commands/#comments</comments>
		
		<dc:creator><![CDATA[iulian]]></dc:creator>
		<pubDate>Wed, 19 Aug 2020 13:33:59 +0000</pubDate>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[AllowSupplementaryGroups]]></category>
		<category><![CDATA[clamav]]></category>
		<category><![CDATA[clamav-unofficial-sigs]]></category>
		<category><![CDATA[dkim]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[exim4u]]></category>
		<category><![CDATA[fehQlibs]]></category>
		<category><![CDATA[qmail]]></category>
		<category><![CDATA[qmail-scanner]]></category>
		<category><![CDATA[qmail-spp]]></category>
		<category><![CDATA[roundcubemail]]></category>
		<category><![CDATA[s/qmail]]></category>
		<category><![CDATA[simscan]]></category>
		<category><![CDATA[spamassassin]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[ucspi-ssl]]></category>
		<category><![CDATA[ucspi-tcp6]]></category>
		<category><![CDATA[vpopmail]]></category>
		<guid isPermaLink="false">https://random.sphere.ro/?p=117</guid>

					<description><![CDATA[<p>I&#8217;ve using Qmail since 2013 and it was a great companion. I&#8217;ve added so many custom scripts in it(or in this ecosystem) that it will take me days just to write about it. Unfortunately for some time already I&#8217;ve started to feel the end is near for Qmail.  Here is way(just few of them): A&#8230;</p>
<p class="read-more"><a class="readmore-btn" href="https://random.sphere.ro/qmail-to-exim-migration-thoughts-and-not-commands/">Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/qmail-to-exim-migration-thoughts-and-not-commands/">qmail to exim migration (thoughts and not commands)</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve using Qmail since 2013 and it was a great companion. I&#8217;ve added so many custom scripts in it(or in this ecosystem) that it will take me days just to write about it.<br />
Unfortunately for some time already I&#8217;ve started to feel the end is near for Qmail.  Here is way(just few of them):</p>
<ul>
<li>A lot of packages are not maintained or things are maintained by different group of people who don&#8217;t use the same patches as you.</li>
<li>It&#8217;s becoming really hard to keep track when you install a new server which patch to apply and at which step(for example i used tap patch but this is rarely used).</li>
<li>Often you need to understand and adapt the patches to your situation because some might include(partially or fully) other patches that you need also to apply. Basically in the end you start to write your own set of patches which obviously contains pieces of code from there of there. If you forgot something it might break or not work as intended.</li>
<li>Quite often as well you need support for new technologies and there fewer and fewer people who want to support this.<br />
For example: if you want ipv6 there is a way <a href="https://www.fehcom.de/ipnet/djbware.html" target="_blank" rel="noopener">via fehQlibs, ucspi-tcp6 and ucspi-ssl </a>but there is no clear indication this will work as intended from the beginning with your own version(i mean your own set of patches) since the owner has his own Qmail version named <a href="https://www.fehcom.de/sqmail/sqmail.html" target="_blank" rel="noopener">s/qmail.</a></li>
<li>After a long ride with qmail-scanner i went to simscan. This one can support only spamassassin and clamav.(or you start coding at it as well). For most of you it will be enough but if you want better antivirus(yes, commercial) than you&#8217;re out of luck. Yes, <a href="https://github.com/extremeshok/clamav-unofficial-sigs" target="_blank" rel="noopener">clamav-unofficial-sigs</a> might give you  a great boost but it might not be sufficient if your client wants the best.</li>
</ul>
<p>&nbsp;</p>
<p>Why Exim ?</p>
<p>Simply because is highly configurable, is popular and you find tons of information. This flexibility might come <a href="https://blog.rapid7.com/2019/09/10/cve-2019-15846-privileged-remote-code-execution-vulnerability-in-the-exim-mailer-what-you-need-to-know/" target="_blank" rel="noopener">with a price</a> but at least those are &#8220;hopefully&#8221; treated fast.<br />
For example i really liked qmail-spp patch and i heavily used(unfortunately this patch is again not included to a lot of different qmail projects available on the market) with a lot of perl scripts and the same principals can be used in exim acl which is great.</p>
<p>Learning curve to exim might be hard. Because of that I&#8217;ve encourage you to use in the beginning and old but good ecosystem named <a href="https://exim4u.org/" target="_blank" rel="noopener">exim4u</a>.<br />
You will definitely need to add/modify ACL protections, to change the behavior of the DKIM for forwarded messages(because the default exim4u install want to sign also the forwarded messages which is wrong) and things that you will &#8220;learn by doing it&#8221;. Again, it&#8217;s far from perfect but it&#8217;s a great start and i recommend it.</p>
<p>Things not to miss on your migration:</p>
<p>&#8211; Compile exim with the support for maildir. In this way you can keep the same structure that you had with vpopmail.(keep in mind that exim4u for you use Maildir instead of .maildir directory so you need to tune a little bit the php files if you use the GUI to create domains/emails/etc.)<br />
&#8211; Migrate the users from vpopmail database to exim4u database &#8211; i suggest to make your own scripts to do this. Doing it manually it&#8217;s taking too much time.<br />
&#8211; Don&#8217;t forget about greylist db ; exim4u use sqlite3 in /var/spool/exim/db/greylist.db. You need to create the file and the tables.<br />
&#8211; Don&#8217;t forget to change in dovecot(or the IMAP app used) to use the new database<br />
&#8211; If you are using an webmail adapt it and his plugins(for example: if you are using <a href="https://roundcube.net/" target="_blank" rel="noopener">Roundcubemail</a> with password plugin you need to change to reflect the new sql/db)<br />
&#8211; If older clamav version is used you might need to use AllowSupplementaryGroups but this should not be case for version above 0.100.(they just announced version 0.103 RC)<br />
&#8211; migrate the TLS (server.cert, server.pem)<br />
&#8211; migrate the DKIM certifications<br />
&#8211; as I&#8217;ve already mentioned several times above, exim4u is far from perfect but from my point of view it has a really nasty bug IF you are (still ???) using not encrypted passwords. Please check how <em>eq</em> and <em>crypteq </em>are used in server_condition. <a href="https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_plaintext_authenticator.html" target="_blank" rel="noopener">More info on the exim manual</a>.</p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/qmail-to-exim-migration-thoughts-and-not-commands/">qmail to exim migration (thoughts and not commands)</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://random.sphere.ro/qmail-to-exim-migration-thoughts-and-not-commands/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>dovecot block login per country / ip2location / geoip</title>
		<link>https://random.sphere.ro/dovecot-block-login-per-country-ip2location-geoip/</link>
					<comments>https://random.sphere.ro/dovecot-block-login-per-country-ip2location-geoip/#comments</comments>
		
		<dc:creator><![CDATA[iulian]]></dc:creator>
		<pubDate>Mon, 20 Jan 2020 20:00:42 +0000</pubDate>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[allow_nets]]></category>
		<category><![CDATA[dovecor]]></category>
		<category><![CDATA[geoip]]></category>
		<category><![CDATA[ip2location]]></category>
		<guid isPermaLink="false">https://random.sphere.ro/?p=105</guid>

					<description><![CDATA[<p>I&#8217;ll need to be honest and say that I&#8217;ve search for a long time an &#8220;easy&#8221; way to restrict IMAP logins / per user / per country. During my search around this topic i&#8217;ve also found allow_nets which is a nice feature but it only allows you to restrict per user / per ip or&#8230;</p>
<p class="read-more"><a class="readmore-btn" href="https://random.sphere.ro/dovecot-block-login-per-country-ip2location-geoip/">Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/dovecot-block-login-per-country-ip2location-geoip/">dovecot block login per country / ip2location / geoip</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ll need to be honest and say that I&#8217;ve search for a long time an &#8220;easy&#8221; way to restrict IMAP logins / per user / per country.</p>
<p>During my search around this topic i&#8217;ve also found <em>allow_nets</em> which is a nice feature but it only allows you to restrict per user / per ip or net. Plus the <a href="https://wiki2.dovecot.org/PasswordDatabase/ExtraFields/AllowNets" target="_blank" rel="noopener">wiki tutorial</a> for this feature is not showing a nice way to integrate with dovecot-sql. My approach was to create another field in the mysql table(in my case vpopmail) and when <em>password_query </em> is formed to request also this field. In short words my current sql lookups are like:</p>
<pre>user_query = SELECT pw_dir as home, 89 AS uid, 89 AS gid FROM vpopmail WHERE pw_name = '%n' AND pw_domain = '%d'

password_query = select pw_clear_passwd as password, allow_nets FROM vpopmail LEFT JOIN limits ON vpopmail.pw_domain=limits.domain WHERE pw_name='%n' and pw_domain='%d' and ( !(pw_gid &amp; 8)
and ('%r'!='127.0.0.1' or !(pw_gid &amp; 4)) and ( '%r'!='127.0.0.1' or COALESCE(disable_webmail,0)!=1) and COALESCE(disable_imap,0)!=1);</pre>
<p>Why so big ? Simply because i wanted also the support for vmoduser features which are also a nice set to restrict behaviour per user/domain. For more info about dovecot and vpopmail sql auth you can read on <a href="https://wiki.dovecot.org/AuthDatabase/VPopMail" target="_blank" rel="noopener">dovecot wiki.</a></p>
<p>As i said in the beginning of the article i was also search for ways to block user(s)/country. Apparently it is possible via dovecot authentication policy but i&#8217;ve found it quite painful. You can read more about this method <a href="https://wiki.dovecot.org/Authentication/Policy" target="_blank" rel="noopener">here.</a></p>
<p>My method is base on <a href="https://www.ip2location.com/" target="_blank" rel="noopener">ip2location</a> which has also also to possibility to download the geographical IP data in CSV. Starting from this data you can easily create a database and import the CVS into it.</p>
<pre>CREATE DATABASE ip2location;
USE ip2location;
CREATE TABLE `ip2location_db1`(
`ip_from` INT(10) UNSIGNED,
`ip_to` INT(10) UNSIGNED,
`country_code` CHAR(2),
`country_name` VARCHAR(64),
PRIMARY KEY (`ip_to`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;</pre>
<pre>LOAD DATA LOCAL
INFILE 'IPCountry.CSV'
INTO TABLE
`ip2location_db1`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n';</pre>
<p>You can find more about how to manipulate data from ip2location <a href="https://www.ip2location.com/faqs/db1-ip-country#database" target="_blank" rel="noopener">on their site.</a></p>
<p>In this moment you will have a database with IPs and their location. Using the dovecot variable %r ( remote ip ) we can pass this to the sql query when searching for username/password. For more about dovecot variables i recommend reading <a href="https://wiki1.dovecot.org/Variables" target="_blank" rel="noopener">their site.</a></p>
<p>I though that will be easy but i didn&#8217;t expect the query to became so long. To be honest i&#8217;ve tried also with sql variables and stored procedures but i didn&#8217;t found a way to properly set it into dovecot. If you find it please leave me a comment.</p>
<p>In this moment my username query is looking like this. Please have in mind that allow_country is another field in vpopmail database(or sql db used for authentication) and this will contain data in the fallowing format: RO,DE,NL (example for: Romania, Germany, Netherlands)</p>
<pre>user_query = SELECT pw_dir as home, 89 AS uid, 89 AS gid FROM vpopmail WHERE pw_name = '%n' AND pw_domain = '%d' and allow_country like CONCAT('%%',(select country_code from ip2location.ip2location_db1 where ip_from &lt;= INET_ATON('%r') and ip_to &gt;= INET_ATON('%r')),'%%')</pre>
<p>&nbsp;</p>
<p>This is all, hope that it was instructive.</p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/dovecot-block-login-per-country-ip2location-geoip/">dovecot block login per country / ip2location / geoip</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://random.sphere.ro/dovecot-block-login-per-country-ip2location-geoip/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>DMARC / Spamassassin / Qmail</title>
		<link>https://random.sphere.ro/dmarc-on-spamassassin/</link>
					<comments>https://random.sphere.ro/dmarc-on-spamassassin/#comments</comments>
		
		<dc:creator><![CDATA[iulian]]></dc:creator>
		<pubDate>Mon, 12 Aug 2019 09:10:03 +0000</pubDate>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[dkim]]></category>
		<category><![CDATA[dmarc]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[qmail]]></category>
		<category><![CDATA[qpsmtpd]]></category>
		<category><![CDATA[spamassassin]]></category>
		<category><![CDATA[spf]]></category>
		<guid isPermaLink="false">https://random.sphere.ro/?p=93</guid>

					<description><![CDATA[<p>There are a lot of articles regarding DMARC so i will not start again about what it is and what is useful for. Also i will not talk about the drawbacks when it&#8217;s implemented. I will instead give you a hint about where to generate a DMARC policy  and where to verify it. Until you&#8230;</p>
<p class="read-more"><a class="readmore-btn" href="https://random.sphere.ro/dmarc-on-spamassassin/">Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/dmarc-on-spamassassin/">DMARC / Spamassassin / Qmail</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>There are a lot of articles regarding DMARC so i will not start again about what it is and what is useful for. Also i will not talk about the drawbacks when it&#8217;s implemented. I will instead give you a hint about where to <a href="https://mxtoolbox.com/DMARCRecordGenerator.aspx" target="_blank" rel="noopener">generate a DMARC</a> policy  and <a href="https://mxtoolbox.com/dmarc.aspx" target="_blank" rel="noopener">where to verify it</a>.</p>
<p>Until you understand the essence please also be very conservative about the policies that you apply. The example of deployment<a href="https://support.google.com/a/answer/2466563?hl=en" target="_blank" rel="noopener"> found it on google</a> it provides the way you should do it as well. More exactly:</p>
<ol>
<li>p=none pct=100</li>
<li>p=quarantine pct=1</li>
<li>p=quarantine pct=5</li>
<li>p=quarantine pct=10</li>
<li>p=quarantine pct=25</li>
<li>p=quarantine pct=50</li>
<li>p=quarantine pct=100</li>
<li>p=reject pct=1</li>
<li>p=reject pct=5</li>
<li>p=reject pct=10</li>
<li>p=reject pct=25</li>
<li>p=reject pct=50</li>
<li>p=reject pct=100</li>
</ol>
<p>Now that you already implemented it you might receive reports(if you provided rua/ruf) about what is happening with your domains.</p>
<p>But what about implementing DMARC in your MTA? Usually the straight answer will be opendmarc but depending your MTA the installation will not be very  easy. Since here we will talk about Qmail the solutions found by me in this moment are:</p>
<p>1) <a href="https://en.wikipedia.org/wiki/Qpsmtpd" target="_blank" rel="noopener">Qpsmtpd</a> and opendmarc. Please <a href="https://github.com/msimerson/mail-dmarc/wiki" target="_blank" rel="noopener">also see.</a></p>
<p>2)<a href="https://metacpan.org/pod/Mail::AuthenticationResults::SpamAssassin" target="_blank" rel="noopener"> A perl plugin</a> written for spam-assassin.</p>
<p>3) Using AskDNS plugin already available in spamassasin like this:</p>
<pre>ifplugin Mail::SpamAssassin::Plugin::AskDNS
askdns __DMARC_POLICY_NONE _dmarc._AUTHORDOMAIN_ TXT /^v=DMARC1;.*\bp=none;/
askdns __DMARC_POLICY_QUAR _dmarc._AUTHORDOMAIN_ TXT /^v=DMARC1;.*\bp=quarantine;/
askdns __DMARC_POLICY_REJECT _dmarc._AUTHORDOMAIN_ TXT /^v=DMARC1;.*\bp=reject;/

meta DMARC_REJECT !(DKIM_VALID_AU || SPF_PASS) &amp;&amp; __DMARC_POLICY_REJECT
score DMARC_REJECT 10
meta DMARC_QUAR !(DKIM_VALID_AU || SPF_PASS) &amp;&amp; __DMARC_POLICY_QUAR
score DMARC_QUAR 5
meta DMARC_NONE !(DKIM_VALID_AU || SPF_PASS) &amp;&amp; __DMARC_POLICY_NONE
score DMARC_NONE 0.1
endif</pre>
<p>Obviously edit the scores according to you needs.</p>
<p>4) After this article was written I&#8217;ve found out from <a href="https://notes.sagredo.eu/en/qmail-notes-185/configuring-dkim-for-qmail-92.html#comment1379" target="_blank" rel="noopener">here</a> (btw great blog about qmail)  there is another tool to use it. You can find it <a href="https://github.com/fany/App-Qmail-DMARC" target="_blank" rel="noopener">here.</a></p>
<p>So, what was your solution for Qmail and DMARC ? What do you use ? How do you use it ?</p>
<p>&nbsp;</p>
<p>Later edit(17/09/2020): A plugin for spamassassin was created. This is maintained and i believe it will introduced in core in the next releases. You can find references <a href="https://github.com/bigio/spamassassin-dmarc" target="_blank" rel="noopener">here</a> and <a href="https://cwiki.apache.org/confluence/display/SPAMASSASSIN/CustomPlugins" target="_blank" rel="noopener">here.</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/dmarc-on-spamassassin/">DMARC / Spamassassin / Qmail</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://random.sphere.ro/dmarc-on-spamassassin/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
		<item>
		<title>Gentoo and upgrading perl core</title>
		<link>https://random.sphere.ro/gentoo-and-upgrading-perl-core/</link>
					<comments>https://random.sphere.ro/gentoo-and-upgrading-perl-core/#respond</comments>
		
		<dc:creator><![CDATA[iulian]]></dc:creator>
		<pubDate>Fri, 02 Aug 2019 09:51:09 +0000</pubDate>
				<category><![CDATA[Uncategorised]]></category>
		<guid isPermaLink="false">https://random.sphere.ro/?p=83</guid>

					<description><![CDATA[<p>GENERAL RULE: always back-up and always use maintenance windows. On a busy server with lots of scripts and programs installed this task might become quite hard since you don&#8217;t know from where the problems can appear. If you look on the official documentation you will find that in order to upgrade perl-core you should upgrade&#8230;</p>
<p class="read-more"><a class="readmore-btn" href="https://random.sphere.ro/gentoo-and-upgrading-perl-core/">Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/gentoo-and-upgrading-perl-core/">Gentoo and upgrading perl core</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>GENERAL RULE</strong>: always back-up and always use maintenance windows.</p>
<p>On a busy server with lots of scripts and programs installed this task might become quite hard since you don&#8217;t know from where the problems can appear. If you look on the official documentation you will find that in order to upgrade perl-core you should upgrade the @world.(all packages).</p>
<p>To be honest i never upgraded the @world for the same reason. I prefer to upgrade the packages that i need ( ex: apache, php,etc ) and when the times comes(once in a while) i usually upgrade the @system. It&#8217;s easier to keep an eye on what happened with only one application instead on finding yourself in the situation that everything is down(for example you can have both email and web downtime in the same time).</p>
<p>But enough with this story, let&#8217;s go to perl.</p>
<p>If you do <span style="color: #0000ff;">emerge -pv dev-lang/perl <span style="color: #000000;">it&#8217;s simply not going to work because of the nightmare of dependencies. One package refers to another and that to another and you will a lot have conflicts. As i said before the official way is to upgrade the @world but there is ANOTHER WAY.</span></span></p>
<pre>echo "=app-admin/gentoo-perl-helpers-0.3.1-r1 ~amd64" &gt;&gt; /etc/portage/package.accept_keywords
emerge gentoo-perl-helpers
</pre>
<p>This is a tool that constructs a list of perl packages that need to be upgraded plus their direct dependencies ( ex: net-snmp if you compiled with perl module, spamassassin, etc) and of-course  perl-core.</p>
<p>It&#8217;s quite simple to use it. For example if you want to upgrade from perl 5.24 to 5.28 you simply do:</p>
<pre># <span style="color: #000080;">gentoo-perl gen-upgrade-sets 5.24 5.28</span>
* [gentoo-perl &gt; gen-upgrade-sets] Generating /etc/portage/sets/perl-cleanup
* [...ch-atom-blacklisted &gt; list-blacklisted-for] No blacklist entries for dev-lang/perl:0/5.28
* [gentoo-perl &gt; gen-upgrade-sets] ... Done /etc/portage/sets/perl-cleanup
* [gentoo-perl &gt; gen-upgrade-sets] Generating /etc/portage/sets/perl-upgrade
* [...perl-subslot-rebuild &gt; installed-deps-atom] revdep DEPEND scanning for dev-lang/perl(|-5\.[^: ]+):0/(5\.26|5\.24|5\.22|5\.20|5\.18|5\.16)=
* [...perl-subslot-rebuild &gt; installed-deps-atom] revdep RDEPEND scanning for dev-lang/perl(|-5\.[^: ]+):0/(5\.26|5\.24|5\.22|5\.20|5\.18|5\.16)=
* [...perl-subslot-rebuild &gt; installed-deps-atom] revdep PDEPEND scanning for dev-lang/perl(|-5\.[^: ]+):0/(5\.26|5\.24|5\.22|5\.20|5\.18|5\.16)=
* [...perl-subslot-rebuild &gt; installed-deps-atom] No matches in PDEPEND
* [gentoo-perl &gt; gen-upgrade-sets] ... Done /etc/portage/sets/perl-upgrade
* [gentoo-perl &gt; gen-upgrade-sets] Created set @perl-cleanup in /etc/portage/sets/perl-cleanup
* [gentoo-perl &gt; gen-upgrade-sets] Created set @perl-upgrade in /etc/portage/sets/perl-upgrade
* [gentoo-perl &gt; gen-upgrade-sets]
* [gentoo-perl &gt; gen-upgrade-sets] Assuming both of those were in /etc/portage/sets you can now do
* [gentoo-perl &gt; gen-upgrade-sets] emerge -va1 -k n @perl-upgrade
* [gentoo-perl &gt; gen-upgrade-sets] And if this exhibits confusing blockers that only refer to perl-core
* [gentoo-perl &gt; gen-upgrade-sets] emerge -C -va @perl-cleanup
* [gentoo-perl &gt; gen-upgrade-sets] Should help pave the way forward
* [gentoo-perl &gt; gen-upgrade-sets]
* [gentoo-perl &gt; gen-upgrade-sets] If portage crashes mid-way through an upgrade, after any relevant issues
* [gentoo-perl &gt; gen-upgrade-sets] Re-run this tool to regenerate the sets before proceeding</pre>
<p>After that you should run &#8230;. but wait a minute and read below the command and not hurry to press YES.</p>
<pre>emerge --oneshot --ask @perl-upgrade
</pre>
<p>Now comes the tricky part. It might be that the packages that you upgrade will not have the same USE definition as before. Pay a lot of attention to this subject because it might break the usability of a certain package. My approach was to look on the packages that will be installed and where necessary to add in /etc/portage/package.use the correct USE elements. For example for net-snmp i have:</p>
<pre># cat /etc/portage/package.use/net-snmp
net-analyzer/net-snmp perl tcpd</pre>
<p>Once you are sure that all the packages are having the correct USE elements you should do the upgrade.</p>
<p>Once the upgrade is done you should all do :</p>
<pre>perl-cleaner -all</pre>
<p>You might also need to do <span style="color: #0000ff;">emerge -cvap</span> and look for(if) something that you can uninistall in order not to create confusion for the next upgrade. Also <span style="color: #0000ff;">emerge revdep-rebuild <span style="color: #000000;">might be needed after this step but this is totally dependent to your system.</span><br />
</span></p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/gentoo-and-upgrading-perl-core/">Gentoo and upgrading perl core</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://random.sphere.ro/gentoo-and-upgrading-perl-core/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Gentoo &#8211; spamassassin with pyzor, razor and dcc</title>
		<link>https://random.sphere.ro/gentoo-spamassassin-with-pyzor-razor-and-dcc/</link>
					<comments>https://random.sphere.ro/gentoo-spamassassin-with-pyzor-razor-and-dcc/#respond</comments>
		
		<dc:creator><![CDATA[iulian]]></dc:creator>
		<pubDate>Tue, 30 Jul 2019 13:33:43 +0000</pubDate>
				<category><![CDATA[Uncategorised]]></category>
		<guid isPermaLink="false">https://random.sphere.ro/?p=55</guid>

					<description><![CDATA[<p>You will find a lot of documentation regarding those but almost nowhere is explaining you that by just un-commenting these in spamassasin config files will not have those working. In order to work you will need to install separate packages from different vendors. In order to use the above for spamassassin you will install only&#8230;</p>
<p class="read-more"><a class="readmore-btn" href="https://random.sphere.ro/gentoo-spamassassin-with-pyzor-razor-and-dcc/">Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/gentoo-spamassassin-with-pyzor-razor-and-dcc/">Gentoo &#8211; spamassassin with pyzor, razor and dcc</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>You will find a lot of documentation regarding those but almost nowhere is explaining you that by just un-commenting these in spamassasin config files will not have those working. In order to work you will need to install separate packages from different vendors.</p>
<p>In order to use the above for spamassassin you will install only the client version ( you don&#8217;t need server version as long your email server will not go above 100.000 emails per day)</p>
<h3><em><strong>Pyzor:</strong></em></h3>
<p>Unfortunately pyzor is the only one which is up-to-date in gentoo portage.</p>
<p><span style="color: #000080;"> emerge  pyzor</span></p>
<p>After installing you can start reading some good documentation which can be found on the <a href="https://pyzor.readthedocs.io/en/release-1-0-0/index.html" target="_blank" rel="noopener">official site.</a></p>
<p><em>The important commands are:</em></p>
<p>Check if you have connectivity with pyzor server: <span style="color: #000080;">pyzor ping</span></p>
<p>Check if message is spam: <span style="color: #000080;">pyzor check &lt; message.eml</span></p>
<p>Report message as spam: <span style="color: #000080;">pyzor report &lt; message.eml</span></p>
<p>Let&#8217;s see if it&#8217;s working.</p>
<p>Uncomment <span style="color: #333399;">&#8220;loadplugin Mail::SpamAssassin::Plugin::Pyzor&#8221; <span style="color: #000000;">from spamassassin config file.</span><br />
</span></p>
<p>Check configuration(you shoul not see any message returned) : <span style="color: #000080;">spamassassin &#8211;lint</span></p>
<p>Restart spamassassin: <span style="color: #000080;">/etc/init.d/spamd restart</span></p>
<p>Test if pyzor is active:</p>
<pre># <span style="color: #000080;">spamassassin 2&gt;&amp;1 -D -t &lt; /msg.1563818007.667538.23924 | grep -i pyzor</span> 
Jul 30 11:01:55.813 [5386] dbg: plugin: loading Mail::SpamAssassin::Plugin::Pyzor from @INC 
Jul 30 11:01:55.817 [5386] dbg: pyzor: network tests on, attempting Pyzor 
Jul 30 11:01:56.614 [5386] dbg: config: fixed relative path: /var/lib/spamassassin/3.004002/updates_spamassassin_org/25_pyzor.cf 
Jul 30 11:01:56.614 [5386] dbg: config: using "/var/lib/spamassassin/3.004002/updates_spamassassin_org/25_pyzor.cf" for included file 
Jul 30 11:01:56.614 [5386] dbg: config: read file /var/lib/spamassassin/3.004002/updates_spamassassin_org/25_pyzor.cf 
Jul 30 11:02:00.057 [5386] dbg: util: executable for pyzor was found at /usr/bin/pyzor 
Jul 30 11:02:00.057 [5386] dbg: pyzor:<strong> pyzor is available</strong>: /usr/bin/pyzor 
Jul 30 11:02:00.057 [5386] dbg: pyzor: opening pipe: /usr/bin/pyzor check &lt; /tmp/.spamassassin5386ua5Fe1tmp 
Jul 30 11:02:00.230 [5386] dbg: pyzor: [5390] finished: exit 1 
Jul 30 11:02:00.231 [5386] dbg: pyzor: <strong>got response: public.pyzor.org:24441 (200, 'OK') 0 0</strong> 
Jul 30 11:02:00.232 [5386] dbg: check: tagrun - tag PYZOR is now ready, value: Reported 0 times. 
</pre>
<p>&nbsp;</p>
<h3><em><strong>Razor:</strong></em></h3>
<p>Unfortunately is not in the portage anymore so you need to <a href="http://razor.sourceforge.net" target="_blank" rel="noopener">download </a>and install it manually.</p>
<p>Official documentation can be found <a href="http://razor.sourceforge.net/docs/doc.php?type=pod&amp;name=razor-admin" target="_blank" rel="noopener">here</a>.</p>
<pre># <span style="color: #000080;">perl Makefile.PL</span>

Checking if your kit is complete...
Looks good
Warning: NAME must be a package name
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Razor2::Preproc::deHTMLxs
Writing MYMETA.yml and MYMETA.json
Generating a Unix-style Makefile
Writing Makefile for razor-agents
Writing MYMETA.yml and MYMETA.json

<span style="color: #000080;">make &amp;&amp; make install
</span></pre>
<p>Let&#8217;s create the razor account:</p>
<pre># razor-admin -create
# razor-admin -discover
# razor-admin -register
Register successful. Identity stored in /root/.razor/identity-ruSiVo2Viv</pre>
<p>As before let&#8217;s start and test this.</p>
<p>Uncomment <span style="color: #000080;">loadplugin Mail::SpamAssassin::Plugin::Razor2</span> from spamssassin config.</p>
<pre><span style="color: #000080;"># spamassasin --lint</span>
<span style="color: #000080;"># spamassassin 2&gt;&amp;1 -D -t &lt; /1564471708.7590.message\,S\=1553\:2\, | grep -i razor</span>
Jul 30 11:54:58.359 [18439] dbg: plugin: loading Mail::SpamAssassin::Plugin::Razor2 from @INC
<strong>Jul 30 11:54:58.441 [18439] dbg: razor2: razor2 is available, version 2.84</strong>
Jul 30 11:54:58.814 [18439] dbg: config: fixed relative path: /var/lib/spamassassin/3.004002/updates_spamassassin_org/25_razor2.cf
Jul 30 11:54:58.814 [18439] dbg: config: using "/var/lib/spamassassin/3.004002/updates_spamassassin_org/25_razor2.cf" for included file
Jul 30 11:54:58.814 [18439] dbg: config: read file /var/lib/spamassassin/3.004002/updates_spamassassin_org/25_razor2.cf
Jul 30 11:55:03.396 [18439] dbg: razor2: part=0 engine=8 contested=0 confidence=0
<strong>Jul 30 11:55:03.397 [18439] dbg: razor2: results: spam? 0</strong>
Jul 30 11:55:03.397 [18439] dbg: razor2: results: engine 4, highest cf score: 0
Jul 30 11:55:03.397 [18439] dbg: razor2: results: engine 8, highest cf score: 0
Jul 30 11:55:03.741 [18439] dbg: timing: total 5413 ms - init: 2619 (48.4%), b_tie_ro: 13 (0.2%), parse: 0.86 (0.0%), extract_message_metadata: 36 (0.7%), get_uri_detail_list: 3.0 (0.1%), tests_pri_-1000: 37 (0.7%), compile_gen: 350 (6.5%), compile_eval: 31 (0.6%), tests_pri_-950: 4.3 (0.1%), tests_pri_-900: 5 (0.1%), tests_pri_-90: 15 (0.3%), check_bayes: 8 (0.2%), b_tokenize: 3.7 (0.1%), b_tok_get_all: 1.25 (0.0%), b_comp_prob: 0.59 (0.0%), b_tok_touch_all: 0.36 (0.0%), b_finish: 1.16 (0.0%), tests_pri_0: 625 (11.6%), dkim_load_modules: 24 (0.4%), check_dkim_signature: 0.49 (0.0%), check_spf: 65 (1.2%), poll_dns_idle: 1.51 (0.0%), check_dkim_adsp: 3.3 (0.1%), tests_pri_20: 1715 (31.7%), check_razor2: 1709 (31.6%), tests_pri_30: 197 (3.6%), check_pyzor: 188 (3.5%), tests_pri_500: 141 (2.6%)
</pre>
<p>&nbsp;</p>
<h3>DCC</h3>
<p>There is a version of DCC in the portage but is quite old. I installed it and i found that is working ok so you have two choices:</p>
<p>1) either install dcc-1.3.158 from portage</p>
<pre>echo "&gt;=mail-filter/dcc-1.3.158 DCC" &gt; /etc/portage/package.license
emerge dcc
</pre>
<p>2) or the latest version(now is <a href="https://www.dcc-servers.net/dcc/source/dcc.tar.Z" target="_blank" rel="noopener">2.3.167</a>)</p>
<pre>wget http://www.dcc-servers.net/dcc/source/dcc-dccproc.tar.Z
tar xfvz dcc-dccproc.tar.Z  
cd dcc-dccproc-*
./configure &amp;&amp; make &amp;&amp; make install
</pre>
<p>Test the DCC connection:</p>
<pre><span style="color: #000080;"># cdcc info</span>
# 07/30/19 12:39:59 EEST /var/dcc/map
# Re-resolve names after 14:38:10 Check RTTs after 12:53:14
# 1250.76 ms threshold, 1247.20 ms average 12 total, 10 working servers
IPv6 off version=3

dcc1.dcc-servers.net,- RTT+1000 ms anon
# 74.92.232.243,-
# not answering
# 209.169.14.29,- x.dcc-servers ID 104
# 100% of 1 requests ok 252.40+1000 ms RTT 100 ms queue wait
# 209.169.14.30,- x.dcc-servers ID 104
# 100% of 1 requests ok 254.31+1000 ms RTT 100 ms queue wait

dcc2.dcc-servers.net,- RTT+1000 ms anon
# *136.199.199.160,- URT ID 1060
# 100% of 1 requests ok 147.20+1000 ms RTT 100 ms queue wait
# 157.131.0.46,- sonic ID 1255
# 100% of 1 requests ok 284.97+1000 ms RTT 100 ms queue wait
# 192.84.137.21,- INFN-TO ID 1233
# 100% of 1 requests ok 151.33+1000 ms RTT 100 ms queue wait

dcc3.dcc-servers.net,- RTT+1000 ms anon
# 184.23.168.46,- sonic ID 1254
# 100% of 1 requests ok 279.82+1000 ms RTT 100 ms queue wait
# 212.223.102.90,- ID 1480
# 100% of 1 requests ok 150.76+1000 ms RTT 100 ms queue wait

dcc4.dcc-servers.net,- RTT+1000 ms anon
# 192.135.10.194,- debian ID 1169
# 100% of 1 requests ok 163.44+1000 ms RTT 100 ms queue wait

dcc5.dcc-servers.net,- RTT+1000 ms anon
# 204.90.71.235,- MGTINTERNET ID 1170
# 100% of 1 requests ok 216.45+1000 ms RTT 100 ms queue wait
# 209.169.14.26,- x.dcc-servers ID 104
# 100% of 1 requests ok 254.30+1000 ms RTT 100 ms queue wait

@,- RTT-1000 ms 32768 secret11589268638y1057
# 127.0.0.1,-
# not answering

################
# 07/30/19 12:39:59 EEST greylist /var/dcc/map
# Re-resolve names after 14:38:14 Check RTTs after 12:53:24
# 1 total, 0 working servers

@,- Greylist 32768 secret11589268638y1057
# *127.0.0.1,6276
# not answering</pre>
<p>Sometimes <span style="color: #000080;">cdcc info</span> may not return any server. Run <span style="color: #000080;">cdcc RTT</span> . If you still don&#8217;t have any luck check your firewalls.</p>
<p>Edit whiteclnt and whitecommon and add your own IP as &#8220;trusted&#8221;.</p>
<pre># List statically allocated IP addresses that you trust to never send
# or forward unsolicited bulk email
#ok ip 10.1.2.0/24</pre>
<p>Uncomment <span style="color: #000080;">loadplugin Mail::SpamAssassin::Plugin::DCC <span style="color: #000000;">from the config file and let&#8217;s check it.<br />
</span></span></p>
<pre># spamassassin 2&gt;&amp;1 -D -t &lt;/1563847269.8759.sphere\,S\=1032387\:2\,S | grep -i DCC
Jul 30 13:13:41.829 [17645] dbg: plugin: loading Mail::SpamAssassin::Plugin::DCC from @INC
Jul 30 13:13:41.841 [17645] dbg: dcc: network tests on, registering DCC
Jul 30 13:13:42.290 [17645] dbg: config: fixed relative path: /var/lib/spamassassin/3.004002/updates_spamassassin_org/25_dcc.cf
Jul 30 13:13:42.290 [17645] dbg: config: using "/var/lib/spamassassin/3.004002/updates_spamassassin_org/25_dcc.cf" for included file
Jul 30 13:13:42.290 [17645] dbg: config: read file /var/lib/spamassassin/3.004002/updates_spamassassin_org/25_dcc.cf
Jul 30 13:13:46.406 [17645] dbg: util: executable for cdcc was found at /usr/bin/cdcc
Jul 30 13:13:46.406 [17645] dbg: dcc: dcc_pgm_path, found cdcc in env.path: /usr/bin/cdcc
Jul 30 13:13:46.414 [17645] dbg: dcc: `/usr/bin/cdcc -qV homedir libexecdir` reports '1.3.158 homedir=/var/dcc libexecdir=/usr/sbin '
Jul 30 13:13:46.414 [17645] dbg: dcc: use 'dcc_libexec /usr/sbin' from cdcc
Jul 30 13:13:46.414 [17645] dbg: dcc: use 'dcc_home /var/dcc' from cdcc
Jul 30 13:13:46.414 [17645] dbg: dcc: dccifd is not available; no r/w socket at /var/dcc/dccifd
Jul 30 13:13:46.414 [17645] dbg: util: executable for dccproc was found at /usr/bin/dccproc
Jul 30 13:13:46.414 [17645] dbg: dcc: dcc_pgm_path, found dccproc in env.path: /usr/bin/dccproc
Jul 30 13:13:46.414 [17645] dbg: dcc: /usr/bin/dccproc is available
<span style="color: #000080;">Jul 30 13:13:46.416 [17645] dbg: dcc: opening pipe to /usr/bin/dccproc -C -x 0 -h /var/dcc -a 5.189.178.220 -w whiteclnt &lt;/tmp/.spamassassin17645LOazawtmp
Jul 30 13:13:46.573 [17645] dbg: dcc: dccproc responded with 'X-DCC-EATSERVER-Metrics: sphere 1166; Body=1 Fuz1=28 Fuz2=many'</span>
Jul 30 13:13:46.574 [17645] dbg: check: tagrun - tag DCCB is now ready, value: EATSERVER
Jul 30 13:13:46.575 [17645] dbg: check: tagrun - tag DCCR is now ready, value: sphere 1166; Body=1 Fuz1=28 Fuz2=many
<span style="color: #000080;">Jul 30 13:13:46.575 [17645] dbg: dcc: listed: BODY=1/999999 FUZ1=28/999999 FUZ2=999999/999999 REP=0/90
Jul 30 13:13:46.576 [17645] dbg: rules: ran eval rule DCC_CHECK ======&gt; got hit (1)</span>
Jul 30 13:13:48.992 [17645] dbg: plugin: Mail::SpamAssassin::Plugin::DCC=HASH(0x55db68f00d38) implements 'check_post_learn', priority 0
Jul 30 13:13:48.993 [17645] dbg: dcc: DCC learning not enabled by dcc_learn_score
Jul 30 13:13:48.994 [17645] dbg: check: tests=BAYES_50,DCC_CHECK,FSL_BULK_SIG,HTML_IMAGE_ONLY_32,HTML_MESSAGE,RDNS_NONE,SPF_FAIL,SPF_HELO_PASS</pre>
<p>Now restart your spamd daemon and that&#8217;s it.</p>
<p>&nbsp;</p>
<p><strong>TIPS:</strong></p>
<ul>
<li>Most probably you will ask soon how you report a spam message towards pyzor, razor, dcc. Simple answer is <span style="color: #000080;">spamassassin &#8211;report &lt; message.</span></li>
<li>Are those effective? I didn&#8217;t though so but it seems even if people are using all of them and new spams are reported quite fast. The simple answer is YES, use them.</li>
</ul>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/gentoo-spamassassin-with-pyzor-razor-and-dcc/">Gentoo &#8211; spamassassin with pyzor, razor and dcc</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://random.sphere.ro/gentoo-spamassassin-with-pyzor-razor-and-dcc/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Different types of find between dates and list / delete / move</title>
		<link>https://random.sphere.ro/different-types-of-find-between-dates-and-list-delete-move/</link>
					<comments>https://random.sphere.ro/different-types-of-find-between-dates-and-list-delete-move/#respond</comments>
		
		<dc:creator><![CDATA[iulian]]></dc:creator>
		<pubDate>Wed, 17 Jul 2019 20:34:04 +0000</pubDate>
				<category><![CDATA[Uncategorised]]></category>
		<guid isPermaLink="false">https://random.sphere.ro/?p=49</guid>

					<description><![CDATA[<p>I&#8217;ve struggled for some time with find mtime/atime/ctime but the results were not so confident sometimes and this is because how Linux is operating. If you want to delete all the files between 2018-06-01 and 2019-01-01 you need to: 1) create two files with these dates touch -amt 201806010000 ref1 touch -amt 201901010000 ref2 2)&#8230;</p>
<p class="read-more"><a class="readmore-btn" href="https://random.sphere.ro/different-types-of-find-between-dates-and-list-delete-move/">Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/different-types-of-find-between-dates-and-list-delete-move/">Different types of find between dates and list / delete / move</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve struggled for some time with find mtime/atime/ctime but the results were not so confident sometimes and this is because how Linux is operating.</p>
<p>If you want to delete all the files between 2018-06-01 and 2019-01-01 you need to:</p>
<p>1) create two files with these dates</p>
<p>touch -amt 201806010000 ref1</p>
<p>touch -amt 201901010000 ref2</p>
<p>2) perform the find and list / delete / move</p>
<p>find . -type f -newer ref1 -a ! -newer ref2 -ls</p>
<p>find . -type f -newer ref1 -a ! -newer ref2 -print0 | xargs -r0 rm</p>
<p>find . -type f -newer ref1 -a ! -newer ref2 -print0 | xargs -r0 mv -t 2018/</p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/different-types-of-find-between-dates-and-list-delete-move/">Different types of find between dates and list / delete / move</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://random.sphere.ro/different-types-of-find-between-dates-and-list-delete-move/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Nagios, VMware/vSphere, VMware Perl SDK 6.5 on Gentoo Linux</title>
		<link>https://random.sphere.ro/nagios-vmware-vsphere-vmware-perl-sdk-6-5-on-gentoo-linux/</link>
					<comments>https://random.sphere.ro/nagios-vmware-vsphere-vmware-perl-sdk-6-5-on-gentoo-linux/#respond</comments>
		
		<dc:creator><![CDATA[iulian]]></dc:creator>
		<pubDate>Fri, 07 Jun 2019 11:50:36 +0000</pubDate>
				<category><![CDATA[Uncategorised]]></category>
		<guid isPermaLink="false">https://random.sphere.ro/?p=28</guid>

					<description><![CDATA[<p>Tutorials on how to install nagios to collect data from ESXi for Redhat/Ubuntu you can find plenty on internet. Unfortunately is not the case for Gentoo. What you need to know that is not impossible and fairly easy (once you get it done). Here the steps: 1) Download VMware-vSphere-Perl-SDK-6.5.0-xxxx.x86_64.tar.gz from VMware site. 2) Once you&#8230;</p>
<p class="read-more"><a class="readmore-btn" href="https://random.sphere.ro/nagios-vmware-vsphere-vmware-perl-sdk-6-5-on-gentoo-linux/">Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/nagios-vmware-vsphere-vmware-perl-sdk-6-5-on-gentoo-linux/">Nagios, VMware/vSphere, VMware Perl SDK 6.5 on Gentoo Linux</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Tutorials on how to install nagios to collect data from ESXi for Redhat/Ubuntu you can find plenty on internet. Unfortunately is not the case for Gentoo.</p>
<p>What you need to know that is not impossible and fairly easy (once you get it done).</p>
<p>Here the steps:</p>
<p>1) Download VMware-vSphere-Perl-SDK-6.5.0-xxxx.x86_64.tar.gz from VMware site.</p>
<p>2) Once you untar it you will have a perl script named <span style="text-decoration: underline;">vmware-install.pl</span> which you can run but since it was not created for Gentoo it check prerequisite that you cannot form</p>
<p>Ex:</p>
<pre><em>Creating a new vSphere CLI installer database using the tar4 format.</em>

<em>Installing vSphere CLI 6.5.0 build-4566394 for Linux.</em>

<em>You must read and accept the vSphere CLI End User License Agreement to</em>
<em>continue.</em>
<em>Press enter to display it.</em>

<em>Do you accept? (yes/no) yes</em>

<em>Thank you.</em>

<em>Openssl-devel is not installed on the system.</em>
<em>openssl-devel 0.9.7 is required for encrypted connections.</em>
<em>Please install openssl-devel version 0.9.7 or greater.</em>

<em>e2fsprogs is not installed on the system</em>

<em>e2fsprogs 1.38 is required for UUID.</em>
<em>Please install e2fsprogs 1.38 or greater.</em></pre>
<p>3) So you will need to compile the whole thing manually, using <span style="text-decoration: underline;">perl Makefile.PL</span></p>
<p>4) It will give you a set of dependencies which will be needed, such:</p>
<pre><em>perl Makefile.PL
Warning: prerequisite Class::MethodMaker 2.08 not found.
Warning: prerequisite Crypt::SSLeay 0.51 not found.
Warning: prerequisite SOAP::Lite 0.67 not found.
Warning: prerequisite UUID 0.03 not found.
Warning: prerequisite XML::LibXML 1.58 not found.
Generating a Unix-style Makefile
Writing Makefile for VIPerlToolkit
Writing MYMETA.yml and MYMETA.json
</em></pre>
<p>5) You will need:</p>
<pre>emerge -pv dev-perl/Crypt-SSLeay dev-perl/Class-MethodMaker dev-perl/SOAP-Lite dev-perl/UUID app-text/xml2 dev-libs/libxml2 dev-perl/XML-LibXML dev-perl/libxml-perl</pre>
<p>6) You might get errors when you compile <em>dev-perl/XML-LibXML</em></p>
<p>Here is the trick:</p>
<p>You need to have <em>dev-libs/libxml2, app-text/xml2</em> AND probably the most important one is <em>net-libs/libnsl</em>. Without the last one <em>dev-perl/XML-LibXML</em> will not be able be able to pass the prerequisite for xml2 :</p>
<pre>"Checking for ability to link against xml2...yes"</pre>
<p>7) Once all the perl modules are installed just compile the VMware-vSphere-Perl-SDK with <em>perl Makefile.PL and make</em></p>
<p>8) Symlink or copy the VMware directory that was just created in<em> /usr/local/lib64/perl5</em></p>
<p>9) You are ready to use the perl scripts present in SDK, in theory :))</p>
<p>10) In practice you might have self signed certificates and you need to tweak again some things.</p>
<p>The error :</p>
<pre><em>apps/general/connect.pl --server 1.1.1.1 --username root --password xxxxx</em>
<em>Server version unavailable at 'https://1.1.1.1:443/sdk/vimService.wsdl' at /usr/local/lib64/perl5/VMware/VICommon.pm line 735.</em></pre>
<p>To find the real reason you can add before line 735 something like:</p>
<pre>die $response-&gt;content . "\n";</pre>
<p>Now the error will be :</p>
<pre><em>Can't connect to 89.34.110.253:443 (certificate verify failed)</em>

<em>SSL connect attempt failed error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed at /usr/lib64/perl5/vendor_perl/5.24.1/LWP/Protocol/http.pm line 49.</em></pre>
<p>You will find on internet different solution like adding the fallowing:</p>
<pre>$ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS} = 'Net::SSL'; 
$ENV{'PERL_LWP_SSL_VERIFY_HOSTNAME'} = 0;</pre>
<p>The problem with these commands is that either don&#8217;t work or are exposing you to man-in-the-middle attack.</p>
<p>A better solution is to download the certificates from the vCenter and use them. More exactly on the initial page of vCenter you have a link named: <em>Download trusted root CA certificates.</em> Download, unzip it and copy it to <em>/etc/ssl/certs/.</em></p>
<p>An even better solution is to have/buy certificates but this will not be fallowed here. You can find plenty of tutorials on internet for this.</p>
<p>11) Finally we made it.</p>
<pre>apps/general/connect.pl --server 1.1.1.1 --username root --password xxxxx

Connection Successful
Server Time : 2019-06-07T11:20:28.101016Z</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://random.sphere.ro/nagios-vmware-vsphere-vmware-perl-sdk-6-5-on-gentoo-linux/">Nagios, VMware/vSphere, VMware Perl SDK 6.5 on Gentoo Linux</a> appeared first on <a rel="nofollow" href="https://random.sphere.ro">Random thoughts</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://random.sphere.ro/nagios-vmware-vsphere-vmware-perl-sdk-6-5-on-gentoo-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
