Post Upgrade Configurations for 12.2.4

Perform the following configuratons after upgrading to 12.2.4:

Procedure

  1. From the base version Backup directory, restore the following files:
    • <Installation Root Path>\DiscoverCaptureSocket.cfg
    • <Installation Root Path>\DCMaint.cfg
    • <Installation Root Path>\HBR_PipeLine-base.cfg
    • <Installation Root Path>\Beats\filebeat\filebeat.yml
    • <Installation Root Path>\Beats\winlogbeat\winlogbeat.yml
    • <Installation Root Path>\Portal\WebApp\Web.config
    • <Installation Root Path>\Portal\WebService\Web.config
  2. Navigate to <Discover_Installed_Dir>\Portal\WebApp directory.
  3. In Web.config file, under AppSettings section,
    1. Add a new key to continue with DB/NT Authentication:
      <add key="owin:AutomaticAppStartup" value="false" /> (If its NOT available by default)
    2. Add a new key:
      <add key="BaseUrl" value="https://Portal_ip/Portalapi/api/" /> (replace Portal_ip with Portal server ip)
    3. Under <customHeaders>, for Content-Security-Policy tag, add machine IP address info as shown below:
      <add name="Content-Security-Policy" value="frame-ancestors 'self' https://Portal_ip https://localhost;" /> (replace Portal_ip with Portal server ip)
    4. Comment out the following sections, if they are available:
      Section 1
       Authentication settings 
          				 <authentication mode="Forms"> 
          				 <forms loginUrl="Default.aspx" protection="All" name="TLAuthCookie" path="/" slidingExpiration="true"/> 
          				 </authentication> 

      Section 2

       <authorization> 
          				 <deny users="?" /> 
          				 </authorization> 

      Section 3

       <add name="Clear-Site-Data" value="&quot;storage&quot;" /> 
  4. Navigate to <Discover_Installed dir>\Portal\api\PortalConfig\ directory.
  5. In appsettings.json file, under Admin: section, replace {{localhost}} with Portal server IP with the following lines:
    "prodUrl": "https://{{localhost}}/PortalAPI/api/",
      			"prodV1Url": "https://{{localhost}}/PortalV1/",
    Note: Only HTTPS URLs will work.
  6. If you want to use NT authentication, in the same same appsettings.json file, under AuthenticationSchemes: within the AuthConfig: section, add the following lines:
    "NT": {
            "Name": "NT",
            "Enabled": false
          }
  7. Restart all services of Portal/Report server.

What to do next

Once the application update is complete, you can safely remove, or archive, the old appsettings.json file (<Discover Installed Directory>\Portal\web\assets\data\appsettings.json), as it is no longer required, and retaining it may pose a security risk.

Removing SyncFusion Configurations

Procedure

  1. Access the file web.config from the <Installation Root Path>\Portal\WebApp location.
  2. Within the root <configuration>, make the following changes:
    1. Within <appSettings>, remove the following keys:
      <add key="LoadEJResourcesFromAssembly" value="true"/>
      <add key="EJResources" value="jsrender:true;themes:true;"/>
    2. Within <pages><controls>, remove the following entries:
      <add assembly="Syncfusion.EJ, Version=17.4450.0.39, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" namespace="Syncfusion.JavaScript.Web" tagPrefix="Ej" />
      <add assembly="Syncfusion.EJ, Version=17.4450.0.39, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" namespace="Syncfusion.JavaScript.Models" tagPrefix="Ej" />
      <add assembly="Syncfusion.EJ.Web, Version=17.4450.0.39, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" namespace="Syncfusion.JavaScript.Web" tagPrefix="Ej" />
      <add namespace="Syncfusion.JavaScript.DataVisualization.Models" assembly="Syncfusion.EJ, Version=17.4450.0.39, Culture=neutral, PublicKeyToken=3D67ED1F87D44C89" tagPrefix="Ej" />
    3. Within <compilation><assemblies>, remove the following entries:
      <add assembly="Syncfusion.Licensing, Version=17.4450.0.39, Culture=neutral, PublicKeyToken=632609B4D040F6B4" />
      <add assembly="Syncfusion.Compression.Base, Version=17.4450.0.39, Culture=neutral, PublicKeyToken=3D67ED1F87D44C89" />
      <add assembly="Syncfusion.DocIO.Base, Version=17.4450.0.39, Culture=neutral, PublicKeyToken=3D67ED1F87D44C89" />
      <add assembly="Syncfusion.EJ, Version=17.4450.0.39, Culture=neutral, PublicKeyToken=3D67ED1F87D44C89" />
      <add assembly="Syncfusion.EJ.Export, Version=17.4450.0.39, Culture=neutral, PublicKeyToken=3D67ED1F87D44C89" />
      <add assembly="Syncfusion.EJ.Web, Version=17.4450.0.39, Culture=neutral, PublicKeyToken=3D67ED1F87D44C89" />
      <add assembly="Syncfusion.Licensing, Version=17.4450.0.39, Culture=neutral, PublicKeyToken=632609B4D040F6B4" />
      <add assembly="Syncfusion.Linq.Base, Version=17.4450.0.39, Culture=neutral, PublicKeyToken=3D67ED1F87D44C89" />
      <add assembly="Syncfusion.Pdf.Base, Version=17.4450.0.39, Culture=neutral, PublicKeyToken=3D67ED1F87D44C89" />
      <add assembly="Syncfusion.XlsIO.Base, Version=17.4450.0.39, Culture=neutral, PublicKeyToken=3D67ED1F87D44C89" /> 
    4. Within <runtime><assemblyBinding>, remove <dependentAssembly> / <codeBase> blocks for Syncfusion.Pdf.Base and Syncfusion.Compression.Base (pointing to both SyncfusionPDF\ and Syncfusion17\ paths).
      <dependentAssembly>
              <assemblyIdentity name="Syncfusion.Pdf.Base" publicKeyToken="3d67ed1f87d44c89" />
              <codeBase version="4.402.0.51" href="bin\SyncfusionPDF\syncfusion.pdf.base.dll" />
      </dependentAssembly>
      <dependentAssembly>
              <assemblyIdentity name="Syncfusion.Compression.Base" publicKeyToken="3d67ed1f87d44c89" />
              <codeBase version="4.402.0.51" href="bin\SyncfusionPDF\syncfusion.compression.base.dll" />
      </dependentAssembly>

Blocking Host Header Injection

About this task

It was observed that Discover failed properly validate the Host header. This could allow an attacker to supply arbitrary host values within incoming HTTP requests. This weakness allows host header injection attacks, potentially impacting URL generation, password reset links, cache poisoning mechanisms, and downstream routing logic.

To avoid Host Header Injection, complete the following steps:

Procedure

  1. Download and install the URL rewrite module from the Microsoft website.
  2. Access the web.config file from the <discover installed directory>\Portal\web\ location.
  3. In the <system.webServer> within the <configuration> section, add the following code:
    <rewrite>
    	<rules>
    		<rule name="Block Host Header Injection" stopProcessing="true">
    			<match url=".*" />
    				<conditions>
    					<add input="{HTTP_HOST}" pattern="^(comp-4614-1\.discover\.com)$" negate="true" />
    				</conditions>
    			<action type="AbortRequest" />
    		</rule>
    	</rules>
    </rewrite>

    In case of multiple domains use | as the separator. Example: 127\.0\.0\.1|<hostname>\.discover\.com

    Some examples for configuring domains are as follows: 11\.111\.123\.12|localhost|127\.0\.0\.1|<hostname>\.discover\.com

  4. Save the changes.
  5. Restart the Application Server.

Enabling or Disabling REST API Access

About this task

To enable or disable Discover REST API, complete the following steps:

Procedure

  1. Navigate to the <discover installed directory>\Portal\api\ location.
  2. Open the appsettings.json file.
  3. Go to the Swagger section of the code.
  4. Configure the value of the Enabled parameter to:
    • true - to enable access to REST API.
    • false - to block access to REST API.
  5. After configuring the value, restart the IIS server.