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

Allow non privileged user to manage local instance #6533

Open
tkontogi opened this issue Jan 22, 2025 · 0 comments
Open

Allow non privileged user to manage local instance #6533

tkontogi opened this issue Jan 22, 2025 · 0 comments
Labels
needs triage The issue will be triaged during scrum

Comments

@tkontogi
Copy link

tkontogi commented Jan 22, 2025

Is your feature request related to a problem? Please describe.
Use case:
Migrating from openLDAP to 389-DS.
The appadmin user is used in openLDAP for DIT management.
The same workflow is desired in 389.
Cockpit does not allow non-privileged users to manage the DS instance that the root user created.

Describe the solution you'd like
Through a polkit rule, allow specific/listed users to manage locally running instance created by the root user.

Describe alternatives you've considered
Created the following:

cat /etc/polkit-1/rules.d/60-cockpit.rules 
polkit.addRule(function(action, subject) {
    // Replace 'ldapuser' with the actual LDAP username
    if (subject.user == "appadmin") {
        // List of allowed apps for this user
        var allowedApps = [
            "org.cockpit.389-console" // Directory Server Management
        ];

        // Allow access only to the apps in the allowed list
        if (allowedApps.indexOf(action.id) >= 0) {
            return polkit.Result.YES;
        }

        // Explicitly deny access to everything else
        return polkit.Result.NO;
    }

    // Default behavior for other users (can be omitted if unnecessary)
    return polkit.Result.DEFAULT;
});


Then the user is expected by cockpit to elevate permissions so that it can run cockpit-bridge --privilledged.

Adding that for the user in sudoers allows the user to elevate permissions and gain access to all cockpit apps which overrides the purpose of being able to only use the 389 application.

Additional context
Add any other context or screenshots about the feature request here.

@tkontogi tkontogi added the needs triage The issue will be triaged during scrum label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage The issue will be triaged during scrum
Projects
None yet
Development

No branches or pull requests

1 participant