%3CLINGO-SUB%20id%3D%22lingo-sub-1447159%22%20slang%3D%22en-US%22%3EBeyond%20the%20Edge%3A%20How%20to%20Secure%20SMB%20Traffic%20in%20Windows%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1447159%22%20slang%3D%22en-US%22%3E%3CP%3EHiya%20folks%2C%20%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2Fnerdpyle%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ENed%3C%2FA%3E%20here%20again.%20Organizations%20are%20good%20at%20firewalling%20the%20network%20edge%20to%20stop%20inbound%20intruders.%20We%20need%20to%20move%20on%20to%20preventing%20%3CEM%3Eoutbound%3C%2FEM%3E%20and%20%3CEM%3Elateral%3C%2FEM%3E%20network%20communications.%20With%20the%20rise%20of%20mobile%20computing%20and%20ease%20of%20phishing%20users%2C%20compromising%20an%20individual%20device%20means%20your%20external%20shield%20isn%E2%80%99t%20enough.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EToday%20we%20discuss%20securing%20your%20network%E2%80%99s%20underbelly.%20I%E2%80%99m%20focusing%20on%20Windows%20and%20SMB%2C%20but%20this%20advice%20applies%20to%20your%20other%20protocols%20and%20operating%20systems.%20Your%20environment%20also%20uses%20NFS%2C%20SSH%2C%20RDP%2C%20SFTP%2C%20RPC%2C%20and%20more%20on%20Windows%2C%20Linux%20and%20MacOS.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet%E2%80%99s%20block%20some%20ports!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-470277008%22%20id%3D%22toc-hId-470277008%22%3ESegmentation%20and%20endpoint%20isolation%3C%2FH1%3E%0A%3CP%3EYour%20network%20forms%20segments%20and%20endpoints.%20Segments%20are%20the%20partitions%2C%20be%20they%20subnets%20or%20VLANs%20and%20includes%20your%20VPN-connected%20devices.%20Your%20servers%20and%20clients%20are%20the%20endpoints.%20When%20it%20comes%20to%20SMB%2C%20your%20clients%20and%20servers%20aren%E2%80%99t%20limited%20to%20Windows%20and%20Windows%20Server%20%E2%80%93%20they%20can%20serve%20both%20duties%20on%20any%20edition.%20This%20doesn%E2%80%99t%20just%20mean%20hosting%20an%20SMB%20share%20for%20remote%20file%20access%3B%20SMB%20is%20itself%20a%20sort%20of%20transport%20protocol%20for%20many%20other%20legacy%20application%20protocols%20using%20Named%20Pipes%2C%20RPC%2C%20and%20other%20technology%20for%20your%20management%20tools%20and%20apps.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBy%20default%2C%20no%20version%20of%20Windows%20allows%20inbound%20SMB%20communications%20after%20setup%3B%20the%20built-in%20Windows%20Defender%20Firewall%20(previously%20called%20Windows%20Firewall)%20rules%20prevent%20access%20to%20TCP%20%2F%20port%20445.%20However%2C%20the%20firewall%20%3CEM%3Edoes%3C%2FEM%3E%20allow%20outbound%20SMB%20and%20if%20you%20create%20an%20SMB%20share%2C%20it%20enables%20the%20firewall%20rules%20to%20allow%20inbound%20SMB.%20This%20article%20isn%E2%80%99t%20demanding%20you%20buy%201%2C000%20hardware%20firewalls%20like%20you%E2%80%99re%20in%20some%20craptastic%20hacker%20movie%20%E2%80%93%20it%20is%20about%20using%20that%20Defender%20Firewall%20included%20in%20every%20Windows%20machine%20you%20own.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOur%20goal%20here%20is%20to%20make%20it%20much%20harder%20for%20your%20data%20to%20%3CEM%3Eleave%3C%2FEM%3E%20the%20network%20or%20for%20your%20devices%20to%20attack%20each%20other%20%3CEM%3Ewithin%3C%2FEM%3E%20the%20network.%20%3CSTRONG%3EWe%20are%20not%20trying%20to%20make%20the%20entire%20network%20impervious%20to%20all%20threats.%20We%20are%20trying%20to%20make%20your%20network%20so%20irritating%20to%20an%20attacker%20that%20they%20just%20lose%20interest%20and%20go%20after%20some%20other%20target.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--1337177455%22%20id%3D%22toc-hId--1337177455%22%3EDefender%20Firewall%3C%2FH1%3E%0A%3CP%3EI%E2%80%99m%20not%20here%20to%20teach%20you%20the%20built-in%20firewall%2C%20it%E2%80%99s%20a%20big%20product%20but%20a%20well-documented%20one%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fsecurity%2Fthreat-protection%2Fwindows-firewall%2Fwindows-firewall-with-advanced-security-design-guide%3FWT.mc_id%3DITOPSTALK-blog-abartolo%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EWindows%20Defender%20Firewall%20with%20Advanced%20Security%20Design%20Guide%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fsecurity%2Fthreat-protection%2Fwindows-firewall%2Fwindows-firewall-with-advanced-security-deployment-guide%3FWT.mc_id%3DITOPSTALK-blog-abartolo%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EWindows%20Defender%20Firewall%20with%20Advanced%20Security%20Deployment%20Guide%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EDon%E2%80%99t%20worry%2C%20if%20you%E2%80%99re%20still%20using%20Windows%20Server%202012%20R2%20or%E2%80%A6%20%3CEM%3Ewhat%20the%20h%3C%2FEM%3E%E2%80%A6%20Windows%207%2C%20these%20are%20still%20applicable.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3EWhat%20you%20don%E2%80%99t%20know%20is%20that%20my%20absolute%20favorite%20presentation%20ever%20about%20this%20subject%20is%20%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2FjepayneMSFT%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EJessica%20Payne%E2%80%99s%3C%2FA%3E%20talk%20%E2%80%9C%3CA%20href%3D%22https%3A%2F%2Fchannel9.msdn.com%2FEvents%2FIgnite%2FNew-Zealand-2016%2FM377%3FWT.mc_id%3DITOPSTALK-blog-abartolo%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EDemystifying%20the%20Windows%20Firewall%3C%2FA%3E%E2%80%9D%20at%20Ignite%20New%20Zealand%202016.%20If%20you%E2%80%99ve%20never%20heard%20of%20the%20firewall%20or%20have%20been%20using%20it%20for%20years%2C%20this%20talk%20is%20awesome%2C%20and%20you%20should%20watch%20the%20whole%20thing.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CIFRAME%20src%3D%22https%3A%2F%2Fchannel9.msdn.com%2FEvents%2FIgnite%2FNew-Zealand-2016%2FM377%2Fplayer%22%20width%3D%221280%22%20height%3D%22720%22%20frameborder%3D%220%22%20allowfullscreen%3D%22allowfullscreen%22%20title%3D%22Demystifying%20the%20Windows%20Firewall%20%E2%80%93%20Learn%20how%20to%20irritate%20attackers%20without%20crippling%20your%20network%20-%20Microsoft%20Channel%209%20Video%22%3E%3C%2FIFRAME%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESee%3F%20I%20told%20you%20it%20was%20good!%20Jessica%20is%20the%20deal.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1150335378%22%20id%3D%22toc-hId-1150335378%22%3EReducing%20your%20SMB%20matrix%3C%2FH1%3E%0A%3CP%3EHere%E2%80%99s%20the%20plan%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ECut%20inbound%20SMB%20access%20at%20the%20corporate%20firewalls.%3C%2FLI%3E%0A%3CLI%3ECut%20outbound%20SMB%20access%20at%20the%20corporate%20firewall%20with%20exceptions%20for%20specific%20IP%20ranges.%3C%2FLI%3E%0A%3CLI%3EInventory%20for%20SMB%20usage%20and%20shares.%3C%2FLI%3E%0A%3CLI%3EConfigure%20Windows%20Defender%20Firewall%20for%20inbound%20and%20outbound%20blocks%3C%2FLI%3E%0A%3CLI%3EDisable%20SMB%20Server%20if%20truly%20unused%3C%2FLI%3E%0A%3CLI%3ETest%20at%20a%20small%20scale%20by%20hand.%20Deploy%20in%20waves%2C%20using%20policy.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1840896852%22%20id%3D%22toc-hId-1840896852%22%3ECut%20inbound%20SMB%20access%20at%20the%20corporate%20firewalls%3C%2FH2%3E%0A%3CP%3EThe%20easiest%20part%20that%20you%20probably%20already%20completed.%20Block%20TCP%2F%20port%20445%20inbound%20from%20the%20internet%20at%20your%20hardware%20firewalls.%20Now%20anyone%20inside%20your%20network%2C%20including%20VPN-connected%20devices%2C%20won%E2%80%99t%20be%20directly%20accessible%20from%20outside.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-33442389%22%20id%3D%22toc-hId-33442389%22%3ECut%20outbound%20SMB%20access%20at%20the%20corporate%20firewall%20with%20exceptions%3C%2FH2%3E%0A%3CP%3EIt%20is%20extremely%20unlikely%20you%E2%80%99ll%20need%20to%20allow%20%3CEM%3Eany%3C%2FEM%3E%20outbound%20SMB%20to%20the%20Internet%20unless%20you%E2%80%99re%20using%20it%20as%20part%20of%20a%20public%20cloud%20offering.%20With%20Azure%20Files%20SMB%20you%20could%20instead%20use%20a%20-ERR%3AREF-NOT-FOUND-VPN.%20You%20should%20be%20restricting%20that%20outbound%20traffic%20to%20only%20those%20service%20IP%20ranges.%20We%20document%20those%20here%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22http%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D825637%26amp%3BWT.mc_id%3DITOPSTALK-blog-abartolo%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20datacenter%20IP%20addresses%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fdocumentation%2Farticles%2Fremoteapp-ports%2F%3FWT.mc_id%3DITOPSTALK-blog-abartolo%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20remote%20apps%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2FOffice-365-URLs-and-IP-address-ranges-8548a211-3fe7-47cb-abb1-355ea5aa88a2%3FWT.mc_id%3DITOPSTALK-blog-abartolo%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft%20O365%20IP%20addresses%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1774012074%22%20id%3D%22toc-hId--1774012074%22%3EInventory%20for%20SMB%20usage%20and%20shares%3C%2FH2%3E%0A%3CP%3EIf%20our%20goal%20is%20to%20stop%20unneeded%20communication%20inside%20your%20network%2C%20we%20need%20to%20inventory%20SMB.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EWhat%20server%20endpoints%20do%20you%20%3CEM%3Eknow%3C%2FEM%3E%20need%20to%20allow%20inbound%20SMB%20to%20perform%20their%20role%3F%3COL%3E%0A%3CLI%3EDo%20they%20need%20inbound%20access%20from%20all%20clients%2C%20just%20certain%20networks%2C%20or%20just%20certain%20nodes%3F%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3CLI%3EOf%20the%20server%20remaining%20endpoints%2C%20which%20ones%20are%20simply%20%3CEM%3Eallowing%3C%2FEM%3E%20SMB%20inbound%20and%20is%20it%20%3CEM%3Enecessary%3C%2FEM%3E%3F%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EThis%20was%20the%20easy%20part.%20Now%20the%20hard%20part%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%223%22%3E%0A%3CLI%3EOf%20your%20client%20OS%20endpoints%20(Windows%2010%2C%20for%20instance)%2C%20which%20ones%20do%20you%20%3CEM%3Eknow%3C%2FEM%3E%20require%20inbound%20SMB%20access%3COL%3E%0A%3CLI%3EDo%20they%20need%20inbound%20access%20from%20all%20clients%2C%20just%20certain%20networks%2C%20or%20just%20certain%20nodes%3F%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3CLI%3EOf%20your%20client%20OS%20endpoints%2C%20which%20ones%20are%20simply%20%3CEM%3Eallowing%3C%2FEM%3E%20SMB%20inbound%20and%20is%20it%20%3CEM%3Enecessary%3C%2FEM%3E%3F%3C%2FLI%3E%0A%3CLI%3EOf%20your%20client%20OS%20endpoints%2C%20which%20don%E2%80%99t%20even%20need%20to%20run%20the%20SMB%20server%20service%20at%20all%3F%3C%2FLI%3E%0A%3CLI%3EOf%20all%20your%20endpoints%2C%20which%20ones%20can%20we%20force%20to%20only%20allow%20%3CEM%3Eoutbound%3C%2FEM%3E%20SMB%20in%20%3CEM%3Ethe%20safest%20and%20most%20minimal%20%3C%2FEM%3Efashion%3F%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EFile%20Servers%20and%20Domain%20Controllers%20both%20obviously%20require%20SMB%20inbound%20to%20perform%20their%20role.%20Other%20built-in%20roles%20and%20features%20may%20as%20well%20and%20we%E2%80%99ve%20documented%20many%20of%20them%20in%20-ERR%3AREF-NOT-FOUND-Service%20overview%20and%20network%20port%20requirements%20for%20Windows.%20DCs%20and%20file%20servers%20probably%20need%20to%20be%20accessed%20from%20anywhere%20inside%20the%20network%2C%20but%20some%20application%20server%20might%20just%20need%20access%20from%20two%20other%20application%20servers%20on%20the%20same%20subnet.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20examine%20shares%20on%20servers%20and%20clients%20using%20a%20%3CA%20href%3D%22https%3A%2F%2Fmyignite.techcommunity.microsoft.com%2Fsessions%2F82850%3Fsource%3Dsessions%26amp%3BWT.mc_id%3DITOPSTALK-blog-abartolo%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehandy%20script%20called%20Get-FileShares%3C%2FA%3E%20by%20Sam%20Boutros%20and%20decide%20if%20these%20shares%20are%20legitimate%2C%20were%20once%20legitimate%20and%20now%20aren%E2%80%99t%2C%20or%20were%20made%20by%20Chad%20the%20junior%20wildman%20the%20CTO%E2%80%99s%20nephew%20you%20wish%20you%20could%20fire%20his%E2%80%A6%20I%20digress.%20I%20demonstrated%20this%20script%20at%20MS%20Ignite%202019%2C%20catch%20that%20at%200%3A9%3A45%20in%20my%20presentation%20%E2%80%9C-ERR%3AREF-NOT-FOUND-Plan%20for%20Z-Day%202020%3A%20Windows%20Server%202008%20end%20of%20support%20is%20coming!%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3C%2FP%3E%3CDIV%20class%3D%22video-embed-center%20video-embed%22%3E%3CIFRAME%20class%3D%22embedly-embed%22%20src%3D%22https%3A%2F%2Fcdn.embedly.com%2Fwidgets%2Fmedia.html%3Fsrc%3Dhttps%253A%252F%252Fwww.youtube.com%252Fembed%252FX8l6G2wXdAU%253Ffeature%253Doembed%26amp%3Bdisplay_name%3DYouTube%26amp%3Burl%3Dhttps%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253DX8l6G2wXdAU%26amp%3Bimage%3Dhttps%253A%252F%252Fi.ytimg.com%252Fvi%252FX8l6G2wXdAU%252Fhqdefault.jpg%26amp%3Bkey%3Dfad07bfa4bd747d3bdea27e17b533c0e%26amp%3Btype%3Dtext%252Fhtml%26amp%3Bschema%3Dyoutube%22%20width%3D%22600%22%20height%3D%22337%22%20scrolling%3D%22no%22%20title%3D%22YouTube%20embed%22%20frameborder%3D%220%22%20allow%3D%22autoplay%3B%20fullscreen%22%20allowfullscreen%3D%22true%22%3E%3C%2FIFRAME%3E%3C%2FDIV%3E%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20might%20also%20need%20to%20enable%20auditing%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%221.png%22%20style%3D%22width%3A%20643px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F197111i50F6444BC929578A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%221.png%22%20alt%3D%221.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESince%20Windows%20Vista%20and%20Windows%20Server%202008%20you%E2%80%99ve%20had%20access%20to%20an%20-ERR%3AREF-NOT-FOUND-audit%20trail%20of%20SMB%20inbound%20access.%20You%20enable%20it%20as%20part%20of%20group%20policy%20and%20deploy%20to%20whatever%20set%20of%20nodes%20you%20want%20to%20check.%20It%E2%80%99s%20found%20under%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EComputer%20configuration%20%5C%20Policies%20%5C%20Windows%20Settings%20%5C%20Security%20Settings%20%5C%20Advanced%20Audit%20Policy%20Configuration%20%5C%20Audit%20Policies%20%5C%20Object%20Access%20%5C%20File%20Shares%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-06-05_12-58-07.png%22%20style%3D%22width%3A%20949px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F197112i45DD335EC3A37C74%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-06-05_12-58-07.png%22%20alt%3D%222020-06-05_12-58-07.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20discoverable!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20audit%20trail%20can%20get%20chatty%2C%20you%20should%20enable%2Fdisable%20in%20bursts%20or%20collect%20using%20your%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsentinel%2Foverview%3FWT.mc_id%3DITOPSTALK-blog-abartolo%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eevent%20log%20monitoring%20solutions%3C%2FA%3E%20that%20you%20run%20as%20part%20of%20your%20-ERR%3AREF-NOT-FOUND-threat%20detection%20layer.%20Of%20course!%20Ahem.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EExamining%20these%20logs%20will%20let%20you%20know%20which%20nodes%20are%20talking%20to%20which%20endpoints%20over%20SMB%20and%20help%20you%20decide%20if%20an%20endpoint%E2%80%99s%20shares%20are%20really%20in%20use%2C%20which%20don%E2%80%99t%20need%20to%20exist%2C%20or%20if%20the%20server%20has%20no%20obvious%20SMB%20customers.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-713500759%22%20id%3D%22toc-hId-713500759%22%3EConfigure%20Windows%20Defender%20Firewall%20for%20inbound%20and%20outbound%20blocks%3C%2FH2%3E%0A%3CP%3EIf%20you%E2%80%99re%20looking%20for%20a%20step-by-step%20guide%20on%20configuring%20firewalls%2C%20-ERR%3AREF-NOT-FOUND-review%20our%20docs%3B%20my%20blog%20post%20will%20never%20be%20as%20good%20and%20also%20I%20am%20very%20lazy.%20%26nbsp%3BBut%20we%20can%20talk%20tactics.%20The%20key%20thing%20to%20understand%20is%20blocking%20both%20inbound%20%3CEM%3Eand%20outbound%3C%2FEM%3E%20communications%20in%20a%20very%20deterministic%20way%20using%20rules%20that%20include%20exceptions%20and%20add%20additional%20connection%20security.%20A%20common%20attack%20is%20to%20convince%20an%20end%20user%20to%20access%20an%20SMB%20share%20just%20like%20you%E2%80%99d%20trick%20them%20into%20accessing%20an%20evil%20website.%20Email%20them%20a%20link%2C%20convince%20them%20to%20click%2C%20and%20now%20they%20are%20sending%20along%20NTLM%20credentials%20or%20running%20mean%20executables.%20An%20outbound%20firewall%20policy%20that%20prevents%20use%20of%20SMB%20connections%20not%20%3CEM%3Ejust%3C%2FEM%3E%20outside%20the%20safety%20of%20your%20managed%20network%20but%20even%20%3CEM%3Einside%3C%2FEM%3E%20your%20network%20to%20only%20allow%20access%20to%20the%20minimum%20set%20of%20servers%20and%20not%20any%20other%20machines%20is%20true%20lateral%20movement%20defense.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20reference%20here%20for%20SMB%20firewall%20settings%20is%20-ERR%3AREF-NOT-FOUND-Preventing%20SMB%20traffic%20from%20lateral%20connections%20and%20entering%20or%20leaving%20the%20network.%20This%20KB%20covers%20the%20precise%20SMB%20firewall%20rules%20you%20need%20to%20set%20for%20inbound%20and%20outbound%20connections%20to%20match%20your%20inventory.%20I%20want%20to%20call%20out%20a%20few%20important%20points%20in%20that%20KB%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EThe%20KB%20has%20templates%20of%20inbound%20rules%20that%20is%20based%20on%20any%20kind%20of%20network%20profile.%3C%2FLI%3E%0A%3CLI%3EThe%20KB%20has%20templates%20of%20outbound%20rules%20defined%20by%20domain%2Fprivate%20-%20i.e.%20trusted%20-%20network%20profiles%20but%20one%20for%20the%20%3CEM%3Eguest%2Fpublic%20%3C%2FEM%3Eprofiles.%20The%20latter%20is%20particularly%20important%20to%20enforce%20on%20mobile%20devices%20and%20home-based%20telecommuters%20that%20leave%20the%20safety%20of%20your%20firewall%20blocking%20outbound%20traffic.%20Enforcing%20this%20on%20laptops%20will%20reduce%20the%20odds%20of%20phishing%20attacks%20sending%20users%20to%20malicious%20servers%20to%20harvest%20credentials%20or%20run%20attack%20code%20that%20will%20gain%20that%20foothold.%20In%20a%20world%20where%20so%20many%20users%20have%20gone%20home%20to%20stop%20the%20spread%20of%20disease%2C%20the%20definition%20of%20%E2%80%9Cyour%20network%E2%80%9D%20has%20expanded.%3C%2FLI%3E%0A%3CLI%3EThe%20KB%20has%20templates%20for%20building%20a%20global%20block%20list%20that%20contains%20an%20%E2%80%9Callow%E2%80%9D%20list%20for%20Domain%20Controllers%20and%20File%20Servers%20(at%20a%20minimum)%20and%20a%20very%20important%20weapon%20in%20your%20efforts%20to%20stop%20connections%20to%20malicious%20outside%20servers%20called%20%E2%80%9CAllow%20a%20connection%20if%20secure%E2%80%9D%3A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-06-05_15-20-01.png%22%20style%3D%22width%3A%20714px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F197114iE2A1E22F668CFE82%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-06-05_15-20-01.png%22%20alt%3D%222020-06-05_15-20-01.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-06-05_15-35-28.png%22%20style%3D%22width%3A%20467px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F197113iD6861542571088BF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-06-05_15-35-28.png%22%20alt%3D%222020-06-05_15-35-28.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20%E2%80%9CAllow%20the%20connection%20if%20is%20secure%E2%80%9D%20option%20allows%20override%20of%20a%20global%20block%20rule.%20You%20can%20use%20the%20easy%20but%20least%20secure%20%E2%80%9CAllow%20the%20connection%20to%20use%20null%20encapsulation%E2%80%9D%20along%20with%20%E2%80%9Coverride%20block%20rules%E2%80%9D%20which%20is%20effectively%20relying%20on%20Kerberos%20and%20domain%20membership%20for%20authentication.%20Defender%20Firewall%20allows%20for%20more%20secure%20options%20like%20IPSEC%2C%20but%20they%20will%20require%20more%20from%20you.%20When%20you%20provide%20these%20secure%20connection%20options%2C%20you%20now%20get%20access%20to%20scopes%20like%20authorized%20computers%20and%20IP%20address%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-06-05_15-40-51.png%22%20style%3D%22width%3A%20714px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F197115iE75C90BEE0C5E604%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-06-05_15-40-51.png%22%20alt%3D%222020-06-05_15-40-51.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-06-05_15-42-15.png%22%20style%3D%22width%3A%20549px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F197116i3D21D4B5D90182FF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-06-05_15-42-15.png%22%20alt%3D%222020-06-05_15-42-15.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20defensive%20impact%20of%20this%20layering%20means%20attackers%20must%20determine%20which%20small%20set%20of%20allowed%20servers%20are%20valid%20targets%20that%20must%20be%20controlled%20or%20replaced%20without%20detection%2C%20all%20within%20your%20inner%20network.%20Broad%20lateral%20movement%20and%20client-hopping%20ransomware%20will%20no%20longer%20be%20able%20to%20piggyback%20SMB%20on%20end%20user%20device.%20When%20I%20talk%20about%20being%20too%20irritating%20of%20a%20target%2C%20this%20is%20what%20I%20mean.%20Yes%2C%20all%20of%20those%20things%20are%20possible%2C%20but%20you%E2%80%98ve%20increased%20your%20chance%20to%20catch%20them%2C%20required%20a%20huge%20amount%20of%20extra%20recon%20and%20care%20from%20the%20attacker%2C%20broke%20a%20ton%20of%20lazy%20code%20written%20by%20criminals%2C%20and%20frankly%20makes%20you%20unattractive.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20type%20of%20outbound%20protection%20at%20the%20Windows%20Firewall%20is%20also%20great%20technique%20for%20those%20who%20don%E2%80%99t%20want%20to%20walk%20their%20COVID%20telecommuters%20through%20changing%20home%20router%20firewalls%20to%20block%20SMB%20outbound%20to%20the%20Internet%20when%20you%20don%E2%80%99t%20use%20VPN.%20I%20know%20you%E2%80%99re%20out%20there%2C%20you%20all%20asked%20me%20about%20machine%20account%20password%20expiration%20rules%20two%20months%20ago!%20Even%20if%20they%20can%E2%80%99t%20get%20group%20policy%20or%20Intune%2C%20you%20at%20least%20have%20a%20consistent%20set%20of%20steps%20or%20script%20for%20a%20Help%20Desk%20remote.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1093953704%22%20id%3D%22toc-hId--1093953704%22%3EDisable%20SMB%20Server%20if%20truly%20unused%3C%2FH2%3E%0A%3CP%3EYour%20Windows%20clients%20and%20even%20some%20of%20your%20Windows%20Servers%20may%20not%20require%20the%20SMB%20Server%20service%20to%20be%20running%20at%20all.%20Here%E2%80%99s%20my%20own%20work%20Surface%20Laptop%20with%20SMB%20server%20disabled%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-06-05_13-11-20.png%22%20style%3D%22width%3A%20684px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F197118iA01CEF08AFC4CDAC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-06-05_13-11-20.png%22%20alt%3D%222020-06-05_13-11-20.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFar%20more%20secure%20than%20any%20firewall%20is%20the%20complete%20lack%20of%20an%20SMB%20Server%20service%20running%20at%20all.%20This%20step%20that%20will%20require%20you%20to%20fundamentally%20understand%20your%20processes%20and%20apps%20and%20comes%20with%20the%20risk%20of%20a%20very%20confusing%20troubleshooting%20experience%20in%20a%20year%20after%20you%E2%80%99ve%20forgotten%20doing%20this.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENote%3C%2FSTRONG%3E%3A%20I%20have%20debated%20making%20this%20service%20on-demand%20in%20the%20future%20and%20perhaps%20disabled%20by%20default%20in%20certain%20conditions%20and%20editions%20like%20Windows%2010%20for%20home%20users%20or%20Professional.%20This%20might%20seem%20like%20an%20easy%20call%20to%20make%2C%20but%20you%20haven%E2%80%99t%20spent%207%20years%20of%20SMB1%20removal%20pain%20customers%20saw%20when%20I%20first%20started%20making%20it%20optional%20and%20self-uninstalling.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1393559129%22%20id%3D%22toc-hId-1393559129%22%3ETest%20at%20a%20small%20scale%20by%20hand.%20Deploy%20in%20waves%2C%20using%20policy.%3C%2FH2%3E%0A%3CP%20data-unlink%3D%22true%22%3EYou%20should%20use%20phased%20group%20policy%20rollouts%20to%20make%20these%20changes%20%3CSTRONG%3E%3CEM%3Eafter%3C%2FEM%3E%3C%2FSTRONG%3E%20you%20do%20small-scale%2C%20hand-made%20deployments%20on%20select%20servers%20and%20clients%20%E2%80%93%20do%20%3CSTRONG%3Enot%3C%2FSTRONG%3E%20just%20blast%20these%20settings%20out%20everywhere%20or%20you%E2%80%99re%20going%20to%20have%20a%20bad%20%3CSPAN%20style%3D%22text-decoration%3A%20line-through%3B%22%3Eday%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22text-decoration%3A%20line-through%3B%22%3Eweek%3C%2FSPAN%3E%20exit%20interview.%20I%20recommend%20starting%20with%20the%20heaviest%20user%20of%20SMB%20%E2%80%93%20your%20own%20IT%20team.%20We%20call%20this%20%E2%80%9Ceating%20your%20own%20dogfood%26nbsp%3B.%E2%80%9D%20If%20your%20team%E2%80%99s%20laptops%20and%20apps%20and%20file%20share%20access%20appear%20to%20be%20working%20well%20after%20hand%20deploying%20your%20inbound%20and%20outbound%20firewall%20rules%2C%20create%20test%20group%20policy%20within%20your%20broad%20test%20and%20QA%20environments.%20Based%20on%20results%2C%20start%20sampling%20some%20departmental%20machines%2C%20then%20expand%20out.%20Take%20your%20time%20here%20%E2%80%93%20you%E2%80%99ve%20had%20the%20wild%20west%20for%2020%20years%2C%20you%20won%E2%80%99t%20cleanup%20Tombstone%20in%20a%20weekend.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1383056025%22%20id%3D%22toc-hId-1383056025%22%3EWrap-up%3C%2FH1%3E%0A%3CP%3EThat%20concludes%20the%20SMB%20steps.%20Now%20just%20repeat%20for%20NFS%2C%20SSH%2C%20SFTP%2C%20RDP%2C%20and%20the%20rest%2C%20figuring%20out%20all%20the%20equivalent%20firewall%20options%20of%20MacOS%20and%20Linux.%20Simple!%20%3BD%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20recap%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ECut%20inbound%20SMB%20access%20at%20the%20corporate%20firewalls.%3C%2FLI%3E%0A%3CLI%3ECut%20outbound%20SMB%20access%20at%20the%20corporate%20firewall%20with%20exceptions%20for%20specific%20IP%20ranges.%3C%2FLI%3E%0A%3CLI%3EInventory%20for%20SMB%20usage%20and%20shares.%3C%2FLI%3E%0A%3CLI%3EConfigure%20Windows%20Defender%20Firewall%20for%20inbound%20and%20outbound%20blocks%3C%2FLI%3E%0A%3CLI%3EDisable%20SMB%20Server%20if%20truly%20unused%3C%2FLI%3E%0A%3CLI%3ETest%20at%20a%20small%20scale%20by%20hand.%20Deploy%20in%20waves%2C%20using%20policy.%3C%2FLI%3E%0A%3CLI%3EMaintain%20%3CEM%3Emaintain%3C%2FEM%3E%20%3CSTRONG%3E%3CEM%3Emaintain%3C%2FEM%3E%3C%2FSTRONG%3E.%20Every%20new%20server%20you%20add%20or%20remove%20from%20your%20network%20may%20now%20have%20an%20entry%20in%20your%20inventory%20and%20firewall%20exceptions.%20Good%20defensive%20security%20is%20about%20consistent%20maintenance.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EDistributed%20system%20protocols%20help%20your%20organization%20make%20money%20and%20get%20things%20done.%20However%2C%20they%20do%20demand%20your%20respect%20if%20you%20want%20to%20make%20your%20environment%20unattractive%20to%20bad%20people.%20Computers%2C%20networks%2C%20and%20users%20aren%E2%80%99t%20good%20at%20defending%20themselves%3A%20that%E2%80%99s%20your%20job.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20hope%20you%20found%20this%20useful%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E-%20Ned%20Pyle%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1447159%22%20slang%3D%22en-US%22%3E%3CP%3ESecure%20your%20Windows%20environment%20from%20inbound%2C%20outbound%2C%20and%20lateral%20SMB%20movement.%20A%20guest%20post%20from%20the%20owner%20of%20SMB%2C%20Ned%20Pyle.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-06-05_12-58-07.png%22%20style%3D%22width%3A%20949px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F197112i45DD335EC3A37C74%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-06-05_12-58-07.png%22%20alt%3D%222020-06-05_12-58-07.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1447159%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ENed%20Pyle%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESecurity%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

Hiya folks, Ned here again. Organizations are good at firewalling the network edge to stop inbound intruders. We need to move on to preventing outbound and lateral network communications. With the rise of mobile computing and ease of phishing users, compromising an individual device means your external shield isn’t enough.

 

Today we discuss securing your network’s underbelly. I’m focusing on Windows and SMB, but this advice applies to your other protocols and operating systems. Your environment also uses NFS, SSH, RDP, SFTP, RPC, and more on Windows, Linux and MacOS.

 

Let’s block some ports!

 

Segmentation and endpoint isolation

Your network forms segments and endpoints. Segments are the partitions, be they subnets or VLANs and includes your VPN-connected devices. Your servers and clients are the endpoints. When it comes to SMB, your clients and servers aren’t limited to Windows and Windows Server – they can serve both duties on any edition. This doesn’t just mean hosting an SMB share for remote file access; SMB is itself a sort of transport protocol for many other legacy application protocols using Named Pipes, RPC, and other technology for your management tools and apps.

 

By default, no version of Windows allows inbound SMB communications after setup; the built-in Windows Defender Firewall (previously called Windows Firewall) rules prevent access to TCP / port 445. However, the firewall does allow outbound SMB and if you create an SMB share, it enables the firewall rules to allow inbound SMB. This article isn’t demanding you buy 1,000 hardware firewalls like you’re in some craptastic hacker movie – it is about using that Defender Firewall included in every Windows machine you own.

 

Our goal here is to make it much harder for your data to leave the network or for your devices to attack each other within the network. We are not trying to make the entire network impervious to all threats. We are trying to make your network so irritating to an attacker that they just lose interest and go after some other target.

 

Defender Firewall

I’m not here to teach you the built-in firewall, it’s a big product but a well-documented one:

 

Don’t worry, if you’re still using Windows Server 2012 R2 or… what the h… Windows 7, these are still applicable.

 

What you don’t know is that my absolute favorite presentation ever about this subject is Jessica Payne’s talk “Demystifying the Windows Firewall” at Ignite New Zealand 2016. If you’ve never heard of the firewall or have been using it for years, this talk is awesome, and you should watch the whole thing.

 

See? I told you it was good! Jessica is the deal.

 

Reducing your SMB matrix

Here’s the plan:

 

  1. Cut inbound SMB access at the corporate firewalls.
  2. Cut outbound SMB access at the corporate firewall with exceptions for specific IP ranges.
  3. Inventory for SMB usage and shares.
  4. Configure Windows Defender Firewall for inbound and outbound blocks
  5. Disable SMB Server if truly unused
  6. Test at a small scale by hand. Deploy in waves, using policy.

 

Cut inbound SMB access at the corporate firewalls

The easiest part that you probably already completed. Block TCP/ port 445 inbound from the internet at your hardware firewalls. Now anyone inside your network, including VPN-connected devices, won’t be directly accessible from outside.

 

Cut outbound SMB access at the corporate firewall with exceptions

It is extremely unlikely you’ll need to allow any outbound SMB to the Internet unless you’re using it as part of a public cloud offering. With Azure Files SMB you could instead use a VPN. You should be restricting that outbound traffic to only those service IP ranges. We document those here:

 

 

Inventory for SMB usage and shares

If our goal is to stop unneeded communication inside your network, we need to inventory SMB.

 

  1. What server endpoints do you know need to allow inbound SMB to perform their role?
    1. Do they need inbound access from all clients, just certain networks, or just certain nodes?
  2. Of the server remaining endpoints, which ones are simply allowing SMB inbound and is it necessary?

This was the easy part. Now the hard part:

 

  1. Of your client OS endpoints (Windows 10, for instance), which ones do you know require inbound SMB access
    1. Do they need inbound access from all clients, just certain networks, or just certain nodes?
  2. Of your client OS endpoints, which ones are simply allowing SMB inbound and is it necessary?
  3. Of your client OS endpoints, which don’t even need to run the SMB server service at all?
  4. Of all your endpoints, which ones can we force to only allow outbound SMB in the safest and most minimal fashion?

File Servers and Domain Controllers both obviously require SMB inbound to perform their role. Other built-in roles and features may as well and we’ve documented many of them in Service overview and network port requirements for Windows. DCs and file servers probably need to be accessed from anywhere inside the network, but some application server might just need access from two other application servers on the same subnet.

 

