Skip to content

Instantly share code, notes, and snippets.

@megamorf
Created October 16, 2018 16:01
Show Gist options
  • Save megamorf/ca20a36b32d099b40d71207b968fe64d to your computer and use it in GitHub Desktop.
Save megamorf/ca20a36b32d099b40d71207b968fe64d to your computer and use it in GitHub Desktop.
InSpec Shell - show available resource methods
inspec> http("https://www.domain.com/", method: 'GET').class.superclass.instance_methods(false).sort
=> [:body, :headers, :http_method, :status, :to_s]
inspec> file('/tmp').class.superclass.instance_methods(false).sort
=> [:allowed?,
:basename,
:block_device?,
:character_device?,
:contain,
:content,
:directory?,
:executable?,
:exist?,
:file,
:file?,
:file_version,
:gid,
:group,
:grouped_into?,
:immutable?,
:link_path,
:linked_to?,
:md5sum,
:mode,
:mode?,
:mount_options,
:mounted?,
:mtime,
:owned_by?,
:owner,
:path,
:pipe?,
:product_version,
:readable?,
:selinux_label,
:setgid?,
:setuid?,
:sgid,
:sha256sum,
:shallow_link_path,
:size,
:socket?,
:source,
:source_path,
:sticky,
:sticky?,
:suid,
:symlink?,
:to_s,
:type,
:uid,
:version?,
:writable?]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment