{"id":221,"date":"2018-10-17T06:08:21","date_gmt":"2018-10-17T06:08:21","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/katello-security-compliance-management-with-openscap-lisenet-com-linux-security\/"},"modified":"2018-10-17T06:08:21","modified_gmt":"2018-10-17T06:08:21","slug":"katello-security-compliance-management-with-openscap-lisenet-com-linux-security","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/katello-security-compliance-management-with-openscap-lisenet-com-linux-security\/","title":{"rendered":"Katello: Security Compliance Management with OpenSCAP | Lisenet.com :: Linux | Security"},"content":{"rendered":"<p>Working with Katello \u2013 part 6. We will configure OpenSCAP plugin to receive automated vulnerability assessment and security compliance audits from Foreman hosts. <\/p>\n<p>This article is part of the <a href=\"https:\/\/www.lisenet.com\/2018\/homelab-project-with-kvm-katello-and-puppet\/\" target=\"_blank\">Homelab Project with KVM, Katello and Puppet<\/a> series.<\/p>\n<h2>Homelab<\/h2>\n<p>We have Katello installed on a CentOS 7 server:<\/p>\n<p>katello.hl.local (10.11.1.4) \u2013 see <a href=\"https:\/\/www.lisenet.com\/2016\/install-katello-on-centos-7\/\" target=\"_blank\">here<\/a> for installation instructions<\/p>\n<p>See the image below to identify the homelab part this article applies to.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"793\" src=\"https:\/\/www.lisenet.com\/wp-content\/uploads\/2018\/04\/lisenet-homelab-diagram_katello.png\" width=\"1200\" \/><\/p>\n<h2>OpenSCAP<\/h2>\n<p>The Security Content Automation Protocol (SCAP) enables the definition of configuration and security policies, also the means of auditing for compliance with those policies. In Foreman, SCAP is implemented with the tools provided by the OpenSCAP project.<\/p>\n<p>The OpenSCAP plugin enables Foreman to receive automated vulnerability assessment and security compliance audits from Foreman hosts. We can upload SCAP compliance contents, create compliance policies out of them and assign the policies to hosts or hostgroups.<\/p>\n<h2>Installation<\/h2>\n<p>Detailed installation instructions can be found on the Foreman website. See references for a weblink.<\/p>\n<p>We need to install the following:<\/p>\n<ol>\n<li>Foreman OpenSCAP (foreman_openscap).<\/li>\n<li>Smart Proxy OpenSCAP (smart_proxy_openscap).<\/li>\n<li>foreman_scap_client.<\/li>\n<li>puppet-foreman_scap_client.<\/li>\n<\/ol>\n<h3>Install foreman_openscap<\/h3>\n<p># foreman-installer &#8211;enable-foreman-plugin-openscap<\/p>\n<h3>Install smart_proxy_openscap<\/h3>\n<p># foreman-installer &#8211;enable-foreman-proxy-plugin-openscap<\/p>\n<p>If you want to, you can modify \/etc\/foreman-proxy\/settings.d\/openscap.yml with custom settings.<\/p>\n<p>After installing smart_proxy_openscap on the proxy, refresh features of the proxy so it will register with OpenSCAP feature on the Foreman.<\/p>\n<h3>Install Puppet Module puppet-foreman_scap_client<\/h3>\n<p>This puppet module will automatically install foreman_scap_client and configure the client with all parameters needed for the operation of foreman_scap_client.<\/p>\n<p># puppet module install theforeman-foreman_scap_client &#8211;environment homelab&#xD;<br \/>\nNotice: Preparing to install into \/etc\/puppetlabs\/code\/environments\/homelab\/modules &#8230;&#xD;<br \/>\nNotice: Downloading from https:\/\/forgeapi.puppet.com &#8230;&#xD;<br \/>\nNotice: Installing &#8212; do not interrupt &#8230;&#xD;<br \/>\n\/etc\/puppetlabs\/code\/environments\/homelab\/modules&#xD;<br \/>\n\u2514\u2500\u252c theforeman-foreman_scap_client (v0.3.18)&#xD;<br \/>\n \u2514\u2500\u2500 puppetlabs-stdlib (v4.24.0)<\/p>\n<p>After installing the module, import new Puppet classes via Katello WebUI:<\/p>\n<p>Configure &gt; Puppet Classes &gt; Import environments from katello.hl.local<\/p>\n<h3>Setup Foreman Plugins Repository<\/h3>\n<p>Starting with puppet-foreman_scap_client 0.3.14 shipped with Foreman 1.14 the Foreman plugins yum repo can be set up if you define at least Foreman\u2019s major release version. This repository is needed to install foreman_scap_client, which will fail otherwise. <\/p>\n<p>Note that packages are not signed.<\/p>\n<p>Create a new repository and sync it:<\/p>\n<p># hammer repository create &#xD;<br \/>\n &#8211;product &#8220;el7_repos&#8221; &#xD;<br \/>\n &#8211;name &#8220;foreman-plugins-117&#8221; &#xD;<br \/>\n &#8211;label &#8220;foreman-plugins-117&#8221; &#xD;<br \/>\n &#8211;content-type &#8220;yum&#8221; &#xD;<br \/>\n &#8211;download-policy &#8220;on_demand&#8221; &#xD;<br \/>\n &#8211;url &#8220;https:\/\/yum.theforeman.org\/plugins\/1.17\/el7\/x86_64\/&#8221;<br \/>\n# hammer repository synchronize &#xD;<br \/>\n &#8211;name &#8220;foreman-plugins-117&#8221; &#xD;<br \/>\n &#8211;product &#8220;el7_repos&#8221;<\/p>\n<p>Add the new repository to the content view:<\/p>\n<p># hammer content-view add-repository &#xD;<br \/>\n &#8211;name &#8220;el7_content&#8221; &#xD;<br \/>\n &#8211;product &#8220;el7_repos&#8221; &#xD;<br \/>\n &#8211;repository &#8220;foreman-plugins-117&#8221;<\/p>\n<p>Publish a new version of the content view that includes the Foreman plugins repository:<\/p>\n<p># hammer content-view publish &#xD;<br \/>\n &#8211;name &#8220;el7_content&#8221; &#xD;<br \/>\n &#8211;description &#8220;Publishing foreman plugins 1.17&#8221;<\/p>\n<p>Let us see the version number that we want to promote:<\/p>\n<p># hammer content-view version list<\/p>\n<p>Promote content view version to our \u201cstable\u201d lifecycle environment:<\/p>\n<p># hammer content-view version promote &#xD;<br \/>\n &#8211;content-view &#8220;el7_content&#8221; &#xD;<br \/>\n &#8211;version &#8220;11.0&#8221; &#xD;<br \/>\n &#8211;to-lifecycle-environment &#8220;stable&#8221; &#xD;<br \/>\n &#8211;description &#8220;Publishing foreman plugins 1.17&#8221;<\/p>\n<p>At this point the new repository should be available to clients.<\/p>\n<h2>Usage<\/h2>\n<h3>Create Default SCAP Content<\/h3>\n<p>This following will search for scap-security-guide SCAP contents and create SCAP content on the Foreman.<\/p>\n<p># foreman-rake foreman_openscap:bulk_upload:default&#xD;<br \/>\nSaved \/usr\/share\/xml\/scap\/ssg\/content\/ssg-centos6-ds.xml as Red Hat centos6 default content&#xD;<br \/>\nSaved \/usr\/share\/xml\/scap\/ssg\/content\/ssg-centos7-ds.xml as Red Hat centos7 default content&#xD;<br \/>\nSaved \/usr\/share\/xml\/scap\/ssg\/content\/ssg-firefox-ds.xml as Red Hat firefox default content&#xD;<br \/>\nSaved \/usr\/share\/xml\/scap\/ssg\/content\/ssg-jre-ds.xml as Red Hat jre default content&#xD;<br \/>\nSaved \/usr\/share\/xml\/scap\/ssg\/content\/ssg-rhel6-ds.xml as Red Hat rhel6 default content&#xD;<br \/>\nSaved \/usr\/share\/xml\/scap\/ssg\/content\/ssg-rhel7-ds.xml as Red Hat rhel7 default content<\/p>\n<h3>Create Policy Wizard<\/h3>\n<p>Open Katello WebUI and navigate to the following:<\/p>\n<p>Hosts &gt; Compliance &gt; Policies &gt; New Compliance Policy<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"461\" src=\"https:\/\/www.lisenet.com\/wp-content\/uploads\/2018\/07\/lisenet-openscap-policy.png\" width=\"670\" \/><\/p>\n<p>Create a new policy and provide the following details:<\/p>\n<ol>\n<li>Name of the policy (e.g. homelab).<\/li>\n<li>Choose which SCAP content and SCAP profile to apply (e.g. STIG).<\/li>\n<li>Choose schedule when to run this policy (e.g. weekly on Sundays).<\/li>\n<li>Select which location \/ organization thes policy belongs to (e.g. Lisenet \/ HomeLab).<\/li>\n<li>Choose which hostgroups you wish to pply this policy to (e.g. el7_group).<\/li>\n<\/ol>\n<p>The result should look something like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"252\" src=\"https:\/\/www.lisenet.com\/wp-content\/uploads\/2018\/07\/lisenet-openscap-policy-done.png\" width=\"891\" \/><\/p>\n<p>This will assign the policy to the specified hostgroup. All hosts which belong to the hostgroup will automatically be assigned to the policy, and the Puppet class will be included.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"326\" src=\"https:\/\/www.lisenet.com\/wp-content\/uploads\/2018\/07\/lisenet-openscap-puppet-class.png\" width=\"399\" \/><\/p>\n<p>Open Katello WebUI, edit Host Group and specify OpenSCAP Proxy:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"517\" src=\"https:\/\/www.lisenet.com\/wp-content\/uploads\/2018\/07\/lisenet-openscap-proxy.png\" width=\"730\" \/><\/p>\n<p>Make sure that all hosts that are assigned to the hostgroup have OpenSCAP Proxy assigned.<\/p>\n<p>Hosts will get foreman_scap_client automatically installed and configured on the next Puppet agent run. There will be a cron file created \/etc\/cron.d\/foreman_scap_client_cron that runs according to the schedule that was chosen when creating the policy.<\/p>\n<h3>How to Run foreman_scap_client Manually<\/h3>\n<p>Check the content of the cron file on a host you want to run the client on (we use db1.hl.local):<\/p>\n<p>[db1]# cat \/etc\/cron.d\/foreman_scap_client_cron&#xD;<br \/>\n# DO NOT EDIT THIS FILE MANUALLY&#xD;<br \/>\n# IT IS MANAGED BY PUPPET&#xD;<br \/>\n&#xD;<br \/>\n# foreman_scap_client cron job&#xD;<br \/>\n&#xD;<br \/>\n# Runs foreman_scap_client 1&#xD;<br \/>\n0 1 * * 0 root \/usr\/bin\/foreman_scap_client 1 &gt; \/dev\/null<\/p>\n<p>Copy the line from the file and run:<\/p>\n<p>[db1]# \/usr\/bin\/foreman_scap_client 1&#xD;<br \/>\n[&#8230;]&#xD;<br \/>\nUploading results to https:\/\/katello.hl.local:9090\/compliance\/arf\/1<\/p>\n<p>Reports can be found here: Hosts &gt; Compliance &gt; Reports<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"229\" src=\"https:\/\/www.lisenet.com\/wp-content\/uploads\/2018\/07\/lisenet-openscap-report.png\" width=\"932\" \/><\/p>\n<h3>SCAP Workbench and Tailoring Files<\/h3>\n<p>Default SCAP policies may not suit your needs and can therefore be edited. SCAP Workbench is a graphical utility that offers an easy way of doing that.<\/p>\n<p>Workbench allows you to modify an XCCDF profile in an easy way without changing the respective XCCDF file. The tool provides a graphical way to enable or disable XCCDF elements. Your changes can be stored as an XCCDF tailoring file.<\/p>\n<h2>References<\/h2>\n<p><a href=\"https:\/\/www.theforeman.org\/plugins\/foreman_openscap\/0.8\/index.html\" target=\"_blank\">https:\/\/www.theforeman.org\/plugins\/foreman_openscap\/0.8\/index.html<\/a><\/p>\n<p><a href=\"https:\/\/www.open-scap.org\/tools\/scap-workbench\/\" target=\"_blank\">https:\/\/www.open-scap.org\/tools\/scap-workbench\/<\/a><\/p>\n<p> <a href=\"https:\/\/www.lisenet.com\/2018\/katello-security-compliance-management-with-openscap\/\" target=\"_blank\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Working with Katello \u2013 part 6. We will configure OpenSCAP plugin to receive automated vulnerability assessment and security compliance audits from Foreman hosts. This article is part of the Homelab Project with KVM, Katello and Puppet series. Homelab We have Katello installed on a CentOS 7 server: katello.hl.local (10.11.1.4) \u2013 see here for installation instructions &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/katello-security-compliance-management-with-openscap-lisenet-com-linux-security\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Katello: Security Compliance Management with OpenSCAP | Lisenet.com :: Linux | Security&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-221","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=221"}],"version-history":[{"count":0,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/221\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}