Write fast, secure, easily upgradable InSpec
OTHER License
/* Copyright (C) Nick Schwaderer - All Rights Reserved
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file lib/rubocop/inspecstyle
. To experiment with that code, run bin/console
for an interactive prompt.
https://rubydoc.info/gems/inspecstyle
Add this line to your application's Gemfile:
gem 'inspecstyle', require: false
And then execute:
$ bundle install
Or install it yourself as:
$ gem install inspecstyle
InSpecStyle integrates with rubocop to lint your InSpec code.
#.rubocop.yml
require:
- inspecstyle
This gem must be installed to use the InSpecStyle atom linter package.
To only run these cops on your local rubocop run, execute:
rubocop . --only InSpecStyle
inspecstyle.guide
atom
package: [
its('minimum_days_between_password_change') { should eq 0 } becomes 'mindays'
its('maximum_days_between_password_change') { should eq 0 } becomes 'maxdays'
Inspec.deprecate(:resource_user_serverspec_compat, "The user resource `has_home_directory?` matcher is deprecated. Please use `its('home')`.")
Inspec.deprecate(:resource_user_serverspec_compat, "The user resource `has_authorized_key?` matcher is deprecated. There is no currently implemented alternative")
shadow resource deprecations
(e.g.)
describe shadow('/etc/my-custom-place/shadow') do
its('count') { should eq 32 }
end
property deprecations:
user -> users
password -> passwords
last_change -> last_changes
expiry_date -> expiry_dates
lines (no replacement)
e.g.
sql = oracledb_session(user: 'my_user', pass: 'password')
describe sql.query(\"SELECT UPPER(VALUE) AS VALUE FROM V$PARAMETER WHERE UPPER(NAME)='AUDIT_SYS_OPERATIONS'\").row(0).column('value') do
its('value') { should eq 'TRUE' }
end
oracledb_session deprecated `pass`, use `password` instead
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/schwad/inspecstyle. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the Rubocop::InSpecStyle project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.