Tuesday, 28 January 2014

10 Important Facts of Kerberost Protocol

10 Important Facts of Kerberost Protocol

You should read this list of Kerberos facts if you read nothing else in this article. Kerberos is an important protocol that’s sometimes misunderstood by administrators.
  1. Kerberos is an industry standard that was initially developed by MIT in the 1980’s. The current version, Kerberos 5, is defined in RFC 1510.
  2. If you log on to an Active Directory (AD) domain from a computer running Windows 2000 or later, you are probably relying on the Kerberos 5 authentication protocol to access a wide array of network resources, such as AD domain resources, file shares, print services, Microsoft IIS, and even resources protected by IPSec.
  3. Kerberos is currently the most secure authentication mechanism supported by AD.
  4. Kerberos is the best choice for most Microsoft Office SharePoint Server 2007 (MOSS) implementations in an intranet or extranet where users log on to an AD domain.
  5. Kerberos is the only Windows authentication protocol that provides constrained delegation (aka double-hop authentication) and protocol transition.
  6. Windows Integrated Authentication is a superset of the authentication protocols Kerberos and NTLM.
  7. Kerberos Digest and Basic authentication (augmented for security with TLS/SSL) protocols aren’t part of Windows Integrated Authentication but are available via the Security Support Provider Interface (SSPI) in Windows.
  8. Kerberos authentication to a Web site requires that your Microsoft browser be Microsoft Internet Explorer 5.0 or above. Mozilla Firefox and other browsers also support Kerberos authentication.
  9. Kerberos works for both password-based and smart card-enabled authentication.
  10. In Greek mythology, Kerberos/Cerberus was the Greek god, Hades’, watchdog-a threeheaded canine that guarded the gates of the underworld.

What is the krbtgt account used for in Active Directory?

What is the krbtgt account used for in an Active Directory?

A replay attack occurs when an intruder steals a packet from the network and forwards that packet to a service or application as if the intruder was the user who originally sent the packet. When the packet is an authentication packet, the intruder can use the replay attack to authenticate on another person's behalf and consequently access that person's resources or data.
To protect against replay attacks, the Kerberos authentication protocol uses the concept of an authenticator. A Kerberos authenticator is embedded in the Kerberos protocol exchanges that occur between the authenticating client and the authentication server (in Windows, the domain controller—DC). It holds additional authentication data, such as the ticket lifetime, and most important, the client's timestamp. When the Kerberos logic on a DC or resource server validates a Kerberos authentication message, it will always check the authenticator's timestamp. If the timestamp is earlier or the same as a previous authenticator, the server-side Kerberos logic will reject the packet because it considers it part of a replay attack and user authentication will fail. The Kerberos server-side logic also compares the timestamp in the authenticator to the local server time. If the timestamp in the authenticator isn't within five minutes of the time on the server, it will also reject the packet. These five minutes are referred to as the Kerberos time skew. In Windows, the time skew defaults to five, but you can change this value if desired. To do so, you use the Maximum tolerance for computer clock synchronization Group Policy Object (GPO) setting located in the GPO folder Computer Configuration\Windows Settings\Security Settings\Account Policies\Kerberos Policy.
All this explains why it has become very important to keep the computer clocks synchronized in a Windows Active Directory (AD) forest, starting with Windows 2000 (when Kerberos became the default Windows authentication protocol). For that purpose, Windows includes the Windows Time service, which is crucial to the proper functioning of the Kerberos authentication services. To keep the system clocks on all computers in a Windows domain within five minutes, the Windows Time service uses the Network Time Protocol (NTP). OSs prior to Windows Server 2003 use the Simple Network Time Protocol (SNTP), which is the predecessor of NTP.

How Kerberos Work - Kerberos Uncovered

How Kerberos Work - Kerberos Uncovered


Lets understand it by using this Amusement Park Example;

1. You go to the Amusement Park and Buy a Ticket from the Main Entrance Counter to Enter into the Amusement Part to Enjoy The Rides, whichever you have paid for. (Which we call TGT - Ticket Granting Ticket)




2. He goes to the first rider and says I want to ride MarygoRound and present the Ticket (TGT) to the Rider. But the rider says, show me the ticket that you have to ride this ride.

3. Rider suggest him to go to the different counter to get the ticket for this Ride (Call it Service Ticket). He goes to that counter and shows his Ticket (TGT) and gets Service Ticket for the MarrygoRound Ride.


4. After getting the Service Ticket, he shows it to the Rider and he allows him for this Ride. He Enjoys the Ride.

5. Overview

