Skip to content
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 sssctl to manage cached GPOs #7147

Closed
wants to merge 15 commits into from

Conversation

scabrero
Copy link
Contributor

Extends the sssctl tool to show, list, remove and purge cached GPOs.

Fixes #4523

@scabrero scabrero force-pushed the sssctl-manage-gpo-cache branch from ebbec2b to a23f1e5 Compare January 24, 2024 17:59
src/tools/sssctl/sssctl_cache.c Dismissed Show dismissed Hide dismissed
Copy link
Contributor

@thalman thalman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scabrero, I reviewd the changes, looks great! Thanks for the effort.

Would you be so kind and update also sss_cache man page? (src/man/sss_cache.8.xml)

Tomáš

@thalman
Copy link
Contributor

thalman commented Feb 6, 2024

@scabrero, I reviewd the changes, looks great! Thanks for the effort.

Would you be so kind and update also sss_cache man page? (src/man/sss_cache.8.xml)

Sorry, mixed up sssctl and sss_cache. Ignore my comment, please.

T.

Copy link
Contributor

@thalman thalman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, works as expected, ACK

@alexey-tikhonov alexey-tikhonov added the no-backport This should go to target branch only. label Feb 6, 2024
@alexey-tikhonov
Copy link
Member

Hi @scabrero,

could you please add RN?
See https://github.com/SSSD/sssd/blob/master/.git-commit-template#L7 for a hint.

@scabrero
Copy link
Contributor Author

scabrero commented Feb 6, 2024

Hi @scabrero,

could you please add RN? See https://github.com/SSSD/sssd/blob/master/.git-commit-template#L7 for a hint.

Hi @alexey-tikhonov, I added an empty commit with the :relnote: tag. If you prefer to amend the latest patch just let me know and I will push again.

Thanks for the reviews!

@sumit-bose
Copy link
Contributor

Hi,

thank you for the patches, in general I'm fine but please my in-line comments.

Some general comments. sssctl gpo-show and sssctl gpo.remove require that the domain name must be given, e.g

sssctl gpo-show 'Default Domain Policy'@samba.test

or

sssctl gpo-show -g {31B2F340-016D-11D2-945F-00C04FB984F9}@samba.test

which imo should be mentioned in the --help output because it might be unexpected.

Is there is reason you are using the description attribute to store the display name and not the name attribute? The benefit would be that name is already indexed. Additionally, gpoGUID isn't indexed as well and since there are now searches by GUID it might be worth to add an index for gpoGUID as well?

bye,
Sumit

@scabrero scabrero force-pushed the sssctl-manage-gpo-cache branch from 44923f8 to 4179583 Compare February 13, 2024 17:23
@scabrero
Copy link
Contributor Author

Hi,

I have addressed all suggestions and pushed an update with the following changes:

Hi Sumit,

Some general comments. sssctl gpo-show and sssctl gpo.remove require that the domain name must be given
Ok, fixed.

Is there is reason you are using the description attribute to store the display name and not the name attribute? The benefit would be that name is already indexed.

Because I saw that get_attr_name() in sssctl_cache.c checks dom->fqnames to build a FQDN, so I used SYSDB_DESCRIPTION to keep it separated from use_fully_qualified_names. I agree with the index reasoning so I have changed it to use SYSDB_NAME but kept a separate handler for it.

Additionally, gpoGUID isn't indexed as well and since there are now searches by GUID it might be worth to add an index for gpoGUID as well?

Yes, and I made it case-insensitive for searches.

Summary of changes:

  • Switch to Sumit's suggested fix for GPO referral processing when subdomain connection is not yet initialized.
  • Store the AD displayName attribute in SYSDB_NAME instead of SYSDB_DESCRIPTION.
  • Bump sysdb version to 0.24: Index gpoGUID and make it case-insensitive on searches.
  • Add new parameter to show extended help for sssctl subcommands
  • Add extended help for gpo-show and gpo-remove subcommands.

@scabrero scabrero force-pushed the sssctl-manage-gpo-cache branch from 08a7645 to 9aa961e Compare March 13, 2024 17:10
Copy link
Contributor

@sumit-bose sumit-bose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

thank you for your patience, I have no further comments, ACK.

bye,
Sumit

@alexey-tikhonov alexey-tikhonov added Ready to push Ready to push and removed Ready to push Ready to push labels Apr 22, 2024
scabrero added 11 commits April 25, 2024 13:08
Resolves: SSSD#4523

Signed-off-by: Samuel Cabrero <[email protected]>
Always store the guid uppercased and enclosed in curly brackets.

Resolves: SSSD#4523

Signed-off-by: Samuel Cabrero <[email protected]>
Resolves: SSSD#4523

Signed-off-by: Samuel Cabrero <[email protected]>
Resolves: SSSD#4523

Signed-off-by: Samuel Cabrero <[email protected]>
Resolves: SSSD#4523

Signed-off-by: Samuel Cabrero <[email protected]>
Resolves: SSSD#4523

Signed-off-by: Samuel Cabrero <[email protected]>
:relnote: The 'sssctl' command line tool has been extended to manage
the cached GPOs. It is now possible to list ('gpo-list') and show
('gpo-show') the cached GPOs, and the 'gpo-remove' and 'gpo-purge'
subcommands are particularly useful as they remove not only the entry
from the database but also the downloaded GPO files.

Signed-off-by: Samuel Cabrero <[email protected]>
@scabrero scabrero force-pushed the sssctl-manage-gpo-cache branch from 9aa961e to 4d6dfc0 Compare April 25, 2024 12:35
@alexey-tikhonov alexey-tikhonov added Ready to push Ready to push and removed Ready to push Ready to push labels Apr 25, 2024
@pbrezina
Copy link
Member

  • master
    • 54179a0 - SSSCTL: Add the new cached GPOs management commands to release notes
    • c5b16ee - SSSCTL: Add gpo-purge command
    • afee68b - SSSCTL: Add sssctl gpo-remove command
    • be73599 - SYSDB: Add a function to delete GPO entry by GPO GUID
    • 6dc9166 - SSSCTL: Add sssctl gpo-list command
    • 18a17bc - SSSCTL: Add gpo-show command
    • 095e31e - SSSCTL: Prepare for extended help in subcommands
    • cf59da1 - SYSDB: Add new index for gpoGUID and make searches on it case insensitive
    • 66fd8a0 - SYSDB: Always canonicalize GPO guid
    • 3580134 - SYSDB: Store the GPO's filesystem path in sysdb entry
    • 568ca5d - SYSDB: Store GPO's displayName in sysdb
    • e169277 - GPO: Fetch the GPO's displayName attribute
    • 9926067 - SYSDB: Add sysdb_gpos_base_dn()
    • 98efb5e - GPO: Remove unused local variable
    • 738bb53 - GPO: Defer SMB server choice until id connection established when processing referrals

@pbrezina pbrezina closed this Apr 26, 2024
@pbrezina pbrezina added Pushed and removed Accepted Ready to push Ready to push labels Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-backport This should go to target branch only. Pushed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TOOLS: Add feature to delete the cached GPOs
6 participants