Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waiver file of csv format not working with --filter-waived-controls option. #6506

Open
Nik08 opened this issue Apr 27, 2023 · 0 comments
Open

Comments

@Nik08
Copy link
Contributor

Nik08 commented Apr 27, 2023

Describe the problem

Tried running inspec profile with following command:

bundle exec inspec exec test/fixtures/profiles/waivers/basic --waiver-file test/fixtures/profiles/waivers/basic/files/waivers.csv --filter-waived-controls

Got exception:

inspec/lib/inspec/profile.rb:264:in `block in filter_waived_controls': undefined method `keys' for "control_id,justification,run,expiration_date,,, 03_waivered_no_expiry_ran_passes,Sound reasoning,TRUE,,,, 04_waivered_no_expiry_ran_fails,Unassailable thinking,TRUE,2077-11-10T00:00:00Z,,, ,,,,,, 05_waivered_no_expiry_not_ran,Sheer cleverness,FALSE,,,, 06_waivered_expiry_in_past_ran_passes,Necessity,TRUE,,,, 14_waivered_expiry_in_future_z_not_ran,Lack of imagination,FALSE,2077-11-10T00:00:00Z,,, random contorl id with no data,,,,,,random data in csv!":String (NoMethodError)
	from inspec/lib/inspec/profile.rb:257:in `each'
	from inspec/lib/inspec/profile.rb:257:in `filter_waived_controls'
	from inspec/lib/inspec/profile.rb:223:in `collect_tests'
	from inspec/lib/inspec/runner.rb:123:in `block in load'
	from inspec/lib/inspec/runner.rb:104:in `each'
	from inspec/lib/inspec/runner.rb:104:in `load'
	from inspec/lib/inspec/runner.rb:163:in `run'
	from inspec/lib/inspec/cli.rb:364:in `exec'

Possible Solution

Needs handling of different file formats in this logic of filter_waved_controls on line profile.rb:258

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant