Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

RSS

osquery (16) Versions 1.5.5

Install and configure osquery (osquery.io)

Berkshelf/Librarian
Policyfile
Knife
cookbook 'osquery', '= 1.5.5'
cookbook 'osquery', '= 1.5.5', :supermarket
knife cookbook site install osquery
knife cookbook site download osquery
README
Dependencies
Changelog
Quality

osquery chef cookbook

Build Status Cookbook Version

  • Installs, configures, and starts osquery.

Supported Platforms

  • OS X
    • 10.10+
  • Ubuntu
    • 12.04
    • 14.04
  • Centos/Redhat
    • 6.5+
    • 7.0+

Attributes

attributes/default.rb:
name type default description
['osquery']['version'] String 1.8.1 osquery version to install
['osquery']['packs'] Array %w(incident-response osx-attacks) packs to install
['osquery']['pack_source'] String osquery cookbook to load osquery packs from
['osquery']['audit']['enabled'] Boolean true enable/disable chef audits
['osquery']['repo']['internal'] Boolean false enable/disable the use the facebook repo
['osquery']['syslog']['enabled'] Boolean true enable syslog tables
['osquery']['syslog']['filename'] String /etc/rsyslog.d/60-osquery.conf syslog conf file path
['osquery']['syslog']['pipe_user'] String root syslog pipe user
['osquery']['syslog']['pipe_group'] String root syslog pipe group
attributes/config.rb:
name type default description
['osquery']['options']['config_plugin'] String filesystem configuration plugin
['osquery']['options']['logger_plugin'] String filesystem logger plugin
['osquery']['options']['schedule_splay_percent'] Fixnum 10 query schedule splay percentage
['osquery']['options']['events_expiry'] Fixnum 3600 timeout to expire eventing pubsub results
['osquery']['options']['verbose'] Boolean false enable verbose informational messages
['osquery']['options']['worker_threads'] Fixnum 2 number of work dispatch threads
['osquery']['options']['enable_monitor'] Boolean false enable schedule monitor
['osquery']['options']['syslog_pipe_path'] String /var/osquery/syslog_pipe_test syslog pipe path
attributes/schedule.rb:
name type default description
['osquery']['schedule'] Hash osquery_info osquery scheduled queries
attributes/file_paths.rb:
name type default description
['osquery']['fim_enabled'] Boolean false enable/disable file event tracking in config
['osquery']['file_paths'] Hash homes, etc, and tmp file paths to monitor events from
attributes/decorators.rb:
name type default description
['osquery']['decorators'] Hash {} load, always, or interval decorator queries

Custom Resources

osquery_conf: creates osquery config from selected options and packs
  • actions: :create or :delete
  • schedule: (required) Hash of scheduled queries to run
  • fim_paths: (optional) Hash of file integrity monitoring path descriptions and array of their paths
  • packs: (optional) List of osquery packs to install. Based on filenames ending in *.conf in pack_source/packs
  • pack_source: (optional) Cookbook source for osquery packs
  • The daemon configuration is compiled from the node['osquery']['options'] attributes.

create:

osquery_conf osquery_config_path do
  action      :create
  schedule    node['osquery']['schedule']
  fim_paths   node['osquery']['file_paths']
  packs       node['osquery']['packs']
  pack_source node['osquery']['pack_source']
  decorators  node['osquery']['decorators']
end

delete:

osquery_conf 'delete osquery config' do
  action :delete
end
osquery_install: installs osquery on centos/redhat, ubuntu, or os x
  • actions:
    • :install_ubuntu, :install_centos, :install_os_x
    • :remove_ubuntu, :remove_centos, :remove_os_x
  • version: (required - name attribute) string of the osquery version to install

install:

osquery_install node['osquery']['version'] do
  action :install_ubuntu
end

remove:

osquery_install node['osquery']['version'] do
  action :remove_ubuntu
end
osquery_syslog: creates osquery syslog config file
  • actions: :create or :delete
  • filename: (required - name attribute) filename of the osquery syslog config
  • note: this resource installs rsyslog if not already configured

install:

osquery_syslog node['osquery']['syslog']['filename'] do
  action   :create
  only_if  { node['osquery']['syslog']['enabled'] }
  notifies :restart, "service[#{osquery_daemon}]"
end

delete:

osquery_syslog node['osquery']['syslog']['filename'] do
  action   :delete
  notifies :restart, "service[#{osquery_daemon}]"
end

Testing

Run $ rake to execute: * foodcritic * rubocop * chefspec

Requirements: VirtualBox with Extension Pack (for the OS X vm) * $ kitchen list to show integration test suites <br /> * $ kitchen converge to run test suites

Note: Audit mode is enabled in the Kitchen yaml by default. The tests are found in ./recipes/audit.rb and run post converge. To disable, override the node['osquery']['audit']['enabled'] attribute to false.

Usage

  • Include osquery in your node's run_list
  • Override attributes to fit your desired setup

Contributing

  1. Fork the repository on Github.
  2. Create a named feature branch (like add_component_x).
  3. Write your change.
  4. Write tests for your change.
  5. Run the tests, ensuring they all pass (rubocop; rspec).
  6. Submit a Pull Request using Github.

License and Authors

Copyright 2013-2014 Jack Naglieri <jacknagzdev@gmail.com>

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.

Dependent cookbooks

apt >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

osquery CHANGELOG

This file is used to list changes made in each version of the osquery cookbook.

0.1.0

  • [jack naglieri] - Initial release of osquery

0.2.0

  • [jack naglieri] - Dynamic osquery config template

Check the Markdown Syntax Guide for help with Markdown.

The Github Flavored Markdown page describes the differences between markdown on github and standard markdown.

Collaborator Number Metric
            

1.5.5 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Foodcritic Metric
            

1.5.5 failed this metric

FC024: Consider adding platform equivalents: /tmp/5337ae4cce259493dbeaf239/osquery/libraries/helpers.rb:13
FC024: Consider adding platform equivalents: /tmp/5337ae4cce259493dbeaf239/osquery/libraries/helpers.rb:26
FC024: Consider adding platform equivalents: /tmp/5337ae4cce259493dbeaf239/osquery/libraries/helpers.rb:35
FC024: Consider adding platform equivalents: /tmp/5337ae4cce259493dbeaf239/osquery/libraries/helpers.rb:44
FC024: Consider adding platform equivalents: /tmp/5337ae4cce259493dbeaf239/osquery/recipes/audit.rb:45