This is an automated email from the ASF dual-hosted git repository.
vikaskr22 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git
The following commit(s) were added to refs/heads/master by this push:
new 237a6cbc8 RANGER-5728: Update stress_kms script to run against Keberos
enabled . (#1143)
237a6cbc8 is described below
commit 237a6cbc85888e4894510519a46987f74e8671f9
Author: Vikas Kumar <[email protected]>
AuthorDate: Wed Aug 12 14:52:36 2026 +0530
RANGER-5728: Update stress_kms script to run against Keberos enabled .
(#1143)
* RANGER-5728: Update stress_kms script to run against Keberos enabled KMS
server
* RANGER-5728: Update stress_kms script to run against Keberos enabled KMS
server-Incorporated the review comments
* RANGER-5728: Update stress_kms script to run against Keberos enabled KMS
server-Incorporated the review
* RANGER-5728: Update stress_kms script to run against Keberos enabled KMS
server-fix review comment
---
ranger-tools/src/main/python/stress/stress_kms.py | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/ranger-tools/src/main/python/stress/stress_kms.py
b/ranger-tools/src/main/python/stress/stress_kms.py
index 7ab0c5b06..5e605f315 100755
--- a/ranger-tools/src/main/python/stress/stress_kms.py
+++ b/ranger-tools/src/main/python/stress/stress_kms.py
@@ -20,6 +20,7 @@
from apache_ranger.client.ranger_kms_client import RangerKMSClient
from apache_ranger.client.ranger_client import HadoopSimpleAuth
+from requests_kerberos import HTTPKerberosAuth, DISABLED
from apache_ranger.model.ranger_kms import RangerKey
from threading import Thread
from datetime import datetime
@@ -29,7 +30,7 @@
# This script requires Python package apache_ranger to be present.
# The package can be installed using following command:
# pip3 install --upgrade apache_ranger
-#
+# pip3 install requests-kerberos
##
## This script calls KMS APIs from multiple-threads
@@ -42,8 +43,14 @@
## encrypted_key_count: number of encrypted keys to generate per key
## thread_count: number of threads to call Apache Ranger APIs from
##
+kms_user = 'keyadmin' # used only when kms auth is 'simple'
+
+## Following instructions may be useful when KMS is running in Docker and
auth_type is Kerberos :
+## Use Docker network hostname in URL instead of localhost, like,
'http://ranger-kms.rangernw:9292'
+## Docker network hostname should be resolved to an IP.
+## On local system, update '/etc/hosts' to contain following entry:
+## 127.0.0.1 ranger-kms.rangernw ranger-kdc.rangernw
ranger.rangernw
kms_url = 'http://localhost:9292'
-kms_auth = HadoopSimpleAuth('keyadmin')
key_count = 320
rollover_key_count = 10
encrypted_key_count = 6
@@ -51,6 +58,11 @@
delete_on_exit = True
key_prefix = 'test_'
+# for simple:
+kms_auth = HadoopSimpleAuth(kms_user)
+# for kerberos:
+# kms_auth = HTTPKerberosAuth(mutual_authentication=DISABLED)
+
##
## Setup logging