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

Failed File Operations #18

Open
gr8sk8s opened this issue Jan 18, 2024 · 1 comment
Open

Failed File Operations #18

gr8sk8s opened this issue Jan 18, 2024 · 1 comment

Comments

@gr8sk8s
Copy link

gr8sk8s commented Jan 18, 2024

This might be a known issue, but documenting it here for transparency. We need internal file operations to work for the STIG checks to run successfully. Currently these fail, as seen in the following NotImplementedError:

`file_via_connection': Train::K8s::Container::Connection does not implement #file_via_connection(...) (NotImplementedError)

For more info, please see description below.

Describe the problem

To view this issue, simply run an inspec exec command against any STIG profile such as apache server (httpd), or Postgresql , or any other container app. Shown below is the example for the inspec exec against an apache (httpd) container ; note that only the top few lines of the error stack is shown for relevancy and brevity:

❯ inspec exec apache-server-2.4x-stig-baseline -t k8s-container://staging/apache-web-24-5d89d6949c-8fv9d/httpd

/opt/inspec/embedded/lib/ruby/gems/3.1.0/gems/train-core-3.10.7/lib/train/plugins/base_connection.rb:245:in `file_via_connection': Train::K8s::Container::Connection does not implement #file_via_connection(...) (NotImplementedError)
	from /opt/inspec/embedded/lib/ruby/gems/3.1.0/gems/train-core-3.10.7/lib/train/plugins/base_connection.rb:162:in `file'
	from /opt/inspec/embedded/lib/ruby/gems/3.1.0/gems/train-core-3.10.7/lib/train/platforms/detect/helpers/os_common.rb:124:in `unix_uuid_from_chef'
	from /opt/inspec/embedded/lib/ruby/gems/3.1.0/gems/train-core-3.10.7/lib/train/platforms/detect/helpers/os_common.rb:117:in `unix_uuid'
	from /opt/inspec/embedded/lib/ruby/gems/3.1.0/gems/train-core-3.10.7/lib/train/platforms/detect/uuid.rb:19:in `find_or_create_uuid'
	from /opt/inspec/embedded/lib/ruby/gems/3.1.0/gems/train-core-3.10.7/lib/train/platforms/platform.rb:45:in `uuid'
	from /opt/inspec/embedded/lib/ruby/gems/3.1.0/gems/train-core-3.10.7/lib/train/platforms/platform.rb:52:in `[]'
	from /opt/inspec/embedded/lib/ruby/gems/3.1.0/gems/inspec-core-5.22.3/lib/inspec/resources/platform.rb:46:in `[]'
	from /opt/inspec/embedded/lib/ruby/gems/3.1.0/gems/inspec-core-5.22.3/lib/inspec/formatters/base.rb:285:in `platform'
....
....

Possible Solution

Please add this missing File operations and system internals functionality to the new k8s train. Thank you.

@clintoncwolfe
Copy link
Contributor

Yes, file operations are not yet implemented. The project is in early development.

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

2 participants