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

Add CORS support for Riak add-ons [JIRA: RTS-1709] #1606

Open
Basho-JIRA opened this issue Jan 20, 2017 · 0 comments
Open

Add CORS support for Riak add-ons [JIRA: RTS-1709] #1606

Basho-JIRA opened this issue Jan 20, 2017 · 0 comments

Comments

@Basho-JIRA
Copy link

In order for Grafana Riak TS Datasource plugin to communicate with Riak TS via the HTTP interface, cross-origin resource sharing (CORS) comes into play (*), so should be opened.

To allow customers to specify the allowable origins w/i their environment, the allowable_origins should be configurable. That said, the add-on and others that may come are optional so should be configured in advanced.config.

CORS provides for a wildcard match for all origins "*". While this may be used, we should provide ample reason why this should not be used in documentation for the feature.

While Grafana is mentioned here several times, this feature opens Riak TS to other such trusted add-ons where the trust is configured by the customer.

An alternative to providing CORS support is to force the customer to setup a reverse proxy, i.e. nginx which intentionally disregards CORS. This option IMHO should be left as an option to the customer, not forced upon the customer, especially since such a reverse proxy provides a tunnel that can be abused by malicious services which the reverse proxy did not intend to grant such access to.

*) Grafana plugins are javascript and generally make direct calls to the underlying web services. Grafana does allow for proxying, but even then the Grafana service proxying respects CORS so passes Origin and Referer headers, i.e. the following simplified curl request yanked from the net tab:

curl -XPOST http://localhost:10018/ts/v1/query -d 'SHOW TABLES' -H 'Origin: http://localhost:3000' -H 'Referer: http://localhost:3000/datasources/edit/5'

Riak TS http in ^^ is listening on 10018. Grafana is listening on 3000.

[Created in JIRA by James Gorlick]

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

No branches or pull requests

1 participant