Copilot commented on code in PR #704:
URL: https://github.com/apache/ranger/pull/704#discussion_r2443240243


##########
dev-support/ranger-docker/config/kdc/create_keytab.sh:
##########
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+ADMIN_PRINCIPAL=admin/admin
+ADMIN_PASSWORD=rangerR0cks!

Review Comment:
   Hard-coded credentials in the script create a security vulnerability. These 
credentials should be passed as environment variables or parameters instead of 
being embedded in the script.



##########
dev-support/ranger-docker/scripts/ranger-admin-install-oracle.properties:
##########
@@ -91,3 +91,12 @@ STALE_PATCH_ENTRY_HOLD_TIME=10
 
 hadoop_conf=
 authentication_method=UNIX
+
+#------------ Kerberos Config -----------------
+spnego_principal=HTTP/_HOST@REALM
+spnego_keytab=/etc/keytabs/HTTP.keytab
+token_valid=30
+admin_principal=rangeradmin/_HOST@REALM
+admin_keytab=/etc/keytabs/rangeradmin.keytab
+lookup_principal=rangerlookup/_HOST@REALM
+lookup_keytab=/etc/keytabs/rangerlookup.keytab

Review Comment:
   All keytab path references use `/etc/keytabs/` but the script creates them 
in `/opt/ranger/admin/keytabs`. These paths should be updated to 
`/opt/ranger/admin/keytabs/` to match the actual keytab location defined in 
ranger.sh.
   ```suggestion
   spnego_keytab=/opt/ranger/admin/keytabs/HTTP.keytab
   token_valid=30
   admin_principal=rangeradmin/_HOST@REALM
   admin_keytab=/opt/ranger/admin/keytabs/rangeradmin.keytab
   lookup_principal=rangerlookup/_HOST@REALM
   lookup_keytab=/opt/ranger/admin/keytabs/rangerlookup.keytab
   ```



##########
dev-support/ranger-docker/scripts/ranger-admin-install-sqlserver.properties:
##########
@@ -97,3 +97,12 @@ STALE_PATCH_ENTRY_HOLD_TIME=10
 
 hadoop_conf=
 authentication_method=UNIX
+
+#------------ Kerberos Config -----------------
+spnego_principal=HTTP/_HOST@REALM
+spnego_keytab=/etc/keytabs/HTTP.keytab

Review Comment:
   The keytab path reference is inconsistent with the script that creates 
keytabs in `/opt/ranger/admin/keytabs` (line 19 of ranger.sh). The path should 
be `/opt/ranger/admin/keytabs/HTTP.keytab` to match where the keytab is 
actually created.
   ```suggestion
   spnego_keytab=/opt/ranger/admin/keytabs/HTTP.keytab
   ```



##########
dev-support/ranger-docker/scripts/ranger-admin-install-sqlserver.properties:
##########
@@ -97,3 +97,12 @@ STALE_PATCH_ENTRY_HOLD_TIME=10
 
 hadoop_conf=
 authentication_method=UNIX
+
+#------------ Kerberos Config -----------------
+spnego_principal=HTTP/_HOST@REALM
+spnego_keytab=/etc/keytabs/HTTP.keytab
+token_valid=30
+admin_principal=rangeradmin/_HOST@REALM
+admin_keytab=/etc/keytabs/rangeradmin.keytab

Review Comment:
   The keytab path reference is inconsistent with the script that creates 
keytabs in `/opt/ranger/admin/keytabs` (line 19 of ranger.sh). The path should 
be `/opt/ranger/admin/keytabs/rangeradmin.keytab` to match where the keytab is 
actually created.
   ```suggestion
   admin_keytab=/opt/ranger/admin/keytabs/rangeradmin.keytab
   ```



##########
dev-support/ranger-docker/scripts/ranger-admin-install-sqlserver.properties:
##########
@@ -97,3 +97,12 @@ STALE_PATCH_ENTRY_HOLD_TIME=10
 
 hadoop_conf=
 authentication_method=UNIX
+
+#------------ Kerberos Config -----------------
+spnego_principal=HTTP/_HOST@REALM
+spnego_keytab=/etc/keytabs/HTTP.keytab
+token_valid=30
+admin_principal=rangeradmin/_HOST@REALM
+admin_keytab=/etc/keytabs/rangeradmin.keytab
+lookup_principal=rangerlookup/_HOST@REALM
+lookup_keytab=/etc/keytabs/rangerlookup.keytab

Review Comment:
   The keytab path reference is inconsistent with the script that creates 
keytabs in `/opt/ranger/admin/keytabs` (line 19 of ranger.sh). The path should 
be `/opt/ranger/admin/keytabs/rangerlookup.keytab` to match where the keytab is 
actually created.
   ```suggestion
   lookup_keytab=/opt/ranger/admin/keytabs/rangerlookup.keytab
   ```



##########
dev-support/ranger-docker/scripts/ranger-admin-install-postgres.properties:
##########
@@ -90,3 +90,12 @@ STALE_PATCH_ENTRY_HOLD_TIME=10
 
 hadoop_conf=
 authentication_method=UNIX
+
+#------------ Kerberos Config -----------------
+spnego_principal=HTTP/_HOST@REALM
+spnego_keytab=/etc/keytabs/HTTP.keytab
+token_valid=30
+admin_principal=rangeradmin/_HOST@REALM
+admin_keytab=/etc/keytabs/rangeradmin.keytab
+lookup_principal=rangerlookup/_HOST@REALM
+lookup_keytab=/etc/keytabs/rangerlookup.keytab

Review Comment:
   All keytab path references use `/etc/keytabs/` but the script creates them 
in `/opt/ranger/admin/keytabs`. These paths should be updated to 
`/opt/ranger/admin/keytabs/` to match the actual keytab location defined in 
ranger.sh.
   ```suggestion
   spnego_keytab=/opt/ranger/admin/keytabs/HTTP.keytab
   token_valid=30
   admin_principal=rangeradmin/_HOST@REALM
   admin_keytab=/opt/ranger/admin/keytabs/rangeradmin.keytab
   lookup_principal=rangerlookup/_HOST@REALM
   lookup_keytab=/opt/ranger/admin/keytabs/rangerlookup.keytab
   ```



##########
dev-support/ranger-docker/scripts/ranger-admin-install-mysql.properties:
##########
@@ -90,3 +90,12 @@ STALE_PATCH_ENTRY_HOLD_TIME=10
 
 hadoop_conf=
 authentication_method=UNIX
+
+#------------ Kerberos Config -----------------
+spnego_principal=HTTP/_HOST@REALM
+spnego_keytab=/etc/keytabs/HTTP.keytab
+token_valid=30
+admin_principal=rangeradmin/_HOST@REALM
+admin_keytab=/etc/keytabs/rangeradmin.keytab
+lookup_principal=rangerlookup/_HOST@REALM
+lookup_keytab=/etc/keytabs/rangerlookup.keytab

Review Comment:
   All keytab path references use `/etc/keytabs/` but the script creates them 
in `/opt/ranger/admin/keytabs`. These paths should be updated to 
`/opt/ranger/admin/keytabs/` to match the actual keytab location defined in 
ranger.sh.
   ```suggestion
   spnego_keytab=/opt/ranger/admin/keytabs/HTTP.keytab
   token_valid=30
   admin_principal=rangeradmin/_HOST@REALM
   admin_keytab=/opt/ranger/admin/keytabs/rangeradmin.keytab
   lookup_principal=rangerlookup/_HOST@REALM
   lookup_keytab=/opt/ranger/admin/keytabs/rangerlookup.keytab
   ```



-- 
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