You can examine shares on servers and clients using a handy script called Get-FileShares by Sam Boutros and decide if these shares are legitimate, were once legitimate and now aren’t, or were made by Chad the junior wildman the CTO’s nephew you wish you could fire his… I digress. I demonstrated this script at MS Ignite 2019, catch that at 0:9:45 in my presentation “Plan for Z-Day 2020: Windows Server 2008 end of support is coming!

 

 

You might also need to enable auditing:

 

1.png

 

Since Windows Vista and Windows Server 2008 you’ve had access to an audit trail of SMB inbound access. You enable it as part of group policy and deploy to whatever set of nodes you want to check. It’s found under:

 

Computer configuration \ Policies \ Windows Settings \ Security Settings \ Advanced Audit Policy Configuration \ Audit Policies \ Object Access \ File Shares

 

2020-06-05_12-58-07.png

 

So discoverable!

 

This audit trail can get chatty, you should enable/disable in bursts or collect using your event log monitoring solutions that you run as part of your threat detection layer. Of course! Ahem.

 

Examining these logs will let you know which nodes are talking to which endpoints over SMB and help you decide if an endpoint’s shares are really in use, which don’t need to exist, or if the server has no obvious SMB customers.

 

Configure Windows Defender Firewall for inbound and outbound blocks

