Security Working With
Total Page:16
File Type:pdf, Size:1020Kb
Security Working With Network Startup Resource Center Partially adopted from materials by These materials are licensed under the Creative Commons Attribution-NonCommercial 4.0 International license (http://creativecommons.org/licenses/by-nc/4.0/) Last updated 4 March 2018 Before we discuss security… Definitions: A reminder and some formal definitions about what we are working towards both using and building: – perfSONAR – Data Transfer Node – Science DMZ perfSONAR fits within an environment of Data Transfer Nodes that are, often, placed within a Science DMZ. perfSONAR & Data Transfer Nodes (DTNs) perfSONAR A network measurement toolkit that provides end-to-end statistics and helps to establish end-to-end usage expectations. DTN: Data Transfer Node Data Transfer Nodes (DTNs), are typically PC-based Linux servers built with high-quality components and configured specifically for wide area data transfer. They use local storage and software tools designed for high-speed data transfer to remote systems such as GridFTP, Globus Online, XRootd and versions of default toolsets such as SSH/SCP with high-performance patches applied. Science DMZ Science DMZ The Science DMZ is a portion of the network, built at or near the campus or laboratory's local network perimeter that is designed such that the equipment, configuration, and security policies are optimized for high- performance scientific applications rather than for general-purpose business systems or “enterprise” computing. Science DMZ Key Components A Science DMZ integrates four key concepts into a unified whole that together serve as a foundation for this model. These include: – A network architecture explicitly designed for high-performance applications, where the science network is distinct from the general- purpose network – The use of dedicated systems for data transfer – Performance measurement and network testing systems that are regularly used to characterize the network and are available for troubleshooting – Security policies and enforcement mechanisms that are tailored for high performance science environments Ad Hoc DTN Deployment DTN traffic subject to firewall limitations Site Border Router Perimeter Firewall WAN 10G 10GE Global security policy mixes rules for science Test and measurement and business traffic not aligned with data perfSONAR resource placement Conflicting requirements Site / Campus result in performance LAN Note: Site border compromises router and perimeter firewall are often the same device Building or Wiring Closet Switch/Router High performance Data Transfer Node with high-speed storage DTN traffic subject to limitations of general-purpose networking equipment/config 6 – ESnet Science Engagement ([email protected]) - 8/1/18 A better approach: simple Science DMZ Border Router Enterprise Border perfSONAR Router/Firewall WAN 10G 10GE Clean, Site / Campus 10GE High-bandwidth access to Science WAN path DMZ resources perfSONAR 10GE Site / Campus LAN Science DMZ Switch/Router 10GE perfSONAR Per-service security policy control points High performance Data Transfer Node with high-speed storage 7 – ESnet Science Engagement ([email protected]) - 8/1/18 Local And Wide Area Data Flows Border Router Enterprise Border perfSONAR Router/Firewall WAN 10G 10GE Clean, Site / Campus 10GE High-bandwidth access to Science WAN path DMZ resources perfSONAR 10GE Site / Campus LAN Science DMZ Switch/Router 10GE perfSONAR Per-service security policy control points High performance High Latency WAN Path Data Transfer Node with high-speed storage Low Latency LAN Path Problem Statement: Security & ScienceDMZs Very large! Host-based security Network security Data Security How much ”security” do we need? Host-based security Overview – perfSONAR is built with security in mind – A few missing pieces, but included in docs https://docs.perfsonar.net/manage_security.html If you need to interact at the command line… … you gotta set up Secure SHell properly Network Security Overview – DTNs as part of a ScienceDMZ – ScienceDMZ design includes: • Strong host-based security • Minimal host-based services • Use of ACLs not firewalls (in the network) • NIDs (Network Intrusion Detection systems) Securing data on DTNs: ACLs Aggressive access lists (network) – More useful with project-specific DTNs – Exchanging data with a small set of remote collaborators = ACL is fairly easy to manage – Large-scale data distribution servers = difficult/time consuming to handle (but then, the firewall ruleset for such a service would be, too) Limitation of the application set (host) – Makes it easier to protect – Keep unnecessary applications off the DTN (and watch for them anyway using a host IDS – take violations seriously) Securing data on DTNs: Network IDS Intrusion Detection Systems (IDS) – One example is Bro – https://www.bro.org/ – Bro is high-performance and battle-tested • Bro protects several high-performance national assets • Bro can be scaled with clustering: https://www.bro.org/sphinx/cluster/index.html • Other IDS solutions are available also Securing data on DTNs: Host IDS Using a Host IDS is recommended for hosts in a Science DMZ Several open source solutions have been recommended: • OSSec: https://ossec.github.io/ • Rkhunter: http://rkhunter.sourceforge.net/ • chkrootkit: http://www.chkrootkit.org/ • Logcheck: http://logcheck.org/ • Fail2ban: https://www.fail2ban.org/ • denyhosts: http://denyhosts.sourceforge.net/ ScienceDMZ ScienceDMZ Do we really need to go through all this trouble? “Big Data” vs. BIG Data One Biology experiment SnapChat Data produced at one Beamline by a team per day worldwide in 2016 of nine scientists: by millions of people = 38 TB = 114 TB (Photosystem II X-Ray Study) http://www.nature.com/articles/ncomms5371 17 – ESnet Science Engagement ([email protected]) - 8/1/18 Moving the BIG data w/ Firewall Inbound data transfer is filtered nuttcp -r -T 10 -i 1 -p 10200 bwctl.newy.net.internet2.edu 4.5625 MB / 1.00 sec = 38.1995 Mbps 13 retrans 4.8750 MB / 1.00 sec = 40.8956 Mbps 4 retrans 4.8750 MB / 1.00 sec = 40.8954 Mbps 6 retrans 6.4375 MB / 1.00 sec = 54.0024 Mbps 9 retrans 5.7500 MB / 1.00 sec = 48.2310 Mbps 8 retrans 5.8750 MB / 1.00 sec = 49.2880 Mbps 5 retrans 6.3125 MB / 1.00 sec = 52.9006 Mbps 3 retrans 5.3125 MB / 1.00 sec = 44.5653 Mbps 7 retrans 4.3125 MB / 1.00 sec = 36.2108 Mbps 7 retrans 5.1875 MB / 1.00 sec = 43.5186 Mbps 8 retrans 53.7519 MB / 10.07 sec = 44.7577 Mbps 0 %TX 1 %RX 70 retrans 8.29 msRTT 18 – ESnet Science Engagement ([email protected]) - 8/1/18 Moving the BIG data w/o Firewall Outbound data transfer not filtered nuttcp -T 10 -i 1 -p 10200 bwctl.newy.net.internet2.edu 92.3750 MB / 1.00 sec = 774.3069 Mbps 0 retrans 111.8750 MB / 1.00 sec = 938.2879 Mbps 0 retrans 111.8750 MB / 1.00 sec = 938.3019 Mbps 0 retrans 111.7500 MB / 1.00 sec = 938.1606 Mbps 0 retrans 111.8750 MB / 1.00 sec = 938.3198 Mbps 0 retrans 111.8750 MB / 1.00 sec = 938.2653 Mbps 0 retrans 111.8750 MB / 1.00 sec = 938.1931 Mbps 0 retrans 111.9375 MB / 1.00 sec = 938.4808 Mbps 0 retrans 111.6875 MB / 1.00 sec = 937.6941 Mbps 0 retrans 111.8750 MB / 1.00 sec = 938.3610 Mbps 0 retrans 1107.9867 MB / 10.13 sec = 917.2914 Mbps 13 %TX 11 %RX 0 retrans 8.38 msRTT Approximately 20-25 times performance improvement 19 – ESnet Science Engagement ([email protected]) - 8/1/18 On the open Internet • Public IPs • No firewall • Expectations of well-maintained hosts Scary! On the open Internet: Scary A few statistics… In 35 hours on a prior class network on one host*: – 19,000+ attempted ssh logins – 350 different invalid user accounts tried – 17,500+ attempts against root account – 4 IP addresses accounted for most of the attempts – This with fail2ban throttling attempts over 1,920 times! *host = 134.164.48.209; dates = Feb 4 at 17:35 to Feb 5 at 04:35 On the open Internet… …What do you think might be the number one thing we can do or, perhaps, the most critical thing we can do to protect our hosts? What else? Host-based security strategies The usual suspects: – Authentication and access • Minimal access to minimal surface (users / services) – Minimal services – Minimal ports – Bind to localhost as appropriate – Auto updates – Consider host-based IDS – Log and log watching – Host-based firewall if needed • perfSONAR needs it and has it What’s running on your host? • firewall-cmd • netstat • systemctl • lsof • ps • top • Others? And, on your network? • Network Intrusion Detection systems (Bro) • Network flows (if possible without causing router slowdowns • Network monitoring tools – LibreNMS, flow tools (NfSen, etc.), check_mk, your favorite tool(s) • snmp properly configured and used What about ssh, passwords & keys? Reminder: configuring and using ssh incorrectly will guarantee a security compromise… The wrong way: – Using simple passwords for users – Allowing root to login with a password – In reality – allowing any login with a password The right way: – Disable all password access – Disable root access with password – Some disable root access completely Reminder: New NIST password guidelines https://www.passwordping.com/surprising-new- password-guidelines-nist/ • Some are surprised… • It’s about time! New US Government guidelines: 1. Remove periodic password change requirements 2. Drop the algorithmic complexity song and dance 3. Require screening of new passwords against lists of commonly used or compromised passwords References • Sample netstat usage: – https://www.thegeekstuff.com/2010/03/netstat-command- examples/ • perfSONAR firewall setup: – http://docs.perfsonar.net/manage_security.html • Using firewalld on CentOS: – https://linode.com/docs/security/firewalls/introduction-to- firewalld-on-centos/ • Firewalld documentation: – http://www.firewalld.org/documentation/ • Esnet ScienceDMZ overview: – https://fasterdata.es.net/science-dmz/science-dmz-security/ Questions?.