3.3. 리모팅을 위한 Kerberos 인증 통합
관리 인터페이스 및 웹 애플리케이션의 보안을 위해 Kerberos를 사용하는 것 외에도 remoting을 통해 액세스하는 서비스에 대해 Kerberos 인증을 구성할 수도 있습니다(예: Jakarta Enterprise Beans).
Kerberos의 시스템 속성도 구성해야 합니다. 자세한 내용은 Configure the Elytron Subsystem 에서 참조하십시오.
3.3.1. 레거시 보안 Realms를 사용한 Kerberos 인증 통합 링크 복사링크가 클립보드에 복사되었습니다!
Kerberos 인증을 구성하려면 다음을 수행해야 합니다.
원격 및
RealmDirect를 사용하여 보안 도메인 구성원격 를 통해 액세스하는 서비스에서 사용할 보안 도메인을 구성해야 합니다. 이 보안 도메인은
Remoting로그인 모듈과 RealmDirect 로그인 모듈(예:RealmDirect또는RealmUsersRoles)을 모두 사용해야 합니다. 기본적으로 기본적으로 제공된other보안 도메인과 매우 유사해야 합니다. 각 로그인 모듈의 특정 구성 옵션에 대한 자세한 내용은 JBoss EAP 로그인 모듈 참조를 참조하십시오.예제: Remoting 및 RealmDirect 로그인 모듈이 있는 보안 도메인
/subsystem=security/security-domain=krb-remoting-domain:add() /subsystem=security/security-domain=krb-remoting-domain/authentication=classic:add() /subsystem=security/security-domain=krb-remoting-domain/authentication=classic/login-module=Remoting:add(code=Remoting, flag=optional, module-options=[password-stacking=useFirstPass]) /subsystem=security/security-domain=krb-remoting-domain/authentication=classic/login-module=RealmDirect:add(code=RealmDirect, flag=required, module-options=[password-stacking=useFirstPass, realm=krbRealm]) /subsystem=security/security-domain=krb-remoting-domain/mapping=classic:add() /subsystem=security/security-domain=krb-remoting-domain/mapping=classic/mapping-module=SimpleRoles:add(code=SimpleRoles, type=role, module-options=["testUser"="testRole"]) reloadKerberos 인증을 위한 보안 영역 구성.
Kerberos 인증을 사용하여 보안 영역 설정은 Kerberos로 관리 인터페이스 보안 섹션에서 설명합니다.
예제: 보안 영역
/core-service=management/security-realm=krbRealm:add() /core-service=management/security-realm=krbRealm/server-identity=kerberos:add() /core-service=management/security-realm=krbRealm/server-identity=kerberos/keytab=remote\/localhost@JBOSS.ORG:add(path=\/path\/to\/remote.keytab, debug=true) /core-service=management/security-realm=krbRealm/authentication=kerberos:add(remove-realm=true) reload원격하위 시스템에서 HTTP 커넥터를 구성합니다.또한 원격 시스템에서 새로 만든 보안 영역을 사용하도록
HTTP커넥터를 구성해야 합니다.예제: 하위 시스템 리모팅
/subsystem=remoting/http-connector=http-remoting-connector:write-attribute(name=security-realm, value=krbRealm)서비스의 보안을 구성합니다.
또한 원격 인터페이스를 사용하여 액세스한 서비스를
보호하도록 설정해야 합니다. 서비스에 따라 달라집니다. 예를 들어 Jakarta Enterprise Bean에서는@SecurityDomain 및 @RolesAllowed주석을 사용할 수 있습니다.
3.3.2. Elytron을 사용한 Kerberos 인증 통합 링크 복사링크가 클립보드에 복사되었습니다!
인증 원격화를 위해 Kerberos 또는 GSSAPI SASL 인증에 대한 Elytron 보안 도메인을 정의할 수 있습니다.
ID를 로드할 보안 영역을 정의합니다. 역할을 할당하는 데 사용됩니다.
/path=kerberos:add(relative-to=user.home, path=src/kerberos) /subsystem=elytron/properties-realm=kerberos-properties:add(users-properties={path=kerberos-users.properties, relative-to=kerberos, digest-realm-name=ELYTRON.ORG}, groups-properties={path=kerberos-groups.properties, relative-to=kerberos})서버 ID에 대한 Kerberos 보안 팩토리를 정의합니다.
/subsystem=elytron/kerberos-security-factory=test-server:add(relative-to=kerberos, path=remote-test-server.keytab, principal=remote/test-server.elytron.org@ELYTRON.ORG)보안 도메인을 정의하고 SASL 인증 팩토리를 함께 정의합니다.
/subsystem=elytron/security-domain=KerberosDomain:add(default-realm=kerberos-properties, realms=[{realm=kerberos-properties, role-decoder=groups-to-roles}], permission-mapper=default-permission-mapper) /subsystem=elytron/sasl-authentication-factory=gssapi-authentication-factory:add(security-domain=KerberosDomain, sasl-server-factory=elytron, mechanism-configurations=[{mechanism-name=GSSAPI, credential-security-factory=test-server}])원격하위 시스템에서 createdsasl-authentication-factory를 사용하여 원격 작업을 활성화합니다.CLI 명령 예
/subsystem=remoting/http-connector=http-remoting-connector:write-attribute(name=sasl-authentication-factory, value=gssapi-authentication-factory)서비스의 보안을 구성합니다.
Jakarta Enterprise Beans에서 보안 도메인을 참조하는 경우 Elytron 보안 도메인에 매핑되는
application-security-domain을 지정해야 합니다. 예를 들어 Jakarta Enterprise Beans에서는@SecurityDomain주석을 사용할 수 있습니다.CLI 명령 예
/subsystem=ejb3/application-security-domain=KerberosDomain:add(security-domain=KerberosDomain)
Identity 연관에 Jakarta Authentication Subject를 사용하는 것은 더 이상 지원되지 않습니다. Jakarta Enterprise Beans 호출에 대한 Kerberos ID를 프로그래밍 방식으로 관리하려는 클라이언트는 다음과 같이 AuthenticationConfiguration API를 직접 마이그레이션하고 사용해야 합니다.
// create your authentication configuration
AuthenticationConfiguration configuration = AuthenticationConfiguration.empty()
.useProvidersFromClassLoader(SecuredGSSCredentialClient.class.getClassLoader())
.useGSSCredential(getGSSCredential());
// create your authentication context
AuthenticationContext context = AuthenticationContext.empty().with(MatchRule.ALL, configuration);
// create a callable that looks up an Jakarta Enterprise Bean and invokes a method on it
Callable<Void> callable = () -> {
...
};
// use your authentication context to run your callable
context.runCallable(callable);
useGSSCredential(getGSSCredential()) 에 대한 호출은 AuthenticationConfiguration 을 생성할 때 발생합니다. 자카르타 인증 주체에 이미 액세스할 수 있는 클라이언트 코드는 다음과 같이 쉽게 변환하여 다음과 같이 변환할 수 있습니다.
private GSSCredential getGSSCredential() {
return Subject.doAs(subject, new PrivilegedAction<GSSCredential>() {
public GSSCredential run() {
try {
GSSManager gssManager = GSSManager.getInstance();
return gssManager.createCredential(GSSCredential.INITIATE_ONLY);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
});
}
2024-02-09에 최종 업데이트된 문서