If you’re looking for a step-by-step guide on configuring firewalls, review our docs; my blog post will never be as good and also I am very lazy.  But we can talk tactics. The key thing to understand is blocking both inbound and outbound communications in a very deterministic way using rules that include exceptions and add additional connection security. A common attack is to convince an end user to access an SMB share just like you’d trick them into accessing an evil website. Email them a link, convince them to click, and now they are sending along NTLM credentials or running mean executables. An outbound firewall policy that prevents use of SMB connections not just outside the safety of your managed network but even inside your network to only allow access to the minimum set of servers and not any other machines is true lateral movement defense.

 

You reference here for SMB firewall settings is Preventing SMB traffic from lateral connections and entering or leaving the network. This KB covers the precise SMB firewall rules you need to set for inbound and outbound connections to match your inventory. I want to call out a few important points in that KB:

 

  1. The KB has templates of inbound rules that is based on any kind of network profile.
  2. The KB has templates of outbound rules defined by domain/private - i.e. trusted - network profiles but one for the guest/public profiles. The latter is particularly important to enforce on mobile devices and home-based telecommuters that leave the safety of your firewall blocking outbound traffic. Enforcing this on laptops will reduce the odds of phishing attacks sending users to malicious servers to harvest credentials or run attack code that will gain that foothold. In a world where so many users have gone home to stop the spread of disease, the definition of “your network” has expanded.
  3. The KB has templates for building a global block list that contains an “allow” list for Domain Controllers and File Servers (at a minimum) and a very important weapon in your efforts to stop connections to malicious outside servers called “Allow a connection if secure”:

 

