Commit graph

3547 commits

Author SHA1 Message Date
Grant Ridder
4daf948eec Converge inspec doesn't have yet from comma seperated list to bullet list
Signed-off-by: Grant Ridder <shortdudey123@gmail.com>
2017-05-01 10:10:40 -07:00
Grant Ridder
82a478f2ba Improve "Which Serverspec resources are available in InSpec?" doc
- Switch serverspec and inspec resource compare to a table and fix the links
- Add links for serverspec resources not in inspec

Serverspec to InSpec markdown table generated with:
```
mapping = {
  bond: 'bond',
  bridge: 'bridge',
  command: 'command',
  cron: 'crontab',
  docker_container: 'docker_container',
  docker_image: 'docker_image',
  file: 'file',
  group: 'group',
  host: 'host',
  interface: 'interface',
  iis_website: 'iis_website',
  iis_app_pool: 'iis_website',
  iptables: 'iptables',
  kernel_module: 'kernel_module',
  linux_kernel_parameter: 'kernel_parameter',
  mysql_config: 'mysql_conf',
  package: 'package',
  port: 'port',
  ppa: 'apt',
  process: 'processes',
  service: 'service',
  user: 'user',
  windows_feature: 'windows_feature',
  windows_registry_key: 'registry_key',
  x509_certificate: 'x509_certificate',
  yumrepo: 'yum',
  zfs: 'zfs_pool'
}

serverspec_base = 'http://serverspec.org/resource_types.html#'
inspec_base = "https://www.inspec.io/docs/reference/resources/"

serverspec_max = serverspec_base.length + mapping.max_by{|k,v| k.length}[0].length * 2 + 4
inspec_max = inspec_base.length + mapping.max_by{|k,v| v.length}[1].length * 2 + 5

serverspec_header_half = ' ' * ((serverspec_max - 'Serverspec'.length) / 2)
inspec_header_half = ' ' * ((inspec_max - 'InSpec'.length) / 2)

puts "| #{serverspec_header_half}Serverspec#{serverspec_header_half} | #{inspec_header_half}InSpec#{inspec_header_half} |"
puts "|:#{'-' * serverspec_max}:|:#{'-' * inspec_max}:|"

mapping.each do |serverspec, inspec|
  serverspec_text = "[#{serverspec}](#{serverspec_base}#{serverspec})"
  padding = serverspec_max - serverspec_text.length
  serverspec_string = serverspec_text + ' ' * padding

  inspec_text = "[#{inspec}](#{inspec_base}#{inspec}/)"
  padding = inspec_max - inspec_text.length
  inspec_string = inspec_text + ' ' * padding

  puts "| #{serverspec_string} | #{inspec_string} |"
end
```

Signed-off-by: Grant Ridder <shortdudey123@gmail.com>
2017-04-28 15:03:04 -07:00
Dominik Richter
935850a5b1 Merge pull request #1739 from chef/adamleff/flush-cache
[www] Add rake task for flushing Fastly cache
2017-04-28 21:48:36 +02:00
Adam Leff
d022faea81
Add rake task for flushing Fastly cache
inspec.io is now hosted by Fastly which operates as a caching reverse
proxy. This change adds a Rake task that will flush the cache at Fastly
if the API key and Service ID are set in the appropriate environment
variables.

Flushing the cache is not required, so this will not error out if the
environment variables aren't provided; the cache will eventually clear
on its own. This will simply speed along the process as needed.

Signed-off-by: Adam Leff <adam@leff.co>
2017-04-28 14:22:00 -04:00
Christoph Hartmann
ed137ae052 Merge pull request #1737 from chef/dr/deprecation-messages
rename old deprecations that were meant for 1.0
2017-04-28 12:40:13 +02:00
Dominik Richter
144dede6eb rename old deprecations that were meant for 1.0
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-04-28 12:09:24 +02:00
Dominik Richter
a7b8d2a117 Merge pull request #1734 from chef/adamleff/update-website-references
Update inspec.io references in docs/code
2017-04-28 00:49:43 +02:00
Adam Leff
a1769cc01b
Update inspec.io references in docs/code
The website is now at https://www.inspec.io - updating all inspec.io
references accordingly. :)

