Monday 5 June 2023

Business Central - Azure SSO Redirect Loop

 

Azure SSO Redirect Loop

I noticed an odd issue when both Business Central application servers were running at the same time, in which the Azure Single Sign-on page would constantly loop round and round after entering your credentials. If I disabled IIS and stopped the Business Central Service Instance on one of the servers, the issue went away.

In Azure, I noticed that the following setting was enabled on the Production Application Gateway, but was disabled on Test. Under Settings > Backend Settings > navServiceTierBackendHttpSettings > Cookie-based affinity.



The application gateway can use cookies to keep a user session on the same server. You can enable this feature if the client supports the use of cookies.

I enabled Cookie Based affinity for the navServiceTierBackendHttpSettings port 443 and this resolved the issue.






Monday 13 February 2023

Ditched the Cisco router for OpenWrt Dual WAN Setup

Due to the poor performance of my old POTS ADSL line, I decided to look at 4G Routers. Surprisingly, I could get over 200mbps download and around 50mbps upload!

Compared to my ADSL line of 17mbps down and 1mbps up, this significantly increased speed and performance!

I wanted to make use of my ADSL line, so I turned my Raspberry Pi into an OpenWrt router, and have it monitor both WAN connections.

If it detects the 4G connection is down by performing regular pings to 1.1.1.1, it will set the metric to a value of 1, and set the backup ADSL interface metric to 0. 

The lowest value takes precedence, and the routing table is updated accordingly setting the default WAN interface to the ADSL interface. When the 4G interface comes back online the metric value is set back to 0, and the ADSL interface metric is set back to 1.

It works really well, and with OpenWrt, you can have many packages running that provide all sorts of extra functionality like Dynamic DNS updates, Private DNS, QOS and Bandwidth monitoring!






Sunday 10 July 2022

Azure SQL PaaS Private Endpoints & DNS

So I have a SQL PaaS Server in Azure, typically you connect to it using the server name which is a domain name that resolves to a public IP address. Now we have disabled public access, so we connect to it via a Private Endpoint.

Private Endpoints link the Azure Virtual Network (vnet), and our network config is done so the routing tables send the traffic to the correct location via SD-WAN etc. Connecting to the SQL Database is done via the server name, but that resolves to a public IP, which I can’t use, due to public access being disabled.


Enabling Private Endpoints creates this private DNS alias, if public access was still enabled then this alias would not exist. So in Azure, you can have Private DNS Zones which use Azure’s own DNS servers and services. We don’t use Private DNS for the virtual network in production, we use our own DNS servers in AD.


If I do a nslookup on the server name you will see it has an alias with the zone I need to add.
When you do the nslookup for the main server name sql-server.datbase.windows.net, it resolves to the alias sql-server.privatelink.database.windows.net.


So by creating the zone in our DNS servers in AD, Azure will look at this zone and return the private IP I need of 10.X.X.X for sql-server.privatelink.database.windows.net. Now because it's an alias looking up the original server name will then eventually return my private IP.


The reason Microsoft does it this way is so if you wanted public access back again, Azure would add/remove this alias address providing you the correct IP you need.


Hope that helps.

For more information, see the original Microsoft community support post I made, along with a very useful video on Azure DNS in relation to Private Endpoints,


Monday 6 June 2022

IE Mode Microsoft Edge (Chromium) Default Policy

Edge IE Mode Microsoft Edge (Chromium) Default Policy - IE MODE

The group policy enables a feature in Edge called IE Mode, which adds legacy browser compatibility for Internet Explorer.

1.      Download the policy file from Microsoft Edge Policy Template.

2.      Extract the downloaded Policy File folder MicrosoftEdgePolicyTemplates.

Domain Controller Setup

3.      Copy msedge.admx, msedgeupdate.admx and msedgewebview2.admx file from C:\Users\{user}\Downloads\MicrosoftEdgePolicyTemplates\windows\admx to C:\Windows\PolicyDefinitions.

4.      Copy msedge.adml, msedgeupdate.adml and msedgewebview2.adml file from C:\Users\{user}\Downloads\MicrosoftEdgePolicyTemplates\windows\admx\en-US to C:\Windows\PolicyDefinitions\en-US.

5.      Open Group Policy Editor.

6.      Click User Configuration/Computer Configuration > Administrative Templates > Microsoft Edge.

7.      Double-click Configure Internet Explorer integration.

8.      Select Enabled.

9.      Under Options, set the drop-down value to Internet Explorer mode if you want the sites to open in IE mode on Microsoft Edge

Configuring the Enterprise Mode Site List policy

Configure IE mode with a separate policy for Microsoft Edge. This additional policy allows you to override the IE site list. For example, some organizations target the production site list to all users. You can then deploy the pilot site list to a small group of users using this policy.

1.     Create or reuse a Site List.

2.    Open Group Policy Editor.

3.      Click User Configuration/Computer Configuration > Administrative Templates > Microsoft Edge.

4.      Double-click Configure the Enterprise Mode Site List.

5.      Select Enabled.

6.      Under Options, type the location of the website list.

7.      Click OK or Apply to save these settings

More Info

·       https://www.youtube.com/watch?v=A2o0x9-0urE
https://docs.microsoft.com/en-us/deployedge/edge-ie-mode-site-list-manager

 

 

Sunday 31 January 2021

IP on DNS blacklist (IP on DNS Blacklist) Down (Error checking bl.spamcop.net, it contains an entry for 127.0.0.1 )

 

Our PRTG server started alerting us to the following.

IP on DNS blacklist (IP on DNS Blacklist) Down (Error checking bl.spamcop.net, it contains an entry for 127.0.0.1)

Also, emails sent from Office 365, some at not getting through.

watchdog.wmf.de gave this error:
Decision Engine classified the mail item was rejected because of IP Block (from outbound normal IP pools) -> 550 40.107.14.123 blacklisted at bl.spamcop.net

Appears  bl.spamcop.net  have not renewed their domain?

https://forum.kpn.com/e-mail-10/spamcop-net-opgeheven-levert-problemen-op-530208?postid=1229636#post1229636

This appears to be causing miss classifications of IP’s that are being blacklisted.

The server used at this time for Office 365 appears to on this backlist.

Name:    mail-eopbgr140123.outbound.protection.outlook.com

Address:  40.107.14.123

 


 


 


Tracking ID: 1ca78e52-284c-4af5-b352-1053cc27860f

Monday 4 May 2020

Home Network Setup

Being someone who love playing around with Cisco kit I decided to annoy my wife and remove the standard cheap basic router from my ISP and go full enterprise at home!

The diagram below shows the topology of my setup, the broadband line uses a Fibre Line VDSL Broadband Fibre Connection. The main ISP router is a Cisco 887VA-M which has the firewall completely locked down with only ports 443 open for SSL VPN connection into my network. I gave the local interfaces an IP from the subnet of 192.168.2.X /30. This allows two IP addresses which can be used to connect the core ISP Cisco router to my Cisco ASA Firewall, which protects in the internal network.

The local LAN runs on a different subnet, 192.168.1.X /24, which uses DHCP reserved addresses. I allocate specific IP addresses and lock down the network with firewall rules on the Cisco ASA.

The local wireless access point is a Cisco AP541N-E which uses WPA2 PSK along with MAC Address filtering to further lock down who can access the network via MAC Addresses.

If you wanted to know how the network was configured please get in touch and I can always send you snippets of the configs.

Physical setup.

Sunday 29 September 2019

McAfee Web Control & Outlook Email Annotations

Summary

This post explains the investigation steps we took and the tools we used to work out how McAfee Web Control functions within our IT Estate.

Topic on McAfee Forums: https://community.mcafee.com/t5/Endpoint-Security-ENS/Outlook-email-annotations-McAfee-Web-Control/m-p/636770#M5508

Problem / Issue we have with McAfee Web Control

Email annotations do not load on malicious sites that appear in emails in Microsoft Outlook.

How does McAfee Web Control Work?

Web Control uses JavaScript as its core to display the Web Control warning, So Web
Control uses executable mfewc.exe to do all the work.

Image

It also calls a child process which can be seen.

Outlook references the DLL files which can be found in the Web Control installation
directory (C:\Program Files (x86)\McAfee\Endpoint Security\Web Control)
like wchook.dll.

There are two versions of the wchook.dll which are 32bit and 64bit. This has no effect on the Microsoft Office version, just the Windows Operating system architecture. 

  • C:\Program Files
    (x86)\McAfee\Endpoint Security\Web Control\x64\wchook.dll
  • C:\Program Files
    (x86)\McAfee\Endpoint Security\Web Control\wchook.dll

I used a tool to check the DLL type to confirm this, as you can see the wchook.dll which I believe is used to hook into the Outlook.exe process, does support both 32 & 64bit Windows.

c:\program files (x86)\mcafee\endpoint security\web control\x64\wchook.dll:

Verified: Signed

Signing date:   10:54 28/11/2018

Publisher:      McAfee, Inc.

Company:      McAfee, LLC.

Description:   Web Control

Product:     Web Control

Prod version:   10.6.1.0

File version:   10.6.1.1082

MachineType:    64-bit

C:\Users\newmant>sigcheck "C:\Program Files (x86)\McAfee\Endpoint Security\Web Control\wchook.dll"

c:\program files (x86)\mcafee\endpoint security\web control\wchook.dll:

Verified:  Signed

Signing date:   10:50 28/11/2018

Publisher: McAfee, Inc.

Company: McAfee, LLC.

Description:  Web Control

Product:  Web Control

Prod version:   10.6.1.0

File version:   10.6.1.1082

MachineType:    32-bit

NOTE: McAfee Web Control only works with 32bit versions of Outlook.

https://docs.mcafee.com/bundle/endpoint-security-10.5.0-web-control-interface-reference-guide-epolicy-orchestrator-macOS-windows/page/GUID-3A772EF7-241E-4E87-9417-7D405B4163F5.html

Monitoring the behaviour of Web Control shows the Web Control Service in a “Wait” sate,
waiting for “mfewc.exe” to pickup any malicious URLS.

"C:\Program Files (x86)\McAfee\Endpoint Security\Web Control\mfewch.exe" saHooker_Initialize_and_Wait 

When Web Control is running on a working 32bit version of Outlook, you will see Outlook loads the McAfee Web Control DLL file for use.

outlook.exe pid: 6504

Command line: "C:\Program Files\Microsoft Office 15\root\office15\OUTLOOK.EXE" 

0x0000000070510000  0x1e000  
 C:\Program Files (x86)\McAfee\Endpoint Security\Web Control\wcHook.dll

JavaScript

How does Web Control make email annotations to emails like the ones below? Outlook doesn’t have a plugin for this, it’s all controlled with JavaScript.

So there are quite a few Javascript .js files that do the work of displaying the warning in Outlook, the main one is this JS file.

 C:\Program Files (x86)\McAfee\Endpoint Security\Web Control\scripts\safe_im.js 

 Location of scripts

C:\Program Files (x86)\McAfee\Endpoint Security\Web Control\scripts

You can see if references various applications it can display the warning for, which
Outlook is a part of.

Also I found this for McAfee Site Adviser which was the previous product before Web Control that did this, that “Message Preview” is required.

https://kc.mcafee.com/corporate/index?page=content&id=KB81730&ePO0514

Network Level Troubleshooting

Where does Web Control obtain its ratings, is it from the ePO Server? Ratings do not come from the ePO server. Ratings come from sae.gti.mcafee.com on port 443.

https://kc.mcafee.com/corporate/index?page=content&id=KB73457

When corrections are made to the Web Control scripts, the Web Control client automatically downloads them from sadownload.mcafee.com.

https://kc.mcafee.com/corporate/index?page=content&id=KB87640

The URL McAfee looks up is below, it tags the malicious URL at the end and looks it up.

https://www.mcafee.com/enterprise/en-us/threat-intelligence.websitetc.html?vid=http%3A%2F%2Fcolorbackpack.best%2FIqMS7cn_G4zyR_it56S3FdKlt2Zl6yWxH6D4h2BQvrI

Image

Looking at the logs and using Wireshark I was able to find the websites Web Control was using, and these interesting error messages about HTTP 403 return codes, which basically mean Web Control is unable to get to these sites.

McAfee Log:  C:\ProgramData\McAfee\Endpoint Security\Logs\WebControl_Debug.log 

http://sadownload.mcafee.com/products/sa/update.xml

Line 74275: 09/20/2019 11:08:07.056 AM
   mfewc(6344.7384) <SYSTEM> WebControl.SaSSHMod.Debug:
Http 
request
for url [
http://sadownload.mcafee.com/products/sa/update.xml] is forbidden
(HTTP_STATUS_FORBIDDEN/403)

Line 74274: 09/20/2019 11:08:07.056 AM  
 mfewc(6344.7384) <SYSTEM> WebControl.SaSSHMod.Debug: Http status
code returned = 403 

09/23/2019 12:06:38.472 AM  
 mfewc(2612.3016) <SYSTEM> WebControl.SaSSHMod.Debug: Http request
for url [
http://sadownload.mcafee.com/products/sa/update.xml] is forbidden
(HTTP_STATUS_FORBIDDEN/403)

What was the solution?

I added the following exclusions to the “Semi Restricted Whitelist” and the “CFS URL” list in our SonicWall Firewall.  I’m not sure if all these sites are needed such as “akamaitechnologies.com” but when running a packet capture on the client and firewall on a device with a malicious email open I could see this traffic being dropped, that’s why I whitelisted it.

A reboot is required before Web Control kicks in.

  1. akamaitechnologies.com (It’s a CDN, so
    probably used to speed up web control: https://en.wikipedia.org/wiki/Akamai_Technologies)
  2. *.akamaitechnologies.com
  3. static.akamaitechnologies.com
  4. sadownload.mcafee.com
  5. mcafee.com
  6. sae.gti.mcafee.com
  7. sae.gti.mcafee.akadns.net

To confirm this was the cause I used “Microsoft Network Monitor” on a working machine, which is a tool that shows you process level network traffic, and you can see that the process “mfewc.exe” McAfee Web Control is communicating on port 443 with McAfee servers.

Testing & Confirming the solution

So as we know Web Control only works on 32bit versions of Outlook, after testing this on a few machines after rebooting them, I was able to get the warning message by using the test site www.screensavers.com.

You can see this being flagged in Outlook and Internet Explorer.

If you look in the log, when McAfee Web Control has found the URL as malicious, it will log it here.

Image

Log tolook for "C:\ProgramData\McAfee\Endpoint Security\Logs\WebControl_Debug.log"

I passed on my findings to McAfee forums to help others. Was really pleased with the response.

https://community.mcafee.com/t5/Endpoint-Security-ENS/Outlook-email-annotations-McAfee-Web-Control/td-p/636137



Business Central - Azure SSO Redirect Loop

  Azure SSO Redirect Loop I noticed an odd issue when both Business Central application servers were running at the same time, in which th...