-
Notifications
You must be signed in to change notification settings - Fork 27
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
New Unix SSHD test proposal #86
Conversation
Added a new unix sshd test to collect and evaluate named sshd parameters
LGTM, WDYT @isimluk? This will also need to be converted into a PR into the develop branch. |
LGTM. Consensus call initiated: http://lists.cisecurity.org/pipermail/oval_developer_lists.cisecurity.org/Week-of-Mon-20200210/000616.html |
Do I get to vote on my own proposal? If so, I think it looks great :) |
As far as it goes, the schema look good to me. However, it is possible (and I think it actually happens) to configure more than one instance of the sshd daemon. For instance, see - https://access.redhat.com/solutions/1166283. It might be useful to add an instance element of some sort (points to config file(s) that was used to start the sshd instance? Maybe?) to the object, state, and item schema. Unfortunately, I'm not sure how best to do that. Different OSes may use different mechanisms to do the multiple sshd daemons trick. 'Will continue to dig. |
@wmunyan, the 14 days consensus call period concluded. @johnulmer-oval raised important point, about having multiple instances of sshd available on the assessed system. What are Your thoughts on the subject? Is that anything that could be addressed by changes to this proposal? |
Agreed. Would it be appropriate to add an element, Thoughts on that idea? |
Regarding: having a 'config_file' element in the OVAL object, state, and item elements If this makes sense, the OVAL object needs only a boolean to indicate targeting either just the default location/config or all running sshd configurations. The state and item would need 'config_file' elements. I think.... |
Hi @johnulmer-oval , I think probably using process_object and variables is how (in OVAL) someone would find the config file -- but your idea of a shortcut certainly would make things easier for a content-writer, and your point about all SSH configurations being security-relevant is taken. I wouldn't object to either approach -- I'd say one would add an xsi:nilable filepath entity, and the other would use a behaviors entity. |
@solind, I agree with your approach to gathering system chars for this test (variables + process object). While I like the idea of a "short-cut", I don't want to stray from the conventional methods for constructing content. |
@solind, @johnulmer-oval do you envision the behaviors entity on the object to be something like:
With the default value assumed to be |
@solind , I my thinking, the creation of a new sshd test would be most useful if it was a short cut, so to speak, around a more tedious and error prone approach. We do not currently 'need' a new sshd test. We can do everything we need to check sshd configurations with the existing process test and the various file content tests. (Find the processes. Find their config files. Parse config files. Populate sshd items.) The value in a new sshd test is that we can reduce the complexity of that OVAL content chunk and let the SCAP/OVAL tool developers do the design work. So, if we know what we want checked regarding sshd instances, I think (as in I may be wrong) we could have a pretty concise OVAL test definition that is easy for a content author to employ. That gets me to @wmunyan, that was pretty much what I was thinking. Let the SCAP/OVAL tool developers do the work and put the intelligence in the scanner. Leave the content author to write a pretty concise test and move on. Maybe... unless I'm wrong.... have been before.... |
Speaking for myself, I am not certain that there's a lot of value in writing tests simply to make them more usable for content authors to write. That is because, at least in my organization, content writing is done programmatically. I thought the idea behind this test was to use sshd to actually interpret and then output the effective configuration. THAT is a valuable addition, because the effective configuration cannot really be determined from the configuration file(s) alone (in part because it depends on sshd's own defaults). As to the behaviors, @wmunyan, I would prefer something more declarative, like:
We should also consider, an advantage of using the approach of actually specifying a file path in the object is that it makes it possible to inspect a configuration without that configuration being actively tied to a running process. This could be nice, for example, if you're scanning an offline image. In light of this consideration, the behavior I propose would allow collection of the default configuration even if sshd is not running, and likewise implies it would not collect that configuration in the event no sshd process was running. EDIT: that last sentence should read "... and likewise implies that it would collect that configuration in the event no sshd process was running" -- whereas in the event all_running_instances is used, it would NOT be collected if there was no corresponding process. So subtle, I sometimes even confuse myself. :D |
@solind and @wmunyan, I happy with whatever y'all think is appropriate. My only real concern was that the current schema addresses only the default config. As long as we address the wider situation, I'm happy. Adding a behavior seems to do that. @solind , I like the 'default_instance' | 'all running' approach. |
|
I will share here a context of the test, and I hope that it will help to the discussion:
So to sum it up, I would drop the runtime aspect of this PR, and I would transfer the responsibility of scanning the correct SSHD configuration to those who perform the scan. |
In that case simply adding the path+filename/filepath to the (renamed) object should work, right @matejak ? The existing proposal doesn't have any process dependencies. And also, I agree with your thinking. |
<xsd:element name="sshd_object" substitutionGroup="oval-def:object"> | ||
<xsd:annotation> | ||
<xsd:documentation> | ||
The sshd_object is used by a sshd_test to define which sshd parameters on the local system should be collected via the "sshd -T [NAME]" command. |
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.
The sshd -T [NAME]
is probably incorrect - the OpenSSH client doesn't expect any arguments if supplied with the -T
option, and it dumps configuration keys and respective values. I suggest that the -f <main config file>
is added to the documentation.
Right, I was reacting to the discussion that we had, and there is no runtime aspect visible in the proposal, so it doesn't make sense in the context of the PR. |
Question: If we add the (path/filename|filepath) elements to this test, would it follow to add |
Hey @wmunyan , question for you... If SshdObject/filepath@xsi:nil="true", then what should the SshdItem/filepath value be? @status="does not exist"? Or should the item/filepath also be nilable? |
Since the |
It's fine with me to document that object filepath@xsi:nil="true" -> item filepath="/etc/ssh/sshd_config". I see it already says that in the object documentation; I was looking at the item documentation (where it's not mentioned). |
… account for value when object's filepath is xsi:nil=true
I updated the documentation for the filepath element in the system characteristics schema |
Nice! Thanks! ETA: I think this is ready to submit into develop. |
Added a new unix sshd test to collect and evaluate named sshd parameters. Content to follow, and will be added to issue.