6. In Reality How it Happens
    - User Sends a Authentication Service Request to Domain Controller
    - Domain Controller Sends Back Authentication Service Response along with TGT Key
    - User Send an Application Request along with the TGT Key to the Domain Controller
    - Domain Controller Sends Back TGT Response along with the Service Ticket to Access the Requested
       Application
    - User sends a Request to the Application Server along with the Service Key
    - Application Server Validates it and Grant Permission to Access it

How Replication Works in Windows 2008

How Replication Works in Windows 2008

To troubleshoot AD replication at a deeper level, it helps to have an in-depth understanding of how replication works when changes occur in the directory. AD was one of the first LDAP directories to introduce multi-master replication, whereby changes can originate in any instance of the directory (i.e., on any domain controller—DC). Previously, such as with Windows NT 4.0, changes could originate on only one DC, the Primary Domain Controller (PDC). Multi-master replication has numerous inherent benefits, but it presents a complex problem: how to coalesce and replicate changes to the directory. Throughout this article, I’ll refer back to the simple three-DC domain that Figure 1 shows.
Figure 1: Sample AD replication topology

Figure 1: Sample AD replication topology 


Keeping Track of Replication

AD uses several counters and tables to ensure that every DC has the most current information for each attribute and object and to prevent any endless replication loops. AD uses naming contexts (NCs), also known as directory partitions, to segment replication. Every forest has a minimum of three NCs: the domain NC, the configuration NC, and the schema NC. AD also supports special NCs, often known as application partitions or non-domain naming contexts (NDNCs). DNS uses NDNCs (e.g., DomainDnsZones, ForestDnsZones). Each NC or NDNC replicates independently of one another.
Every DC maintains a special counter known as an update sequence number (USN)counter. The USN is a 64-bit number that you can think of like a clock. The USN counter is never decremented, and a USN can never be reused. Each DC maintains a separate USN counter that starts during the Dcpromo process and is incremented over the lifetime of a DC. It’s improbable that any two DCs in a forest will ever have the exact same USN at the same time. The USN counter is incremented each time a transaction occurs on a DC. Transactions are typically create, update, or delete operations against an object. An update transaction might include updates to a single attribute, or it might include updates to many attributes. In the event that a transaction fails and is rolled back, the USN assigned to the transaction isn’t reused. When an object is modified (or created), the usnChanged attribute of that object is stamped with the USN of the transaction that caused the change. You can therefore keep track of changes to AD by asking a DC for all the objects for which the usnChanged attribute is greater than the highest USN the last time you checked.
Table 1 illustrates a simple example of the changes to the USNs of two DCs over time. Consider a scenario in which you create five new groups on DC-A. This action will increment DC-A’s USN counter by five. DC-A then replicates these groups to DC-B, whose USN counter is incremented by five. (Note that the initial USN values in Table 1 were chosen for illustration purposes.) Subsequently, you edit the name of one of the groups on DC-B. DC-B’s USN counter is incremented by one. When the change in name replicates to DC-A, DC-A’s USN counter is incremented by one.
Table 1: USN Changes Over Time

Table 1: USN Changes Over Time
From the perspective of DC-A, when the five groups are created, this is considered to be an originating write. From the perspective of DC-B, this is a replicated write. Conversely, when a group’s name is updated on DC-B, DC-B considers this action an originated write and DC-A considers it a replicated write.
The AD replication process identifies all the DCs participating in the replication process using two globally unique identifiers (GUIDs). The first GUID, the Directory Service Agent (DSA) GUID, is established during Dcpromo and doesn’t change for the lifetime of the DC. The DSA GUID is stored in the objectGuid attribute of the NTDS Settings object under the DC as shown in Active Directory Sites and Services. The second GUID, the Invocation ID, is the identifier for the DC during the replication process; it might change during the DC’s lifetime.
The Invocation ID is stored in the invocationId attribute of the NTDS Settings object. Any time a restore is performed on a DC by a supported restoration process, such as Windows Server Backup or NTBACKUP, that DC’s Invocation ID is reset. By resetting the Invocation ID, AD is able to ensure that the DC receives a copy of any changes that occurred on that DC between when the backup was taken and when the restore was performed. Because the Invocation ID is the unique identifier for the DC during the replication process, the reset of the Invocation ID effectively ensures that the DC enters the replication process as a new DC and there are no assumptions about data that might already exist on that DC. Improper restoration of a virtualized DC, such as restoring or reverting back to a saved snapshot, won’t reset the DC’s invocation ID. This leads to a situation known as USN rollback, which can cause severe replication problems.

