<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Adfs on The Network Stack</title>
    <link>https://thenetworkstack.com/tags/adfs/</link>
    <description>Recent content in Adfs on The Network Stack</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 27 May 2017 01:06:39 +0000</lastBuildDate>
    <atom:link href="https://thenetworkstack.com/tags/adfs/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>ADFS MFA with Office 365</title>
      <link>https://thenetworkstack.com/adfs-mfa-with-office-365/</link>
      <pubDate>Sat, 27 May 2017 01:06:39 +0000</pubDate>
      <guid>https://thenetworkstack.com/adfs-mfa-with-office-365/</guid>
      <description>&lt;p&gt;We wanted to implement MFA (multi-factor authentication) for our ADFS servers when authenticating to Office 365.  If you just want basic “MFA for all users” then the AD FS GUI will allow you to select your MFA provider and enable.  I needed a more granular policy:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Only enable MFA if the user is a member of a specific security group &lt;strong&gt;AND&lt;/strong&gt; the user is coming from outside the corporate network &lt;strong&gt;AND&lt;/strong&gt; it is a browser based authentication request&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description>
      <content:encoded><![CDATA[<p>We wanted to implement MFA (multi-factor authentication) for our ADFS servers when authenticating to Office 365.  If you just want basic “MFA for all users” then the AD FS GUI will allow you to select your MFA provider and enable.  I needed a more granular policy:</p>
<blockquote>
<p><em>Only enable MFA if the user is a member of a specific security group <strong>AND</strong> the user is coming from outside the corporate network <strong>AND</strong> it is a browser based authentication request</em></p>
</blockquote>
<p>The third part of that policy is in place so that a user can still use activesync or skype for business, since they do not support MFA (or microsoft modern authentication) right now.</p>
<p>Granular ADFS policies are set using “claims”, which can be combined together with “&amp;&amp;” statements.  Here are the three claims I needed enabled:</p>
<p><em>Only enable MFA for members of a security group (use your own group SID in <strong>Value == &quot; &ldquo;</strong>)</em></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">c:[Type == “http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid&amp;#8221;, Value == “S-1-2-46-1537777264-XXXXXXXXXXXXX”] &amp;&amp;
</span></span></code></pre></div><p><em>Only enable MFA for users outside the corporate network (auth requests that go through the AD FS web proxy)</em></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">c1:[Type == “http://schemas.microsoft.com/ws/2012/01/insidecorporatenetwork&amp;#8221;, Value == “false”] &amp;&amp;
</span></span></code></pre></div><p><em>Only enable MFA for browser based requests</em></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">c2:[Type == “http://schemas.microsoft.com/2012/01/requestcontext/claims/x-ms-endpoint-absolute-path&amp;#8221;, Value =~ “(/adfs/ls)|(/adfs/oauth2)”]
</span></span></code></pre></div><h3 id="configuration"><strong>Configuration</strong></h3>
<p>To apply these claims, first enable the MFA provider using the GUI.  Open AD FS, click on “Authentication Policies” and then click “Edit Global Multi-Factor Authentication” on the left-hand side.  From there you can select your MFA provider and click “Apply”.  After this, you must use powershell.  I also used powershell variables to make the process a little cleaner.</p>
<p>First, the <strong>$mfarule</strong> variable contains all three claims above, joined together with <strong>&amp;&amp;</strong>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">PS C:\windows\system32&gt; $mfarule=&#39;c:[Type == &#34;http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid&#34;, Value == &#34;S-1-2-46-1537777264-XXXXXXXXXXXXX&#34;] &amp;&amp; c1:[Type == &#34;http://schemas.microsoft.com/ws/2012/01/insidecorporatenetwork&#34;, Value == &#34;false&#34;] &amp;&amp; c2:[Type == &#34;http://schemas.microsoft.com/2012/01/requestcontext/claims/x-ms-endpoint-absolute-path&#34;, Value =~ &#34;(/adfs/ls)|(/adfs/oauth2)&#34;] =&gt; issue(Type = &#34;http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod&#34;, Value = &#34;http://schemas.microsoft.com/claims/multipleauthn&#34;);&#39;
</span></span></code></pre></div><p>Second, we set the <strong>$rpt</strong> variable with the name of the Relying Party Trust that needs MFA.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">PS C:\windows\system32&gt; $rpt = Get-AdfsRelyingPartyTrust –Name &#34;Microsoft Office 365 Identity Platform&#34;
</span></span></code></pre></div><p>Last, we use both the variables we defined before and set the MFA rule.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">PS C:\windows\system32&gt; Set-AdfsRelyingPartyTrust –TargetRelyingParty $rpt –AdditionalAuthenticationRules $mfarule
</span></span></code></pre></div><p>And now you are done!  The following command reverts the changes made back to default:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">PS C:\windows\system32&gt; Set-AdfsRelyingPartyTrust –TargetRelyingParty $rpt –AdditionalAuthenticationRules &#39;&#39;
</span></span></code></pre></div><h3 id="additional-commands"><strong>Additional Commands</strong></h3>
<p>The commands above enable MFA just for the Office 365 relying party (so I can have different policies per party).  If you would like to enable these settings on a global scale, use this:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">PS C:\windows\system32&gt; Set-AdfsAdditionalAuthenticationRule -AdditionalAuthenticationRules $mfarule
</span></span></code></pre></div><p>And finally, to see all your changes made:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">PS C:\windows\system32&gt; Get-AdfsRelyingPartyTrust -Name DisplayNameofRelyingTrust
</span></span></code></pre></div><hr>
<p>These blogs were extremely helpful throughout this process:</p>
<p><a href="https://doubledit.co.uk/2015/10/21/adfs-multi-factor-authentication-force-mfa-for-browser-based-access-to-office-365/">https://doubledit.co.uk/2015/10/21/adfs-multi-factor-authentication-force-mfa-for-browser-based-access-to-office-365/</a></p>
<p><a href="http://blog.auth360.net/2014/10/23/mfa-conditional-access-policies-in-ad-fs-2012-r2/">http://blog.auth360.net/2014/10/23/mfa-conditional-access-policies-in-ad-fs-2012-r2/</a></p>
<p><a href="http://blogs.msdn.com/b/ramical/archive/2014/01/30/under-the-hood-tour-on-multi-factor-authentication-in-ad-fs-part-1-policy.aspx">http://blogs.msdn.com/b/ramical/archive/2014/01/30/under-the-hood-tour-on-multi-factor-authentication-in-ad-fs-part-1-policy.aspx</a></p>
<p><a href="https://technet.microsoft.com/en-us/library/dn479343(v=wps.630).aspx">https://technet.microsoft.com/en-us/library/dn479343(v=wps.630).aspx</a></p>
]]></content:encoded>
    </item>
    <item>
      <title>ADFS Sign-In Page Customization</title>
      <link>https://thenetworkstack.com/adfs-sign-in-page-customization/</link>
      <pubDate>Fri, 14 Apr 2017 00:19:37 +0000</pubDate>
      <guid>https://thenetworkstack.com/adfs-sign-in-page-customization/</guid>
      <description>&lt;p&gt;If you use ADFS as your primary IdP, you may have noticed that before your users sign in, they have the option to pick the Relying Party they want to sign into under the &amp;ldquo;Sign in to one of the following sites&amp;rdquo; radio button. If ADFS is accessible from the internet (which it mostly likely is if you are using Office 365), this is a giant security concern, as it gives an attacker a view into all the external applications your employees use. With the prevalence of credential phishing and social engineering, you want to limit the information an attacker has about the resources your company uses.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>If you use ADFS as your primary IdP, you may have noticed that before your users sign in, they have the option to pick the Relying Party they want to sign into under the &ldquo;Sign in to one of the following sites&rdquo; radio button. If ADFS is accessible from the internet (which it mostly likely is if you are using Office 365), this is a giant security concern, as it gives an attacker a view into all the external applications your employees use. With the prevalence of credential phishing and social engineering, you want to limit the information an attacker has about the resources your company uses.</p>
<p>Microsoft doesn&rsquo;t have an easy button to change this behavior, but you are able to customize the sign-in page by editing the &ldquo;onboard.js&rdquo; file. This technet article explains how to export your onboard.js file: <a href="https://technet.microsoft.com/en-us/windows-server-docs/identity/ad-fs/operations/advanced-customization-of-ad-fs-sign-in-pages">https://technet.microsoft.com/en-us/windows-server-docs/identity/ad-fs/operations/advanced-customization-of-ad-fs-sign-in-pages</a></p>
<p>Once exported, I copied the file to my workstation and used notepad++ to edit the file and add this block of code to the <strong>bottom of the file</strong>:</p>
<pre tabindex="0"><code>// Do not show idp_OtherRpPanel or idp_ThisRpPanel if signed out
var IsAuthenticated = document.getElementById(&#39;IsAuthenticated&#39;);
    if(IsAuthenticated.innerHTML==&#34;False&#34;) {
        idp_OtherRpPanel.style.display = &#39;none&#39;;
        idp_ThisRpPanel.style.display = &#39;none&#39;;
}
</code></pre><p>This looks at the variable &lsquo;IsAuthenticated&rsquo;, and if it is False, does not display the list of Relying Parties under the &ldquo;Sign in to one of the following sites&rdquo; radio button.</p>
<p>Copy the new onboard.js file to your ADFS server and make the onboard.js active via powershell (step 4 on the technet article).  Once applied, your changes will be live, no need to restart the ADFS service.</p>
<p>***Note - This is not foolproof.  Although the list of relying parties is hidden, it is still viewable in the HTML source code. I still think this is better than nothing.</p>
]]></content:encoded>
    </item>
    <item>
      <title>WebEx and ADFS</title>
      <link>https://thenetworkstack.com/webex-and-adfs/</link>
      <pubDate>Tue, 26 Apr 2016 17:04:11 +0000</pubDate>
      <guid>https://thenetworkstack.com/webex-and-adfs/</guid>
      <description>&lt;p&gt;Implemented WebEx with ADFS 3.0 (Windows 2012R2), and found these articles helpful:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://cisco-support.webex.com/guest/articles/en_US/Usability_FAQs/WBX63102/myr=false&#34;&gt;https://cisco-support.webex.com/guest/articles/en_US/Usability_FAQs/WBX63102/myr=false&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://digitalglue.wordpress.com/2014/02/11/configuring-cisco-webex-meeting-server-to-work-with-adfs-2-0/&#34;&gt;https://digitalglue.wordpress.com/2014/02/11/configuring-cisco-webex-meeting-server-to-work-with-adfs-2-0/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But those guides do not go over configuring the sign-out process. By default, when a user sign&amp;rsquo;s out of WebEx, they are not signed out of their SSO session. This can be accomplished with the WSFederation sign-out URL:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://social.technet.microsoft.com/wiki/contents/articles/1439.ad-fs-how-to-invoke-a-ws-federation-sign-out.aspx&#34;&gt;http://social.technet.microsoft.com/wiki/contents/articles/1439.ad-fs-how-to-invoke-a-ws-federation-sign-out.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To get this working, follow these steps on your ADFS server:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go to AD FS Manager -&amp;gt; Trust Relationships -&amp;gt; Relying Party Trusts -&amp;gt; WebEx -&amp;gt; Properties&lt;/li&gt;
