<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: NetNamedPipeBinding and Impersonation</title>
	<atom:link href="http://kennyw.com/work/indigo/102/feed" rel="self" type="application/rss+xml" />
	<link>http://kennyw.com/work/indigo/102</link>
	<description>Kenny Wolf</description>
	<lastBuildDate>Thu, 02 Feb 2012 02:21:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Alan Jones</title>
		<link>http://kennyw.com/work/indigo/102/comment-page-1#comment-48860</link>
		<dc:creator>Alan Jones</dc:creator>
		<pubDate>Wed, 16 May 2007 17:26:24 +0000</pubDate>
		<guid isPermaLink="false">http://kennyw.com/indigo/102#comment-48860</guid>
		<description>Here&#039;s an update: To make sure, I moved my back-end service, the one called using an impersonated user account, to another box. I am still able to reach the back-end service.

So, my client application is running under my user account; the middle-tier service is on the same box running under the Network Service account and the back-end service is on another box running under a domain service account.

The client connects to the middle-tier using a netNamedPipe binding. The middle tier impersonates the caller and connects to the back-end service using a wsHttpBinding with message security (clientCredentialType=Windows).

The back-end service authenticates the caller as the impersonated user and executes without error. Is this the expected bahavior? 

I see you posted this back in March 2006, has something changed since Indigo became WCF? I sure would like to understand this, so I don&#039;t get bit later when some &quot;small&quot; change breaks my app.

-- Alan</description>
		<content:encoded><![CDATA[<p>Here&#8217;s an update: To make sure, I moved my back-end service, the one called using an impersonated user account, to another box. I am still able to reach the back-end service.</p>
<p>So, my client application is running under my user account; the middle-tier service is on the same box running under the Network Service account and the back-end service is on another box running under a domain service account.</p>
<p>The client connects to the middle-tier using a netNamedPipe binding. The middle tier impersonates the caller and connects to the back-end service using a wsHttpBinding with message security (clientCredentialType=Windows).</p>
<p>The back-end service authenticates the caller as the impersonated user and executes without error. Is this the expected bahavior? </p>
<p>I see you posted this back in March 2006, has something changed since Indigo became WCF? I sure would like to understand this, so I don&#8217;t get bit later when some &#8220;small&#8221; change breaks my app.</p>
<p>&#8211; Alan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan Jone</title>
		<link>http://kennyw.com/work/indigo/102/comment-page-1#comment-48053</link>
		<dc:creator>Alan Jone</dc:creator>
		<pubDate>Fri, 11 May 2007 20:59:41 +0000</pubDate>
		<guid isPermaLink="false">http://kennyw.com/indigo/102#comment-48053</guid>
		<description>I&#039;m sorry, I don&#039;t understand what you are saying here. 

Here&#039;s my story:

I am hosting a WCF service in a Windows Service, running under the local Network Service account. The WCF service exposes a single endpoint with a standard netNamedPipeBinding, no binding configuration added.

On the same box I have a unit test, running under my credentials that calls the netNamedPipe service endpoint.

The security negotiation results in a kerberos token in the service. The service is able to impersonate the caller and call a endpoing on another service with a netTcpBinding, again same machine.

In the second service, if I look at the claimset, I see that one of the claims is:
ClaimType: &quot;http://schemas.xmlsoap.org/ws/2005/05/identity/claims/sid&quot;
    Resource: {S-1-5-2}
    Right: &quot;http://schemas.xmlsoap.org/ws/2005/05/identity/right/possessproperty&quot;

From what you&#039;re saying, seems like my results shouldn&#039;t be possible. Do I misunderstand, what you&#039;re saying here?</description>
		<content:encoded><![CDATA[<p>I&#8217;m sorry, I don&#8217;t understand what you are saying here. </p>
<p>Here&#8217;s my story:</p>
<p>I am hosting a WCF service in a Windows Service, running under the local Network Service account. The WCF service exposes a single endpoint with a standard netNamedPipeBinding, no binding configuration added.</p>
<p>On the same box I have a unit test, running under my credentials that calls the netNamedPipe service endpoint.</p>
<p>The security negotiation results in a kerberos token in the service. The service is able to impersonate the caller and call a endpoing on another service with a netTcpBinding, again same machine.</p>
<p>In the second service, if I look at the claimset, I see that one of the claims is:<br />
ClaimType: &#8220;http://schemas.xmlsoap.org/ws/2005/05/identity/claims/sid&#8221;<br />
    Resource: {S-1-5-2}<br />
    Right: &#8220;http://schemas.xmlsoap.org/ws/2005/05/identity/right/possessproperty&#8221;</p>
<p>From what you&#8217;re saying, seems like my results shouldn&#8217;t be possible. Do I misunderstand, what you&#8217;re saying here?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kenny</title>
		<link>http://kennyw.com/work/indigo/102/comment-page-1#comment-342</link>
		<dc:creator>Kenny</dc:creator>
		<pubDate>Sun, 19 Mar 2006 02:19:56 +0000</pubDate>
		<guid isPermaLink="false">http://kennyw.com/indigo/102#comment-342</guid>
		<description>There are some transports which have intrinsic topology restrictions. For example, if I was writing an in-process or in-appdomain channel, you wouldn&#039;t be able to contact that endpoint outside of the process/endpoint in question. Which endpoints you decide to publish is certainly a matter of policy.  While it is technically possible to use named-pipes cross-machine, we made a conscious decision (based on customer requests) to restrict this usage to on-machine.  Users wanted a way to ensure their service is not accessible off-machine. Furthermore, they wanted this assurance to be complete. If we used a custom security header then you are exposed to an attack where code on-machine can pass this &quot;local secret&quot; off box and then your service is accessible off-machine.  For defense in depth we actually have a variation of this which is the pipe name is stored in shared memory and it is that shared memory name which is referenced by net.pipe://xxxx.  But the only true way to ensure you are not accessible off box is to deny Network SID.  

You could argue that we could have added a knob &quot;bool AllowOffMachineAccess&quot; which allowed the user to toggle our behavior, though it would also require an overhaul of our net.pipe addressing scheme. 

I don&#039;t understand your assertion that you cannot used named pipes with a domain account. Our named pipe tranpsort can be used by any account on the box. The restriction I am talking about is only in effect when using named pipes while running under an impersonated token.</description>
		<content:encoded><![CDATA[<p>There are some transports which have intrinsic topology restrictions. For example, if I was writing an in-process or in-appdomain channel, you wouldn&#8217;t be able to contact that endpoint outside of the process/endpoint in question. Which endpoints you decide to publish is certainly a matter of policy.  While it is technically possible to use named-pipes cross-machine, we made a conscious decision (based on customer requests) to restrict this usage to on-machine.  Users wanted a way to ensure their service is not accessible off-machine. Furthermore, they wanted this assurance to be complete. If we used a custom security header then you are exposed to an attack where code on-machine can pass this &#8220;local secret&#8221; off box and then your service is accessible off-machine.  For defense in depth we actually have a variation of this which is the pipe name is stored in shared memory and it is that shared memory name which is referenced by net.pipe://xxxx.  But the only true way to ensure you are not accessible off box is to deny Network SID.  </p>
<p>You could argue that we could have added a knob &#8220;bool AllowOffMachineAccess&#8221; which allowed the user to toggle our behavior, though it would also require an overhaul of our net.pipe addressing scheme. </p>
<p>I don&#8217;t understand your assertion that you cannot used named pipes with a domain account. Our named pipe tranpsort can be used by any account on the box. The restriction I am talking about is only in effect when using named pipes while running under an impersonated token.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Kane</title>
		<link>http://kennyw.com/work/indigo/102/comment-page-1#comment-323</link>
		<dc:creator>Matthew Kane</dc:creator>
		<pubDate>Fri, 10 Mar 2006 19:51:28 +0000</pubDate>
		<guid isPermaLink="false">http://kennyw.com/indigo/102#comment-323</guid>
		<description>This makes me quite uncomfortable for a number of reasons.

First, it seems to me that under the tenets of SOA, the issue of which connections are acceptable is a matter for policy, not channel. I would expect that the default binding for the named pipe channel would have a policy restricting the other endpoint to one on the same box, because even though named pipes work across boxes, TCP is a more efficient choice in that scenario. However, I could see a situation in which it would make sense to override this policy. Imagine a Windows service that spawns numerous instances of executables to handle work (as IIS does) and uses web services to send messages for assigning work. The named pipe channel would make the most sense. But if on a farm, the services needed to occasionally communicate to coordinate load balancing, you might not want to create a separate binding or a separate service, depending on certain implementation details. In any case, I wouldn&#039;t want the architecture to enforce that named pipes can only be used on-box.

Second, using SIDs to restrict endpoints seems to be a mismatch. I can see that named pipes don&#039;t give you any other way to do it. However, I could see creating a custom security header in soap that would pass some information that could only be known by a client on the same box.

Third, based on your description above, I suspect that if I were running a process under a domain account rather than a local account, I would be unable to used the named pipes channel. This would completely screw me. For various reasons, it is often not an option for me to run a process under a local account, and I would not like it if that denied me the ability to use the named pipe channel.</description>
		<content:encoded><![CDATA[<p>This makes me quite uncomfortable for a number of reasons.</p>
<p>First, it seems to me that under the tenets of SOA, the issue of which connections are acceptable is a matter for policy, not channel. I would expect that the default binding for the named pipe channel would have a policy restricting the other endpoint to one on the same box, because even though named pipes work across boxes, TCP is a more efficient choice in that scenario. However, I could see a situation in which it would make sense to override this policy. Imagine a Windows service that spawns numerous instances of executables to handle work (as IIS does) and uses web services to send messages for assigning work. The named pipe channel would make the most sense. But if on a farm, the services needed to occasionally communicate to coordinate load balancing, you might not want to create a separate binding or a separate service, depending on certain implementation details. In any case, I wouldn&#8217;t want the architecture to enforce that named pipes can only be used on-box.</p>
<p>Second, using SIDs to restrict endpoints seems to be a mismatch. I can see that named pipes don&#8217;t give you any other way to do it. However, I could see creating a custom security header in soap that would pass some information that could only be known by a client on the same box.</p>
<p>Third, based on your description above, I suspect that if I were running a process under a domain account rather than a local account, I would be unable to used the named pipes channel. This would completely screw me. For various reasons, it is often not an option for me to run a process under a local account, and I would not like it if that denied me the ability to use the named pipe channel.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