Now that we’ve discussed how replication keeps track of DCs and changes, we can take a look at how replication determines what changes need to be replicated to a given DC and how replication ensures that changes aren’t unnecessarily replicated. Two tables are used for this process: the High-Watermark Vector (HWMV) and the Up-To-Dateness Vector (UTDV). The HWMV is maintained independently by each DC to keep track of where it left off (in terms of the last USN) replicating an NC with a given partner. The UTDV is used by DCs to ensure that they don’t create needless replication or a loop. When DC-A sends DC-B a request for replication, it includes its UTDV so that DC-B sends only changes that DC-A hasn’t received (e.g., in the case of changes made on DC-B that were replicated to DC-C and in turn to DC-A).
Table 2: DC-A’s High Watermark Vector (HWMV)

Table 2: DC-A’s High Watermark Vector (HWMV)
Table 2 shows the HWMV of DC-A after the changes that occurred earlier, as shown inTable 1. Table 3 shows the HWMV of DC-B after the changes that occurred earlier, as shown in Table 1.
Table 3: DC-B’s High Watermark Vector (HWMV)

Table 3: DC-B’s High Watermark Vector (HWMV)
The UTDV stores the highest originating update USN that the DC has received from every other DC replicating a given NC. By storing this information, DCs will never be sent changes that they’ve already received via another path (e.g., if a change occurs on DC-A, but DC-C receives it via DC-B). This behavior is often referred to as propagation dampening. Using the UTDV, the DC sending the information is able to determine changes it hasn’t sent to the DC that’s requesting replication, but also not send changes the DC has already received from other DCs. This behavior prevents an endless loop of changes being replicated between DCs.
To summarize this process, each DC maintains an independent, forward-moving counter known as a USN counter. The USN counter on a DC is incremented each time that DC performs an originating write (such as a create, delete, or update) to the directory. When DCs replicate, they ask for all the changes since the previous USN they replicated from that DC. This previous USN is stored in the HWMV so that DCs don’t ask for changes they’ve already received. Inside each replication request, DCs also include their UTDV. Each DC maintains a UTDV for each NC replicated, and inside the UTDV the DC tracks the highest originating update USN for which it has received changes, for every DC replicating the NC. This prevents endless replication loops and leads to the behavior known as propagation dampening, which ensures that updates aren’t needlessly replicated.

Tracking Object Updates

The key to AD’s replication model is replication metadata (i.e., information about the data that has replicated). Replication metadata is associated with each object in the directory, and this is what AD uses to determine the relative state of objects across multiple DCs. Every object has a number of fields that it stores on a per-attribute basis inside a table that constitutes that object’s replication metadata:
  • Attribute name
  • Change timestamp
  • Attribute version number
  • Originating DC ID (DSA GUID)
  • Originating DC USN
If we consider a simplified version of the scenario outlined earlier, in which we complete the following tasks, we can illustrate how each of these fields in the replication metadata changes:
  1. Create a user on DC-A.
  2. Replicate that user to DC-B.
  3. Modify an attribute of the user on DC-B.
  4. Replicate the change back to DC-A.
When we create a user on DC-A (as in Step 1), the new user’s replication metadata will look similar to Table 4. In the interest of simplification, I’ve included only three attributes (first name, last name, and password); however, many more attributes are set when a user is created.
Table 4: New User Replication Metadata on DC-A

Table 4: New User Replication Metadata on DC-A
The usnCreated attribute of the user is also permanently set on DC-A to 5,001. The usnChanged attribute is also set to 5,001; however, this attribute will be modified each time an update is made (originated) or received (replicated) for the user. After the new user replicates to DC-B (Step 2), the replication metadata on DC-B will match Table 5.
Table 5: New User Replication Metadata on DC-B

Table 5: New User Replication Metadata on DC-B
When a change to the user’s password (Step 3) occurs on DC-B, the metadata for the password attribute (unicodePwd) is updated, as Table 6 shows. The change is subsequently replicated back to DC-A, which updates the local metadata for the user, as Table 7 shows.
Table 7: Updated User Replication Metadata on DC-A

Table 7: Updated User Replication Metadata on DC-A
 

Decoding Object History

One of the nice things about replication metadata is that it lives with an object for its entire life. If you’ve ever been asked where or when an attribute was changed, or when an object was created, you can use replication metadata to find out. The data is accessible in a couple of difficult-to-understand formats as an attribute of the object, but fortunately Repadmin, which is included in Windows Server 2008 and later (or in the Support Tools for previous versions of Windows), makes it easy to decode the data.
To review the replication metadata of an object, you must provide the DC to request the metadata from and the distinguished name (DN) of the object in question. You can use the following command to review the metadata for a user:
'User A' on DC-A: repadmin /showobjmeta "DC-A" "CN=User A,CN=Users,DC=contoso,DC=com"
You’ll see output similar to that in Figure 2.
Figure 2: User object replication metadata

Figure 2: User object replication metadata
From this output, we can see that the user was created on DC-A on March 24, 2008. This is evident based on the originating timestamp and originating DSA for the objectClass attribute, which is version 1. The objectClass attribute can change in some scenarios, in which case you’d need to look elsewhere (such as the metadata for the objectGuid attribute). On March 22, 2010, the user’s givenName (first name) was modified on DC-B, as evidenced by the same originating DSA and originating timestamp columns. You can determine the number of changes that have been made to an attribute based on the version number.

Resolving Conflicts

When it’s possible to make changes to the same object on multiple DCs at the same time, conflicts can occasionally occur. The most common types of conflicts are objects that are created in the same place with the same name (e.g., two “John Doe” accounts in the same organizational unit—OU) and changes to the same attribute in between replication cycles.
In the case of whole object conflicts, the problem is that it isn’t permissible to have two objects with the same relative distinguished name (RDN) within a given container. If you created the user “John Doe” in AD, by default that user’s RDN would be 'CN=John Doe'. If another administrator created an account for John Doe on a different DC in the same container before your user replicated, the change would be permitted—however, during replication AD would need to handle the duplicate RDNs. AD does this by keeping the RDN of the object with the most recent timestamp and renaming the older object(s) such that their GUID is appended (e.g., the older John Doe would have an RDN of 'CN=John Doe\0ACNF:<ObjectGUID>'). In the case in which the conflict is caused by renaming an object rather than creating a new object, the version number of the RDN attribute (typically CN) is considered first, and the highest version number wins.
When changes occur to the same attribute within a replication cycle (e.g., perhaps a user’s description is changed on two DCs by two administrators at about the same time), AD must decide which update to keep. AD first looks at the version number of the attribute in the replication metadata. The change with the highest version number wins. If the version numbers are equal, AD then looks at the timestamps and picks the last write. In the unlikely event that the timestamps are identical, AD looks at the originating server GUIDs and picks the change from the mathematically largest originating server GUID.
The final scenario is the case in which an OU or container is deleted, but before that deletion replicates to other DCs, another administrator creates a child object inside that OU or container. A simple example is when you’re closing an office, perhaps the Chicago office, so you delete the OU for Chicago. Meanwhile, an administrator in San Francisco moves a new user to the Chicago OU. When the deletion of the Chicago OU replicates to San Francisco, AD won’t delete the user that was moved. Instead, AD moves the user to the LostAndFound container at the root of the domain (or in the case of the configuration NC, the LostAndFoundConfig container).

Complex Challenges

AD implemented one of the first multi-master LDAP directory replication models. Multi-master replication introduces some complex challenges, such as how to ensure that replication doesn’t create loops or endless network traffic and how to resolve conflicts. Every DC stores several tables to keep track of replication state and to ensure consistency. In addition, each object stores replication metadata, which serves as a history of that object.

Saturday, 25 January 2014

What’s new for Hyper-V in Windows Server 2012 R2

With the release of Windows Server 2012 R2 end of the year a lot of new features will be introduced, his post covers Hyper-V.

Generation 2 Virtual Machines
·         A VM with no “Legacy”
·         UEFI based
No emulated devices
Boots off virtual SCSI / network adapters
Supports Secure Boot
·         For now only supported guest OS’s are 64-bit Windows 8 and Windows Server 2012 and later
·         VMs boots seconds faster, OS install much faster
(You will not be able cannot upgrade a Gen1 VM to Gen2 VM because of UFIE (new bootloader) and use of GPT partition and not MBR to boot.)
Gen2VM

Enhanced VM interaction
·         Full remote desktop capabilities, even when the network is down!
·         Integrated into Hyper-V Management experience
·         Virtual machines are automatically activates when hosted on Window Server 2012 Datacenter edition
·         Zero touch activation of VMs for hosters / enterprises
·         Copy and paste rich text and graphics inside hyper-V console!
·         Video and audio over Hyper-V console
·         Copy/paste feature as PowerShell commandlet for non GUI guest
·         USB passthrough can be enabled (GPO) it is tied to "RDP" session of VM remote tool.

2x to 10x Faster Live Migration Zero downtime migration
·         Live migration VMs from Window Server 2012 to Win Server 2012 R2
·         Compression enables over 2x improvement in live migration time
·         SMB Direct support allows for high-speed live migrations over high-end networks (RDMA)
FasterLM1-Hyper-V
Online VHDX resize, Live VM export / clone
·         Increase and decrease the size of VHD while VM is live
·         Export VM while it is running
·         Export snapshot of a VM, while VM keeps running
OnlineVHDResize
Storage QoS
·         Can restrict disk throughput for overactive / disruptive VM
·         Dynamically configurable while VM is running

