Top Banner
Securing Windows With Group Policy
48

Securing Windows with Group Policy

Jan 15, 2017

Download

Technology

Josh Rickard
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Securing Windows with Group Policy

Securing Windows With Group Policy

Page 2: Securing Windows with Group Policy

Josh Rickard• BS in Computer Information Systems

• Central Methodist University – 1 year

• University of Missouri – 4 years

• Currently a Security Analyst-Specialist

– QualysGuard, Kasperksy, incident response

Page 3: Securing Windows with Group Policy

Josh Rickard• Microsoft Deployment Toolkit & SCCM

• Group Policy

• Digital forensics

• Incident response

• PowerShell tool making!

Page 4: Securing Windows with Group Policy

Josh Rickard• GIAC Certified Windows Security Administrator - GCWN

• GIAC Certified Forensic Analyst – GCFA

• QualysGuard Certified Specialist – QGCS-VM

• Apple Certified Associate – Mac Integration

Page 5: Securing Windows with Group Policy

FIRST STEP TOWARDS SECURING WINDOWS

Page 6: Securing Windows with Group Policy

START WITH MALWARE-RESISTANT OPERATING SYSTEMS AND SOFTWARE

Page 7: Securing Windows with Group Policy

NEXT STEPS

Page 8: Securing Windows with Group Policy

PATCH MANAGEMENT

Page 9: Securing Windows with Group Policy

Questions• Who uses Active Directory in their environment?

• Who uses Group Policy in their environment?

– Daily?

– Weekly?

– Monthly?

– Year or more?

Page 10: Securing Windows with Group Policy

Questions• Who has/uses two separate accounts?

– Mundane ([email protected])

– Admin (unique account)

Page 11: Securing Windows with Group Policy

USE TWO SEPARATE ACCOUNTS

Page 12: Securing Windows with Group Policy

Two Group Policy Questions• Where are you? (Domain, OU, Site)

• What are you? (User or Computer)

Page 13: Securing Windows with Group Policy

LSD OU!

Local •Local Group Policy

Site•Site or Forest Group Policy

Domain•Domain Group Policy

OU• Organizational

Unit Group Policy

Page 14: Securing Windows with Group Policy

Exceptions to the rule• Account Policies

– Password Policy

– Enforce password history

– Maximum & Minimum password age

– Minimum password length

– Passwords must meet complexity requirements

– Store password using reversible encryption for all users in the domain (NOOOOOOOOOO!!!!!!)

• Account Lockout Policy settings

– Account lockout duration

– Account lockout threshold

– Reset account lockout counter after

• Kerberos Policy settings

– Enforce user logon restrictions

– Maximum lifetime for service ticket

– Maximum lifetime for user ticket

– Maximum lifetime for user ticket renewal

– Maximum tolerance for computer clock synchronization

– Network Access: Allow anonymous SID/NAME translation

– Network Security: Force Logoff when Logon Hours expire

• Local Policies

Page 15: Securing Windows with Group Policy

Computer Configuration• Computer configuration almost always wins

• Used to apply configuration changes specific to machines

• Think, HKLM

• Exception: Loopback Processing Mode

Page 16: Securing Windows with Group Policy

User Configuration• Really only useful if user & computer objects in same OU

• Used to apply configuration changes specific to users

• Think, HKCU or HKU

Page 17: Securing Windows with Group Policy

Policies• No tattoo

– If GPO is out of scope, it will be removed

• Overwrite current application settings

• Policies are recognized by applications

– i.e. grayed out settings

Page 18: Securing Windows with Group Policy

Preferences• Tattoo's

– If GPO goes out of scope, settings remain

• Item Level Targeting

– We will talk about this later

Page 19: Securing Windows with Group Policy

Block Inheritance• Block GPOs higher in the LSD OU order

• Keep in mind that Kerberos, password, & lockout policies will still be enforced for everyone in that domain.

Page 20: Securing Windows with Group Policy

Enforced (a.k.a., “No Override”)• Enforce parent container GPO to all sub-containers

• This will “override” any “Block Inheritance” GPO settings

• Except: Loopback Mode GPOs

Page 21: Securing Windows with Group Policy

Loopback Processing Mode• User configurations for computer objects

• Replace

– This will replace current user settings applied to that OU

• Merge

– This will merge both the user & computer GPO

• *NOTE: User GPO will win.

Page 22: Securing Windows with Group Policy

WMI Filtering• Filter/configure GPO “scope”

• Filter based on specific users/computers/groups/etc.

Page 23: Securing Windows with Group Policy

Item Level Targeting• GPO Preferences

• Target a specific machine attribute (other than WMI Filtering)

Page 24: Securing Windows with Group Policy

Active Directory Permissions• Enable “Advanced Features”

• Delegate control

– Always take a “least privilege” approach

• Delegate full control over an OU only

Page 25: Securing Windows with Group Policy

Morale of the Story• We need to ask ourselves, where is the computer/user

account located in AD?

Page 26: Securing Windows with Group Policy

Now the fun stuff!

We need to ask ourselves, where is the computer/user account located in AD?

Page 27: Securing Windows with Group Policy

Auto-Play & Auto-Run• Disable the action taken when a thumb drive or portable

hard drive is plugged into a computer

Page 28: Securing Windows with Group Policy

Windows Firewall with Advanced Security

• Manage Network Profiles

– Domain

– Home

– Public

• Manage applications/services that should be allowed/denied

Page 29: Securing Windows with Group Policy

Manage Group Memberships• GPO Restricted Groups

– Manage global groups in AD

– Centrally manage all high-target groups

– “Rebuilds” the group completely every time GP is refreshed

• GPO Preferences

– Best for managing local groups on domain machines

– Create custom local groups

– Assign Customized rights and privileges

– Assign customized permission as well

Page 30: Securing Windows with Group Policy

Manage User Rights• Allow/Deny Log On Locally

– Why does someone need to log on locally to a server/computer?

• Allow/Deny Access to Computer From the Network

– Limit this to either specific user or just admins/IT Pro’s

• Allow/Deny Log On Remote Desktop Services

– Normal users do not need RDP

Page 31: Securing Windows with Group Policy

Manage High Target Accounts• Restrict Logon Hours and Workstations

– Enterprise, Schema, and Domain Admins should be restricted as tightly as possible.

• Remote Desktop logon

• Remote Control logon

• Etc.

• Why would Domain/Enterprise/Schema Admins be RDPing?

– Answer: They wouldn’t!

Page 32: Securing Windows with Group Policy

AppLocker• Requirements:

– Application Identity Service must be running (Automatic)

• Three different conditions can be use

– Hash Condition Rules

– Path Condition Rules

– Publisher Condition Rules

Page 33: Securing Windows with Group Policy

AppLocker – Hash Condition• Every file has a unique hash value

• Positive

– Unique hash for every executable

– Secure!

• Negative

– Every update has a new hash

Page 34: Securing Windows with Group Policy

AppLocker – Path Condition• Positive

– Select an entire suite of products

– You can use wildcards (*)

• Negative

– You must know all paths the application uses

• C:\ProgramData

• C:\Users\username\AppData\Local\*\*.zip\*

Page 35: Securing Windows with Group Policy

AppLocker – Publisher Condition• Positive

– Select an entire path to allow a suite of applications

– You can use wildcards (*)

• Negative

– Only works for applications that are digitally signed

Page 36: Securing Windows with Group Policy
Page 37: Securing Windows with Group Policy

Additional Security Measures• Require screensavers with passwords

• Use LAPS – do not keep the same local admin password on all machines

– If possible, disable the ability to logon with a local account

– If you set passwords using GP, then they are stored unencrypted in \\domain.com\SYSVOL

• Hashed does not mean encrypted.

Page 38: Securing Windows with Group Policy

Additional Security Measures• Disable Guest Account

– Option: Network Access: Sharing and Security Model for Local Accounts

• Automatically demotes any remote user who authenticates to guest status

– If you disable the guest account and this setting is enabled, then no one will be able to long using a local account (good thing!)

Page 39: Securing Windows with Group Policy

Additional Security Measures• Display a Logon Banner with Legal Notice

This system is for use of authorized users only and is not public. Individuals using this computer system without authority or in excess of their authority are subject to having all of their activities on this system monitored and recorded,

including their keystrokes and mouseclicks. Anyone using this system expressly consents to such monitoring and is advised that if this monitoring

reveals possible evidence of criminal activity, this evidence may be provided to law enforcement officials with the intent to prosecute.

Page 40: Securing Windows with Group Policy

Block Unsigned Scripts• PowerShell

• WSH

• VBScript

• Jscript

• Perl

• Python

• This does NOT protect you from advanced users & Malware

• PowerShell is not a security mechanism

Page 41: Securing Windows with Group Policy

Advanced Protection• DEP – Data Execution Prevention

– Prevents execution of code in memory that are not marked as executable

• ASLR – Address Space Layout Randomization

– Random address spaces make exploits more difficult. No way to hard code memory locations

• EMET – Enhanced Mitigation Experience Toolkit

Page 42: Securing Windows with Group Policy

Scheduled Tasks for GPO Scripts• Schedule tasks to run under the identity with the least

privilege

– Local Services

– Network Services

– Local System (if needed)

• Do NOT use passwords in scripts

Page 43: Securing Windows with Group Policy

7 Deadly Sins (for Malware)• Act As Part of the Operating System

• Create a Token Object

• Debug Programs

• Load and Unload Device Drivers

• Restore Files and Directories

• Take Ownership

• Impersonate a Client After Authentication

Page 44: Securing Windows with Group Policy

Impersonate A Client Privilege• Primary Security Access Token (SAT)

– Basically, impersonate a user’s SAT for other running processes

• Used by network services to impersonate clients

• Token stealing

– Steal SATs for network authentication

Page 45: Securing Windows with Group Policy

Debug Programs Privilege• Grants read/write access to user & kernel-mode memory

• Malware uses it for:

– New thread injected into any process

– Passwords, hashes, encryption keys and other data can be read out of kernel space memory without DLL injection.

• Pass-The-Hash Attacks

– Once malware has your password hash they can:

• Extract password hashes of local accounts

• Extract password hashes of interactive users with AD accounts

• Plus others

Page 46: Securing Windows with Group Policy

Disable IPv6 – Until You Need It• Why Disable IPv6?

– We want to shrink our attack surface

• Why Not Disable IPv6?

– Microsoft DirectAccess requires it (kind of)

– Microsoft doesn’t test their patches on systems with IPv6 disabled

Page 47: Securing Windows with Group Policy

JUST REMEMBERGroup Policy is basically a large enterprise scale registry editor!

Page 48: Securing Windows with Group Policy

Contact Info

• Name: Josh Rickard

• E-Mail: [email protected]

• Blog: http://MSAdministrator.com

• Twitter: @MS_dministrator