2020-06-05_15-20-01.png2020-06-05_15-35-28.png

 

The “Allow the connection if is secure” option allows override of a global block rule. You can use the easy but least secure “Allow the connection to use null encapsulation” along with “override block rules” which is effectively relying on Kerberos and domain membership for authentication. Defender Firewall allows for more secure options like IPSEC, but they will require more from you. When you provide these secure connection options, you now get access to scopes like authorized computers and IP address:

 

2020-06-05_15-40-51.png2020-06-05_15-42-15.png

 

If you watch Jessica Payne's video above you'll learn way more about this. Really!

 

The defensive impact of this layering means attackers must determine which small set of allowed servers are valid targets that must be controlled or replaced without detection, all within your inner network. Broad lateral movement and client-hopping ransomware will no longer be able to piggyback SMB on end user device. When I talk about being too irritating of a target, this is what I mean. Yes, all of those things are possible, but you‘ve increased your chance to catch them, required a huge amount of extra recon and care from the attacker, broke a ton of lazy code written by criminals, and frankly makes you unattractive.

 

This type of outbound protection at the Windows Firewall is also great technique for those who don’t want to walk their COVID telecommuters through changing home router firewalls to block SMB outbound to the Internet when you don’t use VPN. I know you’re out there, you all asked me about machine account password expiration rules two months ago! Even if they can’t get group policy or Intune, you at least have a consistent set of steps or script for a Help Desk remote.

 

Disable SMB Server if truly unused

Your Windows clients and even some of your Windows Servers may not require the SMB Server service to be running at all. Here’s my own work Surface Laptop with SMB server disabled:

 

2020-06-05_13-11-20.png

 

Far more secure than any firewall is the complete lack of an SMB Server service running at all. This step that will require you to fundamentally understand your processes and apps and comes with the risk of a very confusing troubleshooting experience in a year after you’ve forgotten doing this.

 

Note: I've debated making this service on-demand in the future and perhaps disabled by default in certain conditions and editions like Windows 10 for home users or Professional. This might seem like an easy call to make, but you haven’t spent 7 years of SMB1 removal pain customers saw when I first started making it optional and self-uninstalling. It would initially break a lot of enterprises. 

 

Test at a small scale by hand. Deploy in waves, using policy.

You should use phased group policy rollouts to make these changes after you do small-scale, hand-made deployments on select servers and clients – do not just blast these settings out everywhere or you’re going to have a bad day week exit interview. I recommend starting with the heaviest user of SMB – your own IT team. We call this “eating your own dogfood .” If your team’s laptops and apps and file share access appear to be working well after hand deploying your inbound and outbound firewall rules, create test group policy within your broad test and QA environments. Based on results, start sampling some departmental machines, then expand out. Take your time here – you’ve had the wild west for 20 years, you won’t cleanup Tombstone in a weekend.

 

Wrap-up

That concludes the SMB steps. Now just repeat for NFS, SSH, SFTP, RDP, and the rest, figuring out all the equivalent firewall options of MacOS and Linux. Simple! ;D

 

To recap:

 

  1. Cut inbound SMB access at the corporate firewalls.
  2. Cut outbound SMB access at the corporate firewall with exceptions for specific IP ranges.
  3. Inventory for SMB usage and shares.
  4. Configure Windows Defender Firewall for inbound and outbound blocks
  5. Disable SMB Server if truly unused
  6. Test at a small scale by hand. Deploy in waves, using policy.
  7. Maintain maintain maintain. Every new server you add or remove from your network may now have an entry in your inventory and firewall exceptions. Good defensive security is about consistent maintenance.

 

Distributed system protocols help your organization make money and get things done. However, they do demand your respect if you want to make your environment unattractive to bad people. Computers, networks, and users aren’t good at defending themselves: that’s your job.

 

I hope you found this useful,

 

- Ned Pyle

 

4 Comments

Thanks for Sharing @Ned Pyle with the Community :cool:

Visitor

Excellent article and quite timely as we are currently testing this.

Microsoft

@rsim8123 let me know how it goes; your experiences can help make this blog post better. I like to tinker with them after publishing :)

Microsoft

@James van den Berg thank's for ensuring that we have a community to share with! :)