Commit graph

20 commits

Author SHA1 Message Date
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
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
Vasu1105
9454821d7c CFINSPEC-183: Rename artifact commands to inspec sign
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-05-13 00:31:32 +05:30