-
Notifications
You must be signed in to change notification settings - Fork 681
Update ssh_config resource to support returning the current sshd_config file in use. #7070
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
Conversation
Signed-off-by: Aaron Lippold <lippold@gmail.com>
✅ Deploy Preview for chef-inspec ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
Hello aaronlippold! Thanks for the pull request! Here is what will happen next:
Thank you for contributing! |
|
odd thing we are seeing is that git is not allowing us to add the docs ... seeing if I can resolve it. gitignore seems to be correct. |
… with a non-constant value (inspec#7079) * fix: update io reads to fix codescanning vuln Signed-off-by: Sonu Saha <sonu.saha@progress.com> * fix: remove kernel#open fallback and update open method to handle local files Signed-off-by: Sonu Saha <sonu.saha@progress.com> * fix: replace io.readlines to file.readlines Signed-off-by: Sonu Saha <sonu.saha@progress.com> * chore: fix lint offense, unnecessary space Signed-off-by: Sonu Saha <sonu.saha@progress.com> * fix: raise exception for standard errors as FetcherFailure Signed-off-by: Sonu Saha <sonu.saha@progress.com> * chore: update exception message Signed-off-by: Sonu Saha <sonu.saha@progress.com> --------- Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Obvious fix; these changes are the result of automation not creative thinking.
Signed-off-by: Ian Maddaus <ian.maddaus@progress.com>
Obvious fix; these changes are the result of automation not creative thinking.
Signed-off-by: Aaron Lippold <lippold@gmail.com>
| identifier = "inspec/resources/os/sshd_active_config.md sshd_active_config resource" | ||
| parent = "inspec/resources/os" | ||
| +++ | ||
| Use the `sshd_active_config` Chef InSpec audit resource to test configuration data for the OpenSSH daemon located at `/etc/ssh/sshd_active_config` on Linux and Unix platforms. sshd---the OpenSSH daemon---listens on dedicated ports, starts a daemon for each incoming connection, and then handles encryption, authentication, key exchanges, command execution, and data exchanges. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think /etc/ssh/sshd_active_config is what should be here correct?
The sshd active config finds the path of the sshd_config file by interrogating the active sshd process for the config file it is loaded with. Then we can say, all other functions and properties of the ssh and sshd resource are the same with the addition of the active_path variable available to the sshd_active_config resource which will be the path of the config file the sshd service reported as loaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake. This has been corrected.
clintoncwolfe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very good from where I sit. There is a linting concern - I opened a PR against your branch to resolve, mitre#1 .
I've also asked Product for clearance to include this in the next release of InSpec 6.
|
|
||
| ### Version | ||
|
|
||
| This resource first became available in v1.0.0 of InSpec. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been approved by Product and is expected to be in v6.8.0 - you may update the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
updated version
clintoncwolfe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
…/inspec into sshd-config-active-testing
…ig file in use. (#7070) * modify resource * windows compatibility * end line * removing comments to clean things up Signed-off-by: Aaron Lippold <lippold@gmail.com> * CHEF-12175: Remove use of `Kernel.open` or `IO.read` or similar sinks with a non-constant value (#7079) * fix: update io reads to fix codescanning vuln Signed-off-by: Sonu Saha <sonu.saha@progress.com> * fix: remove kernel#open fallback and update open method to handle local files Signed-off-by: Sonu Saha <sonu.saha@progress.com> * fix: replace io.readlines to file.readlines Signed-off-by: Sonu Saha <sonu.saha@progress.com> * chore: fix lint offense, unnecessary space Signed-off-by: Sonu Saha <sonu.saha@progress.com> * fix: raise exception for standard errors as FetcherFailure Signed-off-by: Sonu Saha <sonu.saha@progress.com> * chore: update exception message Signed-off-by: Sonu Saha <sonu.saha@progress.com> --------- Signed-off-by: Sonu Saha <sonu.saha@progress.com> * fix: Missing regular expression anchor (#7077) Signed-off-by: Sonu Saha <sonu.saha@progress.com> * Bump version to 6.6.27 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. * Fix gitignore file in docs dir (#7082) Signed-off-by: Ian Maddaus <ian.maddaus@progress.com> * Bump version to 6.6.28 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. * adding docs now that the gitignore is fixed. Signed-off-by: Aaron Lippold <lippold@gmail.com> * add docs for sshd_active_config resource * fix docs * unit tests * rubocop on ssh_config.rb, sshd_con_test.rb, and sshd_active_config.md * rename active path in method * doc fix * Linting Corrections for Active SSHD Config (#1) Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com> * Update sshd_active_config.md updated version * doc version update --------- Signed-off-by: Aaron Lippold <lippold@gmail.com> Signed-off-by: Sonu Saha <sonu.saha@progress.com> Signed-off-by: Ian Maddaus <ian.maddaus@progress.com> Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com> Co-authored-by: Daniel Medina <dmedina@mitre.org> Co-authored-by: Sonu Saha <98935583+ahasunos@users.noreply.github.com> Co-authored-by: Chef Expeditor <chef-ci@chef.io> Co-authored-by: Ian Maddaus <IanMadd@users.noreply.github.com> Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Aaron Lippold lippold@gmail.com
@DMedina6 is implementing and @aaronlippold is reviewing
Description
Updates to the testing requirements for various benchmarks require the ability to dynamically ask the sshd process which configuration file on the system is being used to configure the system.
This PR adds that ability to the
ssh_configresource with a new resourcesshd_active_configto active this and then inherit the rest of its interface from the existing sshd_config resource.This is a blocker for profile updates to the latest revision of security profiles for the DoD STIGs.
PR Tasks
sshd_active_configRelated Issue
N/A
Types of changes
Checklist: