CIS Apache Solr Benchmark

Security configuration benchmark for Apache Solr search platform

v1.0.0 03-2025

Overview

▶

This benchmark provides prescriptive guidance for establishing a secure configuration posture for Apache Solr. It covers version management, authentication and authorization, TLS encryption, ZooKeeper security, logging, network binding, resource limits, data directory permissions, Config API restriction, backup configuration, and removal of unnecessary features.

14Recommendations
7Sections
2Profile Levels
SectionAreaFocus
1Installation & IdentityVersion management, dedicated user
2Authentication & AuthorizationBasicAuth, role-based access
3TLS ConfigurationEndpoint TLS, ZooKeeper security
4Logging & MonitoringAudit logs, slow query tracking
5Network & ResourcesBinding restrictions, JVM limits
6Data & API SecurityDirectory permissions, Config API
7Maintenance & HardeningBackups, feature removal

Profile Definitions

▶
ProfileDescriptionIntended Use
L1Level 1 — StandardEssential security for all Apache Solr deployments; minimal performance impact.
L2Level 2 — HardenedAdvanced hardening for PCI-DSS, HIPAA, or high-security environments.

1 — Installation & Identity

▶

1.1 Version & Process Security

▶
1.1.1 Ensure Solr is running the latest stable version (Manual)
L1 Manual
Description

This recommendation verifies that Solr is running the latest stable version on the Apache Solr search platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Solr search platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Verify Solr version
curl -s http://localhost:8983/solr/admin/info/system | python3 -m json.tool | grep -E 'solr-spec-version|lucene-spec-version'
Remediation
# Update Solr to latest stable
cd /opt
wget https://downloads.apache.org/solr/solr-9.x.x/solr-9.x.x.tgz
tar xzf solr-9.x.x.tgz
./solr-9.x.x/bin/install_solr_service.sh solr-9.x.x.tgz
systemctl restart solr
1.1.2 Ensure Solr runs as a dedicated non-root user (Automated)
L1 Auto
Description

This recommendation verifies that Solr runs as a dedicated non-root user on the Apache Solr search platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Solr search platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check Solr runs as dedicated user
ps -eo user,pid,comm | grep solr
grep '^SOLR_USER=' /etc/default/solr.in.sh
Remediation
# Configure dedicated user
useradd -r -s /usr/sbin/nologin solr
chown -R solr:solr /var/solr /opt/solr
# In /etc/default/solr.in.sh:
SOLR_USER="solr"

2 — Authentication & Authorization

▶

2.1 Auth Plugins

▶
2.1.1 Ensure authentication is enabled with blockUnknown (Automated)
L1 Auto
Description

This recommendation verifies that authentication is enabled with blockUnknown on the Apache Solr search platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Solr search platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check authentication enabled
grep -r 'authenticationPlugin' /var/solr/data/security.json 2>/dev/null
curl -s http://localhost:8983/solr/admin/authentication
Remediation
# Enable BasicAuth
cat > /var/solr/data/security.json << 'EOF'
{
  "authentication": {
    "blockUnknown": true,
    "class": "solr.BasicAuthPlugin",
    "credentials": {}
  },
  "authorization": {
    "class": "solr.RuleBasedAuthorizationPlugin",
    "permissions": [{"name": "security-edit", "role": "admin"}],
    "user-role": {"solradmin": "admin"}
  }
}
EOF
chown solr:solr /var/solr/data/security.json
2.1.2 Ensure role-based authorization is configured (Automated)
L1 Auto
Description

This recommendation verifies that role-based authorization is configured on the Apache Solr search platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Solr search platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check Solr authorization rules
curl -s -u admin:pass http://localhost:8983/solr/admin/authorization | python3 -m json.tool
Remediation
# Configure role-based authorization
curl -s -u admin:pass http://localhost:8983/solr/admin/authorization \
  -H 'Content-Type: application/json' \
  -d '{
    "set-permission": {"name": "read", "role": "reader"},
    "set-permission": {"name": "update", "role": "writer"},
    "set-permission": {"name": "all", "role": "admin"}
  }'

3 — TLS Configuration

▶

3.1 Transport & ZooKeeper TLS

▶
3.1.1 Ensure TLS is enabled for all Solr endpoints (Automated)
L1 Auto
Description

This recommendation verifies that TLS is enabled for all Solr endpoints on the Apache Solr search platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Solr search platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check TLS configuration
grep -E 'SOLR_SSL_|solr.ssl' /etc/default/solr.in.sh
curl -s https://localhost:8983/solr/ -k
Remediation
# Configure TLS in /etc/default/solr.in.sh:
SOLR_SSL_ENABLED=true
SOLR_SSL_KEY_STORE=/opt/solr/server/etc/solr-ssl.keystore.p12
SOLR_SSL_KEY_STORE_PASSWORD=changeit
SOLR_SSL_KEY_STORE_TYPE=PKCS12
SOLR_SSL_TRUST_STORE=/opt/solr/server/etc/solr-ssl.truststore.p12
SOLR_SSL_TRUST_STORE_PASSWORD=changeit
SOLR_SSL_NEED_CLIENT_AUTH=false
SOLR_SSL_WANT_CLIENT_AUTH=false
SOLR_SSL_CLIENT_HOSTNAME_VERIFICATION=true
3.1.2 Ensure ZooKeeper connections use digest authentication (Automated)
L1 Auto
Description

This recommendation verifies that ZooKeeper connections use digest authentication on the Apache Solr search platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Solr search platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check ZooKeeper connection security
grep -E 'ZK_HOST|zkACLProvider|zkCredentialsInjector' /etc/default/solr.in.sh
Remediation
# Secure ZooKeeper communication
# In /etc/default/solr.in.sh:
SOLR_ZK_CREDS_AND_ACLS="-DzkACLProvider=org.apache.solr.common.cloud.DigestZkACLProvider \
  -DzkCredentialsProvider=org.apache.solr.common.cloud.DigestZkCredentialsProvider \
  -DzkDigestUsername=admin -DzkDigestPassword=secureZKpass"
# Add to SOLR_OPTS:
SOLR_OPTS="$SOLR_OPTS $SOLR_ZK_CREDS_AND_ACLS"

4 — Logging & Monitoring

▶

4.1 Audit & Request Logs

▶
4.1.1 Ensure audit logging with rotation is configured (Automated)
L1 Auto
Description

This recommendation verifies that audit logging with rotation is configured on the Apache Solr search platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Solr search platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check Solr logging configuration
cat /opt/solr/server/resources/log4j2.xml | grep -E 'Root level|Appender'
Remediation
# Configure audit logging in log4j2.xml
# Add audit appender:
<RollingFile name="AuditFile" fileName="/var/solr/logs/audit.log"
  filePattern="/var/solr/logs/audit-%d{yyyy-MM-dd}.log.gz">
  <PatternLayout pattern="%d %-5p [%t] %c{1.} - %m%n"/>
  <Policies>
    <TimeBasedTriggeringPolicy interval="1"/>
    <SizeBasedTriggeringPolicy size="100MB"/>
  </Policies>
  <DefaultRolloverStrategy max="30"/>
</RollingFile>
4.1.2 Ensure slow query logging is enabled (Automated)
L1 Auto
Description

This recommendation verifies that slow query logging is enabled on the Apache Solr search platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Solr search platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check request logging
grep -E 'solr.log.dir|slowQueryThresholdMillis' /etc/default/solr.in.sh
ls -la /var/solr/logs/
Remediation
# Configure request logging
# In /etc/default/solr.in.sh:
SOLR_LOGS_DIR=/var/solr/logs
SOLR_LOG_LEVEL=WARN
# In solrconfig.xml per collection:
<slowQueryThresholdMillis>1000</slowQueryThresholdMillis>
# Configure log rotation:
find /var/solr/logs -name '*.log' -mtime +30 -delete

5 — Network & Resources

▶

5.1 Binding & Limits

▶
5.1.1 Ensure Solr binds only to required interfaces (Automated)
L1 Auto
Description

This recommendation ensures that Solr binds only to required interfaces on the Apache Solr search platform. Enforcing this requirement establishes a minimum security standard and prevents insecure configurations.

Rationale

Without this enforcement, the Apache Solr search platform may accept insecure configurations that weaken overall security posture. Mandating this control ensures consistent protection against common attack vectors.

