Idea for explicit symlink handling in file_object
#261
Replies: 3 comments 12 replies
-
|
There is a catch I didn't consider. If you blindly followed symlinks and treated them as files, you could hide an insecure sitation. A symlink's target is one part of several important permissions you would need to check, but you would also need to verify that the chain of parent directories was also sufficiently restricted or else a file could be altered without your knowledge and still pass the tests. Here's a more obvious example, but gets the point across: A test against Maybe such a symlink feature would open up more problems instead of making the content more convenient. |
Beta Was this translation helpful? Give feedback.
-
|
See, @don-patterson, the way around your conundrum is to use the symlink_test...
|
Beta Was this translation helpful? Give feedback.
-
|
Thinking out loud, a little..... <symlink_item> The 'links' could be fed through variables to feed any other test_type. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I'm curious if this conversation has come up before, or if there is a convenient workaround that I've missed. Here's the scenario that motivated me to raise up the discussion:
I work with the Joval engine and recently an issue came up where a compliance scan on Linux intended to confirm that the file
/etc/motdexists and has certain (readonly) permissions. On the particular host where this ran,/etc/motdwas a symlink to another file that did indeed have the expected permissions. Being a symlink on linux though, it had wide open (777) permissions, and that is what Joval collected. This caused the test to fail, and by the OVAL spec, this appears to be correct behavior. I would argue that the content writer intended for this situation to pass the test.I talked to Max and he made me aware of the
symlink_objectthat could be used to populate a variable with the value of the symlink target via thecanonical_pathattribute, and test against that. While possible, this seems pretty tedious, and would have to be done for just about every file object where it would be reasonable to have a symlink instead of a file.Anyhow, TLDR: What are people's thoughts on adding something to the FileBehaviors for
file_objects such as:that would cause the collected
file_items to take on the size, permissions+execution bits, and timestamps of the target file, rather than the symlink itself. I suspect this is almost always preferred, but it would be a bit much to suggest defaulting this to 'true`.Thanks for your time,
Don
Beta Was this translation helpful? Give feedback.
All reactions