π Lecture 43 β CS205 Information Security
π Overview: This lecture covers advanced security hardening topics including Java logging rules, Perl and Android/iOS case studies, Asterisk VoIP security, version control for IT assets, secure software images, and the vulnerability management lifecycle. It provides practical hardening methodologies for diverse IT environments and introduces key concepts like CVE, NVD, exploit databases, and the Qualys/Nessus scanning tools.
ποΈ Topics Covered
The lecture covers Java exception handling in logging (Rule 7), Perl format string vulnerabilities, CIS benchmarks for Android and iOS, Asterisk VoIP hardening steps, version control benefits and best practices, CIS control 5 for secure configurations, manual and automated hardening workflows, Qualys demo for compliance scanning, the security hardening lifecycle, hardening for non-standard assets, vulnerability management definitions and lifecycle (6 steps), reasons for insecure software, patch management importance, CVE/NVD/CVSS standards, exploit types and databases, effective VM program stages, security breach case studies (Home Depot, Anthem), best practices for patching, roles of Infosec and IT Ops teams, Nessus and Qualys features, VM scanner operation methodology, OpenVAS open-source scanner, scanning frequency recommendations, VM challenges and pitfalls, IT asset management challenges, UEM tools, software restriction policies, security engineering as the third layer of the security transformation model, DMZ architecture, firewall access lists, CIS 20 Critical Security Controls (CSC 1-5, 9, 10), ISO 31000 risk management process, incident management top 10 considerations, and ITIL change management types.
π Lecture Summary
Rule 7 β Prevent exceptions while logging data
Exceptions thrown during logging can prevent successful logging and allow attackers to conceal critical security exceptions. Programs must ensure data logging continues correctly even when exceptions occur during the logging process.
π Definition β ERR02-J: Prevent exceptions while logging data to maintain security logging integrity.
The non-compliant code example writes a critical security exception to the standard error stream, which is inadequate because the stream may be exhausted or closed, the trust level may be insufficient for sensitive exceptions, an I/O error would cause the exception to be lost, and an attacker can disguise the exception among innocuous ones.
π Solution: Use java.util.logging.Logger (the default JDK 1.4+ logging API) or other compliant mechanisms like log4j. Typically only one logger is required for the entire program.
CASE STUDY β PERL APPLICATIONS SECURITY HARDENING
Rule 1 β IDS30-PL: Exclude user input from format strings Never call any formatted I/O function with a format string containing user input. An attacker who controls the format string can crash the Perl interpreter, cause denial of service, modify values using the %n conversion specifier, and divert control flow. printf() and sprintf() should never be passed unsanitized format strings.
π Example: A non-compliant Perl authentication script uses printf() with user-supplied password as the format string. The compliant solution avoids printf() and uses print() instead, which provides sufficient functionality.
Case Study: Security Hardening β Android (CIS Benchmarks, Google Android 7)
1.15 Ensure Android Device Manager is set to Enabled (Not Scored)
- Profile applicability: Level 2
- Rationale: If you lose your Android device, you can use Android Device Manager to find, ring, lock, or erase device data remotely.
- Audit Steps: System Settings β Personal β Security β Device administration β Device administrators β Verify Android Device Manager is enabled.
- Remediation Steps: Same path β Tap Android Device Manager β Activate this device administrator.
- Impact: Google may track your device location anytime.
- Default Value: Android Device Manager is not enabled by default.
Case Study: Security Hardening β Apple iOS 10 (CIS Benchmarks)
3.2.1.12 (L2) Ensure 'Allow modifying cellular data app settings' is set to 'Disabled' (Not Scored)
- Profile applicability: Level 2 - Institutionally Owned Devices
- Rationale: Forcing cellular data to remain active supports remote locating and erasure capability.
- Audit: Via Apple Configurator β Restrictions tab β Functionality β verify checkbox for "Allow modifying cellular data app settings" is unchecked. Or on device: Settings β General β Profile β Restrictions β confirm "Changing app cellular data usage not allowed" is displayed.
- Remediation: Uncheck the checkbox in Apple Configurator and deploy the configuration profile.
- CIS Controls: 5.1 Minimize And Sparingly Use Administrative Privileges.
CASE STUDY β ASTERISK VOIP SECURITY HARDENING (Part 1)
- Physically secure your IP PBX and network hardware.
- Never use default passwords on any system. Use strong passwords.
- Never use the same username and password on your extensions (e.g., password 101 for extension 101 is a serious risk).
- Place your PBX behind a Firewall. Use VPNs for remote access, limit to specific IP addresses, allow only necessary ports, disable anonymous WAN requests (ICMP/PING).
- Use "permit=" and "deny=" lines in sip.conf to only allow a small range of IP addresses access to extensions.
- Keep inbound and outbound routing separate (different contexts) to prevent toll fraud if an intruder gains access.
CASE STUDY β ASTERISK VOIP SECURITY HARDENING (Part 2)
- Limit registration by extensions to your local subnet using ACL (permit/deny) in SIP.conf to fend off brute force registration attempts.
- Disable channels and services not in use (e.g., skinny, MGCP). For Asterisk PBXs, unload modules in
/etc/modules.conf. - Set "alwaysauthreject=yes" to prevent Asterisk from telling SIP scanners which extensions are valid. Also install a SIP port firewall to block scanning of ports 5060/5061.
- Limit and restrict routing and phone number dial plans β restrict high-cost destinations and premium numbers (e.g., 0900).
- Audit your system security regularly.
Version Control For IT Assets
Benefits of version control:
- Organized, coordinated management of changes by one or many individuals (possibly geographically dispersed).
- Coordinated management for emergency hot-fixes, routine maintenance, upgrades, and new features with overlapping development timeframes.
- An auditable change history (what changed, when, and by whom).
- A reliable master copy of current production assets.
- A reliable master copy to build/configure the production environment.
- Reliable copies of previous production versions.
- Ability to see specific differences between distinct versions of a given asset.
Security controls: Access control measures, privileged management, backups.
Version Control Best Practices
- Choose a source control system.
- Keep source code in source control (not generated/compiled files).
- Ensure working file is from the latest version.
- Only check-out the file being worked upon.
- Check in immediately after alterations.
- Review every change before committing β utilize the diff function.
- Commit often β every commit provides a rollback position.
- Make extensive detailed notes in check-in comments about why changes were made.
- Developers must commit their own changes (only).
- Use the ignore button for files that should not be committed; add pre-commit filters.
- Ensure external dependencies are added to source control.
SECURITY HARDENING - SECURE SOFTWARE IMAGES (CIS 20 Critical Security Controls, Control 5, Version 7)
5.1 Establish Secure Configurations: Maintain documented, standard security configuration standards for all authorized operating systems and software. 5.2 Maintain Secure Images: Maintain secure images or templates for all systems based on approved configuration standards. Compromised systems should be re-imaged using these templates. 5.3 Securely Store Master Images: Store master images on securely configured servers, validated with integrity monitoring tools. 5.4 Deploy System Configuration Management Tools: Automatically enforce and redeploy configuration settings at regularly scheduled intervals. 5.5 Implement Automated Configuration Monitoring Systems: Use a Security Content Automation Protocol (SCAP) compliant monitoring system to verify configurations, catalog approved exceptions, and alert on unauthorized changes.
SECURITY HARDENING β MANUAL & AUTOMATED WORK
Step 1: Scan an IT asset using Qualys compliance scan, NESSUS compliance scan, or CIS CAT PRO Tool β acquire report of failed controls. Step 2: Apply the failed controls using AD (for Windows) or manually for other systems. Step 3: Use the automated feature to verify controls are in place β compare 'before' and 'after' report. Step 4: Manually verify any discrepancies. Step 5: For assets that cannot be scanned, conduct manual validation using sampling (e.g., 15-20% of assets checked at random, or 15-20% of controls checked on an asset).
QUALYS DEMO β SECURITY HARDENING (Topics 111-112)
Qualys is an excellent tool for compliance scanning. The demo covers:
- Qualys website free trial
- QualysGuard home screen
- Policy Compliance home screen (5 steps)
- Help options, online help, resources, training videos (Vimeo)
- Adding IP addresses to scan
- Configuring scan settings
- Creating a new compliance profile (e.g., 'CIS Scan Test Profile')
- Configuring authentication
- Compliance library: CIS Red Hat Enterprise Linux 7
- Policy editor
- Launching compliance scans from the main Qualys dashboard
SECURITY HARDENING β LIFECYCLE
- Harden IT Asset: Pursue the 8-step hardening methodology.
- Periodic Validation: Check periodically (every quarter) for changes to the established standard/baseline.
- Seek Updated Hardening Benchmarks: Subscribe to feeds from CIS, DISA, NIST NCP (National Checklist Program) repository.
- Implement Additional Controls: Update controls by studying changes.
- Pursue & Implement Controls That May Require Additional Working: Some controls may have caused crashes/malfunctions or were not possible due to dependencies. Enhance the % of implemented controls.
Hardening When CIS/DISA STIG Not Available
For IT assets like software applications (ASP.NET, PHP, other), or applications such as Asterisk deployments that do not have a CIS/DISA STIG:
- Step 2: Research: Look up Google, case studies, and whitepapers.
- Other considerations: Implement on test setup, test controls, use security testing tools, perform third-party penetration testing, follow vendor best-practices for application security hardening.
- With effort and by following the 8-step methodology, all types of assets can be hardened.
QUALYS POLICY LIBRARIES (Topic 115)
Qualys has built-in libraries for creating scanning policies: CIS, QUALYS, MANDATE, DISA, VENDOR. Libraries include policies like DISA STIG, Qualys SAP Adaptive Server Enterprise 16, and various vendor policies. Qualys has a vast number of options for Compliance Scans that should be fully explored through the trial.
Security Hardening For Outsourced IT Assets
IT Outsourcing examples: Call centers, hosted servers, software development, workstation helpdesk, network services. Mechanism: Information Security Policy, vendor contract (with right-to-audit clause), security project with project manager, periodic reviews, penalties for non-compliance. Important considerations: Enter security requirements into RFP, include in vendor evaluation, proceed with contract including InfoSec clauses, conduct awareness training. Security evaluations: Include outsourced scope in periodic internal audit, ask for third-party security review, vulnerability assessment and penetration test (if applicable), spot security checks.
What is Vulnerability Management?
π Definition β Vulnerability: A cyber-security term referring to a flaw in a system that can leave it open to attack. It may refer to any type of weakness in a computer system, procedures, or anything that leaves information security exposed to a threat.
π Definition β Vulnerability Management: The "cyclical practice of identifying, classifying, remediating, and mitigating vulnerabilities".
π Definition β Vulnerability Assessment (VA): A process that defines, identifies, and classifies the security holes (vulnerabilities) in a computer, network, or communications infrastructure.
Common vulnerability scanners: OpenVAS, Nessus, Qualys, Rapid7.
How to fix vulnerabilities: Keep software security patches up to date. These patches remedy flaws or security holes found in the initial release. Stay informed about current vulnerabilities.
What Are The Steps In VM Lifecycle? (6 Steps)
- Analyze assets: Examine assets to scan, gather details on IP subnet, look at potential network traffic issues, inform asset owners and department heads.
- Prepare scanner: Set parameters, select scan type, look at credentials-based scan, explore/research plug-ins, do a test run, coordinate with asset owner.
- Run vulnerability scanner: Run the automated scan, monitor network performance degradation, generate report.
- Assess results: Evaluate results, prioritize according to risk level, collate results for asset owners, communicate results and remediation timelines.
- Patch systems: Research vulnerabilities, evaluate fixes and remediation methods, test patches/fixes, apply patches, monitor results.
- Verify (re-scan): Re-scan to confirm the scanner gives a positive report, collate results, report findings.
Why Is Software Insecure?
Software is being developed with many defects exploitable by attackers due to the race to meet deadlines with little emphasis on security.
Gary McGraw's "trinity of trouble" for software security:
- Connectivity: Ever-increasing computer connectivity and internet access enhances exposure to attacks.
- Extensibility: Systems that support updates/plug-ins make it difficult to keep the constantly-adapting system free of vulnerabilities.
- Complexity: Software systems grow exponentially in size and complexity, making vulnerabilities unavoidable.
Carnegie Mellon University's CyLab estimates commercial software contains 20 to 30 bugs per 1,000 lines of code. Windows XP contains at least 40 million lines of code β that's potentially 1 million bugs.
Monoculture (Dan Greer): The security situation deteriorates when nearly all end-user computers rely on a single operating system subject to the same vulnerabilities worldwide.
Why Is A VM Program Required?
π Definition β Patch: A piece of software designed to update a computer program or its supporting data to fix or improve it, including fixing security vulnerabilities and other bugs.
π Definition β Patch Management: An area of systems management that involves acquiring, testing, and installing multiple patches to an administered computer system.
Patch management tasks: Maintaining current knowledge of available patches, deciding appropriate patches, ensuring proper installation, testing after installation, documenting procedures.
Risk of not patching: Leaving the door open for malware attacks. The timeframe between an exploit and when a patch is released is getting shorter. Defects in clients (web browsers, email programs, image viewers, IM software, media players) may allow malicious websites to compromise your computer with no action other than viewing.
A VM program addresses timely management of patching to ensure vulnerabilities are not present for hackers to exploit.
What Is CVE & Vulnerability Database?
π Definition β CVE (Common Vulnerabilities and Exposures): A list of information security vulnerabilities and exposures that aims to provide common names for publicly known cyber security issues. The goal is to make it easier to share data across separate vulnerability capabilities (tools, repositories, and services) with this "common enumeration."
π Definition β NVD (National Vulnerability Database): The CVE dictionary augmented with additional analysis, a database, and a fine-grained search engine. The NVD is a superset of CVE and is synchronized with CVE so updates appear immediately.
π Definition β CVSS (Common Vulnerability Scoring System): An open standard for assigning vulnerability impacts used by a variety of organizations. The NVD uses CVSS Version 2 and NISTIR 7946 describes methodologies for using CVSS.
All major vendors publish their security vulnerabilities online (Microsoft, Oracle, Cisco, etc.).
What Is An Exploit?
π Definition β Exploit: A program or code that takes advantage of a security hole (vulnerability) in an application or system so an attacker can use it for their benefit.
- Remote exploit: Works over a network and exploits the vulnerability without any prior access to the vulnerable system.
- Local exploit: Requires prior access and usually increases the privileges of the person running it past those granted by the system administrator.
Exploit Database: A CVE compliant archive of public exploits and corresponding vulnerable software for penetration testers and vulnerability researchers. It is a repository for exploits and proof-of-concepts rather than advisories.
π Definition β Zero-day exploit: A zero-day vulnerability refers to a hole in software unknown to the vendor. This security hole is exploited by hackers before the vendor becomes aware and fixes it β this exploit is called a zero-day attack.
Effective Vulnerability Management: Stage 2
Stage 1: Security hardening β Taking stock of assets, prioritizing, establishing an MSB, implementing controls with CIS/DISA/Other benchmarks, basic/broader security hardening.
- Stage 1 (Hardening) is equivalent to tightening all the screws on machinery β reduces impact of an attack (like a shield).
- Stage 2 (Patching) will seal all entry points for an attacker to gain access.
- Both stages are equally important and necessary.
Security Breach Case Study 1: Home Depot 2014
- 56 million payment cards compromised in early September 2014.
- Sequence of events: Attackers gained access via a third-party vendor's logon credentials β exploited a zero-day vulnerability in Windows to pivot to the corporate environment β installed memory scraping malware on 7,500+ self-checkout POS terminals β grabbed 56 million credit/debit cards and 53 million email addresses.
- Failures: No secure configuration of POS terminal software/hardware, no regularly scheduled vulnerability scanning, no proper network segregation between corporate and POS networks, missing vendor management of IDs/access management, and missing network monitoring.
Security Breach Case Study 2: Anthem (Health Insurer)
- Affected 78.8 million individuals.
- Sequence of events: User opened a phishing email (Feb 18, 2014) β malicious files downloaded β hackers gained remote access to the computer and 90+ systems β moved laterally and escalated privileges β compromised 50+ accounts and 90 systems β accessed the enterprise data warehouse β exfiltrated 78.8 million unique user records.
- Vulnerabilities: Exploitable vulnerabilities found in the network; lack of user security awareness training to prevent phishing.
- Remediation: Implemented two-factor authentication on all remote access tools, deployed privileged account management, enhanced logging, completed a full password reset for privileged users, suspended remote access pending 2FA, created new Network Admin IDs.
Best Practices For Applying Security Patches
Guiding principle: "The risk of implementing the service pack, hotfix and security patch should ALWAYS be LESS than the risk of not implementing it."
- Use a change control process with an identified owner, customer input path, audit trail, clear announcement/review period, testing procedures, and a well-understood back-out plan.
- Read all related documentation and peer review β ensure the update is relevant, won't cause other issues, check dependencies and sequencing instructions.
- Apply updates on a need-only basis.
- Testing.
- Plan to uninstall.
- Working backup and production downtime.
- Always have a roll-back plan.
- Don't get more than 2 service packs behind.
Who Conducts Vulnerability Management?
Role of Infosec team:
- Takes primary ownership of the VM process
- Runs scanning after coordinating with IT Ops
- Shares scanning reports with IT teams and management
- Tracks remediation timelines
- Understands criticality and helps prioritize
- Studies security patch details as backup
- Assists with change management
Role of IT Ops team:
- Owner of the IT asset
- Receives and studies the vulnerability scan report
- Understands criticality, impact, and dependencies
- Helps develop project plan and timelines
- Tests patches in test environment
- Takes backups, develops roll-back plan
- Takes downtime and owns change management
- Implements patches
- Monitors systems after implementation
- Rolls back if necessary
- Creates documentation
Nessus Features
- Reports: Customize by vulnerability or host, create executive summary, compare scan results, targeted email notifications.
- Scan Types: Asset discovery, un-credentialed vulnerability discovery, credentialed scanning for system hardening and missing patches.
- Compliance & Config Scans: Compliance auditing (FFIEC, FISMA, GLBA, HIPAA, PCI, SOX, etc.), configuration auditing (CERT, CIS, DISA STIGs, ISO, NIST, NSA).
- Risk scores: Vulnerability ranking based on CVE, five severity levels (Critical, High, Medium, Low, Info), customizable severity levels.
- Nessus is a cost-effective scanner with CIS and DISA compliance templates. Has some flaws and bugs but is overall useful.
Qualys Features
- Cloud-based service with on-premise device options
- Complete suite, scalable and immediate deployment
- Asset discovery, prioritize & manage remediation tickets
- Continuous monitoring service
- Policy compliance scanning
- Qualys Secure Seal for websites
- Website scanning, compliance scanning
- Annual subscription service model
- Convenient and scalable with several modules; subscription-based pricing can be expensive; advantages due to cloud-based service.
How Do VM Scanners Work? (Qualys Methodology)
The scanner follows steps an attacker might take:
- Check if remote host is alive β probe well-known TCP/UDP ports. If at least one reply is received, continue.
- Firewall detection β check if host is behind any filtering device to gather network infrastructure info.
- TCP/UDP Port scanning β detect all open ports (default: ~1900 TCP ports and 180 UDP ports).
- OS Detection β send specific TCP packets to open and closed ports.
- TCP/UDP Service Discovery β identify which service runs on each open port.
- Vulnerability assessment based on services detected β check service version to detect only applicable vulnerabilities. Every detection is non-intrusive (never exploits vulnerability if it could negatively affect the host).
Limitations: Scanners work like antivirus programs using databases of vulnerability descriptions; there may be false positives or false negatives.
Open Source Vulnerability Scanners (OpenVAS)
- Simple, free (open source) VA scanner
- Approximately 50k Network Vulnerability Tests
- Has source code documentation, virtual images for download, and mailing lists on website
- Login/password: livedemo (at openvas.org/livedemo.html)
Suggested Frequency For VM Scanning
- Pre-requisites: Information security team, vulnerability management policy, in-house scanner or OpenVAS tool, trained staff.
- At the start: Scanning once a year or not at all β vulnerabilities not remediated, lack of discipline/management support.
- As organizations mature (Quarterly): Quarterly scan, quarterly remediation, quarterly report to IT Steering Committee.
- Mature organizations: Monthly scan, monthly remediation, quarterly or bi-annual external VA/PT, monthly reports.
- Most mature organizations: Fortnightly scan, fortnightly remediation, monthly reporting.
VM Challenges & Pitfalls
- Internal expertise on VM tool: Not too much expertise required β create testbed, monitor traffic pattern, train staff, patch small portions first.
- Not enough support from IT teams: Create reports, share among IT management, highlight/educate risks to management and board, create departmental competition and relationship-building.
- Patching causing application failure: In test environment create workarounds or compensating controls, test them, document them.
- Not enough management support: Share reports highlighting recent incidents, share industry-specific/geographically relevant breach reports, create awareness.
IT Asset Management Challenges
The typical enterprise has hundreds or thousands of IT assets with fast-paced business changes. Challenges:
- Asset discovery & tracking: New assets added & old removed, temporary/replacement machines, travelling staff, test beds, vendor environments.
- Antivirus status: Working and updated AV critical; geographically dispersed networks; some stations not responding/updating.
- Windows & OS updates: Windows, Linux, Unix, AIX, database systems; vendor patches from multiple sources; testing patches; acquiring downtime windows; monitoring performance.
- Patch management: Scanning for vulnerabilities, passing reports to IT teams, tracking remediation, re-scanning, reporting to management.
- Change management: Inherent to all change processes; requires reviews and approvals; Configuration Management Database (CMDB) or repository.
ASSET MANAGEMENT TOOLS FOR SECURITY FUNCTIONS (Topic 144)
Asset management helps with: 1. Patch management, 2. Software whitelisting, 3. Software assets discovery/management, 4. Enterprise tracking and reporting.
Gartner β Unified Endpoint Management (UEM): Tools that combine management of multiple endpoint types in a single console. UEM functions (Gartner UEM 2018):
- Configure, manage, and monitor iOS, Android, Windows 10, macOS, and some IoT/wearable endpoints.
- Unify application of configurations, management profiles, device compliance, and data protection.
- Provide a single view of multi-device users, enhancing end-user support and gathering detailed workplace analytics.
- Act as a coordination point to orchestrate activities of related endpoint technologies (identity services, security infrastructure).
Microsoft Software Restriction Policies (SRP) for Whitelisting: A Group Policy-based feature that identifies software programs and controls their ability to run. Can create highly restricted configurations allowing only specifically identified applications to run. Integrated with Microsoft Active Directory and Group Policy.
WHAT IS SECURITY ENGINEERING? (Layer 3 of Security Transformation Model)
Consists of more in-depth and complicated security activities taking more time and effort, often related to security architecture. Types of activities:
- Firewall granular access lists
- Building an effective DMZ architecture
- Segregating the network with VLANs
- Adding security tools like SIEM, FW, DLP, NAC
- App-DB encryption
DMZ Architecture Case Study: DMZ is an important zone for devices that need to communicate with the outside world (web servers, email gateways, web gateways).
FW Access List Case Study: Most of the industry has not built granular access lists. Most FWs have "allow all" for traffic. Granular access lists need to be built based on servers or traffic flows.
Why at Layer 3?: Low hanging fruit first. Teams tend to get bogged down with advanced security tasks that take time, effort, and budget approval.
WHAT IS THE OBJECTIVE OF SECURITY ENGINEERING?
- Security architecture as per best-practices
- The right security devices in the right places
- Effective security configuration of security devices (features)
- Optimum operation of security devices
- Aggregate controls
Examples: FW first and then IPS; Edge FW, data center FW; Malware protection at network edge; VPN termination on remote access VPN device; VPN tunnels for extranet