Skip to content

Failed File Operations #18

@gr8sk8s

Description

@gr8sk8s

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions