Commit graph

301 commits

Author SHA1 Message Date
Clinton Wolfe
1f3b5ea098
Fix failing plugin search test, failing since we published a new test gem (#6674)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2023-09-26 00:55:43 -07:00
Sathish Babu
5145fbb779
CHEF-4010 make a clean exit for License list command (#6552)
* make a clean exit for License list command

Signed-off-by: Sathish <sbabu@progress.com>

* exit UI

Signed-off-by: Sathish <sbabu@progress.com>

---------

Signed-off-by: Sathish <sbabu@progress.com>
2023-08-10 09:27:44 -04:00
Nikita Mathur
752b39b9c9
CHEF-4559 Extended support to inspec parallel for reporters using config (#6578)
* Validate reporter options from config when --reporter option is missing in options file

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Message changes in case of error in invocations validation

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Config reporters fix for null or empty values

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Testing cases to validate reporters using config

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Added missing fixture files for inspec parallel reporter config test

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Removed check for stdout false in config for reporters for parallel validation

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

---------

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2023-07-25 08:49:31 -04:00
Sonu Saha
50aabd06d3
CHEF-3895: Prevent Stacktrace in STDOUT by handling Invalid License exception during license add (#77)
* FIX: Handle invalid license exception as handled in base_cli:57

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* Use 174 error code when exiting with license subsystem error from license add

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

---------

Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2023-07-06 23:23:43 -04:00
Clinton Wolfe
1ecf6bdae0
CHEF-3759 Crossport public 6540 Fix for inspec parallel on windows crashing due to error log rename (#74)
* Error logging changes to fix renaming of files in windows

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Parallel rename, delete and logging fix for windows

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Log path changes reverted after testing with static logs directory

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Fix lint

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Logic to rename error log files on interrupt

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* An attempt to reduce the delay on control c interrupt by killing child process instantly

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Only rename existing file of the child process to avoid conficts in renaming

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Fix in renaming with control-c interrupt by invoking from command library itself

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Added logic to wait for processes to die after process kill, to fix error on interrupt

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Removed idle inititation on status super reporter for parallel - needs future improvements

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Fileutils Mkdir usage refactoring

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

---------

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
Co-authored-by: Nikita Mathur <nikita.mathur@chef.io>
Co-authored-by: Vasu1105 <vasundhara.jagdale@chef.io>
2023-07-04 15:58:04 -04:00
Clinton Wolfe
b9bc201ced
CHEF-3806 Fix for InSpec Parallel hangs for cetain CIS profile on Windows. (#71)
Sending EOF Marker at the end of of the whole suit run here instead of depending on the controls count

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>
Co-authored-by: Vasu1105 <vasundhara.jagdale@progress.com>
2023-06-27 22:07:39 -04:00
Nikita Mathur
f031999218
CHEF-3704 Modify help for local licensing service mode and other distros (#59)
* Update license commands description to be updated for local mode

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* To hide licensing information in help for CINC & other distros

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

---------

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2023-06-22 11:01:46 -04:00
Sathish Babu
feaf67d9bf
restrict license commands only to inspec distro (#58)
Signed-off-by: Sathish <sbabu@progress.com>
2023-06-21 18:37:55 +05:30
Nikita Mathur
68af725b6d
CHEF-3184 Error handling for inspec license add command - disabled in local mode (#52)
* Error handling for inspec license add command

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* License generation disabled exit code introduced for ui exit

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Removed the phrase something went wrong since error msgs will be changes and meaningful

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Renamed license generation error status name

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Error handling using specific error class

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* License exit code - license not set added

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

---------

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2023-06-21 13:42:19 +05:30
Sonu Saha
646cbb7bda
Add command to list license information (#10)
* Initial commit to set inspec cli command license

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* INTEGRATE: Use chef_licensing endpoint to list licenses info

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* CHORE: Update chef-licensing gem name, update description

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* CHEF-56 License add command integrated (#11)

* Added license add command in inspec license command plugin

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Chef licensing gem changes pointing to url and branch

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

---------

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* EXEC_NAME is always inspec as set in Dist,
check is not required

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* DOCS: Update docs for the plugin

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* DOCS: Update docs for the plugin

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

---------

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Co-authored-by: Nikita Mathur <nikita.mathur@chef.io>
Co-authored-by: Nikita Mathur <Nik08@users.noreply.github.com>
2023-03-31 13:21:44 +05:30
Vasundhara Jagdale
8e429571a6
Fix Ruby 2.7 Bundle Installs on CI Verify Pipeline (#6324) (#6446)
* We will never be on 2.6 again



* Only run html-proofer test on Ruby 3



* Pin to chef 16 on ruby 2.7, 17+ on Ruby 3

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2023-02-24 15:03:59 +05:30
Vasundhara Jagdale
ecce508ee0
Sync up the default branch as main (#6239) (#6455)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
Co-authored-by: Takuya N <takninnovationresearch@gmail.com>
2023-02-24 14:20:00 +05:30
Vasundhara Jagdale
3685eff535
RESOURCE-527 Add an inspec init template for alicloud (#6304) (#6432)
* adding the alicloud in the spec.files



* adding the test for generating inspec profile alicloud



* adding the alicloud profile



* fix lint error

Signed-off-by: Soumyodeep Karmakar <soumyo.k13@gmail.com>
Co-authored-by: Soumyodeep Karmakar <63713087+soumyo13@users.noreply.github.com>
2023-02-24 13:25:09 +05:30
Nikita Mathur
44939be5a6
Merge pull request #6272 from inspec/nm/parallel-breaking-fix
CFINSPEC-479 Inspec parallel breaking fix
2022-10-25 18:52:10 +05:30
Nikita Mathur
15433e8661
Foreport 6229 to inspec 6 (#6277)
* Not applicable if logic addition

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Changes from not applicable if to only applicable if

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Fix to enable placing only_applicable_if at any position in control and for keeping impact zero intact

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Doc change added for only_applicable_if

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Doc Review

Signed-off-by: Deepa Kumaraswamy <dkumaras@progress.com>

* Added generic examples that supports cross platform for testing

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Yet another build fix due to changes in test

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Deepa Kumaraswamy <dkumaras@progress.com>
Co-authored-by: Deepa Kumaraswamy <dkumaras@progress.com>
2022-10-20 14:07:10 -04:00
Sonu Saha
8b39f2865e
CFINSPEC-462: Fixes inspec sign breaks when there is period or dot in the profile name (#6261) (#6276)
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
Co-authored-by: Vasundhara Jagdale <vasundhara.jagdale@chef.io>
2022-10-20 14:06:38 -04:00
Clinton Wolfe
393b8072e8
Feature Config File and Logger Support (#6260)
* Convenience method skeleton

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Basic support for a config file

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Add features() array method

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Accept config as an option to with_feature

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Accept logger as an option to with_feature

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Refactor to push code into its own files

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Basic logger integration

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Crude validation of feature names, simply issues a warning log message

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Linting

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Add basic tamperproofing to feature config

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Convenience method skeleton

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Basic support for a config file

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Add features() array method

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Accept config as an option to with_feature

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Accept logger as an option to with_feature

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Refactor to push code into its own files

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Basic logger integration

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Crude validation of feature names, simply issues a warning log message

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Linting

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Add basic tamperproofing to feature config

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* CFINSPEC-464 CLI commands declaration using with_feature functionality (#6263)

* Declared inspec cli commands within feature_with function

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Added enhanced outcomes, waivers, reporters and streaming reporters within with_feature block

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Added with_feature declaration for attestations

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Update features.yaml signature after adding in new feature flags

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Fix lint

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Resolved undefined method with_feature in reporters.rb

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Fix for features tampered file test failing

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Fixed the failing functional test for junit2: Missing the entry in the features.yaml
Added progress-bar reporter entry in features.yaml

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
Co-authored-by: Nikita Mathur <Nik08@users.noreply.github.com>
Co-authored-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-10-19 19:17:56 +05:30
Nikita Mathur
8912f1a71a Error log files cleanup logic changes along with few minor improvements
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-10-17 18:17:44 +05:30
Nikita Mathur
c9f5dcb57d Parallel breaking fix due to method usage changes after attestation merge
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-10-17 18:17:07 +05:30
Nikita Mathur
efc6f2c63a
CFINSPEC-246/CFINSPEC-247 Attestation changes for N/R outcomes (#6222)
* Added attestation file option to read attestation in various formats

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Added method to add attestation data on control level

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Enhanced outcomes flag to be true when attestation file is passed

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Added logic for attestation for reporters

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Attestation integration with streaming reporters and lots of refactoring

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Support for mitre - with frequency, updated and explanation fields'

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* To only revise enhanced outcomes when attestation data is present for the control - fix in streaming reporter

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Added test cases for attestation and also added validation warnings

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Attestation test for different formats of attestation file

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Validating presence of status column to be mandtory for attestation files

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Build fix

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Attestation build fix for windows

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* No justification and no status graceful handling

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* New class attestations added for logic and added missing test attestations file

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Code comments and cli doc changes for attestation option

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Moved logic of attestations and enhanced outcomes to the base of streaming reporter

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Attestation documentation added

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Added information on what happens if justification is missing in attestation file

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Attestation doc changes as per the review

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* File fields doc changes in attestation doc

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Content Review

Signed-off-by: Deepa Kumaraswamy <dkumaras@progress.com>

* Edits

Signed-off-by: Deepa Kumaraswamy <dkumaras@progress.com>

* Attestation test changes matching regex and separated logic for expiration using frequency and updated date

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Proof-read

Signed-off-by: Deepa Kumaraswamy <dkumaras@progress.com>

* Name changes for expiry calculation method

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Generic tests in attestations for cross platform

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Deepa Kumaraswamy <dkumaras@progress.com>
Co-authored-by: Deepa Kumaraswamy <dkumaras@progress.com>
2022-09-30 09:53:32 -04:00
Nikita Mathur
b9750c0faf Added inspec parallel logs in log file in case of warn/errors
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-08-22 16:08:20 +05:30
Nikita Mathur
1c6bfa8f24 Merge branch 'main' into inspec-6 2022-08-22 14:55:01 +05:30
Nikita Mathur
82ab13dbe4 Html reporter changes for enhanced outcomes and refactoring changes
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-07-29 14:30:59 +05:30
Nikita Mathur
1fc0076f1a Enhanced outcomes changes for streaming progress bar reporter
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-07-29 14:30:58 +05:30
Nikita Mathur
4e83f395c8 enhanced outcome fix in streaming reporter - collected test based on control_id
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-07-29 14:30:58 +05:30
Nikita Mathur
f56f5ec844 enhanced outcomes logic in streaming reporter base class
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-07-29 14:30:58 +05:30
Nikita Mathur
62662d5ae0 Comment to add info for silent super class
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-06-30 13:46:58 +05:30
Nikita Mathur
c5b03be490 Enabled silent run by adding silent superreporter
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-06-29 13:43:10 +05:30
jayashrig158
542b9cc246 add ruby test 3.1 in verify pipeline (#5892)
* add ruby test 3.1 in verify pipeline

Signed-off-by: jayashri garud <jgarud@msystechnologies.com>

* updating rubygem to 3.3.3

Signed-off-by: jayashri garud <jgarud@msystechnologies.com>

* Test fixture plugin files for ABI 3.1.0

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Use kwargs to match new calling style for ERB in ruby 2.7 and 3.0

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Allow Date and Time data types, needed for waivers, since safe load is now the default for YAML

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Use Time.parse, not Time.new since the rules tightened for what you can pass the constructor for waiver dates

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Add ruby platform debug message to test parallel output

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Conditionalize permitted_classes in inputs yaml_load for <= 3.1.x only

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* In ruby 3.1.0 net/pop3 is no more a default gem and that will require us to add it in Gemfile so trying with the byebug gem which we are bundling already

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* CFINSPEC-166 Updated url fetcher to handle Net::OpenTimeout Exception on Windows

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Co-authored-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-14 16:07:08 +05:30
Nikita Mathur
6eb5df2e49 Skip parallel exec tests on windows
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-06-14 15:17:02 +05:30
Nikita Mathur
d8fd959af5 Fix test cases in inspec parallel tests
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-06-14 13:46:34 +05:30
jayashrig158
ffbf2ff554
add ruby test 3.1 in verify pipeline (#5892)
* add ruby test 3.1 in verify pipeline

Signed-off-by: jayashri garud <jgarud@msystechnologies.com>

* updating rubygem to 3.3.3

Signed-off-by: jayashri garud <jgarud@msystechnologies.com>

* Test fixture plugin files for ABI 3.1.0

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Use kwargs to match new calling style for ERB in ruby 2.7 and 3.0

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Allow Date and Time data types, needed for waivers, since safe load is now the default for YAML

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Use Time.parse, not Time.new since the rules tightened for what you can pass the constructor for waiver dates

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Add ruby platform debug message to test parallel output

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Conditionalize permitted_classes in inputs yaml_load for <= 3.1.x only

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* In ruby 3.1.0 net/pop3 is no more a default gem and that will require us to add it in Gemfile so trying with the byebug gem which we are bundling already

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* CFINSPEC-166 Updated url fetcher to handle Net::OpenTimeout Exception on Windows

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Co-authored-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-13 14:24:33 -04:00
Nikita Mathur
f04a31d822
CFINSPEC-120 inspec parallel feature (#5975)
* Initial commit - Inspec parallel setup

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Added dry run option functionality and renamed subcommand

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Runner logic parsing options file and executing cmds

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Validation logic changes for dry run and run commands

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Validator bug fix when using options like --sudo with no value

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* initial commit for using default options

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Logic to not parse empty lines and comments and some cleanup

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Functional test cases added

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Test cases fix and bug fix in validator

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Add logic to append default options passed from cli

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* Add test for default options and extend options-file-1.txt

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* Add comments in options-file-2 and 3

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* Bug fix and some refactoring

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Changes from pair programming

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Fixed incorrect line no used in dry run validation & added verbose option

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Initial code with parallel gem setup

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Error handling and some changes in parallel running result

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Working spawn and fork implementation; no pipes or error handling

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* CFINSPEC-143 Child status reporter plugin

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Read status from children using pipes; Windows implementation is likely broken

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Linting

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Removed parallel gem and it's code usage

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Erb templating and option file as shell/powershell option added

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Added missing raise error in content reading logic

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Adding for the sake of keeping bash file syntax correct

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Switch to select() polling, enabling Windows support; also add a terrible hack to the child-status reporter

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Move child-status reporter into inspec-parallel plugin to reduce pollution

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Rename a bunch of things, remove some instance variables, always validate, and use Inspec::UI exit codes

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Rework validation to be Thor-based; add logic to inject child-status reporter

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Linting

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Refactor parent UI to make it object oriented

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Add a prototype 'status' super-reporter

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Improve status UI edge cases, add info to output, make default

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Error handling added when running bash instead of system check

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Daemon run for background process in unix system for parallel runs

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Added logic to cleanup daemon process'

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Review changes for background command name and windows handling

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Error raised with error handling class for options file

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Fix to not intialise ui when background run is opted

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* typo fix in child reporter append logic in validator

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Changes to trap control c and exit gracefully

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Moved ctl c handling code to command class

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Linter fixes

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Error and runner logging added

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* ERB pid option to use child process id for generating result output

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Renamed 38125 to Process.pid for clear notation

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Log path option added for inspec parallel

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Adjust ERB eval

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* STDERR logging added

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Fix of --bg with ui

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Deleting log files if empty and status super reporter to show done

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Docs for InSpec Parallel

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Doc Review

Signed-off-by: Deepa Kumaraswamy <dkumaras@progress.com>

* Grammar corrections

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

Co-authored-by: Sonu Saha <sonu.saha@progress.com>
Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Co-authored-by: Deepa Kumaraswamy <dkumaras@progress.com>
2022-06-13 13:58:41 -04:00
Vasu1105
04d93db068 CFINSPEC-340 Adds usage header line in the signed profile
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-08 10:35:16 +05:30
Vasu1105
078d1ce898 Updated sign and verify command to directly accept the path of the profile instead of additional option to provide those. Updated docs for the same.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-02 10:36:50 +05:30
Vasu1105
fdb4d5c3ca Fix the --profile-content-id option not to overwrite the existing profile_content_id value in the metadata file
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-01 22:14:53 +05:30
Vasu1105
12b73a6609 Only adds or updates the profile_content_id without modifying the existing contents of the metadata file.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-05-30 14:37:39 +05:30
Vasu1105
16353af6e3 Fixed the profile content id option description.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-05-30 12:11:23 +05:30
Vasu1105
bee69410ca CFINSPEC-255: Add --profile-content-id option to inspec sign profile command
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-05-13 16:34:48 +05:30
Vasu1105
28f6eec56a Fix failing test
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-05-13 00:31:32 +05:30
Clinton Wolfe
47bc41cd2c Several small bugs and usability fixes
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2022-05-13 00:31:32 +05:30
Vasu1105
3f22d899fb Fixed failing test and adds test for signed dependent profile
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-05-13 00:31:32 +05:30
Vasu1105
56b8306e34 Fix for test failure
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-05-13 00:31:32 +05:30
Clinton Wolfe
0ec4461756 Look for signing and validation keys in user and source directories
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2022-05-13 00:31:32 +05:30
Clinton Wolfe
29034b6b9d Fix log output, don't use temp dir
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2022-05-13 00:31:32 +05:30
Vasu1105
9c2fa3f012 Fixed typo
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-05-13 00:31:32 +05:30
Vasu1105
6da6c85e54 Refactored code to use existing archive command to archive the file.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-05-13 00:31:32 +05:30
Vasu1105
9ef83bfce8 Updated to generate binary format of the signed profile
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-05-13 00:31:32 +05:30
Vasu1105
6bb06eee5f Adds class iaf_file to validate the signed profile
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-05-13 00:31:32 +05:30
Vasu1105
f0c868759d Renamed the method for validating header
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-05-13 00:31:32 +05:30