Add -g option for custom group attribute#2395
Add -g option for custom group attribute#2395ankor2023 wants to merge 7 commits intosquid-cache:masterfrom
Conversation
Version update
Add -g option for group attribute name and update helper output format
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
The change to send list syntax instead of separate notes has been on my TODO list for a long while. Thank you for implementing.
However, IMO we should not make the key name configurable;
- first because "group=" has documented semantics and special handling associated to ensure the behaviour happens, and
- changing the name looses all indications that the values presented are group names, and
- secondly because in the use-case where "clt_conn_tag=" is useful, it is likely that "group=" will be needed at the same time (eg. by other helpers).
- What that case actually needs is all notes from an Negotiate and NTLM auth'n helper applied to the connection notes. Which is a separate feature change out of scope here.
Fix review comments
Fix review comments
Fix review comments
Fix review comments
We provide administrators with the ability to customize helper behavior while keeping the default behavior unchanged. As an alternative, we could maintain the current 'group' annotation while duplicating its value to an additional attribute under the -a flag. Or would it be better to wait for a more generic functionality to copy all annotations from authentication helpers? |
|
I'm also planning a subsequent PR to implement group filtering. In large environments, Kerberos tickets often contain 200–300 groups, while only a few are actually used in Squid policies. Filtering them out would significantly reduce overhead, improve performance, and simplify policy administration. |
Fixed a typo.
My answer would depend on whether that filtering is universal or highly custom:
Please note that an algorithm that can be easily implemented as helper output filter, should probably not go into the helper: negotiate_kerberos_auth ... | sed 's/,groupFoo,/,/'The above sketch illustrates the concept of an external filter. It is not meant to be used "as is", of course. |
I would like to implement a new I also intend to add SID-to-name mapping: With this, the helper will return group names to Squid instead of SIDs. Alex, where’s the best place to discuss the filtering logic? |
Amos, I agree that if this is implemented in the near future, the I’ve located the function that processes helper annotations. However, how do we distinguish whether the response was received from the Negotiate or NTLM helper specifically? On the other hand, annotations from Basic auth helpers should also be connection-bound. Thus, we can create a new annotation update function UpdateAuthRequestNotes() for auth helpers and call it from authTryGetUser(). |
Changes:
Added
-goption:Allows specifying the annotation attribute name used by the helper
to return groups. This enables using attributes like
clt_conn_tagfor group annotation within a connection.
Updated helper output format:
Groups are now returned in a single key with comma separated values:
group=group1,group2,group3Efficiency:
The new format reduces overhead by removing redundant attribute names
for each group, allowing more groups to fit within the same buffer size.