Commit graph

620 commits

Author SHA1 Message Date
Vasundhara Jagdale
699d73993c
Licensing - Integrates Software Entitlement (#13)
* 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>
2023-03-27 10:26:35 -04:00
Vasundhara Jagdale
530d2d1ef2
CFINSPEC-580 Dependent profiles fix for any scheme of version used in profiles (#6410) (#6468)
* Dependent profiles fix for any scheme of version used in profiles



* Dependent profile fix when version is blank in dependent profiles



---------

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Co-authored-by: Nikita Mathur <Nik08@users.noreply.github.com>
2023-02-27 14:04:02 +05:30
Vasundhara Jagdale
812001abcc
CFINSPEC-542 Bug fix for profiles with dependent profiles (#6377) (#6435)
* Matching semver using regex to determine profile name without version in dsl logic



* Testing for selecting control using version in require control dsl



* Documentation for using version with profile name when including or selecting controls in a profile



* Commenting in dsl library about logic for fetching version and matching it



* Comment for regex used to fetch version



* Minor improvement for regex variable placement

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Co-authored-by: Nikita Mathur <Nik08@users.noreply.github.com>
2023-02-26 20:37:28 +05:30
Nikita Mathur
440934ca13
Foreport 6369 to inspec-6 Extended file format support for waivers: JSON & CSV only (#6371)
* Revert "Revert "CFINSPEC-240 Extended file format support for waivers (#6193)" (#6366)"

This reverts commit 30146e07fe.

* Waiver support for csv and json

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

* Removed the word excel from image tag

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

* Removed excel file format support for attestations file (#6370)

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

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

* Update waivers.md

Signed-off-by: Ian Maddaus <ian.maddaus@progress.com>

---------

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Ian Maddaus <ian.maddaus@progress.com>
Co-authored-by: Ian Maddaus <ian.maddaus@progress.com>
2023-02-26 19:27:02 +05:30
Vasundhara Jagdale
4376365304
Fix env smoke test by updating ERB.new in inspec env; add additional test (#6342) (#6440)
* Failing test for Ruby 3.1 - ERB.new call options changed



* Fix for Ruby 3.1 by using named params to ERB.new



* Restrict test to non-windows systems



* Restrict test to non-windows systems

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2023-02-24 17:42:42 +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
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
b7ddac9dcc
CFINSPEC-240 Extended file format support for waivers (#6193)
* Added separate waiver file reader and support for csv

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

* Added support for json format waivers

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

* Added support for xls and xlsx

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

* Build issues and updated description of gems

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

* Doc changes for waivers about supports

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

* Fix added to check final options presense in config

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

* Renamed variables from inputs to waivers

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

* Validation changes with other small changes

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

* Headers validation added for json and yaml

* Linter issues resolved

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

* Some refactoring and message change

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

* exit code check removed from test cases since not req

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

* Doc change for waiver support for excel by showing example

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

Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2022-08-01 09:19:35 -04:00
Nikita Mathur
249f0aec9a Enhanced outcomes build fix for windows
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-07-29 14:42:37 +05:30
Nikita Mathur
c8351c9323 Added doc for only if impact change and modified test cases
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-07-29 14:31:40 +05:30
Nikita Mathur
1274a39690 Minitest deprecation warning fix for nil check
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-07-29 14:31:40 +05:30
Nikita Mathur
84c14a505a Added impact setting option in only_if
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-07-29 14:31:40 +05:30
Nikita Mathur
b26506b741 Enhanced outcomes changes in json based and yaml reporter
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-07-29 14:30:59 +05:30
Nikita Mathur
cfbddb82a5 Negative test added to check no status flag exist when enhanced outcomes flag is not used
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-07-29 14:30:59 +05:30
Nikita Mathur
a9fae7cfe2 Added enhanced outcomes option to schema subcommand and updated schema
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-07-29 14:30:59 +05:30
Nikita Mathur
a96e226bef Exit code logic to consider error count and build fixes
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
2b9f4d4bbf Enhanced outcomes changes in cli reporter
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-07-29 14:30:58 +05:30
Nikita Mathur
e7aa37dc24 Added logic for error in run_data
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-07-29 14:30:58 +05:30
Nikita Mathur
390d883f99 Test added for enhanced_outcomes N/A and N/R
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-07-29 14:30:58 +05:30
Nikita Mathur
ec43054411 Platform checks on tests for unix and windows
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-07-01 14:14:00 +05:30
Nikita Mathur
df0397fa61 Windows testing with different versions of dependent profiles
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-06-30 17:51:27 +05:30
Nikita Mathur
26a40c1bbb Fix for if conditions placement in exec test file
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-06-30 13:37:13 +05:30
Nikita Mathur
8bcfc38fe0 Windows fix for dependent profiles
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-06-29 17:05:59 +05:30
Nikita Mathur
1166489a93 Test case added for verifying running of same profile with different versions
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-06-14 13:21:27 +05:30
Clinton Wolfe
610e7aacea
Merge pull request #5995 from inspec/vasundhara/sign-profile-binary-format
CFINSPEC-167: Profile Signing Rollup
2022-06-08 17:07:27 -04:00
Vasu1105
5c061ea90b Fixes azure connection test
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-08 10:43:41 +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
Clinton Wolfe
1d4e70ede5
Merge pull request #6057 from inspec/vasundhara/gem-dependency-version-issue
CFINSPEC-252: Fix profile gem dependency installation is failing when  gem version is not specified
2022-05-16 23:21:52 -04:00
Clinton Wolfe
0b587a98af Add ability to export metadata and README
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2022-05-13 00:31:32 +05:30
Clinton Wolfe
0553b7a359 Add validation options for --what and --format, add (failing) tests
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2022-05-13 00:31:32 +05:30
Vasu1105
b64857358a CFINSPEC-192: Alias inspec json command to inspec export --format json
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-05-13 00:31:32 +05:30
Vasu1105
28f6eec56a Fix failing test
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
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
c937573763 Adds test to execute signed profile.
Fixes failing test.

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
163095859d CFINSPEC-252: Fix profile gem dependency installation is failing when gem version is not specified.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-05-13 00:18:03 +05:30
Vasu1105
e5e9bb0608 CFINSPEC-250: Fix for inspec json command does not populate the attribues/inputs for the profile
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-05-12 13:34:32 +05:30
Vasu1105
07f6793533 CFINSPEC-181: Fix unable to upload inspec compliance profile using to Chef Automate.
Add --with-cookstyle option to inspec check command to disable cookstyle check as default

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-04-14 21:47:10 +05:30
Vasu1105
adfe38c161 CFINSPEC-137: Set the target_id to blank string if unable to fetch it from train
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-03-11 15:47:50 +05:30
Vasu1105
ab01652ee2 CFINSPEC-137: Fix the failing test and lint for the --target-option deprication changes
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-03-11 15:47:50 +05:30
Vasu1105
8e85e2005b CFINSPEC-137: Deprecate --target-id option
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-03-11 15:47:50 +05:30
Clinton Wolfe
b6b2fd385b
Merge pull request #5915 from inspec/nm/remove-cloud-resources
CFINSPEC-129 Removed cloud resources ( AWS & Azure ) from inspec-core
2022-03-10 15:24:59 -05:00
Clinton Wolfe
ee70d0e200 Update tests to match new deprecation message
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2022-03-10 14:35:14 -05:00
Vasu1105
30ef9648c4 Fix lint
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-03-10 20:45:23 +05:30
Vasu1105
13f9376a63 Skip the test on Windows uuid generation using helper method in test generates blank string on Windows due to which it fails
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-03-10 20:45:23 +05:30
Vasu1105
bd8c5f7cbf Skip aws test as it looking for credentials.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-03-10 20:45:23 +05:30
Vasu1105
f7fdadc617 CFINSPEC-68: Fix aws test
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-03-10 20:45:23 +05:30
Vasu1105
72ba700669 CFINSPEC-68 Fix test
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-03-10 20:45:23 +05:30
Nikita Mathur
9e1ef742f8 Test cases fixed and new test cases added
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-03-10 19:24:52 +05:30