{"id":372,"date":"2020-07-07T22:31:23","date_gmt":"2020-07-07T22:31:23","guid":{"rendered":"http:\/\/certcent.io\/?p=372"},"modified":"2020-07-07T22:31:23","modified_gmt":"2020-07-07T22:31:23","slug":"hardening-office-365-security","status":"publish","type":"post","link":"https:\/\/certcent.io\/index.php\/2020\/07\/07\/hardening-office-365-security\/","title":{"rendered":"Hardening Office 365 security"},"content":{"rendered":"<h3><strong>A couple easy ways to harden Office 365 security:<\/strong><\/h3>\n<p>Here are a couple messy notes for client access rules.  We are trying to limit access to e-mail accounts that are legacy, i.e., MFA printer devices or devices that send notifications, but do not support Modern Authentication.  Most MFP printers, Canon, HP, Xerox printer built before 2017 probably do not support Modern Authentication.  A key sign that it is modern authentication is it opens a browser window for user\/pass and not a Windows popup box.<br \/>\nCreate Priority Rule 1 to Allow Powershell Access:<\/p>\n<pre class=\"lang:default decode:true \">New-ClientAccessRule -Name AllowRemotePS -Action Allow -AnyOfProtocols RemotePowerShell -Priority 1<\/pre>\n<p>1) Identify clients that do not support Modern authentication. smtp.utility@mydomain.com<br \/>\n2) Specify field to input client to filter, e.g., deparment, custom, company and input &#8216;SMTP&#8217;<br \/>\n3) Create new client rule to only applies to that field:<\/p>\n<pre class=\"lang:default decode:true \">New-ClientAccessRule -Enabled $true -Action Block -UserRecipientFilter \"Department -eq 'SMTP'\" -ExceptAnyOFClientIPAddressesOrRanges @{Add='1.1.1.1','2.2.2.2'}<\/pre>\n<p>4) Test new rule with test-clientaccessrule<br \/>\nMore Powershell Exchange Fun!<br \/>\nHere are Office Modules\/Applications you should have loaded:<br \/>\n<strong>1) Connect-MsolService<\/strong><br \/>\n<strong>2) Connect-ExchangeOnline<br \/>\n3) Connect-AzureAD<br \/>\n<\/strong><br \/>\n1) Enable Modern Authentication (disable use of older more vulnerable protocols)<br \/>\n2) Enable Client Access Rules (limit access to apps based on location)<br \/>\n3) Configure AuthenticationPolicy (block older protocols)<br \/>\nConsider enable policy and rules using these commands:<br \/>\nGet-OrganizationConfig<br \/>\nRun the following command to enable modern authentication connections to Exchange Online by Outlook 2013 or later clients:<\/p>\n<pre class=\"lang:default decode:true \">Set-OrganizationConfig -OAuth2ClientProfileEnable $true<\/pre>\n<p>I am using the Microsoft.Exchange.Management.ExoPowershellModule Module on my test tenant.<br \/>\nAuthentication Policies and Client Access Rules:<\/p>\n<pre class=\"lang:default decode:true\" title=\"office 365 security authentication policies\">NAME\n   <strong> Set-AuthenticationPolicy<\/strong>\nSYNTAX\n    Set-AuthenticationPolicy [-Identity] &lt;AuthPolicyIdParameter&gt; [-AllowBasicAuthActiveSync] [-AllowBasicAuthAutodiscover] [-AllowBasicAuthImap] [-AllowBasicAuthMapi]\n    [-AllowBasicAuthOfflineAddressBook] [-AllowBasicAuthOutlookService] [-AllowBasicAuthPop] [-AllowBasicAuthPowershell] [-AllowBasicAuthReportingWebServices] [-AllowBasicAuthRpc]\n    [-AllowBasicAuthSmtp] [-AllowBasicAuthWebServices] [-DomainController &lt;Fqdn&gt;] [-ProxyToMailbox &lt;MailboxIdParameter&gt;] [-ProxyToServer &lt;string&gt;] [-WhatIf] [-Confirm] [-Name &lt;string&gt;]\n    [&lt;CommonParameters&gt;]\n<\/pre>\n<pre class=\"lang:default decode:true\" title=\"office 365 security client access rules\">NAME\n    <strong>Set-ClientAccessRule<\/strong>\nSYNOPSIS\n    This cmdlet is available in on-premises Exchange and in the cloud-based service. Some parameters and settings may be exclusive to one environment or the other.\n    Use the Set-ClientAccessRule cmdlet to modify existing client access rules. Client access rules help you control access to your organization based on the properties of the connection.\n    For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax (https:\/\/technet.microsoft.com\/library\/bb123552.aspx).\n    -------------------------- Example 1 --------------------------\n    Set-ClientAccessRule \"Allow IMAP4\" -AnyOfClientIPAddressesOrRanges @{Add=\"172.17.17.27\/16\"}\n    This example adds the IP address range 172.17.17.27\/16 to the existing client access rule named Allow IMAP4 without affecting the existing IP address values.\n<\/pre>\n<p>When setting ClientAccessRules, this will apply to everybody in your tenant, so be careful.  The policy will take a while to apply too, so give it at least an hour before you give up.<br \/>\nClient Access Rules provide a solid way limited who can access e-mail, administrator portals, and remote Powershell.  These things are not enabled by default, so tighten your security up to be safe.<br \/>\nTips:<br \/>\nYou can use this parameter to filter:<\/p>\n<pre class=\"lang:default decode:true\">Get-ClientAccessRule<\/pre>\n<p><strong> (list current rules).<br \/>\n<\/strong><\/p>\n<pre class=\"lang:default decode:true\">Get-User -Filter \"Department -eq 'IT'\"<\/pre>\n<p><strong>(filter by field Department)<br \/>\n<\/strong><\/p>\n<pre class=\"lang:default decode:true\">Set-User Username -Department IT<\/pre>\n<p><strong> (set the department for this user)<\/strong><\/p>\n<pre class=\"lang:default decode:true\">Set-ClientAccessRule -Identity ITPolicy -UserRecipientFilter \"Department -eq 'IT'\"<\/pre>\n<pre class=\"lang:default decode:true\">Set-ClientAccessRule -Identity ITPolicy -UserRecipientFilter \"Department -ne 'IT'\" -Action DenyAccess -AnyofProtocols \"RemotePowerShell\",\"ExchangeAdminCenter\"<strong> <\/strong><\/pre>\n<p>Configure rules based by IP addresses.  This is perfect for older mailboxes that need to send mail, but do not support Modern Authentication.  This is common with printers internally.<br \/>\n<!--StartFragment --><\/p>\n<div>\n<pre class=\"lang:default decode:true \">Set-ClientAccessRule -ExceptAnyOfClientIPAddressesOrRanges @{Add=\"50.34.200.0\/24\"}<\/pre>\n<\/div>\n<p><!--EndFragment --><br \/>\nHere are the types of access you can allow or deny:<\/p>\n<pre class=\"parameterName stack\"><strong>-AnyOfProtocols<\/strong>\n<\/pre>\n<div class=\"parameterInfo\">\n<pre>The AnyOfProtocols parameter specifies a condition for the client access rule that's based on the client's protocol.\nValid values for this parameter are:<\/pre>\n<ul>\n<li>\n<pre>ExchangeActiveSync<\/pre>\n<\/li>\n<li>\n<pre>ExchangeAdminCenter<\/pre>\n<\/li>\n<li>\n<pre>ExchangeWebServices<\/pre>\n<\/li>\n<li>\n<pre class=\"\">IMAP4<\/pre>\n<\/li>\n<li>\n<pre>OfflineAddressBook<\/pre>\n<\/li>\n<li>\n<pre>OutlookAnywhere<\/pre>\n<\/li>\n<li>\n<pre>OutlookWebApp<\/pre>\n<\/li>\n<li>\n<pre>POP3<\/pre>\n<\/li>\n<li>\n<pre>PowerShellWebServices<\/pre>\n<\/li>\n<li>\n<pre>RemotePowerShell<\/pre>\n<\/li>\n<li>\n<pre>REST<\/pre>\n<\/li>\n<li>\n<pre class=\"\">UniversalOutlook (Mail and Calendar app)<\/pre>\n<\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>A couple easy ways to harden Office 365 security: Here are a couple messy notes for client access rules. We are trying to limit access to e-mail accounts that are legacy, i.e., MFA printer devices or devices that send notifications, but do not support Modern Authentication. Most MFP printers, Canon, HP, Xerox printer built before&hellip; <a class=\"more-link\" href=\"https:\/\/certcent.io\/index.php\/2020\/07\/07\/hardening-office-365-security\/\">Continue reading <span class=\"screen-reader-text\">Hardening Office 365 security<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/posts\/372"}],"collection":[{"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/comments?post=372"}],"version-history":[{"count":0,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/posts\/372\/revisions"}],"wp:attachment":[{"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/media?parent=372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/categories?post=372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/tags?post=372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}