Chapter 8 - Hardening and Security
Chapter 8 - Hardening and Security
2
Why bother with security?
What are they typically doing during those 243 days? Siphoning all of
your data, bit by bit out the back door
There are always new tools and technology coming out that can help
you fight off the bad guys!!!
3
Security is a top priority for IT
Attacks ruin reputations
Application Hardening
Anti-Virus
Defense-in-Depth Model
Data Security
21
Windows Firewall with Advanced Security (WFAS)
22
WFAS
Windows Firewall settings
23
WFAS
Windows Firewall settings
Click on the Advanced settings link or Start -> Run and type wf.msc to launch WFAS
administration console
24
WFAS
Windows Firewall settings
If you plan to utilize IPsec for encryption of network traffic, rules in this section are the
definitions of IPsec tunnels
25
WFAS
Windows Firewall settings: Profiles
Public Profile: When prompted, if you choose "Public" then of course you are assigned the
Public firewall profile.
26
WFAS
Windows Firewall settings: Profiles
When any NIC on a server connected to a network, WF assign that connection one of
the three different profiles
Example: When connect your laptop to the Wi-Fi at your local coffee shop, Windows
prompt and ask you if you were connecting to a home, work, or public network! i.e.,
WF asking you which profile to assign to the new network connection
Assign NICs and network connections to different firewall profiles means that assign
different access rules and criteria for what is or is not allowed over those different
profiles.
27
WFAS
Windows Firewall settings: Profiles
Each network connection assigned its own profile => more than one firewall profile
active at the same time on the same system.
For example, one server connected to both the corporate network and the public
Internet. Inside WFAS, both the Domain Profile and the Public Profile are active
To identify the profile of a NIC: Network and Sharing Center
28
WFAS
Building a new Inbound Rule
29
WFAS
Building a new Inbound Rule
30
WFAS
Building a new Inbound Rule
Only allow the connection if it is authenticated by IPSec: IPsec already established in the
network
31
WFAS
Building a new Inbound Rule
The internal NICs connected to domain network will have the Domain profile assigned to
them; other NICs have either Public or Private profiles active
32
WFAS
Build a rule for ICMP
New Windows Automatically block pings (ICMP)=> Need to create either an allow or a
block rule for ICMP
Create the new rule as previous example (Rule Type: port; Specific Local Port: Any
number, e.g., 1234)
Once your new rule is created, it presents in the Inbound Rules list. Right-click on it, and
head into Properties.
33
WFAS
Build a rule for ICMP
34
WFAS
Managing WFAS with Group Policy
Managing firewall rules on your servers, and clients, can be a huge step toward a
more secure environment for your company
If your company has 1000 computers and you are assigned to implement the entire
list of allows and blocks on every machines, how do you solve this problem?
Group Policy: setting up a firewall policy that applies to everyone is a breeze for
your domain-joined machines
WFAS
Managing WFAS with Group Policy
For more granularity, You can have a GPO applies firewall rules to clients, and a
separate GPO applies firewall rules to servers
Looking the insides of this new GPO to figure out the correct location to create some
new firewall rules
Clicking on the Windows Firewall Properties to determine the status of each firewall
profile individually
WFAS
Managing WFAS with Group Policy
Inside WFAS, we have categories for Inbound Rules and Outbound Rules to help
building a rule into this GPO
Windows Defender
Windows Defender
Installation
Anti-malware software built into the Windows operating system (starting with
Windows 8)
Windows Defender installed by default in Windows Server 2016
If it is not installed yet, we can easily add the Windows Defender feature either from
the Add Roles and Features wizard, or by using PowerShell cmdlet:
Install-WindowsFeature –Name Windows-Defender-GUI
42
Windows Defender
User interface
Open Windows
Defender
43
Windows Defender
User interface
definition files
44
Windows Defender
Disabling
If you want to disable Defender, you must remove the feature from Windows
PowerShell:
Uninstall-WindowsFeature –Name Windows-Defender-Features
45
Protecting Data
Protecting Data
Protecting Data
Protect Data at Rest
Encrypting File System (EFS): existed on both client and server operating systems
EFS encrypt only particular documents or folders
Prevent unauthorized users from viewing its content, no matter of the type of
permissions users have to a file
The process of encryption and decryption is transparent to the user and applications.
Protect Data at Rest
Encrypting File System
When encrypting a file or folder, users just need to select a check box to encrypt the
contents to secure data
Protecting Data at Rest
Encrypting File System
When users access the encrypted files or encrypted folders, they open them the same
way they would open a nonencrypted file.
When unauthorized users attempt to open the file, they will receive a message stating
that access is denied
Protecting Data at Rest
Encrypting File System
2. EFS then encrypts the file 3. Encrypts the FEK with the user's public key
with the generated FEK
2. If EFS decrypts the FEK successfully, EFS uses it to decrypt the file content.
Protecting Data at Rest
BitLocker
A volume-encryption technology that encrypts the whole volume to protect data from
unauthorized access.
Can encrypt an entire volume or only the used parts of a volume.
BitLocker requires the hard drive is encrypted, i.e, OS can't boot without the encryption
being unlocked.
How do we unlock the hard drive so that our machine can boot?
Protecting Data at Rest
BitLocker
The best method is to store the "unlock keys" inside a Trusted Platform Module
(TPM):
o A physical microchip built into a computer.
o You simply enter a pin to gain access to the TPM in order to make it boot.
If deploy BitLocker without the presence of a TPM, to unlock a BitLocker volume and
make it bootable you need to plug in a physical USB stick that contains the BitLocker
unlock keys.
Protecting Data at Rest
BitLocker and the Virtual TPM
Can BitLocker apply to VMs?
o VMs do not have a TPM, and you also have no way of plugging in a USB stick!
o Virtual TPM: Brand new in Windows Server 2016 that can be used for storing
these keys!
Protecting Data at Rest
BitLocker drive encryption architecture
FVEK encrypted with the VMK stored on the disk as part of the volume metadata.
Protecting Data in Transit
Data in transit includes all the information that client computers and servers transfer
during their communication
Protecting Data in Transit
IPSec/VPN/HPPTS
Protecting Data in Transit
IPsec
A suite of protocols that can help protect data in transit through a network by providing
authentication, integrity checking, and encryption.
Two IPSec security protocols used to provide these security services: Encapsulating
Security Payload (ESP) and Authentication Header (AH)
ESP: providing authentication, integrity and confidentially
AH: provides a mechanism for authentication only
Protecting Data in Transit
IPsec
When configuring VPN on RA server: one of the connection protocols the VPN clients
can use to connect to the VPN server is IPsec (IKEv2) tunnels
DirectAccess tunnel is also protected by IPsec.
We can specify the traffic moving around inside our corporate networks to be
encrypted using Ipsec by using IPsec policy settings.
Protecting Data in Transit
IPSec mode: Transport mode
The entire original packet is encrypted and becomes the payload of a new packet
IPSec-aware routers
• to encapsulate and encrypt network traffic from hosts that are not IPsec aware,
• and then decrypt it for use on the destination network by other hosts that are not IPSec aware.
Protecting Data in Transit
Configuring IPsec
Two different places that IPsec settings can be configured in a Microsoft Windows
environment:
o IPsec Security Policy snap-in.
o Windows Firewall with Advanced Security
Protecting Data in Transit
Configuring Ipsec: Using a GPO
Client (Respond Only): computers to negotiate security and authentication methods when requested.
Server (Request Security): a computer to always request security by using the Kerberos V5
authentication protocol for all IP traffic, and allows unsecured communications with the clients that
donot response to the request
Secure Server (Require Security): a computer to always require a secure connection for all IP
traffic and to block untrusted computers.
o Donot allow unsecured communication
Protecting Data in Transit
IPsec Security Policy snap-in
Once inside, you can start creating your own by using the Create IP Security Policy…
by right clicking on IP Security Policies.
Protecting Data in Transit
Configuring IPsec: Using WFAS
The newer platform used for establishing IPsec connection rules is the Windows Firewall
with Advanced Security
Open WFAS
Navigate to the Connection
Security Rules, then right-click
and choose New Rule…
Protecting Data in Transit
Configuring Ipsec: Using WFAS
Configured options:
o Device Guard and AppLocker policies: to allow only Only authorized users can
authorized applications to run on PAW. sign in to the PAW
o Credential Guard: protect the credentials.
o BitLocker: protect the boot environment and the
hard disk data.
o Control access by using a firewall
Protecting Administrative Access
Securing Domain Controllers
If an attacker gains access to domain controllers, the attacker will have access to all of
the domain objects.
Protecting Administrative Access
Securing Domain Controllers
Regularly update Control the execution of executables and scripts on the Configure Windows Firewall
domain controllers DC with AppLocker and Device Guard with Advanced Security
All servers should be configured to allow only administrators to physically log on to the console
General security best practices
General security best practices
Get rid of perpetual administrators
We spend all day working on servers, and very often have to reach out and check
something from a web browser.
It is so easy to pick up bad things from the Internet, especially on servers because if any
machines in our network are running without antivirus protection
Don't even do it for websites that you trust.
A man-in-the-middle attack or a compromise of the website itself can easily corrupt
your server. It's much easier to rebuild a client computer than it is a server.
General security best practices
Role-Based Access Controls
Role-Based Access Control (RBAC) is an ideology all about separating job roles and
duties
When think about separating our employees' job roles from an IT perspective, we
traditionally think in terms of Active Directory groups
AD groups still empower administrators with full access to the groups themselves.
RBAC technologies divide up roles at a different level: focuses more on employee
job descriptions than access restrictions.
General security best practices
Just Enough Administration
If a user working within a JEA and try to invoke a cmdlet not part of the "allowed"
cmdlets, PowerShell pretends like it doesn't even recognize that cmdlet.
A DNS administrator occasionally need to restart the DNS services: Adopting the
JEA/RBAC, not have administrative rights but have JEA-based rights within PowerShell
Restarting the DNS service requires access to use the Restart-Service cmdlet
JEA: provide the user the Restart-Service cmdlet, but only give permissions to restart
DNS services. If the user tried to Restart-Service on winrm, they would be denied.
General security best practices
Device Guard
A technology about limiting which applications allowed to run and install on your
systems
Have a white-list of allowed applications: enforce that only applications having a code
signing certificate allowed to run
Apps that are not trusted natively by Microsoft, or are not explicitly trusted by you,
simply don't run.
Device Guard is unique in that it manages both user and kernel mode processes.
Even if an attacker gains access to the operating system of your server, if you have
Device Guard policies in place, they will not be able to launch and run malicious
software
General security best practices
Credential Guard
Prior to Windows 10 and Windows Server 2016, password hashes and tickets were
stored on the hard drive of a machine, in the Local Security Authority (LSA).
Those hashes were very easily stolen by using simple, free tools available on the
Internet.
Credentials Guard protects your domains credentials from being compromised.
General security best practices
Credential Guard
Security for client machines, networks, cloud resources, and most importantly your
data
No single solution to secure your infrastructure, it requires many different technologies
all working together to provide safety for your resources
This chapter provides examples of security measures and technologies can be utilized
Apps which transmit or store data unencrypted need to be modified or dumped
Protection of information is essential to the longevity of our businesses