Admin Access Checked for non superusers #7017

Closed
opened 2025-12-29 19:47:55 +01:00 by adam · 3 comments
Owner

Originally created by @davama on GitHub (Sep 22, 2022).

NetBox version

v3.3.4

Python version

3.9

Steps to Reproduce

  1. Login with ldap user account that is part of is_active and is_staff auth_groups.
  2. Admin page is accessible. Limited but reachable.

Expected Behavior

With the below ldap settings, this user should not have Admin Access

AUTH_LDAP_USER_FLAGS_BY_GROUP = {
    "is_active": [ "cn=netbox,ou=Group,dc=domain,dc=com","cn=netbox-ops,ou=Group,dc=domain,dc=com","cn=netbox-dcom,ou=Group,dc=domain,dc=com" ],
    "is_staff": [ "cn=netbox,ou=Group,dc=domain,dc=com","cn=netbox-ops,ou=Group,dc=domain,dc=com","cn=netbox-dcom,ou=Group,dc=domain,dc=com" ],
    "is_superuser": "cn=netbox-admin,ou=Group,dc=domain,dc=com"
}

Observed Behavior

image

User can access the Admin page.

image

User rights are wrong

image

User can be dangerous

I even deleted the user from the netbox DB. Then re-login (which recreates and assign groups based on ldap groups) but no change. Still have Admin Access checked in User Profile

Originally created by @davama on GitHub (Sep 22, 2022). ### NetBox version v3.3.4 ### Python version 3.9 ### Steps to Reproduce 1. Login with ldap user account that is part of `is_active` and `is_staff` auth_groups. 2. Admin page is accessible. Limited but reachable. ### Expected Behavior With the below ldap settings, this user should not have `Admin Access` ``` AUTH_LDAP_USER_FLAGS_BY_GROUP = { "is_active": [ "cn=netbox,ou=Group,dc=domain,dc=com","cn=netbox-ops,ou=Group,dc=domain,dc=com","cn=netbox-dcom,ou=Group,dc=domain,dc=com" ], "is_staff": [ "cn=netbox,ou=Group,dc=domain,dc=com","cn=netbox-ops,ou=Group,dc=domain,dc=com","cn=netbox-dcom,ou=Group,dc=domain,dc=com" ], "is_superuser": "cn=netbox-admin,ou=Group,dc=domain,dc=com" } ``` ### Observed Behavior ![image](https://i.imgur.com/p6XRtei.png) User can access the Admin page. ![image](https://i.imgur.com/pb1nXJj.png) User rights are wrong ![image](https://i.imgur.com/cQ80bIy.png) User can be dangerous I even deleted the user from the netbox DB. Then re-login (which recreates and assign groups based on ldap groups) but no change. Still have `Admin Access` checked in `User Profile`
adam added the type: bugstatus: revisions needed labels 2025-12-29 19:47:55 +01:00
adam closed this issue 2025-12-29 19:47:55 +01:00
Author
Owner

@davama commented on GitHub (Sep 22, 2022):

Please let me know if need more details
Thank you!

@davama commented on GitHub (Sep 22, 2022): Please let me know if need more details Thank you!
Author
Owner

@kkthxbye-code commented on GitHub (Sep 22, 2022):

https://demo.netbox.dev/static/docs/administration/authentication/overview/#local-authentication

Local user accounts and groups can be created in NetBox under the "Authentication and Authorization" section of the administrative user interface. This interface is available only to users with the "staff" permission enabled.

The only thing the staff flag does is give access to the admin interface, so I'm unsure what you believe the bug is? Where have you read what the staff flag does and what do you believe it is supposed to do?

@kkthxbye-code commented on GitHub (Sep 22, 2022): https://demo.netbox.dev/static/docs/administration/authentication/overview/#local-authentication > Local user accounts and groups can be created in NetBox under the "Authentication and Authorization" section of the administrative user interface. This interface is available only to users with the "staff" permission enabled. The only thing the staff flag does is give access to the admin interface, so I'm unsure what you believe the bug is? Where have you read what the staff flag does and what do you believe it is supposed to do?
Author
Owner

@davama commented on GitHub (Sep 22, 2022):

Oh!
Must have misunderstood.
Thank you for the response.
Closing

@davama commented on GitHub (Sep 22, 2022): Oh! Must have misunderstood. Thank you for the response. Closing
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7017