-
Notifications
You must be signed in to change notification settings - Fork 681
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
Extend Windows ACL matchers #1744
Extend Windows ACL matchers #1744
Conversation
Hi, @TheLonelyGhost! Thanks for your contribution, and thanks for reaching out for guidance. I'm going to defer to @chris-rock and @arlimus for more feedback. My initial reaction is that I feel this is a bit confusing in that there would be two ways to determine if a file is readable or not (the As for the other two permissions you've proposed, I think it's be good to introduce the right matcher for those... such as Again, deferring to @chris-rock and @arlimus for more feedback. |
I considered that method too, but then considered that noting compatibility for each platform would be easier to list as values for this one matcher For instance:
As a developer, I would have difficulty guessing the matcher form of each permission, but with the I'd be open to switching from string values for |
@TheLonelyGhost I totally see your point. I think the |
@TheLonelyGhost Thank you for your contribution! Your explanation makes a lot of sense. Traditionally we have been very hesitant in introducing new matchers (at least for regular resources). However, this is a different case and I see the use-case. |
@TheLonelyGhost I wanted you to know we haven't forgotten about you and this PR. This is the week leading up to ChefConf and everyone is pretty heads-down on prep. I promise we'll get back to you as soon as possible, likely after ChefConf. Thank you for your patience. :) |
Not a problem. I have a temporary workaround until this is merged, so it has bumped down a few notches in priority. I expect that other profiles I write will need to check permissions in a fine-grained way like this so I'm still very invested in getting this feature extension pushed through. Here's hoping there's an announcement at Chef Conf about vendoring custom InSpec resources... 🤞 |
Now that Chef Conf is over (sorry I didn't get to meet you in-person @arlimus! great presentation though), where did we land with this PR? |
Rebased from latest changes on master |
Rebasing again... |
I'm adding this PR to the next maintainers meeting which should take place next week. Thanks for your patience. |
Hi @TheLonelyGhost, and thanks for your patience. We discussed this PR today. We think this is a fine addition, but we would prefer to not introduce any additional global matchers, such as If we create an
While it's not as natural as your proposal, it's pretty close and I think a nice compromise to get the feature supported without making global changes. What do you think? |
You know what? I really like that. I forgot about the automatic matcher part of RSpec and it bothered me to have the The hash of options thing I'll have to dig into more to make that change in a way that makes sense, but I also like that one. 👍 Will make the changes this week. |
@TheLonelyGhost awesome! Thank you for being receptive to our feedback, and thanks again for your patience. Please reach out if I can help in any way. |
A little belated, but rebases off of master (again) and pushed an additional commit per the change request. 👍 |
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.
@TheLonelyGhost This is looking really good! However, it looks like you need to update your tests to use be_allowed
instead of allow
- you have a whole bunch of integration test failures.
Let me know when you've fixed those up and the tests are green, and I'll be happy to re-review!
Signed-off-by: David Alexander <[email protected]>
Converts to PowerShell array just before use. Signed-off-by: David Alexander <[email protected]>
Signed-off-by: David Alexander <[email protected]>
Signed-off-by: David Alexander <[email protected]>
Signed-off-by: David Alexander <[email protected]>
Limits Windows' broad "read" permission to if it can read all of the above, instead of just the first: - File contents - File attributes - File extended attributes - File permissions This better aligns with how Windows names the permissions. 'read' -> Read instead of 'read' -> ReadData Signed-off-by: David Alexander <[email protected]>
Signed-off-by: David Alexander <[email protected]>
Signed-off-by: David Alexander <[email protected]>
Provides hooks for later use with Windows ACL matching Signed-off-by: David Alexander <[email protected]>
Skips ReadAndExecute on intentionally since it just aliases the combo of 2 permissions into one new one. Signed-off-by: David Alexander <[email protected]>
Signed-off-by: David Alexander <[email protected]>
RSpec inferred matchers work nicely here. This changes the `by_user()` and `by()` chained matchers to just be an options hash on the underlying `allowed?()` method. Signed-off-by: David Alexander <[email protected]>
Ah shoot, it has been long enough that I assumed the integration tests were included in |
Signed-off-by: David Alexander <[email protected]>
There we go. All integration tests passing again. My fault! /cc @adamleff |
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 wonderful, @TheLonelyGhost! Thank you for working with us on this.
Fantastic. Glad to help! |
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.
@TheLonelyGhost This is a great improvement.
Suggested Tags:
enhancement
Given the limitations outlined in #1743, it would be convenient to have a better interface with the Windows permissions.
I've chosen the following approach:
Note that
allow('read')
is synonymous withbe_readable
, but is included for consistency's sake.