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

Allow not only indexName but also full url (when working with reverse proxy) #1032

Open
xorock opened this issue Mar 14, 2023 · 3 comments
Open
Labels
question Further information is requested

Comments

@xorock
Copy link

xorock commented Mar 14, 2023

Hi.
Although the indexName value fits perfectly with the idea of meilisearch indexes it is not quite safe. The prepared URL requires opening access directly to http://ms:7700/. It is much safer to prepare the address under a server's reverse proxy that contains only the needed index.

location /movies-index {
        [...]
        proxy_pass  http://ms:7700/indexes/movies/search/;
    }

What do you think about the proposal to make the indexName value take the name of the index or the full URL. Or the second option - introduce a new value and one of the two must be required.

@bidoubiwa
Copy link
Contributor

bidoubiwa commented Mar 14, 2023

When you create your client

const client = instantMeilisearch("http://ms:7700/. "apiKey")

It is not doing any requests to the server.
instant-meilisearch is only going to request on the route: http://ms:7700/indexes/movies/search/ whenever you start searching.

Since it is only using this route, you do not need to open direct access to http://ms:7700/ i suppose.

Why do you think it is insecure to let the other routes be public?

@bidoubiwa bidoubiwa added the question Further information is requested label Mar 14, 2023
@xorock
Copy link
Author

xorock commented Mar 14, 2023

If I allow access directly to the root address / many bad things can happen. Bad permissions can be given, not only search but also delete. Index settings can be read. If the developer makes a mistake and uses the admin key by accident, full access to everything is opened. Through a bug in MS that doesn't exist yet, maybe attacker can get access to the machine etc.
If possible, access should be restricted at every stage and the current implementation does not allow it (unless I am not aware of something).

@bidoubiwa
Copy link
Contributor

I understand your concern! I think this should be moved to the product repository. It's definitely something that should be discussed :)

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

No branches or pull requests

2 participants