&lt;li&gt;Under the Endpoints tab, click &amp;ldquo;Add SAML&amp;hellip;&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Endpoint Type = SAML Logout, Binding = POST, Trusted URL = &lt;a href=&#34;https://adfsservername.domainname.com/adfs/ls/?wa=wsignout1.0&#34;&gt;https://adfsservername.domainname.com/adfs/ls/?wa=wsignout1.0&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</description>
      <content:encoded><![CDATA[<p>Implemented WebEx with ADFS 3.0 (Windows 2012R2), and found these articles helpful:</p>
<p><a href="https://cisco-support.webex.com/guest/articles/en_US/Usability_FAQs/WBX63102/myr=false">https://cisco-support.webex.com/guest/articles/en_US/Usability_FAQs/WBX63102/myr=false</a></p>
<p><a href="https://digitalglue.wordpress.com/2014/02/11/configuring-cisco-webex-meeting-server-to-work-with-adfs-2-0/">https://digitalglue.wordpress.com/2014/02/11/configuring-cisco-webex-meeting-server-to-work-with-adfs-2-0/</a></p>
<p>But those guides do not go over configuring the sign-out process. By default, when a user sign&rsquo;s out of WebEx, they are not signed out of their SSO session. This can be accomplished with the WSFederation sign-out URL:</p>
<p><a href="http://social.technet.microsoft.com/wiki/contents/articles/1439.ad-fs-how-to-invoke-a-ws-federation-sign-out.aspx">http://social.technet.microsoft.com/wiki/contents/articles/1439.ad-fs-how-to-invoke-a-ws-federation-sign-out.aspx</a></p>
<p>To get this working, follow these steps on your ADFS server:</p>
<ol>
<li>Go to AD FS Manager -&gt; Trust Relationships -&gt; Relying Party Trusts -&gt; WebEx -&gt; Properties</li>
<li>Under the Endpoints tab, click &ldquo;Add SAML&hellip;&rdquo;</li>
<li>Endpoint Type = SAML Logout, Binding = POST, Trusted URL = <a href="https://adfsservername.domainname.com/adfs/ls/?wa=wsignout1.0">https://adfsservername.domainname.com/adfs/ls/?wa=wsignout1.0</a></li>
</ol>
]]></content:encoded>
    </item>
  </channel>
</rss>
