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

Add SSL support #57

Merged
merged 1 commit into from
Jun 18, 2018
Merged

Add SSL support #57

merged 1 commit into from
Jun 18, 2018

Conversation

srilumpa
Copy link
Contributor

Hi,

This is an implementation proposal that should fix #56. The code is compiling but I haven't tested it (I don't know how to include the built project into a fresh TheHive or Cortex build).

Sorry for having removed the for comprehension structure used to generate the xpackClient but I haven't found a proper solution to keep it with multiple independent options so I got back to a more classical way to handle to client setting.

This pull request adds the following features:

  • Handle SSL transport between client and server
  • Can set path to custom CA if not included in the java truststore
  • Handle client authentication through certificate

Here is a sample configuration that should be supported from now on:

search {
  # Name of the index
  index = my_index
  # Name of the Elasticsearch cluster
  cluster = my_cluster
  # Address of the Elasticsearch instance
  host = ["127.0.0.1:9300"]
  # Scroll keepalive
  keepalive = 1m
  # Size of the page for scroll
  pagesize = 50
  # Number of shards
  nbshards = 5
  # Number of replicas
  nbreplicas = 1
  # Arbitrary settings
  settings {
    # Maximum number of nested fields
    mapping.nested_fields.limit = 100
  }
  # Username to log into the database
  username = application_user
  # password
  password = my_super_duper_password
  # SSL settings
  ssl {
    # Activate SSL support whhen connection to the database (default: false)
    enabled = true
    # Path to the custom CA certificate (default: will use the Java truststore)
    ca = /opt/my_app/ca.pem
    # Paths to the certificate and key used to log into the database if client certificate authentication is enabled on the Elastic cluster (default: none)
    certificate = /opt/my_app/client_cert.pem
    key = /opt/my_app/client_key.pem
  }
}

I hope this will fit your expectations. Don't hesitate to point me some improvements to be made if necessary.

@To-om To-om changed the base branch from master to develop June 18, 2018 13:23
@To-om To-om merged commit be547b3 into TheHive-Project:develop Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants