Configure each service
For the complete documentation index see: llms.txt
All documentation pages available in markdown.
The get-started tutorial connected the authorization service’s write path in Aerospike to the support-search path in Elasticsearch over plain HTTP. This section adds the certificates and credentials each service needs to keep that same path encrypted, from the write in Aerospike to a support agent’s search in Elasticsearch.
-
Create
aerospike.confin the project directory. The file adds anetwork.tlsconfiguration for theasd.aerospike.comidentity, then enables mTLS on theesDCCross-Datacenter Replication (XDR) configuration.aerospike.conf service {cluster-name elasticsearch-demofeature-key-file /etc/aerospike/features.conf}logging {console {context any info}}network {tls asd.aerospike.com {cert-file /etc/aerospike/security/asd.aerospike.com.crtkey-file /etc/aerospike/security/asd.aerospike.com.keyca-file /etc/aerospike/security/ca.crt}service {address anyport 3000}heartbeat {mode meshport 3002address anyinterval 150timeout 10}fabric {port 3001address any}info {port 3003address any}}namespace test {replication-factor 1storage-engine memory {data-size 1G}nsup-period 10}xdr {dc esDC {connector truetls-name asd.aerospike.comnode-address-port aerospike-elasticsearch-outbound 8443 connector.aerospike.comnamespace test {}}}The
network.tlsconfiguration gives XDR the Aerospike client certificate, private key, and trusted CA. InesDC,tls-nameselects that TLS context, and the TLS name definition after the port innode-address-portidentifies the Elasticsearch connector asconnector.aerospike.com. See Secure XDR with TLS for the complete XDR TLS options. -
Create
aerospike-elasticsearch-outbound.ymlin the project directory. The file adds aservice.tlsconfiguration for the incoming XDR connection and atls-configunderes-clientfor the outgoing Elasticsearch connection.aerospike-elasticsearch-outbound.yml service:tls:port: 8443mutual-auth: trueallowed-peer-names:- asd.aerospike.comkey-store:store-type: PEMstore-file: /etc/aerospike-elasticsearch-outbound/security/connector.aerospike.com.keycertificate-chain-files: /etc/aerospike-elasticsearch-outbound/security/connector.aerospike.com.crttrust-store:store-type: PEMcertificate-files: /etc/aerospike-elasticsearch-outbound/security/ca.crtmanage:address: 0.0.0.0port: 8902logging:enable-console-logging: truerouting:mode: staticdestination: aerospikedoc-id:source: digestformat:mode: custombatch-formatter-class: com.aerospike.connect.elasticsearch.outbound.formatter.ElasticsearchDefaultBatchFormatterpayload-format:mode: flat-jsonmetadata-key: metadataes-client:cluster-config:type: on-premnodes:- host:hostname: elasticsearchport: 9200scheme: httpsauth-config:type: basicusername: elasticpassword-file: /etc/aerospike-elasticsearch-outbound/security/elastic-password.txttls-config:trust-store:store-type: PEMcertificate-files: /etc/aerospike-elasticsearch-outbound/security/ca.crtThe
service.tlssettings require a certificate issued by the local CA with the peer nameasd.aerospike.com. The Elasticsearch connector presents its own certificate fromkey-store. Underes-client, the Elasticsearch connector uses HTTPS, reads theelasticpassword from a file, and trusts Elasticsearch certificates issued by the local CA.For more options in this section, see Connector settings and Elasticsearch client.
-
Create
elasticsearch.ymlto enable authentication and serve HTTPS on port9200.elasticsearch.yml cluster.name: aerospike-demonode.name: elasticsearchnetwork.host: 0.0.0.0discovery.type: single-nodexpack.security.enabled: truexpack.security.http.ssl.enabled: truexpack.security.http.ssl.key: certs/elasticsearch.local.keyxpack.security.http.ssl.certificate: certs/elasticsearch.local.crtThe security setting activates the built-in
elasticuser and requires authentication. The HTTP SSL settings serve the Elasticsearch certificate over HTTPS. Transport-layer TLS between Elasticsearch nodes is not enabled in this single-node tutorial. -
Create
security/elastic-password.txtwith a dev-only password for theelasticuser. The Elasticsearch connector reads this value when it authenticates to Elasticsearch. The built-inelasticsuperuser is appropriate only for this local tutorial. For longer-lived environments, use a dedicated account or API key with only the permissions the Elasticsearch connector requires.Terminal echo -n "changeme-for-dev" > security/elastic-password.txtchmod 0640 security/elastic-password.txt
Checkpoint
Before you compose the stack, your project directory contains these configuration and security files:
Directoryaerospike-elastic-tls/
- .env
- aerospike-elasticsearch-outbound.yml
- aerospike.conf
- elasticsearch.yml
- features.conf
Directorysecurity/
- asd.aerospike.com.crt
- asd.aerospike.com.key
- ca.crt
- connector.aerospike.com.crt
- connector.aerospike.com.key
- elastic-password.txt
- elasticsearch.local.crt
- elasticsearch.local.key