<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>common-criteria · Paolo Stivanin</title><link>https://paolostivanin.github.io/tags/common-criteria/</link><description>Security QA engineer. FIPS, Common Criteria, openQA, and flaky tests.</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 01 Dec 2026 10:00:00 +0100</lastBuildDate><atom:link href="https://paolostivanin.github.io/tags/common-criteria/index.xml" rel="self" type="application/rss+xml"/><item><title>My IPsec test was pinging itself</title><link>https://paolostivanin.github.io/work/my-ipsec-test-was-pinging-itself/</link><pubDate>Tue, 01 Dec 2026 10:00:00 +0100</pubDate><guid>https://paolostivanin.github.io/work/my-ipsec-test-was-pinging-itself/</guid><category>security</category><category>openqa</category><category>ipsec</category><category>common-criteria</category><description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Our Common Criteria IPsec test reported every allowed ESP cipher as&#10;working. The check behind it was a ping to the client's own address, which&#10;works with or without a tunnel. The test now passes a cipher only if strongSwan&#10;built the SA with that cipher and real traffic went through it&#10;(&lt;a href="https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/27417"&gt;#27417&lt;/a&gt;).&lt;/p&gt;&#10;&lt;h2 id="what-was-wrong"&gt;What was wrong&lt;/h2&gt;&#10;&lt;p&gt;SUSE Linux Enterprise is Common Criteria certified. Part of the evidence is that&#10;IPsec accepts the ciphers the security target allows and refuses the others. In&#10;openQA this is the &lt;code&gt;cc_ipsec&lt;/code&gt; test: two machines, a strongSwan server and a&#10;client, trying one cipher proposal after another.&lt;/p&gt;&#10;&lt;p&gt;The client asks the server for a virtual IP. The server's pool is&#10;192.168.250.0/24, so the client always gets 192.168.250.1. After each proposal&#10;the test checked the connection like this:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-perl" data-lang="perl"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Test the IPSec connection&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;assert_script_run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;ping -W1 -c1 192.168.250.1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;192.168.250.1 is the client itself. That ping succeeds whatever happens to the&#10;tunnel.&lt;/p&gt;&#10;&lt;p&gt;So the allowed ESP cases passed even when the server had answered&#10;&lt;code&gt;NO_PROPOSAL_CHOSEN&lt;/code&gt; and no CHILD_SA existed. The CHILD_SA is the IPsec SA that&#10;actually carries the traffic. The weak 3DES case looked right for another wrong&#10;reason: the server rejected it during IKE_SA_INIT, before it ever looked at the&#10;ESP proposal.&lt;/p&gt;&#10;&lt;p&gt;A green run proved that IKE worked. It proved nothing about the ESP ciphers,&#10;which is what the test is named after.&lt;/p&gt;&#10;&lt;h2 id="how-i-found-it"&gt;How I found it&lt;/h2&gt;&#10;&lt;p&gt;I was reviewing the IPsec modules for a planned refactor, and read the&#10;strongSwan logs of &lt;em&gt;passing&lt;/em&gt; jobs to have a baseline. Every allowed ESP case logged&#10;&lt;code&gt;no CHILD_SA built&lt;/code&gt;, and the test printed Okay right after. The only other check&#10;counted &lt;code&gt;Security Associations (1 up&lt;/code&gt;, and that line counts the IKE SA.&lt;/p&gt;&#10;&lt;h2 id="the-fix"&gt;The fix&lt;/h2&gt;&#10;&lt;p&gt;The cipher cases were shell loops. They are now Perl, and each case has to&#10;prove its result:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;A pass needs a CHILD_SA with the expected proposal, and a ping to the server&#10;(192.168.100.1) through it. The audit log must have the SPD and SAD records&#10;for add and delete.&lt;/li&gt;&#10;&lt;li&gt;A refusal needs the expected reason, at the expected stage.&lt;/li&gt;&#10;&lt;li&gt;The server accepts the proposals of all cases from the start. That removed a&#10;server restart in the middle of the test and two synchronisation points.&lt;/li&gt;&#10;&lt;li&gt;In FIPS mode the kernel disables &lt;code&gt;rfc4543(gcm(aes))&lt;/code&gt;, so ESP AES-GMAC must&#10;fail there. A new server module checks in the journal that the kernel refused&#10;it, so a proposal mismatch can't pass for the same thing.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="result"&gt;Result&lt;/h2&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Before&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;After&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&amp;quot;Allowed&amp;quot; ESP case passes when&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;the client can ping itself&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;a CHILD_SA with that proposal carries traffic&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Weak cipher refused at&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;IKE_SA_INIT, for the wrong reason&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;the ESP proposal, with the expected error&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Server restarts mid-test&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;1&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;0&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;Verification runs covered x86_64, aarch64 and s390x, SLE 15-SP4 to 15-SP7.&lt;/p&gt;&#10;&lt;p&gt;Kernel 5.14, used by 15-SP4 and 15-SP5, logs the same GMAC refusal with a&#10;different message than kernel 6.4. A follow-up,&#10;&lt;a href="https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/27440"&gt;#27440&lt;/a&gt;,&#10;makes the check match the error number instead of the text, so it gives the&#10;same answer on every supported service pack.&lt;/p&gt;&#10;&lt;h2 id="also-fixed-in-november"&gt;Also fixed in November&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/27415"&gt;#27415&lt;/a&gt;:&#10;the same IPsec test was flaky on s390x. Every s390x run used the same IP&#10;pair on a shared network, so two runs at the same time answered each other's&#10;traffic. The client failed in 3.7% of the runs that had no other cluster&#10;running at the same time, and in 35.8% of the runs that did. Each cluster now&#10;derives its own pair from the job ID and checks with &lt;code&gt;arping&lt;/code&gt; that it's free.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/27249"&gt;#27249&lt;/a&gt;:&#10;the FTPS test failed now and then on uploads over TLS 1.3. lftp 4.9.2 leaves&#10;the server's session tickets unread, so the kernel resets the connection and&#10;the TLS close_notify is lost. While there: a hash mismatch only painted the&#10;step red without failing the test, and lftp's batch script exited 0 without&#10;running its commands.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/27271"&gt;#27271&lt;/a&gt;:&#10;every Python test run by openQA's agnostic test runner produced an XUnit&#10;suite called &lt;code&gt;pytest&lt;/code&gt;. With two of them in one job, one result stayed &lt;code&gt;none&lt;/code&gt;&#10;and the job failed with all tests green. This hit other teams' schedules too.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/27331"&gt;#27331&lt;/a&gt;:&#10;on SLE 16.0, postfix rewrites &lt;code&gt;main.cf&lt;/code&gt; the first time it starts. The mail&#10;test configured TLS first and started postfix after, so its settings were&#10;wiped and every STARTTLS failed.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/27514"&gt;#27514&lt;/a&gt;:&#10;review of the lynis hardening checks. A quoting bug made the exception&#10;&lt;code&gt;UNSAFE*&lt;/code&gt; mean &amp;quot;UNSAF followed by any number of E&amp;quot;. Before changing the logic&#10;I replayed it offline on 1,534 real report sections: the old code matched&#10;openQA on 1,533, and the new code moved 8 from soft-fail to ok and none the&#10;other way.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;hr&gt;&#10;&lt;p&gt;&lt;strong&gt;How this was made&lt;/strong&gt;&lt;br&gt;&#10;AI help: an AI agent parsed and correlated the strongSwan logs of the passing&#10;jobs, which is where the missing CHILD_SAs showed up.&lt;br&gt;&#10;Code: reviewed line by line by me, like any other patch, and checked in&#10;verification runs.&lt;/p&gt;&#10;</description></item></channel></rss>