Signed-off-by: Adam Leff <adam@leff.co>
2017-04-27 18:05:51 -04:00
Adam Leff
9ac3db0c6a Merge pull request #1733 from chef/adamleff/release-1.22.0
Release v1.22.0
2017-04-27 17:30:32 -04:00
Adam Leff
2c5668ef16
Release v1.22.0
Signed-off-by: Adam Leff <adam@leff.co>
2017-04-27 17:27:58 -04:00
Adam Leff
c3ab00f74c Merge pull request #1730 from chef/adamleff/rake-updates-for-appbundle-updater
Rakefile updates to support appbundle-updater
2017-04-27 14:52:08 -04:00
Adam Leff
76e1d62ad3 Merge pull request #1731 from chef/adamleff/update-cname
Update GH Pages CNAME
2017-04-27 14:50:54 -04:00
Adam Leff
872574f661
Update GH Pages CNAME
GH pages is now an origin server with a new FQDN, "origin.inspec.io"

Signed-off-by: Adam Leff <adam@leff.co>
2017-04-27 14:48:32 -04:00
Adam Leff
3d272d280b
Rakefile updates to support appbundle-updater
InSpec is "appbundled" into the ChefDK which means users can't
simply run `chef gem install inspec` and get an updated InSpec.
`appbundle-updater` exists to combat this and, when run, will
pull the source and install the gem using `rake install`.

In the appbundle-updater config, we'll want to exclude unnecessary
gems from getting installed, such as the "tests" group. Our Rakefile
doesn't work without the "tests" group being installed.

This change makes the Rakefile usuable when the "tests" gems aren't
available.

Signed-off-by: Adam Leff <adam@leff.co>
2017-04-27 14:15:42 -04:00
Dominik Richter
a6eeb208b1 Merge pull request #1722 from chef/adamleff/matchers-shell-help
Add matchers help to shell, clean up help output
2017-04-27 01:28:59 +02:00
Adam Leff
42797b4231 Add matchers help to shell, clean up help output
A new `help matchers` command will provide helpful examples on a few
of the standard matchers: be, cmp, include, etc.

I also cleaned up the formatting of the resources list and provided
better feedback if a user requests help for an unknown resource.

Resolves #1684

Signed-off-by: Adam Leff <adam@leff.co>
2017-04-27 01:16:39 +02:00
Dominik Richter
4d73d3ccfe Merge pull request #1724 from chef/adamleff/event-update
[www] update event on main page
2017-04-27 01:14:41 +02:00
Adam Leff
5c63210390 Merge pull request #1726 from chef/dr/ports-doc-cmp
use cmp in port docs instead of eq
2017-04-26 18:22:27 -04:00
Adam Leff
2996662bbe Merge pull request #1723 from chef/dr/parse_config-opts
rename SimpleConfig / parse_config / parse_config_file options
2017-04-26 18:20:19 -04:00
Dominik Richter
84a59cab50 use cmp in port docs instead of eq
Fixes https://github.com/chef/inspec/issues/438

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-04-27 00:17:34 +02:00
Adam Leff
ce4d0d2481
[www] update event on main page
Signed-off-by: Adam Leff <adam@leff.co>
2017-04-26 17:59:54 -04:00
Dominik Richter
1dafe50bd9 rename SimpleConfig / parse_config / parse_config_file options
See https://github.com/chef/inspec/issues/1709
Fixes https://github.com/chef/inspec/issues/1709

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-04-26 23:18:40 +02:00
Dominik Richter
71a4f0d8f0 Merge pull request #1719 from chef/dr/inspec-version
provide `inspec.version` information
2017-04-26 13:40:29 +02:00
Dominik Richter
8e5fbb9e02 provide inspec.version information
as a friendly shortcut and a native call within profiles

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-04-26 13:07:32 +02:00
Christoph Hartmann
075336da54 Merge pull request #1718 from chef/dr/expose-inspec
provide the `inspec` keyword
2017-04-26 13:03:30 +02:00
Dominik Richter
8b7ef09f85 provide the inspec keyword
Instead of my favorite shortcut of `os.inspec` just finally add it as a global keyword.

Preparation for https://github.com/chef/inspec/issues/1396

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-04-26 12:30:31 +02:00
Christoph Hartmann
bf1d2ded6d Merge pull request #1717 from chef/dr/prettyprint-inspec-backend
print and prettyprint the inspec backend class
2017-04-26 12:23:36 +02:00
Dominik Richter
50e1c76fce print and prettyprint the inspec backend class
This is always bothersome when debugging code and drilling down objects, since it will just a return a two-layer anonymous class with no help at all.
Instead print a nice name and even give a bit of information on pretty-printing (which pry does naturally)

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-04-26 12:04:01 +02:00
Christoph Hartmann
5212ba9580 Merge pull request #1713 from chef/dr/docs-impact
describe the value ranges of `impact`
2017-04-25 21:14:28 +02:00
Dominik Richter
a7771a4ebc describe the value ranges of impact
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-04-25 19:01:16 +02:00
Christoph Hartmann
49f233f2b6 Merge pull request #1711 from chef/dr/prettyprint-control-desc
pretty-print multiline control descriptions
2017-04-25 18:20:09 +02:00
Dominik Richter
c5101e5ef0 pretty-print multiline control descriptions
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-04-25 17:12:30 +02:00
Christoph Hartmann
8c42d3ec53 Merge pull request #1710 from chef/dr/doc-other-tools
document reference to other tools
2017-04-25 16:22:59 +02:00
Dominik Richter
6b2532224b add podcast link to docs on serverspec-inspec
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-04-25 15:49:56 +02:00
Dominik Richter
ec05c16797 reference docs to other tools in readme
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-04-25 15:44:33 +02:00
Christoph Hartmann
9252b61682 Merge pull request #1707 from chef/dr/fix-unindent
bugfix: unindent description misbehaviors
2017-04-25 13:40:53 +02:00
Dominik Richter
37a2e45cd1 bugfix: unindent description misbehaviors
Unindent has been misbehaving for control `desc`riptions by completely removing newlines. This is now fixed and the unindentation mechanism improved to behave as expected.

Removing empty lines at the beginning and end of string remains unchanged.
Tabs are not treated as multi-space indentations; supporting them as 8-space chars would require additional effort (please comment if this is important to you)

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-04-25 13:21:38 +02:00
Dominik Richter
5f9d1980f7 Merge pull request #1706 from chef/chris-rock/improve-docker-error-handling
handle json parse errors in docker resource
2017-04-25 12:41:28 +02:00
Christoph Hartmann
b3cdc6ba04 handle json parse errors in docker resource
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-04-25 12:02:26 +02:00
Christoph Hartmann
ea2711d213 Merge pull request #1705 from chef/dr/newlines-in-inspec-objects
inspec control.to_ruby to use newlines instead of `\n`
2017-04-25 11:20:32 +02:00
Dominik Richter
37a778173d inspec control.to_ruby to respect newlines
I.e. instead of printing them as:

```
desc "hello\nworld"
```

it would instead do:

```
desc "hello
world"
```

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-04-25 10:34:45 +02:00
Adam Leff
9c75b52fd4 Merge pull request #1703 from chef/adamleff/release-1.21.0
Release 1.21.0
2017-04-24 16:28:21 -04:00
Adam Leff
e352deb6ef
Release 1.21.0
Signed-off-by: Adam Leff <adam@leff.co>
2017-04-24 16:27:27 -04:00
Christoph Hartmann
218bda9c34 Docker resource (#1566)
* add docker, docker_container, and docker_image resources

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-04-24 10:47:03 -04:00
Christoph Hartmann
8e62f6b4f7 Merge pull request #1694 from chef/dr/warn-uninitialized
bugfix: solve warn on uninitialized
2017-04-22 12:49:09 +02:00
Dominik Richter
f731cbca92 bugfix: solve warn on uninitialized
@expectation was analyzed without initializeation, leading to ruby errors. fix it

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-04-22 12:35:56 +02:00
Adam Leff
2eef024c0c Merge pull request #1691 from chef/adamleff/update-www-gemfile
[www] Update www Gemfile.lock
2017-04-21 13:57:31 -04:00
Adam Leff
c6e3b38e6d
[www] Update www Gemfile.lock
The Gemfile.lock in the www directory needs to be updated since
the last InSpec release. We should probably do this as part of
the normal InSpec release process.

You need to `bundle install` before releasing the web stuff,
and the www rake tasks will fail if your git repo is unclean.

Signed-off-by: Adam Leff <adam@leff.co>
2017-04-21 13:54:35 -04:00
Richard Shade
532efccf0e showing how to shellout in docs (#1689)
* showing how to shellout in docs

Signed-off-by: Richard Shade <rshade@rightscale.com>
2017-04-21 13:47:28 -04:00
Christoph Hartmann
b03ee9d0ba Merge pull request #1681 from Happycoil/add-windows-user-groups
fetch user groups while building user object
2017-04-21 11:00:49 +02:00