Friday, October 17, 2014

Sitecore- Vulnerability -Transport Layer Protection and Cross-Frame Scripting

Some key points to handle the Vulnerability and Transport layer protection.

“Transport Layer Protection: Insecure Transmission”

Vulnerability Summary: -  As per standard the user type credential should not be exposed through the “get” method. A username was found in the query string of a GET request or Set-Cookie header.

Update and Action:- This is basically a case where in case item/template not  found, then the URL comes like below

Proposed Solution: - In case if item not found will redirect to the other specific URL, this section required some more investigation.

“Cross-Frame Scripting”

Vulnerability Summary: - A Cross-Frame Scripting (XFS) vulnerability can allow an attacker to load the vulnerable application inside an HTML iframe tag on a malicious page.


Solution: - Fix by including an X-Frame-Options header set to 'SAMEORGIN'. There are two options available either we can change in the web. Config or in the IIS settings.

Change in the web. config: - This is by default, setting and it’s available in the b2b web.config section.
 

Required change in the IIS: - Below are the steps for the IIS settings

  1. Open Internet Information Services (IIS) Manager.
  2. In the Connections pane on the left side, expand the Sites folder and select the site that you want to protect.
  3. Double-click the HTTP Response Header icon in the feature list in the middle.
  4. In the Actions pane on the right side, click Add.
  5. In the dialog box that appears, type X-Frame-Options in the Name field and type SAMEORIGIN in the Value field.
  6. Click OK to save your changes.
For more information :- http://support.microsoft.com/kb/2694329

Please feel free to post here, If have any questions

Wednesday, October 15, 2014

Sitecore :- How to restore deleted data/Item/template in sitecore

We have an option to restore the data through the Recycle Bin option.

Login to Sitecore through Admin User and you will find below option.

Sitecore :- How to deploy/install TDS package

- Go to the below path and upload the TDS package

.... Current Path.../sitecore/admin/Updateinstallationwizard.aspx


Sitecore :- How to reset the cookies and clear cache in Sitecore



Sometimes we may face some issues where our changes not get reflected, In that we need to check below steps

1) Reset the IIS
2) Clear the catch :-
 Go to below link :-..........sitecore/admin/cache.aspx

         

3) Check that item is published or not

Monday, November 25, 2013

Generic functionality and sample program.

Generics refers to a technique of writing code for a class without specifying the data type that the class works with.

First we should now why we required generic

Earlier in C# 1.1 we have object programming and there we  can create object  and in case of typesafe and performace we were creating another classes.

In generic basically we are defining the datatype.

Let say.
  class Generic
    {
        T[] itemsType;
        public static string Name ="test";
    }
}
Calling the generic function
   String nameValue = "";
            nameValue = Generic<string>.Name;

Simple generic program:-
Create a class below
class Address {

        public int SrNo { get; set; }
        public string Name { get; set; }

        public Address(int srNoInput, string NameInput)
        {
            this.SrNo = srNoInput;
            this.Name = NameInput;
        }

    }

Use this class through generic functionality

       List<Address> Addresslist = new List<Address>();

            Addresslist.Add( new Address(1,"Fist"));
            Addresslist.Add( new Address(2,"Second"));
            Addresslist.Add( new Address(3,"Third"));

            foreach( Address Add in Addresslist)
            {

                Console.WriteLine("Address Number:- "  +  Add.SrNo);
                Console.WriteLine("Address Name r:- " + Add.Name);


            }



Wednesday, October 16, 2013

Converting time zone in asp.net,C# and vb.net through framework 3.5.

First add below references.

Namespace:  System
Assembly:  System. Core (in System. Core. dell)

Sample function that works for all of you.

Create below function in common classes.

  Public Function GmtToPacific (ByVal dateTime As DateTime) As DateTime
        Return TimeZoneInfo. ConvertTimeFromUtc (dateTime, TimeZoneInfo. FindSystemTimeZoneById ("Pacific Standard Time"))

    End Function

Calls this function and pass input date in UTC/GMT format.

Dim objName as new CommonClassName

objName .GmtToPacific(sinceDate.ToUniversalTime.ToString())


How to consume RaaS service( Report as a service), details and sample code

Dim webRequest As HttpWebRequest = DirectCast(Net.WebRequest.Create("URL of Raas service"), HttpWebRequest)
        webRequest.Method = "GET"
        webRequest.ContentType = "application/x-www-form-urlencoded"
        webRequest.Credentials = New NetworkCredential("URL of RaaS service", "token")
        Dim httpResponse As HttpWebResponse
        Dim contentReader As StreamReader
        Try
            httpResponse = DirectCast(webRequest.GetResponse(), HttpWebResponse)
            contentReader = New StreamReader(httpResponse.GetResponseStream())
            Dim readToEnd As String = contentReader.ReadToEnd()
        Catch ex As Exception
            '' Log the exception here
        End Try