InSpec Extension for Visual Studio Code
This extension for Visual Studio Code provides grammar and code snippets for InSpec when using Visual Studio Code.
- InSpec - control blocks
- InSpec - describe blocks
- InSpec - resource
-
You will need to install Visual Studio Code
1.5
or higher. -
From the command palette
Ctrl-Shift-P
(Windows, Linux) orCmd-Shift-P
(OSX) selectInstall Extension
, chooseInspec
and reload Visual Studio Code. -
Once the Extention is installed to enable it, choose the
InSpec
language from the bottom right corner (the default isPlain Text
) It should then look like this -
.... or use the keyboard shortcut
(Ctrl-K) M & type Inspec
if you happen to be scared of mice :)
InSpec in it's simplest form is describe block in which you describe a resource's expected configuration. e.g.
describe file('/etc/myapp.conf') do
it { should exist }
its('mode') { should cmp '0644' }
end
TIP: Try typing the resource you want to use i.e. file
and let the snippet create the describe block for you
InSpec is an open-source testing framework for infrastructure with a human- and machine-readable language for specifying compliance, security and policy requirements.
The inspec.io website is full of documentation and links to download the code There is also an interactive demo in which will allow you try it out with a web browser.
This describes the setup procedure for the tools and tokens required to publish the extension: https://code.visualstudio.com/docs/tools/vscecli
# Install the dependencies for the project
$ npm install
# Publish a version of the extension
$ npm publish (major|minor|patch)
Contributions are welcomed, please create an issue and a pull requests via the project homepage.
Review the CHANGELOG.md