I have trouble setting up Anonymous authentication for Kibana, I use proxy auth (SAML) to allow users to access kibana. When I login with test user username is not set to sg_anonymous, uses the username from x-proxy-user. May I know whether Anonymous authentication works with only basic auth.
I would like a flow as if user is not present in roles_mapping, sg_ananymous should be triggered.
For any further information please do let me know.
That’s not really how anonymous authentication works. Basically the flow is like:
First we try to extract the user credentials from the request. In case of proxy auth, it’s the x-proxy-user and x-proxy-roles headers. In case of Basic Auth, it’s the Authorization HTTP header.
If no credentials are found in the first configured authentication domain (proxy_auth_domain in your case) we continue with the next authentication domain (basic_internal_auth_domain in your case)
If we were not able to extract credentials in any authentication domain , and anonymous authentication is enabled, then we create a user sg_anonymous with the backend role sg_anonymous_backendrole
Which means that we only fall back to anonymous authentication if no user credentials could be extracted. The question whether a user is actually mapped to a SG role in sg_roles_mapping.yml is not relevant.
I have issue when I map sg_anonymous_backendrole to guest_tenant I get no date in the kibana. when I used authinfo API I got guest_tenant: false. May I know why I get “false” value for the tenant.
In above sg_role.yml I have user admin_user write access to guest_tenant to create dashboards and guest users (sg_anonymous and guest_user) will see the dashboards. When I tried to access via kibana usign sg_anonymous I could tenant available but no data is visible whereas if I login with `guest_user" I could see all the data in the tenant.
I have enabled anonymous auth in kibana and elasticsearch.
If you required any further information please do let me know.
So to recap: You have created a user guest_user and mapped it to the SGS_GUEST role. And you have mapped the sg_anonymous_backendrole to this very same role.
If you use the guest user it works, but it does not work with the anonymous user, correct?
This seems strange since from the authinfo I can see that anonymout use is indee correctly mapped to the SGS_GUEST role.
So, what would be interesting to see is the authinfo call for the guest user, and compare it with the anonymous one. Some questions:
Are both the anonymous and the guest user also mapped to the SGS_KIBANA_USER (which replaces the legacy sg_kibana_user role)?
Do you have the guest_tenant also configured in sg_tenants.yml (newly introduced in 7)?
The false in the authinfo call means that the tenant is read-only. This is a legacy output that some Kibana functionality still relies on, but which will be removed in some of the next SG versions.
@jkressin Apologies for the delayed response. I have fixed the roles by mapping the backed_roles with SGS_KIBANA_USER. when I try to access the kibana, I could see no dashboards but the dashboard are configured in the tenant. Looks like sg_backend_roles are are looking for apm-* index pattern. Please find the attached.