저는 웹 사이트의 백 엔드로 사용되는 WCF 서비스를 실행하고 있습니다. 웹 사이트와 WCF 서비스는 모두 같은 컴퓨터에서 실행되고 성능 측면에서 netTcpBinding을 사용하여 설정했습니다.netTcpBinding의 가장 빠른 보안 구성은 무엇입니까?
이제는 동일한 상자에 있기 때문에 전송 수준 보안이나 메시지 수준 암호화에 신경 쓰지 않습니다. 메시지가 가로 챌 수있는 유일한 방법은 누군가가 웹 서버 자체에 들어간 경우이며, 그렇게 할 경우 이미 더 큰 문제가있는 것입니다.
내 질문은 : 클라이언트와 서버가 이미 신뢰할 수있는 하위 시스템에있는 경우 netTcpBinding을 최대한 빨리 보장하기 위해 어떤 구성을 사용할 수 있습니까?
물론 대답은 "없음"이라는 보안을 사용하는 것일 수 있습니다. 하지만 필자는 특별한 경우 사용자 지정 데이터베이스에 대해 UserName 인증을 사용해야합니다. 여전히 UserName 인증을 사용하지만 인증서를 신경 쓰지 않거나 엔드 포인트간에 데이터를 보호하지 않도록 구성 할 수 있습니까? 또는 사용자 이름/암호를 저장하기 위해 사용자 지정 SOAP 헤더를 사용하여 사용자 지정 동작을 구현해야 할 수도 있습니다. 그런 다음 실제로 보안을 "none"으로 설정할 수 있습니까?
서버 구성은
<netTcpBinding>
<binding name="Net_Tcp_Binding">
<security mode="Message">
<message clientCredentialType="UserName" />
</security>
</binding>
</netTcpBinding>
그것은 사용자 정의 사용자 이름 인증을 사용 - 기본적으로 모든 호출은 & 사용자 정의 데이터베이스에 대해 권한을 부여 인증합니다. 온
:-) 네,
<serviceBehaviors>
<behavior name="MyBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceAuthorization principalPermissionMode="Custom">
<authorizationPolicies>
<add policyType="MyAssembly.CustomAuthorizationPolicy,MyAssembly" />
</authorizationPolicies>
</serviceAuthorization>
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="MyAssembly.CustomCredentialValidator,MyAssembly" />
<serviceCertificate x509FindType="FindBySubjectName" findValue="CN=servercert" storeLocation="LocalMachine" storeName="My" />
</serviceCredentials>
</behavior>
</serviceBehaviors>
클라이언트 구성
<netTcpBinding>
<binding name="Net_Tcp_Endpoint">
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="Message">
<message clientCredentialType="UserName" />
</security>
</binding>
</netTcpBinding>