macos_install

in chef/cookbooks/cpe_osquery/resources/cpe_osquery.rb [100:132]


  def macos_install
    ld_label = 'com.facebook.osqueryd'
    receipt = osquery_pkg['receipt']

    
    execute "/usr/sbin/pkgutil --forget #{receipt}" do
      not_if { macos_osquery_file_integrity_healthy? }
      not_if { shell_out("/usr/sbin/pkgutil --pkg-info #{receipt}").error? }
      notifies :disable, "launchd[#{ld_label}]", :immediately
    end

    cpe_remote_pkg 'osquery' do
      app pkg_name
      version pkg_version
      checksum pkg_checksum
      receipt receipt
      if ::File.exists?("/Library/LaunchDaemons/#{ld_label}.plist")
        notifies :restart, "launchd[#{ld_label}]", :immediately
      end
    end

    
    syslog_conf = 'com.facebook.osqueryd.conf'
    syslog_conf_path = ::File.join('/etc/newsyslog.d', syslog_conf)
    cookbook_file syslog_conf_path do
      source syslog_conf
    end
    
    launchd ld_label do
      action :nothing
    end
  end