-
Notifications
You must be signed in to change notification settings - Fork 931
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
Unable to see non-LXD managed networks for OIDC identity with server admin entitlement #14085
Comments
@markylaing is this a bug? |
@mas-who which LXD version please |
@tomponline I tested this with LXD snap for both |
Please can you provide output of |
Sure will make sure to include this in the future, here's the
|
Thanks for reporting @mas-who. @tomponline yes this is a bug, we've documented that The reason for this is that the OpenFGA driver relies on the database, but these networks are not in the database! It's an edge case that I should have thought about. I think we should add a new entitlement to |
While working on #14085 I set up a new fine-grained TLS identity and issued the following commands as that identity, without any permissions yet (I forgot I'd changed my default remote): ``` $ lxc auth group create tmp Error: Forbidden $ lxc auth group permission add tmp server admin Error: Failed to check OpenFGA relation: No such entity "/1.0/auth/groups/tmp" ``` Creating the group failed, this is correct behaviour. When attempting to add a permission to the non-existent group, the request failed (correct) but the OpenFGA Authorization driver returned the above error. This is incorrect. This PR checks if the error returned by a `Check` request on the embedded OpenFGA server is a `Not Found` error and returns a generic not found error. This makes errors returned by the authorizer consistent. We are masking all not found errors returned before access control decisions are made to prevent discovery. After this change, the same command returns: ``` $ lxc auth group permission add tmp server admin Error: Not Found ```
Issue description
When making an API request to
GET /1.0/networks
as a TLS authenticated identity, all networks are reported by LXD in the response as shown in the example below:However, when making the same request as an OIDC authenticated identity, with server admin entitlement assigned, the API response shows only the LXD managed networks as shown below.
Since the OIDC identity has server admin entitlement, I would expect to see all networks shown within the API response. This seems like a possible bug in permissions check specifically related to networks.
The above behaviour was seen in the
latest/edge
and5.21/edge
LXD snap.The text was updated successfully, but these errors were encountered: