rameeshm opened a new pull request, #809:
URL: https://github.com/apache/ranger/pull/809

   ## What changes were proposed in this pull request?
   
   This is the initial patch to have OpenSearch in docker setup to support. 
This will enabled to have the Ranger authorization and have also to  have 
OpenSearch as the one of the destination for Audit Service in Ranger
   
   
   ## How was this patch tested?
   Tested by bring up docker and running following commands
   `docker exec -e KRB5CCNAME=/tmp/krb5cc_testuser1 ranger-opensearch kinit -kt 
/etc/keytabs/testuser1.keytab testuser1/[email protected]`
   
   `docker exec -e KRB5CCNAME=/tmp/krb5cc_testuser1 ranger-opensearch klist`
   Ticket cache: FILE:/tmp/krb5cc_testuser1
   Default principal: testuser1/[email protected]
   
   Valid starting       Expires              Service principal
   01/17/2026 00:40:12  01/18/2026 00:40:12  krbtgt/[email protected]
   
   # check opensearch health
   `docker exec ranger-opensearch curl -s 
http://ranger-opensearch.rangernw:9200`
   {
     "name" : "ranger-opensearch.rangernw",
     "cluster_name" : "ranger-opensearch-cluster",
     "cluster_uuid" : "Gf6H-FgjQyOPBWQmqN95Vw",
     "version" : {
       "distribution" : "opensearch",
       "number" : "1.3.19",
       "build_type" : "tar",
       "build_hash" : "3ce0904c5e452a18ba343eecf04005bfd91b3249",
       "build_date" : "2024-08-23T00:37:19.891640Z",
       "build_snapshot" : false,
       "lucene_version" : "8.10.1",
       "minimum_wire_compatibility_version" : "6.8.0",
       "minimum_index_compatibility_version" : "6.0.0-beta1"
     },
     "tagline" : "The OpenSearch Project: https://opensearch.org/";
   }
   
   # create index
   `docker exec ranger-opensearch curl -s --negotiate -u : -X PUT 
"http://ranger-opensearch.rangernw:9200/testuser1_index"; -H 'Content-Type: 
application/json' -d '{ "settings": { "index": { "number_of_shards": 1, 
"number_of_replicas": 0 } } }'`
   
   # create document
   `
   docker exec ranger-opensearch curl -s --negotiate -u : -X POST 
"http://ranger-opensearch.rangernw:9200/testuser1_index/doc/1"; -H 
'Content-Type: application/json' -d '{ "user": "testuser1", "message": "Hello 
from testuser1 with Kerberos!", "timestamp": "'$(date -u 
+%Y-%m-%dT%H:%M:%SZ)'", "department": "engineering", "project": 
"opensearch-kerberos", "authenticated_by": "Kerberos" }'`
   
   `docker exec ranger-opensearch curl -s --negotiate -u : -X POST 
"http://ranger-opensearch.rangernw:9200/testuser1_index/doc/2"; -H 
'Content-Type: application/json' -d '{ "user": "testuser1", "message": "Second 
document from testuser1 with Kerberos!", "timestamp": "'$(date -u 
+%Y-%m-%dT%H:%M:%SZ)'", "department": "engineering", "project": 
"opensearch-kerberos", "authenticated_by": "Kerberos" }'`
   
   `docker exec ranger-opensearch curl -s --negotiate -u : -X GET 
"http://ranger-opensearch.rangernw:9200/testuser1_index/_search"; | python -m 
json.tool`
   {
       "took": 2,
       "timed_out": false,
       "_shards": {
           "total": 1,
           "successful": 1,
           "skipped": 0,
           "failed": 0
       },
       "hits": {
           "total": {
               "value": 2,
               "relation": "eq"
           },
           "max_score": 1.0,
           "hits": [
               {
                   "_index": "testuser1_index",
                   "_type": "doc",
                   "_id": "1",
                   "_score": 1.0,
                   "_source": {
                       "user": "testuser1",
                       "message": "Hello from testuser1 with Kerberos!",
                       "timestamp": "2026-01-17T00:54:26Z",
                       "department": "engineering",
                       "project": "opensearch-kerberos",
                       "authenticated_by": "Kerberos"
                   }
               },
               {
                   "_index": "testuser1_index",
                   "_type": "doc",
                   "_id": "2",
                   "_score": 1.0,
                   "_source": {
                       "user": "testuser1",
                       "message": "Second document from testuser1 with 
Kerberos!",
                       "timestamp": "2026-01-17T00:54:36Z",
                       "department": "engineering",
                       "project": "opensearch-kerberos",
                       "authenticated_by": "Kerberos"
                   }
               }
           ]
       }
   }
   
   `docker exec ranger-opensearch curl -s --negotiate -u : -X GET 
"http://ranger-opensearch.rangernw:9200/testuser1_index/_count"`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to