- Newest
- Most votes
- Most comments
The conf I posted is correct and works as expected. The problem was the user/passwors combination used.
answered 7 months ago
Based on your configuration, both SAML and basic authentication are enabled in your OpenSearch cluster, but there appears to be an issue with the authentication order or challenge settings.
In your security configuration, I notice that the SAML authentication domain has "challenge": true while the basic authentication domain has "challenge": false. This means that when authentication fails, the system is defaulting to challenging with SAML authentication rather than basic authentication.
To fix this issue, you have a few options:
-
Modify the order of authentication domains - The authentication domain with the lower "order" value is tried first. Currently, your basic_internal_auth_domain has order 4 and saml_auth_domain has order 5, which is correct, but other settings might be overriding this.
-
Set "challenge": true for the basic authentication domain - This would make the system challenge with basic auth when authentication fails.
-
Use explicit authentication headers - When making API calls with curl, try adding a specific header to indicate you want to use basic authentication.
For Amazon OpenSearch Service domains with fine-grained access control enabled, you can use both SAML for browser-based access to OpenSearch Dashboards and HTTP basic authentication for API calls. The internal user database allows you to create users that can authenticate with username and password credentials.
Make sure your internal user (the one you're using with curl) has been properly created in the internal user database and mapped to the appropriate roles. You mentioned mapping a local user to the "all_access" role, but verify this user is the same one you're using in your curl command.
If you're still having issues, you might need to check if there are any additional security settings or policies that could be affecting the authentication flow.
Sources
Tutorial: Configure a domain with the internal user database and HTTP basic authentication - Amazon OpenSearch Service
Tutorial: Configure a domain with an IAM master user and Amazon Cognito authentication - Amazon OpenSearch Service
Single sign-on SSO for Amazon OpenSearch Service using SAML and Keycloak | AWS Big Data Blog
answered 7 months ago
Hey,
Hope you're keeping well.
When SAML is enabled in Amazon OpenSearch Service, it typically becomes the primary challenge mechanism if its order is higher than Basic auth, especially when challenge is set to true. In your config, Basic auth has order: 4 and SAML has order: 5 with challenge: true, so browser-based access will always be redirected to the SAML IdP instead of prompting for Basic credentials. To use Basic auth alongside SAML, set the Basic auth domain to a lower order and ensure SAML’s challenge flag is false so it doesn’t override other methods.
Thanks and regards,
Taz
answered 7 months ago
Hey, thanks for your answer. The conf is correct and works as expected. Nevetherless is like the thrd time I reaqd about updating order/challenge but the security conf cannot be configured using the API (PUT operations are banned). So, how is people doing that? I was in a call with AWS and they claimed that they just provide "sane" defaults.
Relevant content
asked 6 years ago
asked 3 years ago

How can I change the order of the two plugins? I did not specify any order while enabling then in CDK (https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_opensearchservice/README.html#saml-authentication) How can I enable challenge for basic auth? Acocrding to docs I have no access to config/opensearch-security/config.yml and access to the security_config API endpoint is blocked.