Skip to content

Version 2.3.4 on supermarket fails to configure /etc/audit/auditd.conf on redhat systems #57

Open
@foobarbam

Description

@foobarbam

Cookbook version

2.3.4

Chef-client version

13.6.4

Platform Details

centos 7.4.1708

Scenario:

The changes detailed at 84c30ce#diff-3145628960d821e12b5cc7c0cb6d1b39 didn't make it into version 2.3.4 released on supermarket at https://supermarket.chef.io/cookbooks/auditd so berks caches version 2.3.4 of the cookbook from supermarket which doesn't have this fix.

Steps to Reproduce:

  1. Create wrapper cookbook
  2. add default['auditd']['ruleset'] = 'cis' to attributtes/default.rb
  3. add include_recipe 'auditd::conf to recipes/default.rb
  4. Add depends 'auditd', '~> 2.3.4' to metadata.rb
  5. run berks install
  6. configure .kitchen.yml to have a centos 7 VM
  7. run kitchen converge centos-7

Expected Result:

/etc/audit/auditd.conf is updated when running the auditd::confrecipe on centos/redhat instead of /etc/audit/cis.auditd.

Actual Result:

Does not configure /etc/audit/auditd.conf instead configuring /etc/audit/cis.auditd

Snippet detailing the errant configuration file path

       Recipe: auditd::conf
         * auditd_conf_file[cis.auditd] action create
           * template[/etc/audit/cis.auditd] action create
             - create new file /etc/audit/cis.auditd
             - update content in file /etc/audit/cis.auditd from none to 64477b
             --- /etc/audit/cis.auditd	2019-02-06 20:40:55.410125292 +0000

Reviewing the berkshelf cache:

[[email protected]]$ cat ~/.berkshelf/cookbooks/auditd-2.3.4/resources/conf_file.rb 
#
# Cookbook:: auditd
# Resource:: auditd_conf_file
#
# Copyright:: 2018, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

property :cookbook, String

action :create do
  extend AuditD::Helper

  template auditd_conffile(new_resource.name) do
    source "#{new_resource.name}.conf.erb"
    cookbook new_resource.cookbook if new_resource.cookbook
    notifies :reload, 'service[auditd]'
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions