SlideShare a Scribd company logo
SECURE CODE
TRAINING
System configuration
DAVID CERVIGNI
IT SECURITY CONSULTANT AND
PCI CODE REVIEWER
Top 10 2013-A5-Security Misconfiguration
https://www.owasp.org/index.php/Top_10_2013-A5-Security_Misconfiguration
Configuration Best Practices
• Turn off all unnecessary features by default.
• Ensure that all switches and configuration for every
feature is configured initially to be the safest possible
choice.
• Inspect the design to see if the less safe choices could
be designed in another way. For example: change
password journey.
• Do not configure anything in preparation for an
optionally deployable feature.
Prevent Security Misconfiguration
The primary recommendations are to establish all of the following:
• A repeatable hardening process that makes it fast and easy to
deploy another environment that is properly locked down.
• Development, QA, and production environments should all be
configured identically (different credentials).
• A process for keeping software updated (dependencies, libs,
pom.xml).
• Consider running scans and doing audits periodically to help detect
future misconfigurations or missing patches.
• Follows a specific hardening guide/checklist for every component
in you stack.
Vulnerabilities in components
Targeted at both the development community and the community of
security practitioners, Common Weakness Enumeration (CWE™) is a
formal list or dictionary of common software weaknesses that can
occur in software's architecture, design, code or implementation that
can lead to exploitable security vulnerabilities. CWE was created to
serve as a common language for describing software security
weaknesses; serve as a standard measuring stick for software security
tools targeting these weaknesses; and to provide a common baseline
standard for weakness identification, mitigation, and prevention
efforts.
Common Weakness Scoring System (CWSS™)
CWSS provides a mechanism for
prioritizing software weaknesses
in a consistent, flexible, open
manner. It is a collaborative,
community-based effort that is
addressing the needs of its
stakeholders across government,
academia, and industry.
SANS TOP25
CWEs & CVEs
Try it:
https://cve.mitre.org/cgi-
bin/cvekey.cgi?keyword=2017+java
Common Vulnerability Scoring System (CVSS)
The Common Vulnerability Scoring System (CVSS) is an open framework for
communicating the characteristics and severity of software vulnerabilities. CVSS
consists of three metric groups: Base, Temporal, and Environmental. The Base
group represents the intrinsic qualities of a vulnerability, the Temporal group
reflects the characteristics of a vulnerability that change over time, and the
Environmental group represents the characteristics of a vulnerability that are
unique to a user's environment.
https://www.first.org/cvss/calculator/3.0
https://www.cvedetails.com/
OWASP Dependency Check
• Project stated December 2011 (first published in 2012)
• Performs Software Composition Analysis
• Reports known vulnerabilities
• Easy solution to the OWASP 2013 Top 10 A9 Using components
with known vulnerabilities
Dependency-Check is a utility that identifies project dependencies and checks
if there are any known, publicly disclosed, vulnerabilities. This tool can be part
of the solution to the OWASP Top 10 2013: A9 - Using Components with
Known Vulnerabilities. This plug-in can independently execute a Dependency-
Check analysis and visualize results.
Dependency-Check is able to identify Java and Python components, Node.js
and Ruby Gem packages, and .NET assemblies.
Dependency-Check Jenkins Plugin
Types (by CVE)
Dependency-Check Jenkins Plugin
Categories (by CWE)
Nexus Lifecycle
https://www.sonatype.com/nexus-lifecycle-tour-software-supply-chain-automation-
sonatype
XML Parsers configuration
1. XML External Entity (XXE) Injection
2. XML Entity Expansion (Billion laughs)
XML External Entity (XXE) Injection
This attack may lead to the disclosure of confidential data, denial of
service, server side request forgery, port scanning from the perspective of
the machine where the parser is located, and other system impacts.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE foo [ <!ELEMENT foo ANY > <!ENTITY xxe SYSTEM
"file:///etc/passwd" >]>
<foo>&xxe;</foo>
http://cwe.mitre.org/data/definitions/611.html
XML Entity Expansion (Billion laughs)
The XML Entity expansion attack, exploits
a capability in XML DTDs that allows the
creation of custom macros, called
entities, that can be used throughout a
document. By recursively defining a set
of custom entities at the top of a
document, an attacker can overwhelm
parsers that attempt to completely
resolve the entities by forcing them to
iterate almost indefinitely on these
recursive definitions.
Malicious
DoS
XML Parser Configuration
PHP
Xerces2
Sax
Secure processing using StAX supports similar SupportDTD property that can be used to disable DTD
processing. This is done by using the setProperty method on XMLInputFactory:
XMLInputFactory xif = XMLInputFactory.newInstance();
xif.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING,false);
Apache hardening
• Remove Server Version Banner
ServerTokens
Prod ServerSignature Off
• Protect binary and configuration directory permission
# chmod –R 750 bin conf
• Timeout value configuration (default 300)
Timeout 60
Apache hardening
• Disable directory browser listing
<Directory /opt/apache/htdocs>
Options –Indexes
• Disable Etag heather
FileETag None
• Protect binary and configuration directory permission
# chmod –R 750 bin conf
Apache hardening
• HTTP Request Methods
<LimitExcept GET POST HEAD>
deny from all
</LimitExcept>
• Set cookie with HttpOnly and Secure flag
Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
• Clickjacking Attack
Header always append X-Frame-Options SAMEORIGIN
Apache hardening
• X-XSS Protection
Header set X-XSS-Protection “1; mode=block”
• Disable HTTP 1.0 Protocol
RewriteEngine On
RewriteCond %{THE_REQUEST} !HTTP/1.1$ RewriteRule .* - [F]
• Disable SSL v2 & v3
SSLProtocol –ALL +TLSv1 +TLSv1.1 +TLSv1.2
• Disable Loading unwanted modules
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#Include conf/extra/httpd-dav.conf
#LoadModule info_module modules/mod_info.so
Also keep in mind…
• DNS subdomains
• Admin consoles
• Internal threats
• Environment isolation (dev to prod)
• Remote debugging
• Other, suggestions?
SECURE CODE
TRAINING
INTENSIVE COURSE
DAVID CERVIGNI
IT SECURITY CONSULTANT AND
PCI CODE REVIEWER
References:
https://www.owasp.org/index.php/Configuration
https://www.owasp.org/index.php/Secure_Configuration_G
uide

