* Remove unused telemetry v1 code
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Sketch out basics of telemetry, with start/stop of invocation telemetry
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Data structure for run telemetry - job capture
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Add per-control and per-run feature detection
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* CHEF-4017 Telemetry job api updations (#6965)
* Added initial changes to jobs api
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Feature flag changes for telemetry
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* move base, debug and null to its own file structure
Signed-off-by: Sathish <sbabu@progress.com>
* make HTTP client post requests
Signed-off-by: Sathish <sbabu@progress.com>
* remove old logic
Signed-off-by: Sathish <sbabu@progress.com>
* make backend class as `HTTP`
Signed-off-by: Sathish <sbabu@progress.com>
* CHEF-7258 Fetch and use licensing information for telemetry (#6964)
* Added method to fetch license ids for inspec
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Added free license check for performing telemetry api call
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* move base, debug and null to its own file structure
Signed-off-by: Sathish <sbabu@progress.com>
* make HTTP client post requests
Signed-off-by: Sathish <sbabu@progress.com>
* remove old logic
Signed-off-by: Sathish <sbabu@progress.com>
* make backend class as `HTTP`
Signed-off-by: Sathish <sbabu@progress.com>
---------
Signed-off-by: Nik08 <nikita.mathur@progress.com>
Signed-off-by: Sathish <sbabu@progress.com>
Co-authored-by: Sathish <sbabu@progress.com>
* Updated control tags and desc value to be used in jobs api
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Added checks for automate run context and free license check
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* capture target mode and id
Signed-off-by: Sathish <sbabu@progress.com>
* profile doesn't need ID
Signed-off-by: Sathish <sbabu@progress.com>
* use run context to set environment data
Signed-off-by: Sathish <sbabu@progress.com>
* refactor `create_wrapper` to be localized
Signed-off-by: Sathish <sbabu@progress.com>
* change all timestamps to be UTC
Signed-off-by: Sathish <sbabu@progress.com>
* Null checks for response and corrected job api endpoint
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Fixed tag values to be sent as string in api call
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* make version as float
Signed-off-by: Sathish <sbabu@progress.com>
* add platform name
Signed-off-by: Sathish <sbabu@progress.com>
* Added control result data in jobs api payload
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Debug logs added for telemetry call
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Removed unwanted telemetry debug class
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Payload fix to pass features data only on per control basis
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Added class function to list all invoked features by feature sub system
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Using feature system to get all invoked features list to be used in jobs api
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Unit tests cases updated and fixed
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* License type check downcased
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Lint fix
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* CHEF-7265 Telemetry opt-in for CINC users (#6966)
* Enabled telemtry opt-in
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Removed old comments
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Unit test case added to validate the disabling telemetry behaviour for inspec user
Signed-off-by: Nik08 <nikita.mathur@progress.com>
---------
Signed-off-by: Nik08 <nikita.mathur@progress.com>
---------
Signed-off-by: Nik08 <nikita.mathur@progress.com>
Signed-off-by: Sathish <sbabu@progress.com>
Co-authored-by: Sathish <sbabu@progress.com>
* Product team review changes - only disable telemetry for commercial license users
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Connection failure handling for telemetry http call
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Testing fix - Remove usage of deleted library
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Telemetry test case fix - Issue caused because unit test are run without feature flag env set
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Fixed and replaced tightly coupled semver versioning regex matching test for telemetry data
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Telemery test fix to use license key from env or a dummy value if not set in env
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Added error logs in case the http call is not successful for telemetry
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Error handling for telemetry start and run calls
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Telemetry opt-in changes (#7055)
* Removed usage of feature system to enable telemetry - making it opt-in by default
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Telemetry disable check fix when no option is passed in args
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Fix in test to use license specs defined for testing
Signed-off-by: Nik08 <nikita.mathur@progress.com>
---------
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* (Restoring) CHEF-10392 load default telemetry url conditionally (#7059)
* load default telemetry url conditionally
Signed-off-by: Sathish <sbabu@progress.com>
* remove version base path
version base path is defined in jobs path already
Signed-off-by: Sathish <sbabu@progress.com>
* use `CHEF_` prefix for the ENV
Signed-off-by: Sathish <sbabu@progress.com>
---------
Signed-off-by: Sathish <sbabu@progress.com>
Co-authored-by: Sathish <sbabu@progress.com>
* Typo fix in features list
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Stub added for CI license key
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* License usage telemetry correction - not track control results (#7060)
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Changes to disable telemetry for other InSpec distros (#7065)
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Lint issue fix
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Removing disable telemetry test - breaks on CI because of commercial license usage
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* CHEF-13228 Chef licensing telemetry documentation (#7056)
* WIP chef telemetry env variable usage updated
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* WIP intro added for chef telemetry - requires edit
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Correction in opt in behaviour of telemetry
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Doc update after default opt in changes
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Doc edit from product
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Doc edit
Signed-off-by: Nik08 <nikita.mathur@progress.com>
* Edits
Signed-off-by: Ian Maddaus <ian.maddaus@progress.com>
---------
Signed-off-by: Nik08 <nikita.mathur@progress.com>
Signed-off-by: Ian Maddaus <ian.maddaus@progress.com>
Co-authored-by: Ian Maddaus <ian.maddaus@progress.com>
* Updated version pinning of chef licensing to version 1 for chef telemetry
Signed-off-by: Nik08 <nikita.mathur@progress.com>
---------
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Nik08 <nikita.mathur@progress.com>
Signed-off-by: Sathish <sbabu@progress.com>
Signed-off-by: Ian Maddaus <ian.maddaus@progress.com>
Co-authored-by: Nikita Mathur <Nik08@users.noreply.github.com>
Co-authored-by: Sathish <sbabu@progress.com>
Co-authored-by: Nik08 <nikita.mathur@progress.com>
Co-authored-by: Ian Maddaus <ian.maddaus@progress.com>
* CFINSPEC-24:Integrate License Software Entitlment.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
* CFINSPEC-506 license execution check
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
* Software entitlement call changes and handling of error
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
* Error handling from chef licensing error to standard error
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
* Updated Gemfile to pick the chef licensing changes from git url
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
* Trying with https url
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
* Revert "Trying with https url"
This reverts commit 33f1f4c0ecacf9ba2826e25e55b41219903ea736.
* Adds the license not entitled exit code
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
* Updates the require statement
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
* Fix typo
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
* Set the licensing configure for entitlement id failure
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
* Use ChefLicensing::Error instead of standard error
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
* REFACTOR Move out licensing cong=fig to its own file and make unconditional
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* FIX TESTS - Add reference to licensing config for places where we call runner explicitly.
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Update inputs_test to use license configuration from utils
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
---------
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Co-authored-by: Nikita Mathur <nikita.mathur@chef.io>
Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Removes pre-loading and registration of resources by adding
method_missing to a couple key areas.
This still drops the ball in some areas, but it is a start.
* Add impact class which contains all cvss scores.
* Add testing for impact changes.
* Change symbols to strings for impact.
* Update error messages to be more clear.
* Fix test with new sha
Signed-off-by: Jared Quick <jquick@chef.io>
* Add yml attribute option.
* Add type matching.
* Add testing profile for global attributes testing all types.
* Allow attributes to be called within a control block.
* Fix attribut test issues and allow value to be set at runtime.
* Allow setting attr value after creation.
* Move attributes to global namespace.
* Move attributes to a singleton object.
* Add unit and updated functional testing.
* Rename attributes to attributes_test so the testhelper picks it up.
* Add attribute object tests and error types.
* Update with feedback changes.
* Remove extra line.
* Move attribute registry class file.
* Add documentation for attributes
* Rename rspec_extensions.
* Add some failing functional tests.
* Update docs and fix typos.
Signed-off-by: Jared Quick <jquick@chef.io>
* Functional tests for userdir option
* Accepts --config-dir CLI option
* Actually loads a config file from the config dir, more cases to test
* Able to load config and verify contents from config-dir
* Functional tests to ensure precedence for config options
* Enable setting config dir via env var
* .inspec, not .inspec.d
* Begin converting PluginCtl to PluginLoader/Registry
* Able to load and partially validate the plugins.json file
* More work on the plugin loader
* Break the world, move next gen stuff to plugin/
* Be sure to require base cli in bundled plugins
* Move test file
* Revert changes to v1 plugin, so we can have a separate one
* Checkpoint commit
* Move v2 plugin work to v2 area
* Move plugins v1 code into an isolated directory
* rubocop fixes
* Rip out the stuff about a user-dir config file, just use a plugin file
* Two psuedocode test file
* Working base API, moock plugin type, and loader.
* Adjust load path to be more welcoming
* Silence circular depencency warning, which was breaking a unit test
* Linting
* Fix plugin type registry, add tests to cover
* Feedback from Jerry
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Formatter and reporter refactor.
Signed-off-by: Jared Quick <jquick@chef.io>
* Add exception and backtrace to json-min report.
Signed-off-by: Jared Quick <jquick@chef.io>
* Add sha to json-min and include generator version for json profile.
Signed-off-by: Jared Quick <jquick@chef.io>
* Fix deprecated typo and add fallback for cli resource title.
Signed-off-by: Jared Quick <jquick@chef.io>
* Update to build json report and clean up cli logic.
Signed-off-by: Jared Quick <jquick@chef.io>
* Add tests for json reporter.
Signed-off-by: Jared Quick <jquick@chef.io>
* Add cli suppress_log_output? and a fallback for invalid reporter type.
Signed-off-by: Jared Quick <jquick@chef.io>
* Update suppress_log_output? to check if we are outputting to stdout.
Signed-off-by: Jared Quick <jquick@chef.io>
* Update reporter cli optoins to work with json_config.
Signed-off-by: Jared Quick <jquick@chef.io>
* Refactor some safe-navigation and variable names.
Signed-off-by: Jared Quick <jquick@chef.io>
* Add thor banner to show reporter file output syntax.
Signed-off-by: Jared Quick <jquick@chef.io>
* Remove any "All Rights Reserved" references
InSpec is licensed and released under the Apache 2.0 license. This
change removes all reference to legacy code files that still had
any Copyright or License lines referring to "All Rights Reserved".
Signed-off-by: Adam Leff <adam@leff.co>
* fix functional tests
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
Inspired by #1640, this change cleans up the logic used when
reading in secrets files, provides clearer warnings when the
secrets files can't be parsed, and adds tests for those methods.
Signed-off-by: Adam Leff <adam@leff.co>
only load plugins through the binary, never through the library. This avoids issue we have in accidentally loading plugins in tests and integration work. They should only be loaded when users request them.