<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 9/3/14, 8:06 AM, Martin Preisler
      wrote:<br>
    </div>
    <blockquote
      cite="mid:1942589189.17787290.1409745973093.JavaMail.zimbra@redhat.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-unicode">
        <pre wrap="">----- Original Message -----
</pre>
        <blockquote type="cite" style="color: #000000;">
          <pre wrap=""><span class="moz-txt-citetags">&gt; </span>From: "Shawn Wells" <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:shawn@redhat.com">&lt;shawn@redhat.com&gt;</a>
<span class="moz-txt-citetags">&gt; </span>To: "scap-security-guide" <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:scap-security-guide@lists.fedorahosted.org">&lt;scap-security-guide@lists.fedorahosted.org&gt;</a>
<span class="moz-txt-citetags">&gt; </span>Sent: Wednesday, September 3, 2014 6:31:00 AM
<span class="moz-txt-citetags">&gt; </span>Subject: Test run of Jenkins (CI tool)
<span class="moz-txt-citetags">&gt; </span>
<span class="moz-txt-citetags">&gt; </span>Also in the vein of automation, went ahead and installed an instance of
<span class="moz-txt-citetags">&gt; </span>Jenkins and connected it to SSG:
<span class="moz-txt-citetags">&gt; </span>
<span class="moz-txt-citetags">&gt; </span><a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://jenkins.ssgproject.org:8080/">http://jenkins.ssgproject.org:8080/</a>
<span class="moz-txt-citetags">&gt; </span>
<span class="moz-txt-citetags">&gt; </span>Not meant to be permanent right now, but wanted to get something stood
<span class="moz-txt-citetags">&gt; </span>up for us to play with. Martin stood one up for the OpenSCAP
<span class="moz-txt-citetags">&gt; </span>interpreter, which was the source of thinking to stand up a sandbox for
<span class="moz-txt-citetags">&gt; </span>SSG too. There really isn't much to see in the UI, but one thing it does
<span class="moz-txt-citetags">&gt; </span>is integrate into GitHub. Whenever someone issues a pull request,
<span class="moz-txt-citetags">&gt; </span>Jenkins will automagically detect that, apply the patch(s), and run
<span class="moz-txt-citetags">&gt; </span>"make validate."
</pre>
        </blockquote>
        <pre wrap="">I wanted to create a testing Jenkins instance for all things OpenSCAP.
There are fixed costs in maintaining the master and all the slaves.
You have to take care of the machines, keep them updated, etc... You
have to keep updating Jenkins itself and be on top of plugin updates.

In my opinion it makes no sense to have 2 Jenkins servers for projects
so closely related. I would prefer to pool resources.

Unfortunately we can't just host our Jenkins on OpenShift because we need
multiple slaves for RHEL 5, 6, 7 and Fedora. And the storage space available
is not enough for our use-case.

</pre>
        <blockquote type="cite" style="color: #000000;">
          <pre wrap=""><span class="moz-txt-citetags">&gt; </span>Check out <a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://github.com/OpenSCAP/scap-security-guide/pull/45">https://github.com/OpenSCAP/scap-security-guide/pull/45</a> for an
<span class="moz-txt-citetags">&gt; </span>example. Or for the lazy <span class="moz-smiley-s1" title=":-)"><span>:-)</span></span>, see below:
</pre>
        </blockquote>
        <pre wrap="">The integration is really cool. I planned to make the Jenkins instance
public after a testing period and do exactly this.</pre>
      </div>
    </blockquote>
    <br>
    Didn't mean to jump the gun to much. I'm just an impatient bastard
    and wanted to get the conversation started on the list (with full
    recognition it's just a test run, we'll figure out how to converge
    everything together, etc).<br>
    <br>
    <br>
    <blockquote
      cite="mid:1942589189.17787290.1409745973093.JavaMail.zimbra@redhat.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-unicode">
        <blockquote type="cite" style="color: #000000;">
          <pre wrap=""><span class="moz-txt-citetags">&gt; </span>Does anyone have experience with Jenkins,  thoughts on how we could
<span class="moz-txt-citetags">&gt; </span>begin building out unit tests, or really any thoughts on usefulness
<span class="moz-txt-citetags">&gt; </span>beyond "make validate" on pull requests?
</pre>
        </blockquote>
        <pre wrap="">I was experimenting with docker for this purpose. The idea was to start
with EL6 image, put ssg and a test script inside. Then you can call
docker run and get the results. The docker instance is deleted after
each run so there is no risk of side effects.

The idea is to do the following:
1) pull ssg HEAD

2) make content

3) generate a profile with just one Rule selected - the tested rule
   (a simple python script can easily do this)

4) evaluate that profile, compare the results with expected results on a
   freshly installed RHEL6

5) anti-remediate - break the configuration (if applicable)

6) evaluate again, check that the result is "fail" (if applicable)

7) remediate - fix the configuration (if applicable)

8) evaluate for the third time, check that the rule passes

*) as an added bonus we could run whatever we are testing, let it
   parse the config files and do another sanity check (sshd for example)

This should provide repeatable tests for all the rules.

Unfortunately we can't do this on OpenShift (AFAIK). We need real
slaves with docker-io installed on them. Another problem is that we can
not test every single rule with this approach. "process test" comes to
mind. Or even systemd tests. However we should be able to test most of
the rules.

<div class="moz-txt-sig">-- 
Martin Preisler
<div class="moz-txt-sig">-- 
SCAP Security Guide mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:scap-security-guide@lists.fedorahosted.org">scap-security-guide@lists.fedorahosted.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide">https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://github.com/OpenSCAP/scap-security-guide/">https://github.com/OpenSCAP/scap-security-guide/</a></div></div></pre>
      </div>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Shawn Wells
Director, Innovation Programs
<a class="moz-txt-link-abbreviated" href="mailto:shawn@redhat.com">shawn@redhat.com</a> | 443.534.0130
@shawndwells

</pre>
  </body>
</html>