You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Stefan Billet (JIRA)" <ji...@apache.org> on 2019/04/24 14:33:00 UTC

[jira] [Commented] (SOLR-12584) Add basic auth credentials configuration to the Solr exporter for Prometheus/Grafana

    [ https://issues.apache.org/jira/browse/SOLR-12584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16825223#comment-16825223 ] 

Stefan Billet commented on SOLR-12584:
--------------------------------------

Hello everyone. Actually, it is possible to export metrics from a SolrCloud secured by Basic Auth, SSL and ZooKeeper ACLs without any change to the Exporter.
 The security configuration can be injected using environment variables. The exporter's main script _solr-exporter_ uses two external environment variables:
 * $JAVA_OPTS allows to add extra JVM options
 * $CLASSPATH_PREFIX allows to add extra libraries

Suppose you have a file basicauth.properties with the Solr Basic-Auth credentials:

{{httpBasicAuthUser=myUser}}
 {{httpBasicAuthPassword=myPassword}}

Then you can start the Exporter as follows.
 # export JAVA_OPTS="-Djavax.net.ssl.trustStore={color:#ff0000}truststore.jks{color} -Djavax.net.ssl.trustStorePassword={color:#ff0000}truststorePassword{color} -Dsolr.httpclient.builder.factory=org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory -Dsolr.httpclient.config={color:#ff0000}basicauth.properties{color} -DzkCredentialsProvider=org.apache.solr.common.cloud.VMParamsSingleSetCredentialsDigestZkCredentialsProvider -DzkDigestUsername={color:#ff0000}readonly-user{color} -DzkDigestPassword={color:#ff0000}zkUserPassword{color}"
 # export CLASSPATH_PREFIX="../../server/solr-webapp/webapp/WEB-INF/lib/commons-codec-1.11.jar"   (The Exporter needs Commons-Codec for SSL/BasicAuth), but doesn't bring it)
 # ./bin/solr-exporter -p 9854 -z {color:#ff0000}zk1:2181,zk2:2181,zk3:2181{color} -f ./conf/solr-exporter-config.xml -n 16

> Add basic auth credentials configuration to the Solr exporter for Prometheus/Grafana  
> --------------------------------------------------------------------------------------
>
>                 Key: SOLR-12584
>                 URL: https://issues.apache.org/jira/browse/SOLR-12584
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Authentication, metrics, security
>    Affects Versions: 7.3, 7.4
>            Reporter: Dwane Hall
>            Priority: Minor
>              Labels: authentication, metrics, security
>         Attachments: lucene-solr.patch
>
>
> The Solr exporter for Prometheus/Grafana provides a useful visual layer over the solr metrics api for monitoring the state of a Solr cluster. Currently this can not be configured and used on a secure Solr cluster with the Basic Authentication plugin enabled. The exporter does not provide a mechanism to configure/pass through basic auth credentials when SolrJ requests information from the metrics api endpoints and would be a useful addition for Solr users running a secure Solr instance.   



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org