Web UI 보안
Web UI 보안
이 문서는 HBase의 Web UI를 보안하는 방법을 설명해요. 기본 HBase 설치는 master와 region 서버의 Web UI에 대해 안전하지 않은 HTTP 연결을 사용해요. HTTPS 활성화, 캐시 비활성화, Kerberos(SPNEGO), LDAP 인증 설정, 그리고 관리자 정의 방법을 다뤄요. 클러스터 UI를 안전하게 운영하고 싶다면 꼭 읽어 볼 내용이에요.
출처: 문서
본문
Web UI에 보안 HTTP(HTTPS) 사용
기본 HBase 설치에서는 master와 region 서버의 Web UIs에 안전하지 않은 HTTP 연결을 사용해요. 대신 보안 HTTP(HTTPS) 연결을 활성화하려면 hbase-site.xml에서 hbase.ssl.enabled를 true로 설정하세요(SSL 인증서와 ssl 구성 파일을 미리 준비하세요). 이것은 Web UI가 사용하는 포트를 바꾸지 않아요. 특정 HBase 구성 요소의 web UI 포트를 바꾸려면 hbase-site.xml에서 해당 포트 설정을 구성하세요. 그 설정은 다음과 같아요.
hbase.master.info.porthbase.regionserver.info.port
보안 HTTP를 활성화하면 클라이언트는 https:// URL을 사용해 HBase에 연결해야 해요. http:// URL을 사용하는 클라이언트는 HTTP 응답 200을 받지만 데이터는 받지 못해요. 다음 예외가 기록돼요.
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
HTTP와 HTTPS에 같은 포트가 사용되기 때문이에요.
HBase는 Web UI에 Jetty를 사용해요. Jetty 자체를 수정하지 않고는 같은 호스트에서 한 포트를 다른 포트로 리다이렉트하도록 Jetty를 구성하는 것이 가능하지 않아 보여요. 자세한 내용은 Nick Dimiduk의 Stack Overflow 스레드 기여를 참고하세요. HTTPS용 두 번째 포트를 열지 않고 이 문제를 고치는 방법을 안다면 패치는 환영이에요.
HBase UI에서 캐시 비활성화
web UI의 max age를 0으로 설정하고 캐시를 비활성화하려면 hbase-site에 다음 구성을 설정하세요.
<property>
<name>hbase.http.filter.no-store.enable</name>
<value>true</value>
</property>
Web UIs에서 Kerberos 인증에 SPNEGO 사용
HBase Web UIs에 대한 Kerberos 인증은 hbase-site.xml의 hbase.security.authentication.ui 프로퍼티로 SPNEGO를 구성해 활성화할 수 있어요. 이 인증을 활성화하려면 HBase도 RPC에 Kerberos 인증을 사용하도록 구성되어 있어야 해요(예: hbase.security.authentication = kerberos).
<property>
<name>hbase.security.authentication.ui</name>
<value>kerberos</value>
<description>Controls what kind of authentication should be used for the HBase web UIs.</description>
</property>
<property>
<name>hbase.security.authentication</name>
<value>kerberos</value>
<description>The Kerberos keytab file to use for SPNEGO authentication by the web server.</description>
</property>
웹 서버에 SPNEGO 인증을 구성하는 여러 프로퍼티가 있어요.
<property>
<name>hbase.security.authentication.spnego.kerberos.principal</name>
<value>HTTP/[email protected]</value>
<description>Required for SPNEGO, the Kerberos principal to use for SPNEGO authentication by the
web server. The _HOST keyword will be automatically substituted with the node's
hostname.</description>
</property>
<property>
<name>hbase.security.authentication.spnego.kerberos.keytab</name>
<value>/etc/security/keytabs/spnego.service.keytab</value>
<description>Required for SPNEGO, the Kerberos keytab file to use for SPNEGO authentication by the
web server.</description>
</property>
<property>
<name>hbase.security.authentication.spnego.kerberos.name.rules</name>
<value></value>
<description>Optional, Hadoop-style `auth_to_local` rules which will be parsed and used in the
handling of Kerberos principals</description>
</property>
<property>
<name>hbase.security.authentication.signature.secret.file</name>
<value></value>
<description>Optional, a file whose contents will be used as a secret to sign the HTTP cookies
as a part of the SPNEGO authentication handshake. If this is not provided, Java's `Random` library
will be used for the secret.</description>
</property>
SPNEGO로 Web UI 관리자 정의
이전 섹션에서는 SPNEGO를 통한 Web UI 인증 활성화 방법을 다뤘어요. 그러나 Web UI의 일부는 HBase 클러스터의 가용성과 성능에 영향을 줄 수 있어요. 따라서 적절한 권한을 가진 사람만 이 민감한 엔드포인트와 상호작용할 수 있게 하는 것이 바람직해요.
HBase는 hbase-site.xml에서 사용자 이름 또는 그룹 목록으로 관리자를 정의할 수 있어요.
<property>
<name>hbase.security.authentication.spnego.admin.users</name>
<value></value>
</property>
<property>
<name>hbase.security.authentication.spnego.admin.groups</name>
<value></value>
</property>
사용자 이름은 core-site.xml의 Hadoop auth_to_local 규칙에 따라 Kerberos 정체성이 매핑되는 이름이에요. 여기서의 그룹은 매핑된 사용자 이름과 연관된 Unix 그룹이에요.
구성 프로퍼티가 어떻게 동작하는지 설명하기 위해 다음 시나리오를 고려해 보세요. Kerberos KDC에 정의된 세 사용자를 생각해 봐요.
기본 Hadoop auth_to_local 규칙은 이 프린시펄들을 "shortname"으로 매핑해요.
alicebobcharlie
Unix 그룹 멤버십은 alice가 admins 그룹의 멤버라고 정의해요. bob과 charlie는 admins 그룹의 멤버가 아니에요.
<property>
<name>hbase.security.authentication.spnego.admin.users</name>
<value>charlie</value>
</property>
<property>
<name>hbase.security.authentication.spnego.admin.groups</name>
<value>admins</value>
</property>
위 구성이 주어지면 alice는 admins 그룹의 멤버이므로 Web UI의 민감한 엔드포인트에 접근할 수 있어요. charlie도 구성에서 관리자로 명시적으로 나열되므로 민감한 엔드포인트에 접근할 수 있어요. bob은 admins 그룹의 멤버가 아니고 hbase.security.authentication.spnego.admin.users로 명시적 관리자 사용자로도 나열되지 않으므로 민감한 엔드포인트에 접근할 수 없지만, Web UI의 비민감 엔드포인트는 사용할 수 있어요.
말할 필요도 없이, 인증되지 않은 사용자는 Web UI의 어떤 부분에도 접근할 수 없어요.
Web UIs에서 LDAP 인증 사용
HBase Web UIs에 대한 LDAP 인증은 hbase-site.xml의 hbase.security.authentication.ui 프로퍼티로 LDAP를 구성해 활성화할 수 있어요. hbase.http.filter.initializers 프로퍼티에도 AuthenticationFilterInitializer 클래스가 필요해요.
중요: LDAP 서버가 구성되어 실행 중이어야 해요. LDAP 서버와의 통신에 TLS가 활성화된 경우(ldaps 스킴 또는 'start TLS' 확장을 통해), LDAP 서버의 공용 인증서를 로컬 truststore에 구성하세요. LDAP 인증 메커니즘은 HTTP Basic 인증 스킴을 사용해 구성된 LDAP(또는 Active Directory) 서버에 대해 사용자 지정 자격 증명을 검증해요. 인증 필터는 다음 init 파라미터로 구성해야 해요.
<property>
<name>hbase.security.authentication.ui</name>
<value>ldap</value>
<description>Controls what kind of authentication should be used for the HBase web UIs.</description>
</property>
<property>
<name>hbase.http.filter.initializers</name>
<value>org.apache.hadoop.hbase.http.lib.AuthenticationFilterInitializer</value>
<description>Comma separated class names corresponding to the Filters that will be initialized.
Then, the Filters will be applied to all user facing jsp and servlet web pages.</description>
</property>
<property>
<name>hadoop.http.authentication.type</name>
<value>ldap</value>
<description>Defines authentication used for the HTTP web-consoles in Hadoop ecosystem.</description>
</property>
웹 서버에 LDAP 인증을 구성하는 여러 프로퍼티가 있어요.
<property>
<name>hadoop.http.authentication.ldap.binddomain</name>
<value>EXAMPLE.COM</value>
<description>The LDAP bind domain value to be used with the LDAP server. This property is optional
and useful only in case of Active Directory server (e.g. example.com).</description>
</property>
<property>
<name>hadoop.http.authentication.ldap.providerurl</name>
<value>ldap://ldap-server-host:8920</value>
<description>The url of the LDAP server.</description>
</property>
<property>
<name>hadoop.http.authentication.ldap.enablestarttls</name>
<value>false</value>
<description>A boolean value used to define if the LDAP server supports 'StartTLS' extension.</description>
</property>
<property>
<name>hadoop.http.authentication.ldap.basedn</name>
<value>ou=users,dc=example,dc=com</value>
<description>The base distinguished name (DN) to be used with the LDAP server. This value is
appended to the provided user id for authentication purpose. This property is not useful in case
of Active Directory server.</description>
</property>
LDAP로 Web UI 관리자 정의
이전 섹션에서는 LDAP를 통한 Web UI 인증 활성화를 다뤘어요. Web UI의 특정 부분은 HBase 클러스터의 가용성과 성능에 영향을 줄 수 있어요. 이 민감한 엔드포인트를 보호하려면 인가된 관리자만 접근을 제한하는 것이 필수적이에요.
HBase는 hbase-site.xml 구성 파일에서 사용자 이름 목록을 통해 Web UI의 관리자를 정의하는 메커니즘을 제공해요.
관리자를 지정하려면 hbase-site.xml에서 다음 프로퍼티를 사용하세요.
<property>
<name>hbase.security.authentication.ldap.admin.users</name>
<value>admin1,admin2,admin3</value>
</property>
위 프로퍼티에 나열된 사용자 이름은 관리자의 LDAP 사용자 이름에 해당해야 해요.
참고 사항
- 이 기능은 HBASE-29244를 가진 HBase 버전만 지원해요.
- LDAP 서버가 제대로 구성되고 실행 중인지 확인하세요. 자세한 내용은 이전 섹션을 참고하세요.
hbase.security.authentication.ldap.admin.users프로퍼티에 명시적으로 나열된 사용자만 민감한 엔드포인트에 접근할 수 있어요.- 관리자가 아닌 사용자도 인증된 경우 비민감 엔드포인트에는 접근할 수 있어요.
이렇게 관리자를 정의하면 인가된 인력만 Web UI의 중요한 기능과 상호작용할 수 있게 해서 HBase 클러스터의 보안과 안정성을 높일 수 있어요.
기타 UI 보안 관련 구성
HBase 개발자에게 명백한 안티 패턴이지만, 개발자들은 HBase 구성(Hadoop 구성 파일 포함)이 민감한 정보를 포함할 수 있다는 것을 인정해요. 그래서 사용자는 모든 인증된 사용자에게 HBase 서비스 수준 구성을 노출하고 싶지 않을 수 있어요. HBase UI를 통해 서비스 수준 구성에 접근하려면 사용자가 관리자여야 하도록 HBase를 구성할 수 있어요. 이 구성은 기본적으로 false예요(모든 인증된 사용자가 구성에 접근할 수 있음).
이것을 바꾸려는 사용자는 hbase-site.xml에 다음을 설정해요.
<property>
<name>hbase.security.authentication.ui.config.protected</name>
<value>true</value>
</property>
민감한 정보를 숨기기 위해 HBase UI에서 스택 트레이스 표시를 비활성화하려면 hbase-site에 다음을 설정하세요.
<property>
<name>hbase.ui.show-stack-traces</name>
<value>false</value>
</property>