Skip to content
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

Opensearch firewall problem with trusted network when updating app. #1239

Open
GiovanniColonni opened this issue Oct 3, 2024 · 2 comments
Open
Labels

Comments

@GiovanniColonni
Copy link
Contributor

Bug Report

I created a OpenSearch cluster in DO to forward logs from my app. The error i have is the following:
Error: Error updating app (xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx): PUT https://api.digitalocean.com/v2/apps/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx: 400 (request "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx") error validating app spec field "services.log_destinations.open_search.cluster_name": service "app-name" log destination "app-name" log destination "app-name-opensearch" trusted sources firewall rules found for cluster db-opensearch-logs. Please disable Trusted Sources for the cluster and try again.
If i disable the Trusted Sources and I open the cluster to any connection then this process works, but otherwise no.

Describe the bug

When attempting to forward logs from an app to a DigitalOcean OpenSearch cluster, the process fails if the Trusted Sources firewall rules are enabled. Disabling the Trusted Sources and allowing connections from all IPs makes the operation succeed. This behavior suggests that the Trusted Sources configuration conflicts with the app's logging destination validation process.

Affected Resource(s)

  • digitalocean_opensearch_cluster
  • digitalocean_app_log_destination
  • app platform

Expected Behavior

The application should successfully forward logs to the OpenSearch cluster while having Trusted Sources enabled for security purposes.

Actual Behavior

An error is thrown, preventing the app from forwarding logs to the OpenSearch cluster when Trusted Sources are enabled. The only workaround is to open the cluster to all connections, which compromises security.

Steps to Reproduce

  1. Create an OpenSearch cluster on DigitalOcean with Trusted Sources enabled.
  2. Set up an app in DigitalOcean that forwards logs to this OpenSearch cluster.
  3. Attempt to update or deploy the app with log forwarding configured.
  4. Encounter the error related to trusted sources firewall rules.
  5. Disable Trusted Sources and try again, which succeeds.

Terraform Configuration Files
The log destination:
log_destination { name = "app-${var.ENVIRONMENT}-opensearch" open_search { cluster_name = "db-app-opensearch-logs" index_name = "app-${var.ENVIRONMENT}-logs" basic_auth { user="user" } } }

@andrewsomething
Copy link
Member

Hi @GiovanniColonni,

This is currently a known product limitation.

Log forwarding does not support sending logs to DigitalOcean Managed OpenSearch clusters with trusted sources enabled. To send logs to a managed OpenSearch cluster, disable trusted sources.

https://docs.digitalocean.com/products/app-platform/how-to/forward-logs/

I'll pass on the feedback relevant teams internally.

@GiovanniColonni
Copy link
Contributor Author

Ok great thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants