Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple security and misc updates: #9

Merged
merged 1 commit into from
Jul 19, 2018

Conversation

majormoses
Copy link
Member

@majormoses majormoses commented Jul 6, 2018

  • removed ruby < 2.3 support
  • updated yard dependency to ~> 0.9.11 per
  • updated rubocop dependency to ~> 0.51.0per
  • bumped dependency of sensu-plugin to ~> 2.5 you can read about it here
  • appeased the cops
  • removed gemnasium badge
  • added slack badge

Signed-off-by: Ben Abrams me@benabrams.it

Pull Request Checklist

General

- [ ] Update README with any necessary configuration snippets

- [ ] Binstubs are created if needed

  • RuboCop passes

  • Existing tests pass

Testing Artifacts

check-lv-usage.rb:

$ bundle exec ./bin/check-lv-usage.rb 
CheckLVUsage UNKNOWN: An error occured getting the LVM info: got empty list of volumes.
Check to ensure sensu has been configured with appropriate permissions.
On linux systems it will generally need to allow executing `/sbin/lvm`

$ sudo /opt/chefdk/embedded/bin/ruby ./bin/check-lv-usage.rb 
[sudo] password for babrams: 
CheckLVUsage OK: All logical volume data usage under 85% and metadata usage under 85%

check-vg-usage.rb:

$ sudo /opt/chefdk/embedded/bin/ruby ./bin/check-vg-usage.rb 
CheckVg CRITICAL: ubuntu-vg 100.0% bytes usage (475/475)

$ bundle exec ./bin/check-vg-usage.rb 
Check failed to run: Fatal error, ` pvs --verbose --separator=^ --noheadings --nosuffix --units=b --unbuffered --options dev_size,pe_start,pv_allocatable,pv_attr,pv_ba_size,pv_ba_start,pv_duplicate,pv_exported,pv_ext_vsn,pv_fmt,pv_free,pv_in_use,pv_major,pv_mda_count,pv_mda_free,pv_mda_size,pv_mda_used_count,pv_minor,pv_missing,pv_name,pv_pe_alloc_count,pv_pe_count,pv_size,pv_tags,pv_used,pv_uuid,vg_uuid` returned 5 with 'WARNING: Running as a non-root user. Functionality may be unavailable.
  /run/lvm/lvmetad.socket: access failed: Permission denied
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.
  /run/lock/lvm/P_global:aux: open failed: Permission denied
  Unable to obtain global lock.', ["/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/chef-ruby-lvm-0.3.0/lib/lvm/external.rb:19:in `cmd'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/chef-ruby-lvm-0.3.0/lib/lvm/wrapper/pvs.rb:33:in `list'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/chef-ruby-lvm-0.3.0/lib/lvm/physical_volumes.rb:21:in `each'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/chef-ruby-lvm-0.3.0/lib/lvm/physical_volumes.rb:31:in `list'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/chef-ruby-lvm-0.3.0/lib/lvm/volume_groups.rb:26:in `each'", "./bin/check-vg-usage.rb:75:in `volume_groups'", "./bin/check-vg-usage.rb:128:in `run'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sensu-plugin-2.5.0/lib/sensu-plugin/cli.rb:57:in `block in <class:CLI>'"]

metrics-vg-usage.rb:

$ bundle exec ./bin/metrics-vg-usage.rb 
Check failed to run: Fatal error, ` pvs --verbose --separator=^ --noheadings --nosuffix --units=b --unbuffered --options dev_size,pe_start,pv_allocatable,pv_attr,pv_ba_size,pv_ba_start,pv_duplicate,pv_exported,pv_ext_vsn,pv_fmt,pv_free,pv_in_use,pv_major,pv_mda_count,pv_mda_free,pv_mda_size,pv_mda_used_count,pv_minor,pv_missing,pv_name,pv_pe_alloc_count,pv_pe_count,pv_size,pv_tags,pv_used,pv_uuid,vg_uuid` returned 5 with 'WARNING: Running as a non-root user. Functionality may be unavailable.
  /run/lvm/lvmetad.socket: access failed: Permission denied
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.
  /run/lock/lvm/P_global:aux: open failed: Permission denied
  Unable to obtain global lock.', ["/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/chef-ruby-lvm-0.3.0/lib/lvm/external.rb:19:in `cmd'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/chef-ruby-lvm-0.3.0/lib/lvm/wrapper/pvs.rb:33:in `list'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/chef-ruby-lvm-0.3.0/lib/lvm/physical_volumes.rb:21:in `each'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/chef-ruby-lvm-0.3.0/lib/lvm/physical_volumes.rb:31:in `list'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/chef-ruby-lvm-0.3.0/lib/lvm/volume_groups.rb:26:in `each'", "./bin/metrics-vg-usage.rb:62:in `volume_groups'", "./bin/metrics-vg-usage.rb:86:in `run'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sensu-plugin-2.5.0/lib/sensu-plugin/cli.rb:57:in `block in <class:CLI>'"]

$ sudo /opt/chefdk/embedded/bin/ruby ./bin/metrics-vg-usage.rb 
babrams-ThinkPad-X1-Carbon-5th.vg_usage.ubuntu-vg.used 511054970880 1530863560
babrams-ThinkPad-X1-Carbon-5th.vg_usage.ubuntu-vg.avail 0 1530863560
babrams-ThinkPad-X1-Carbon-5th.vg_usage.ubuntu-vg.used_percentage 100.0 1530863560

Purpose

Address multiple CVE's, misc clearnup

Known Compatablity Issues

  • Removes Ruby < 2.3 support
  • disables in event filtering (not really relevant since there are no handlers)

Copy link
Member

@jaredledvina jaredledvina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@majormoses majormoses force-pushed the feature/remove-ruby-less-than-2.3 branch from 400ae89 to af6690e Compare July 8, 2018 19:41
- removed ruby `< 2.3` support
- updated yard dependency to `~> 0.9.11` [per](https://nvd.nist.gov/vuln/detail/CVE-2017-17042)
- updated rubocop dependency to `~> 0.51.0`[per](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8418)
- bumped dependency of `sensu-plugin` to `~> 2.5` you can read about it [here](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#v145---2017-03-07)
- appeased the cops
- removed gemnasium badge
- added slack badge

Signed-off-by: Ben Abrams <me@benabrams.it>
@majormoses majormoses force-pushed the feature/remove-ruby-less-than-2.3 branch from af6690e to 749a534 Compare July 8, 2018 19:42
@majormoses majormoses merged commit 997e2f4 into master Jul 19, 2018
@majormoses
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants