Score:1

Configuring Netbox to get authorization information via REMOTE_AUTH?

pt flag

I'm trying to set up an oauth2 proxy in front of Netbox (to authenticate against a local Keycloak instance). I have the following configuration in the /etc/netbox/config/extra.py:

REMOTE_AUTH_ENABLED=True
REMOTE_AUTH_AUTO_CREATE_USER=True
REMOTE_AUTH_HEADER='HTTP_X_FORWARDED_PREFERRED_USERNAME'
REMOTE_AUTH_GROUP_HEADER='HTTP_X_FORWARDED_GROUPS'
REMOTE_AUTH_GROUP_SYNC_ENABLED=True
REMOTE_AUTH_SUPERUSER_GROUPS=['netbox-admin']
REMOTE_AUTH_GROUP_SEPARATOR=','

Authentication works just fine; I can enter my credentials and Netbox shows my email address in the account menu.

Requests have an X-Forwarded-* headers that look like:

X-Forwarded-Preferred-Username: [email protected]
X-Forwarded-Groups: default-roles-example,offline_access,netbox-admin,uma_authorization,role:default-roles-example,role:offline_access,role:netbox-admin,role:uma_authorization,role:account:manage-account,role:account:manage-account-links,role:account:view-profile

I have verified that these headers are present in requests to Netbox.

I've tried setting REMOTE_AUTH_GROUP_HEADER and REMOTE_AUTH_GROUP_SEPARATOR appropriately, but viewing the account profile (https://netbox.../user/profile/) always shows "Groups: None", and I'm not able to get superuser privileges.

Is there something obvious missing from my configuration?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.