More Related Content

PDF
Ten Tools for Security Professionals
PDF
Automatiza las detecciones de amenazas y evita falsos positivos
PDF
Aws security with HIDS, OSSEC
PDF
Implementing ossec
PPTX
Nguyen Phuong Truong Anh - Some new vulnerabilities in modern web application
PPT
Java Security
PPTX
Deep dive into Java security architecture
PDF
Ossec Lightning
Ten Tools for Security Professionals
Automatiza las detecciones de amenazas y evita falsos positivos
Aws security with HIDS, OSSEC
Implementing ossec
Nguyen Phuong Truong Anh - Some new vulnerabilities in modern web application
Java Security
Deep dive into Java security architecture
Ossec Lightning

What's hot (20)

PDF
Automatiza las detecciones de amenazas y evita los falsos positivos
PPTX
Nguyen phuong truong anh a story of bug bounty hunter
PDF
IoT-Shield: A Novel DDoS Detection Approach for IoT-Based Devices
PPTX
Security testing operation vijay
PDF
2012-10-16 Mil-OSS Working Group: Introduction to SCAP Security Guide
PDF
David Thiel - Secure Development On iOS
PPTX
[Wroclaw #7] Security test automation
PPTX
Web Application firewall-Mod security
PPTX
Erlang Common tests - Sergey Bondarchuk
PDF
Chapter 14 sql injection
PDF
THOR Apt Scanner
PDF
Problems with parameters b sides-msp
PPT
Stayer cis-527-assignment-3-threat
PDF
Waf.js: How to Protect Web Applications using JavaScript
PDF
Odoo Code Hardening [Odoo Experience 2019]
PPTX
Mod security
PDF
10 Rules for Safer Code [Odoo Experience 2016]
PPTX
Microsoft Ignite session: Look under the hood: bypassing antimalware tactics ...
PPTX
Phu appsec13
DOCX
Kl 031.30 eng_class_setup_guide_1.2
Automatiza las detecciones de amenazas y evita los falsos positivos
Nguyen phuong truong anh a story of bug bounty hunter
IoT-Shield: A Novel DDoS Detection Approach for IoT-Based Devices
Security testing operation vijay
2012-10-16 Mil-OSS Working Group: Introduction to SCAP Security Guide
David Thiel - Secure Development On iOS
[Wroclaw #7] Security test automation
Web Application firewall-Mod security
Erlang Common tests - Sergey Bondarchuk
Chapter 14 sql injection
THOR Apt Scanner
Problems with parameters b sides-msp
Stayer cis-527-assignment-3-threat
Waf.js: How to Protect Web Applications using JavaScript
Odoo Code Hardening [Odoo Experience 2019]
Mod security
10 Rules for Safer Code [Odoo Experience 2016]
Microsoft Ignite session: Look under the hood: bypassing antimalware tactics ...
Phu appsec13
Kl 031.30 eng_class_setup_guide_1.2
Ad

Similar to Cm5 secure code_training_1day_system configuration (20)

PDF
Automatize a detecção de ameaças e evite falsos positivos
PDF
Dhct config report
PDF
Automatisez la détection des menaces et évitez les faux positifs
PDF
Automatiza las detecciones de amenazas y evita falsos positivos
PPTX
PowerShell-and-DSC-Enables-DSCDevOps-1.pptx
PDF
Automate threat detections and avoid false positives
PDF
Automate threat detections and avoid false positives
PDF
OWASP Secure Coding Quick Reference Guide
DOCX
Understanding Vulnerabilities in Software
PDF
Pragmatic Pipeline Security
PDF
Security Process in DevSecOps
PDF
Security Development Lifecycle Tools
PDF
DevSecOps | DevOps Sec
PPTX
Internship msc cs
PPTX
DevSecOps - automating security
PDF
5 howtomitigate
PDF
System Hardening Using Ansible
ODP
Best practice adoption (and lack there of)
PDF
Module 4 qui parle de la sécurisation des applications
PPTX
Seacon Continuous Delivery Pipeline Tools Track
Automatize a detecção de ameaças e evite falsos positivos
Dhct config report
Automatisez la détection des menaces et évitez les faux positifs
Automatiza las detecciones de amenazas y evita falsos positivos
PowerShell-and-DSC-Enables-DSCDevOps-1.pptx
Automate threat detections and avoid false positives
Automate threat detections and avoid false positives
OWASP Secure Coding Quick Reference Guide
Understanding Vulnerabilities in Software
Pragmatic Pipeline Security
Security Process in DevSecOps
Security Development Lifecycle Tools
DevSecOps | DevOps Sec
Internship msc cs
DevSecOps - automating security
5 howtomitigate
System Hardening Using Ansible
Best practice adoption (and lack there of)
Module 4 qui parle de la sécurisation des applications
Seacon Continuous Delivery Pipeline Tools Track
Ad

More from dcervigni (9)

PPTX
Cm9 secure code_training_1day_input sanitization
PPTX
Cm2 secure code_training_1day_data_protection
PPTX
Cm1 secure code_training_1day_intro
PPTX
Cm8 secure code_training_1day_security libraries
PPTX
Cm3 secure code_training_1day_access_control
PPTX
Cm4 secure code_training_1day_error handling and logging
PPTX
Cm6 secure code_training_1day_file management
PPTX
Cm7 secure code_training_1day_xss
PPTX
JavaScript security and tools evolution at 2017 OWASP Taiwan Week
Cm9 secure code_training_1day_input sanitization
Cm2 secure code_training_1day_data_protection
Cm1 secure code_training_1day_intro
Cm8 secure code_training_1day_security libraries
Cm3 secure code_training_1day_access_control
Cm4 secure code_training_1day_error handling and logging
Cm6 secure code_training_1day_file management
Cm7 secure code_training_1day_xss
JavaScript security and tools evolution at 2017 OWASP Taiwan Week

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Electronic commerce courselecture one. Pdf
PPT
Teaching material agriculture food technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Encapsulation theory and applications.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
KodekX | Application Modernization Development
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Machine learning based COVID-19 study performance prediction
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Empathic Computing: Creating Shared Understanding
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Electronic commerce courselecture one. Pdf
Teaching material agriculture food technology
Dropbox Q2 2025 Financial Results & Investor Presentation
Advanced methodologies resolving dimensionality complications for autism neur...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Encapsulation theory and applications.pdf
Encapsulation_ Review paper, used for researhc scholars
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
NewMind AI Weekly Chronicles - August'25 Week I
KodekX | Application Modernization Development
MIND Revenue Release Quarter 2 2025 Press Release
Machine learning based COVID-19 study performance prediction
Chapter 3 Spatial Domain Image Processing.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Empathic Computing: Creating Shared Understanding
MYSQL Presentation for SQL database connectivity
Programs and apps: productivity, graphics, security and other tools
Mobile App Security Testing_ A Comprehensive Guide.pdf

Cm5 secure code_training_1day_system configuration

  • 1. SECURE CODE TRAINING System configuration DAVID CERVIGNI IT SECURITY CONSULTANT AND PCI CODE REVIEWER
  • 2. Top 10 2013-A5-Security Misconfiguration https://www.owasp.org/index.php/Top_10_2013-A5-Security_Misconfiguration
  • 3. Configuration Best Practices • Turn off all unnecessary features by default. • Ensure that all switches and configuration for every feature is configured initially to be the safest possible choice. • Inspect the design to see if the less safe choices could be designed in another way. For example: change password journey. • Do not configure anything in preparation for an optionally deployable feature.
  • 4. Prevent Security Misconfiguration The primary recommendations are to establish all of the following: • A repeatable hardening process that makes it fast and easy to deploy another environment that is properly locked down. • Development, QA, and production environments should all be configured identically (different credentials). • A process for keeping software updated (dependencies, libs, pom.xml). • Consider running scans and doing audits periodically to help detect future misconfigurations or missing patches. • Follows a specific hardening guide/checklist for every component in you stack.
  • 5. Vulnerabilities in components Targeted at both the development community and the community of security practitioners, Common Weakness Enumeration (CWE™) is a formal list or dictionary of common software weaknesses that can occur in software's architecture, design, code or implementation that can lead to exploitable security vulnerabilities. CWE was created to serve as a common language for describing software security weaknesses; serve as a standard measuring stick for software security tools targeting these weaknesses; and to provide a common baseline standard for weakness identification, mitigation, and prevention efforts.
  • 6. Common Weakness Scoring System (CWSS™) CWSS provides a mechanism for prioritizing software weaknesses in a consistent, flexible, open manner. It is a collaborative, community-based effort that is addressing the needs of its stakeholders across government, academia, and industry. SANS TOP25
  • 7. CWEs & CVEs Try it: https://cve.mitre.org/cgi- bin/cvekey.cgi?keyword=2017+java
  • 8. Common Vulnerability Scoring System (CVSS) The Common Vulnerability Scoring System (CVSS) is an open framework for communicating the characteristics and severity of software vulnerabilities. CVSS consists of three metric groups: Base, Temporal, and Environmental. The Base group represents the intrinsic qualities of a vulnerability, the Temporal group reflects the characteristics of a vulnerability that change over time, and the Environmental group represents the characteristics of a vulnerability that are unique to a user's environment. https://www.first.org/cvss/calculator/3.0 https://www.cvedetails.com/
  • 9. OWASP Dependency Check • Project stated December 2011 (first published in 2012) • Performs Software Composition Analysis • Reports known vulnerabilities • Easy solution to the OWASP 2013 Top 10 A9 Using components with known vulnerabilities Dependency-Check is a utility that identifies project dependencies and checks if there are any known, publicly disclosed, vulnerabilities. This tool can be part of the solution to the OWASP Top 10 2013: A9 - Using Components with Known Vulnerabilities. This plug-in can independently execute a Dependency- Check analysis and visualize results. Dependency-Check is able to identify Java and Python components, Node.js and Ruby Gem packages, and .NET assemblies.
  • 13. XML Parsers configuration 1. XML External Entity (XXE) Injection 2. XML Entity Expansion (Billion laughs)
  • 14. XML External Entity (XXE) Injection This attack may lead to the disclosure of confidential data, denial of service, server side request forgery, port scanning from the perspective of the machine where the parser is located, and other system impacts. <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE foo [ <!ELEMENT foo ANY > <!ENTITY xxe SYSTEM "file:///etc/passwd" >]> <foo>&xxe;</foo> http://cwe.mitre.org/data/definitions/611.html
  • 15. XML Entity Expansion (Billion laughs) The XML Entity expansion attack, exploits a capability in XML DTDs that allows the creation of custom macros, called entities, that can be used throughout a document. By recursively defining a set of custom entities at the top of a document, an attacker can overwhelm parsers that attempt to completely resolve the entities by forcing them to iterate almost indefinitely on these recursive definitions. Malicious DoS
  • 16. XML Parser Configuration PHP Xerces2 Sax Secure processing using StAX supports similar SupportDTD property that can be used to disable DTD processing. This is done by using the setProperty method on XMLInputFactory: XMLInputFactory xif = XMLInputFactory.newInstance(); xif.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE); SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING,false);
  • 17. Apache hardening • Remove Server Version Banner ServerTokens Prod ServerSignature Off • Protect binary and configuration directory permission # chmod –R 750 bin conf • Timeout value configuration (default 300) Timeout 60
  • 18. Apache hardening • Disable directory browser listing <Directory /opt/apache/htdocs> Options –Indexes • Disable Etag heather FileETag None • Protect binary and configuration directory permission # chmod –R 750 bin conf
  • 19. Apache hardening • HTTP Request Methods <LimitExcept GET POST HEAD> deny from all </LimitExcept> • Set cookie with HttpOnly and Secure flag Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure • Clickjacking Attack Header always append X-Frame-Options SAMEORIGIN
  • 20. Apache hardening • X-XSS Protection Header set X-XSS-Protection “1; mode=block” • Disable HTTP 1.0 Protocol RewriteEngine On RewriteCond %{THE_REQUEST} !HTTP/1.1$ RewriteRule .* - [F] • Disable SSL v2 & v3 SSLProtocol –ALL +TLSv1 +TLSv1.1 +TLSv1.2 • Disable Loading unwanted modules #LoadModule dav_module modules/mod_dav.so #LoadModule dav_fs_module modules/mod_dav_fs.so #Include conf/extra/httpd-dav.conf #LoadModule info_module modules/mod_info.so
  • 21. Also keep in mind… • DNS subdomains • Admin consoles • Internal threats • Environment isolation (dev to prod) • Remote debugging • Other, suggestions?
  • 22. SECURE CODE TRAINING INTENSIVE COURSE DAVID CERVIGNI IT SECURITY CONSULTANT AND PCI CODE REVIEWER References: https://www.owasp.org/index.php/Configuration https://www.owasp.org/index.php/Secure_Configuration_G uide