Security

Opensolr Security — find answers to your questions

API - Update HTTP Auth

Security API

Update HTTP Auth

Set or update HTTP Basic Authentication credentials for your Opensolr Index. Protects your Solr endpoints with username/password authentication.

Endpoint

GET https://opensolr.com/solr_manager/api/update_http_auth

Parameters

ParameterStatusDescription
emailRequiredYour Opensolr registration email address
api_keyRequiredYour Opensolr API key
core_nameRequiredThe name of the index you wish to add or update HTTP Auth protection for
usernameRequiredThe username for HTTP Basic Auth on this index
passwordRequiredThe password for HTTP Basic Auth on this index
Once HTTP Auth is enabled, all requests to your Solr index (queries, updates, admin) will require the credentials you set here. Make sure your application is configured with the new credentials before enabling this.

Code Examples

cURL

curl -s "https://opensolr.com/solr_manager/api/update_http_auth?email=YOUR_EMAIL&api_key=YOUR_API_KEY&core_name=my_solr_core&username=index_auth_username&password=index_auth_password"

PHP

$params = http_build_query([
    'email'     => 'YOUR_EMAIL',
    'api_key'   => 'YOUR_API_KEY',
    'core_name' => 'my_solr_core',
    'username'  => 'index_auth_username',
    'password'  => 'index_auth_password',
]);
$response = file_get_contents("https://opensolr.com/solr_manager/api/update_http_auth?{$params}");
$result = json_decode($response, true);
print_r($result);

Python

import requests

response = requests.get("https://opensolr.com/solr_manager/api/update_http_auth", params={
    "email": "YOUR_EMAIL",
    "api_key": "YOUR_API_KEY",
    "core_name": "my_solr_core",
    "username": "index_auth_username",
    "password": "index_auth_password",
})
print(response.json())

Related Documentation

Need help securing your Opensolr Indexes? We are here to help.

Contact Support
Read Full Answer

API - Add index IP access rule

Security API

Add IP Access Rule

Grant access to a specific IP address for a particular Solr handler on your Opensolr Index. Use IP-based rules to restrict who can query or update your index.

Endpoint

GET https://opensolr.com/solr_manager/api/add_ip

Parameters

ParameterStatusDescription
emailRequiredYour Opensolr registration email address
api_keyRequiredYour Opensolr API key
core_nameRequiredThe name of the index you wish to add an IP rule to
ipRequiredThe IP address you wish to grant access (e.g., 15.24.53.123)
handlerRequiredThe Solr URI handler to apply the rule to (e.g., /update, /select)
IP rules are applied per handler. For example, you can restrict /update to your server's IP while leaving /select open for public search queries.

Code Examples

cURL

curl -s "https://opensolr.com/solr_manager/api/add_ip?email=YOUR_EMAIL&api_key=YOUR_API_KEY&core_name=my_solr_core&ip=15.24.53.123&handler=/update"

PHP

$params = http_build_query([
    'email'     => 'YOUR_EMAIL',
    'api_key'   => 'YOUR_API_KEY',
    'core_name' => 'my_solr_core',
    'ip'        => '15.24.53.123',
    'handler'   => '/update',
]);
$response = file_get_contents("https://opensolr.com/solr_manager/api/add_ip?{$params}");
$result = json_decode($response, true);
print_r($result);

Python

import requests

response = requests.get("https://opensolr.com/solr_manager/api/add_ip", params={
    "email": "YOUR_EMAIL",
    "api_key": "YOUR_API_KEY",
    "core_name": "my_solr_core",
    "ip": "15.24.53.123",
    "handler": "/update",
})
print(response.json())

Related Documentation

Need help securing your Opensolr Indexes? We are here to help.

Contact Support
Read Full Answer

API - Get index IP list

Security API

Get IP Access List

Retrieve all IP-based access rules currently configured for your Opensolr Index. Returns the full list of IPs and their associated handlers.

Endpoint

GET https://opensolr.com/solr_manager/api/get_ip_list

Parameters

ParameterStatusDescription
emailRequiredYour Opensolr registration email address
api_keyRequiredYour Opensolr API key
core_nameRequiredThe name of the index you wish to get the IP list for

Code Examples

cURL

curl -s "https://opensolr.com/solr_manager/api/get_ip_list?email=YOUR_EMAIL&api_key=YOUR_API_KEY&core_name=my_solr_core"

PHP

$params = http_build_query([
    'email'     => 'YOUR_EMAIL',
    'api_key'   => 'YOUR_API_KEY',
    'core_name' => 'my_solr_core',
]);
$response = file_get_contents("https://opensolr.com/solr_manager/api/get_ip_list?{$params}");
$result = json_decode($response, true);
print_r($result);

Python

import requests

response = requests.get("https://opensolr.com/solr_manager/api/get_ip_list", params={
    "email": "YOUR_EMAIL",
    "api_key": "YOUR_API_KEY",
    "core_name": "my_solr_core",
})
print(response.json())
Use this endpoint to audit your current IP restrictions before making changes. It's a good practice to review your IP list periodically to ensure only authorized IPs have access.

Related Documentation

Need help securing your Opensolr Indexes? We are here to help.

Contact Support
Read Full Answer

API - Remove IP access

Security API

Remove IP Access Rule

Revoke a previously granted IP access rule from your Opensolr Index. Removes the specified IP and handler combination from the access list.

Endpoint

GET https://opensolr.com/solr_manager/api/delete_ip

Parameters

ParameterStatusDescription
emailRequiredYour Opensolr registration email address
api_keyRequiredYour Opensolr API key
core_nameRequiredThe name of the index you wish to remove an IP rule from
ipRequiredThe IP address you wish to remove (e.g., 15.24.53.123)
handlerRequiredThe Solr URI handler that the restriction was applied to (e.g., /update)
Removing an IP rule is immediate. Make sure you are not locking out your own application by removing the wrong IP. Use the Get IP List API first to review your current rules.

Code Examples

cURL

curl -s "https://opensolr.com/solr_manager/api/delete_ip?email=YOUR_EMAIL&api_key=YOUR_API_KEY&core_name=my_solr_core&ip=15.24.53.123&handler=/update"

PHP

$params = http_build_query([
    'email'     => 'YOUR_EMAIL',
    'api_key'   => 'YOUR_API_KEY',
    'core_name' => 'my_solr_core',
    'ip'        => '15.24.53.123',
    'handler'   => '/update',
]);
$response = file_get_contents("https://opensolr.com/solr_manager/api/delete_ip?{$params}");
$result = json_decode($response, true);
print_r($result);

Python

import requests

response = requests.get("https://opensolr.com/solr_manager/api/delete_ip", params={
    "email": "YOUR_EMAIL",
    "api_key": "YOUR_API_KEY",
    "core_name": "my_solr_core",
    "ip": "15.24.53.123",
    "handler": "/update",
})
print(response.json())

Related Documentation

Need help securing your Opensolr Indexes? We are here to help.

Contact Support
Read Full Answer