Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

There are 3 different ways to connect with authentication: with username/password, Azure AD or Amazon Web Services (AWS).

Step-by-step guide (Username/password)

To connect to an Elasticsearch with basic authentication you will need to encrypt your password and add the right values to the configuration.

Step-by-step guide

Follow the next steps:

  1. Encrypt the password.
    1. Locate on <saga>/bin the file saga-secure-<version>.jar
    2. In a terminal run, in Saga's root folder.

      Code Block
      languagetext
      titleConsole / Terminal / Command
      java -jar bin/saga-secure-<version>.jar -ep=<password> -config="config/config.json"
    3. Keep the generated pwd.txt file at hand, you'll need to reference it in the configuration.
  2. Update the configuration in <saga>/config/config.json.
    1. Update "providers"

      Saga_json
      "providers": [
            {
              "name": "filesystem-provider",
              "type": "FileSystem",
              "baseDir": "./config"
            },
            {
              "name": "saga-provider",
              "type": "Elastic",
              "indexName": "saga",
              "nodeUrls": ["http://localhost:9200"],
              "authentication":"none"
      		"user": "<username>",
      		"password": "<path_to_pwd_file>",
              "timestamp": "updatedAt",
              "exclude": [
                "updatedAt",
                "createdAt"
              ]
            }


      1. Notice the values of "user" and "password".
    2. Update "solutions"

      Saga_json
      "solutions": [
            {
              "display": "Saga",
              "elasticSearch": {
                "nodeUrls": ["http://localhost:9200"],
                "indexName": "saga",
      		  "user": "<username>",
      		  "password": "<path_to_pwd_file>",
                "timeout": 30,
                "delay": 5,
                "retries": 3
              }
            }
          ]


      1. Again notice the values of "user" and "password".

...

  1. Copy Saga's encryption key file to <aspire>/bin/
  2. Copy pwd.txt to <aspire>/bin/ as well.
  3. Update the Saga's config file (the one within the Aspire configuration folder) to reflect the relative path of those files:

    Saga_json
    {
    	"config": {
        	"security": {
    			"encryptionKeyFile": "./bin/saga.ek"
            },
        	"libraryJars": [
                "./lib"
            ],
    		...
    	"providers": [
         	{
    			"name": "filesystem-provider",
    			"type": "FileSystem",
    			"baseDir": "./config"
    		},
    		{
    			"name": "saga-provider",
    			"type": "Elastic",
    			"indexName": "saga",
    			"nodeUrls": [
    				"http://localhost:9200"
    			],
    			"user": "<user>",
    			"password": "./bin/pwd.txt",
    			"timestamp": "updatedAt",
    			"exclude": [
    				"updatedAt",
    				"createdAt"
    			],
    			"maxResults": 2000000
    		}
    	]
    }
    1. Notice the values of "encryptionKeyFile" and "password".

Step-by-step guide (AWS)

To connect to an Elasticsearch with AWS authentication you will need to set your Amazon Web Services credentials locally as environmental variables or get them from the ECS or EC2 credentials.

Follow the next steps:

  1. Set your AWS credentials.
    1. Set your credentials using the AWS CLI. You can see how to do that here.
    2. Or, you can load credentials from you ECS or EC2 instance. With IAM roles for Amazon ECS Tasks, you can specify an IAM role that can be used by the containers in a task to access AWS resources.


      Info
      titleNote

      SagaElasticIndexer gets the credentials automatically by getting the credentials file. That is why you only need to specify region and service in the config file which is below this note.

  2. Update the configuration in <saga>/config/config.json.
    1. Update "providers" using authentication factor as "aws".

      Saga_json
      "providers": [
            {
              "name": "filesystem-provider",
              "type": "FileSystem",
              "baseDir": "./config"
            },
            {
              "name": "saga-provider",
              "type": "Elastic",
              "indexName": "saga",
              "nodeUrls": ["http://localhost:9200"],
              "authentication":"aws",
              "service": "<aws_service>",
              "region": "<region_where_the_aws_service_is_located>"
              "timestamp": "updatedAt",
              "exclude": [
                "updatedAt",
                "createdAt"
              ]
            }


      1. Notice the values of "service" and "region".
    2. Update "solutions" using authentication factor as "aws".

      Saga_json
      "solutions": [
            {
              "display": "Saga",
              "elasticSearch": {
                "nodeUrls": ["http://localhost:9200"],
                "indexName": "saga",
      		  "authentication":"aws",
                "service": "<aws_service>",
                "region": "<region_where_the_aws_service_is_located>",
                "timeout": 30,
                "delay": 5,
                "retries": 3
              }
            }
          ]


      1. Again notice the values of "service" and "region".


Content by Label
showLabelsfalse
max5
spacessaga131
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("elasticsearch","configuration","authentication","aspire") and type = "page" and space = "saga131"
labelsElasticsearch

...