4

Possible robots are hitting my site at /autodiscover/autodiscover.xml. This gets a 404 which logs as a Page Event in analytics. My site is getting slammed with these. Robot detection is obviously failing here. Can I block certain URLs from getting logged as a page event?

Difficulty level: max

I need to do this on 7.2 and 8.0 and 8.1.

  • Sounds like a weakness probe. It would be better to try to block these requests using a firewall rule. It could also be that Outlook is misconfigured on some computers and trying to get information from your web site instead of your Exchange server. – maz Oct 30 '18 at 19:49
  • This is not an answer to your question, hence why a comment. I had the same issue a few years ago. Your site is likely running on the domain name that is used for your company emails. eg. "ethan@example.com" and your site is "www.example.com". Exchange will hit up the example.com all the time trying to discover details about the users. It's really annoying... you need to configure this on the back-end so that they are sent to the correct autodiscovery domain for your users. @Mark Cassidy's answer has lots of options for ya, but start with Exchange/Office365 – Jason St-Cyr Oct 31 '18 at 11:50
4

Well the real fix would be to re-configure how AutoDiscover is set up on your Exchange Server/Outlook clients. For information on that, go to Exchange & The Autodiscover Web Service.

However your question asks specifically how to ignore certain URLs from being logged. I don't know of a way to do that, but I can suggest a way to have this request ignored.

First, make sure Attribute Routing is enabled.

routes.MapMvcAttributeRoutes();

And then add the following controller to your solution.

public class AutoDiscoverController : Controller
{
    [Route("autodiscover/autodiscover.xml")]
    public ActionResult Index()
    {
        return new HttpStatusCodeResult(HttpStatusCode.RequestTimeout);
    }
}

There is also a config level approach where you mark the above request to a static handler in IIS. As such, the request never makes it to your application.

<add name="AutoDiscoverXmlFileHandler" path="autodiscover.xml" verb="GET" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" responseBufferLimit="0" />

Source: Using a route to return 408 on a specific file name request

  • This is one of the more annoying pieces of Exchange... – Jason St-Cyr Oct 31 '18 at 11:51
  • I agree with your first point, but its a client's Exchange Server that I have no control over. So, reviewing some options here. Thanks. – Ethan Schofer Nov 2 '18 at 14:50
3

Just to give some more options, you can add page urls to the untrackedPages section of the config. These are located in the App_Config\Include\Sitecore.Analytics.Tracking.config file.

<tracking>
    <untrackedPages>
      <add path="/sitecore/default.aspx" />
      <add path="/sitecore/service/error.aspx" />
      <add path="/sitecore/service/Heartbeat.aspx" />
      <add path="/sitecore/service/keepalive.aspx" />
      <add path="/sitecore/service/nolicense.aspx" />
    </untrackedPages>
  </tracking>

From a Sitecore ticket I had a little while back:

These pages are processed later in the >Sitecore.Analytics.Pipelines.StartAnalytics.CheckPreconditions processor:

protected bool IsUntrackedPage(string filePath)
{
  Assert.ArgumentNotNull(filePath, "filePath");
  foreach (string untrackedPage in AnalyticsSettings.UntrackedPages)
  {
    if (filePath.Equals(untrackedPage, StringComparison.InvariantCultureIgnoreCase))
    {
      return true;
    }
  }
  return false;
}
  • Unfortunately, this is 8.2 and up. – Ethan Schofer Nov 2 '18 at 15:17
0

If you are using a route than you need to ensure that route is registered after the Sitecore.Mvc.Pipelines.Loader.InitializeRoutesprocessor so the controller requests are not tracked. There is some more info in the Sitecore documentation here as well.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.