StorageQoS

Hyper-V Replica
Extended replication, now add a second replica to add extra protection for your VM at offsite location or hoster
ExtendReplication1
Finer grained control of replication, now choose 30 sec interval or 5 minutes (default) For other scenarios choose 15 minutes.
Windows Azure will support orchestration of recovery using Hyper-V DR replica’s and system center VMM on premise.
ReplicaFrequency

What's new in Microsoft Windows 2012 R2?

The content in this section describes what's new and changed in Windows Server 2012 R2. This content focuses on changes that will potentially have the greatest impact on your use of this release.


1. Server deployment

You can install Essentials as a member server in a domain of any size. Previously, Windows Server 2012 Essentials could be installed as the only domain controller of a small office network. Now Windows Server 2012 R2 Essentials can be installed on a virtual server or physical server, and on a member server in an existing domain of any size. When installing as a member server, you can have more than one server running Essentials in your domain. Figure A shows the option in Windows Server 2012 R2 Server Manager to install the Essentials Experience role.

Figure A



FIG-A-Windows-Server-Essentials-Experience-Role.jpg

Installing the Essentials Experience role on a member server in an existing domain.

2. Client deployment

You can connect computers to your domain from a remote location. In other words, you can domain join your users’ mobile computers even when they are not on your corporate network. Directing a new employee to the “/connect” virtual directory of Essentials remote access website (see Figure B) launches a simple wizard that prompts the user for four pieces of information:
  • Username and password for the domain.
  • If the computer is only for you, or for you and other domain users.
  • An optional description to type such as “TechRepublic Windows 8.1 Tablet”.
  • Will you want the computer to wake up for backups or to only perform backups when the computer is running.

Figure B



FIG-B-Connect-Your-Computer-To-the-Server.jpg

The Connect web page hosted by Essentials will domain-join a computer locally or on the Internet.

3. Pre-configured auto-VPN dialing

If you need access to on-premise network resources there is a pre-configured VPN client.Figure C shows the box that appears after connecting the computer to the network over the Internet. The user can optionally trigger auto-VPN dialing so they are always connected to the workplace.

Figure C



FIG-C-Essentials-Connector.jpg

A pre-configured VPN Client can be optionally set to auto-dial the office.

4. Server storage

You can create shared folders such as user home folders on a secondary server on the network. Get an alert when a server folder grows beyond its defined quota.

5. Health Report

A really useful Health Report is integrated with Windows Server 2012 R2 Essentials and no longer needs to be installed as an add-in. Depending on your business needs, you can customize the system health reports to display items that you prefer to monitor. Figure Dshows a daily health report viewed on a smartphone. This is a quick and easy way to keep your pulse on the health of a small network.

Figure D



FIG-D-Daily-Report-on-Phone.jpg

Health Report viewed on a mobile device.

6. BranchCache

You can turn on BranchCache to improve data access if the server running Windows Server 2012 R2 Essentials is located offsite. BranchCache is a wide area network (WAN) bandwidth optimization technology that is included in some editions of the Windows Server Windows client operating systems. To optimize WAN bandwidth when users access content on remote servers, BranchCache copies content from a main office or hosted cloud content servers and caches the content at branch office locations, allowing client computers at branch offices to access the content locally rather than over the WAN.

7. Office 365 integration

The following functionalities are new in Office 365 integration with Windows Server 2012 R2 Essentials: SharePoint Libraries management and Office 365 Distribution Groups management. For the small business that is looking for a way to accelerate their cloud journey by moving some functions like email to Office 365, it’s hard to imagine this being any easier.

8. Mobile Device Management

If your Windows Server 2012 R2 Essentials server is integrated with Office 365, you can manage your mobile devices using the Exchange Active Sync functionalities from the Essentials dashboard, such as define email access from a mobile device, set up password policies, and remote wipe of the mobile device.

9. Client Full System Restore

Client Full System Restore is now supported by Windows Deployment Services (WDS). You can create client restore service using the Set up Client Restore Service task and perform client full system restore over the network with WDS instead of using an image saved on a DVD.

10. Remote Web Access

Remote Web Access is updated and optimized for touch devices and enhanced with rich HTML5 support. Figure E shows off this really nice looking interface.

Figure E



FIG-E-Remote-Web-Access-Home-Page.jpg

The Remote Web Access home page is optimized for touch screen devices like tablets.