Audit
# Check network binding
grep 'SOLR_HOST\|SOLR_PORT\|SOLR_JETTY_HOST' /etc/default/solr.in.sh
ss -tlnp | grep -E '8983|8984'
Remediation
# Restrict network binding
# In /etc/default/solr.in.sh:
SOLR_HOST=solr.internal
SOLR_PORT=8983
SOLR_JETTY_HOST=127.0.0.1
# Use firewall to restrict access:
ufw allow from 10.0.0.0/8 to any port 8983
5.1.2 Ensure JVM heap and OS resource limits are configured (Automated)
L1 Auto
Description

This recommendation verifies that JVM heap and OS resource limits are configured on the Apache Solr search platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Solr search platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check resource limits
grep -E 'SOLR_HEAP|GC_|SOLR_JAVA_MEM' /etc/default/solr.in.sh
ulimit -a | grep -E 'open files|max user'
Remediation
# Configure resource limits
# In /etc/default/solr.in.sh:
SOLR_HEAP="512m"
SOLR_JAVA_MEM="-Xms512m -Xmx1024m"
GC_LOG_OPTS="-verbose:gc"
# In /etc/security/limits.d/solr.conf:
solr soft nofile 65000
solr hard nofile 65000
solr soft nproc 65000
solr hard nproc 65000

6 — Data & API Security

▶

6.1 Permissions & Config Protection

▶
6.1.1 Ensure data directory permissions are restricted (Automated)
L1 Auto
Description

This setting ensures that data directory permissions are restricted on the Apache Solr search platform. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.

Rationale

Unrestricted access to this capability could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the Apache Solr search platform is essential for defense in depth.

Audit
# Check data directory permissions
find /var/solr -type f -perm /o=rwx -ls 2>/dev/null | head -20
stat -c '%a %U %G' /var/solr/data
Remediation
# Restrict data directory permissions
chown -R solr:solr /var/solr
chmod -R 750 /var/solr/data
chmod 640 /var/solr/data/security.json
find /var/solr -type f -exec chmod 640 {} \;
6.1.2 Ensure Config API and remote streaming are disabled (Automated)
L1 Auto
Description

This recommendation verifies that Config API and remote streaming are disabled on the Apache Solr search platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Solr search platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check Config API protection
curl -s http://localhost:8983/solr/admin/configs | head -20
grep 'configset.upload.enabled' /etc/default/solr.in.sh
Remediation
# Restrict Config API
# In /etc/default/solr.in.sh:
SOLR_OPTS="$SOLR_OPTS -Dconfigset.upload.enabled=false"
# Disable remote streaming in solrconfig.xml:
<requestParsers enableRemoteStreaming="false"
  enableStreamBody="false"
  multipartUploadLimitInKB="2048"/>

7 — Maintenance & Hardening

▶

7.1 Backups & Feature Removal

▶
7.1.1 Ensure automated backup procedures are configured (Automated)
L1 Auto
Description

This recommendation verifies that automated backup procedures are configured on the Apache Solr search platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Solr search platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check backup configuration
ls -la /var/solr/backups/ 2>/dev/null
curl -s http://localhost:8983/solr/admin/collections?action=LISTBACKUP
Remediation
# Configure automated backups
mkdir -p /var/solr/backups
chown solr:solr /var/solr/backups
# Use Collections API for backups:
curl -s 'http://localhost:8983/solr/admin/collections?action=BACKUP&name=backup_$(date +%F)&collection=mycore&location=/var/solr/backups'
# Schedule via cron:
0 2 * * * /opt/solr/bin/solr export -query '*:*' -out /var/solr/backups/daily.json
7.1.2 Ensure unnecessary response writers and handlers are removed (Automated)
L1 Auto
Description

This recommendation verifies that unnecessary response writers and handlers are removed on the Apache Solr search platform. Disabling or removing unnecessary components reduces the attack surface and limits potential vectors for exploitation.

Rationale

Running unnecessary components on the Apache Solr search platform increases the attack surface and the risk of exploitation. Disabling or removing them follows the principle of least functionality and reduces exposure to known vulnerabilities.

Audit
# Check for unnecessary handlers
curl -s http://localhost:8983/solr/admin/info/system | grep -E 'mode|solr_home'
find /opt/solr -name 'solrconfig.xml' -exec grep -l 'VelocityResponseWriter' {} \;
Remediation
# Remove unnecessary features
# In solrconfig.xml, remove/comment:
<!-- <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter"/> -->
# Disable the XSLT response writer:
<!-- <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter"/> -->
# Remove unused request handlers:
# Review and remove /debug/dump, /admin/file handlers if not needed