SlideShare a Scribd company logo
Code Quality - Security
Session Topics:
•
Understand few terms, terminologies, known Issues and
process problems
•
Software security development cycle, leverage tools and build
effective processes.
•
Example projects(OpenSource and Commercial)
Santhosh Kumar Edukulla
Burger King Site Hacked
Twitter hacked by Iranian Army
espn site hacked with unicorns
Few Numbers, Known Issues
• More than 70% of attacks “targeted” are application related, of which web
vulnerabilities are getting prevalent.
• espn, sony, ebay, yahoo, twitter, facebook, dropbox, microsoft …even
google is not spared
Few Examples
Few Code Samples:
• All the samples if we see are functionally wrong, even otherwise
lead them to security issues.
• All these issues can be caught during code reviews, static
analysis, or other code check process.
Core pillars of information security
(CIA)
• Confidentiality – only allow access to data for which the user is
permitted
• Integrity – ensure data is not tampered or altered by
unauthorized users
• Availability – ensure systems and data are available to
authorized users when they need it
In typical SDLC, “Security starts from requirements phase itself
and it never ends…”
Principles of Information Security
• Minimize attack surface area
• Establish secure defaults
• Principle of least privilege
• Principle of defense in depth
• Fail securely
• Don’t trust services
• Avoid security by obscurity
• Fix security issues correctly
• Keep security simple
OWASP Top Web Vulnerabilities
OWASP urges all companies to be aware of these concerns within
their organization and start the process of ensuring that their
web applications do not contain these flaws.
• A1 Injection
• A2 Broken Authentication and Session Management
• A3 Cross Site Scripting (XSS)
• A4 Insecure Direct Object References
• A5 Security Misconfiguration
• A6 Sensitive Data Exposure
• A7 Missing Function Level Access Control
• A8 Cross Site Request Forgery (CSRF)
• A9 Using Components with Known Vulnerabilities
• A10 Invalidated Redirects and Forwards
Code Quality : Functional (Vs) Non
Functional
Definition of Quality: Broad…but should not be fixed only to
functional quality of a software product.
Code Quality ~ (“reliability, efficiency, scalability, security,
maintainability, readability”)
Application Security Responsibility
Definition : Broad…
Code Quality ~ (“reliability, efficiency, scalability, security,
maintainability, readability”)
In abstract..
“Secure” your transports(TCPUDP)
“Secure” your application layers(Https)
“Secure” your data(Resources, configurations, physical, virtual,
sockets, files, users etc)
“Secure” your code.
“Secure” your interactions.
Lock Everything… 
Defense In Depth(SD, client,
Server)
Layers of Defense
Typical User Process Space
Stack Smashing..
Stack Code Escalation
Code Quality : Goals and Objectives
• One of the key goal for every dev team should be to pass on
less number of bugs to QA.
• One of the key goal for every dev team should be to have less
number of design bugs in production and identified more during
reviews.
• The number of issues identified during design and code reviews
quantified with metrics against the total bugs for a release, how
many of them were caught in Dev (Vs) QA etc.
• The sign off criteria for a build or feature should be from design
sign off, code reviews sign off, zero static analysis bugs, zero
profiling bugs detected by agreed upon tool etc.
• In fact, each sprint definition of done should and must be
enforced by quality parameters.
Few Gates
• Effective SCM, commit process, defining Check-In criteria
• Reviews and Walkthroughs( Design and Code )
• Effective code analysis (SAST DAST ), profiling techniques.
• Effective Quality CI Pipeline
Example 1: Code Quality
Open Source Apache Project:
Designing HW Independent Code
Replace with
Simple
Simulator
proxy
Process Improvements
1. CI Cycle Improvements.
2. Categorized the Integration tests to “Self-Service” (Vs) “Hardware” dependent
3. “Two” LGTM(+1s ) for every commit request. No “-1”
4. 100% Unit test coverage.
5. “0” slow static analysis and “0” full Coverity bugs.
6. New Integration Tests should be added, if it’s a new feature commit.
7. Integration test coverage should not regress the previous ones.
8. All Self-Service tests should pass 100%.
9. No new OWASP, sec bugs found with Sonar/Coverity rules engine.
10. Style and license check should pass 100%
11. New feature design document should have at least “2 LGTMs”
Tools Used
• Jenkins
• Git(SCM)
• Gerritt
• ReviewBoard(Code Review)
• Coverity, findbugs, PMD for static analysis
• Jira(For bug tracking)
• Jacoco, SonarQube for Coverage Analysis.
• Nose, coverage for integration tests.
Review and Check-In Sign-Off
Passed
Review and Check-In Sign-Off
Failed
Static Analysis: Identifying issues
Sample coverage report with Issues
Sample coverage report
Git - CI process flow Diagram
Code Coverage
What is is not for:

It does not signify quality “completeness” criteria.

A 100% coverage information does not signify high quality and no bugs.

Tools can report 100% coverage, but still it does not mean code is covered fully.
What it is for:

Finding “Covered” and “Uncovered Areas”.

Priority Vs Non Priority Areas

Priority Tests Vs Non Priority Tests
Coverage Types
• Statement Coverage
• Decision Coverage
• Condition Coverage
• Multiple Condition Coverage
• Condition/Decision Coverage
• Modified Condition/Decision Coverage
• Path Coverage
• Function Coverage
• Call Coverage
• Linear Code Sequence and Jump (LCSAJ) Coverage
• Data Flow Coverage
• Object Code Branch Coverage
• Loop Coverage
• Race Coverage
• Relational Operator Coverage
• Weak Mutation Coverage
Code Coverage
Typically code coverage has two components viz.,

Collection Component:
− Jacoco for Java
− gcov for cc++
− SonarSource c++ Component
− BullsEye
− Rational Purify Plus

Analsysis Component:
− Sonar Qube
− lcov with gcov output
− BullsEye
− Rational Purify Plus
Check-in Criteria.

We had an integration of coverity with our svn server. Every check-in is first analyzed for
coverity run automatically and any checkers marked and finding high severity bugs was not
allowed to be checked in with a failed commit.

We had a valgrind running at scheduled intervals on build and emailing the list of issues
and creating bugs automatically. Any issue reported on new checkins are reverted automatically.

Zero Coverity and Code Collaborator defects for check-in was adopted, otherwise commit
wont be allowed and it is automated.

Failing Sanity run through AutoBVT on staging build wont push the commits to production.

Production push happens automatically only when staging build gets passed.

Peer Review Sign off for every checkin and in case of no signoff, commit wont get committed.
Design and Code Reviews
Tool Used : Code Collaborator, review board, gerritt, github

Reviews Vs WalkThroughs.

What is important is enforcing the Reviews!!
Profiling and Dynamic Analysis
Tools Used: Rational purify plus, coverity, valgrind, gprof, vtune, oprofile etc.

Valgrind: It is an effective memory analysis and debugging tool, not an effective for memory
analysis with static allocation, anything with dynamic memory allocation, it is very effective. It is
limited in support on various platforms and not extensive like Rational Purify Plus, free and lot of
community and user support available.

Rational Purify Plus : Supports lots of platforms, wealth of documentation, good support, does
static analysis, dynamic analysis, and does provide coverage information as well, but little pricey :)

Gprof with krprof : Easily usable with gcc tools on the fly with limited tool set. A common complaint
about these is their excessive rate of false alarms and that the warnings they issue do not correlate
very well with real defects.
To Summarize..
1. Don’t trust your inputs, don’t trust your code, any inputs from any sources.
Validate all Input Sources EX:
• Browser input, headers, request parameters.
• Cookies
• Property files
• External processes
• Data feeds
• Service responses
• Flat files
• Command line parameters
• Environment variables
2. Follow effective commit and build CI process.
3. Effective Reviews, tools, Coverage, sign-off criteria, early fixes
4. Follow Secure Coding Guidelines, many of them are available at OWASP site.
5. Follow a threat model for your projects.
6. Get to an effective assurance level agreed upon.
Code quality, in effect software security
-- Thank you 
-- Q && A:
If(we know)
{
“We will answer”;
}
else
{
“Will find out”;
}
Santhosh Kumar Edukulla
Ad

More Related Content

What's hot (20)

DevSecOps: What Why and How : Blackhat 2019
DevSecOps: What Why and How : Blackhat 2019DevSecOps: What Why and How : Blackhat 2019
DevSecOps: What Why and How : Blackhat 2019
NotSoSecure Global Services
 
DevSecOps The Evolution of DevOps
DevSecOps The Evolution of DevOpsDevSecOps The Evolution of DevOps
DevSecOps The Evolution of DevOps
Michael Man
 
DevSecOps Implementation Journey
DevSecOps Implementation JourneyDevSecOps Implementation Journey
DevSecOps Implementation Journey
DevOps Indonesia
 
DevSecOps: Taking a DevOps Approach to Security
DevSecOps: Taking a DevOps Approach to SecurityDevSecOps: Taking a DevOps Approach to Security
DevSecOps: Taking a DevOps Approach to Security
Alert Logic
 
DevSecOps Basics with Azure Pipelines
DevSecOps Basics with Azure Pipelines DevSecOps Basics with Azure Pipelines
DevSecOps Basics with Azure Pipelines
Abdul_Mujeeb
 
DevSecOps : an Introduction
DevSecOps : an IntroductionDevSecOps : an Introduction
DevSecOps : an Introduction
Prashanth B. P.
 
A Software Engineer
A Software EngineerA Software Engineer
A Software Engineer
Abbasgulu Allahverdili
 
Secure Coding 101 - OWASP University of Ottawa Workshop
Secure Coding 101 - OWASP University of Ottawa WorkshopSecure Coding 101 - OWASP University of Ottawa Workshop
Secure Coding 101 - OWASP University of Ottawa Workshop
Paul Ionescu
 
DevSecOps
DevSecOpsDevSecOps
DevSecOps
Tomas Honzak
 
CI/CD Overview
CI/CD OverviewCI/CD Overview
CI/CD Overview
An Nguyen
 
DevSecOps
DevSecOpsDevSecOps
DevSecOps
Cheah Eng Soon
 
Building an API Security Strategy
Building an API Security StrategyBuilding an API Security Strategy
Building an API Security Strategy
SmartBear
 
Code Quality
Code QualityCode Quality
Code Quality
François Camus
 
ELK stack introduction
ELK stack introduction ELK stack introduction
ELK stack introduction
abenyeung1
 
Cyber Threat Hunting Workshop
Cyber Threat Hunting WorkshopCyber Threat Hunting Workshop
Cyber Threat Hunting Workshop
Digit Oktavianto
 
Recon with Nmap
Recon with Nmap Recon with Nmap
Recon with Nmap
OWASP Delhi
 
Threat modeling web application: a case study
Threat modeling web application: a case studyThreat modeling web application: a case study
Threat modeling web application: a case study
Antonio Fontes
 
Kubernetes Security
Kubernetes SecurityKubernetes Security
Kubernetes Security
Karthik Gaekwad
 
Wazuh Security Platform
Wazuh Security PlatformWazuh Security Platform
Wazuh Security Platform
Pituphong Yavirach
 
Security-by-Design and -Default
 Security-by-Design and -Default Security-by-Design and -Default
Security-by-Design and -Default
Mehdi Mirakhorli
 
DevSecOps The Evolution of DevOps
DevSecOps The Evolution of DevOpsDevSecOps The Evolution of DevOps
DevSecOps The Evolution of DevOps
Michael Man
 
DevSecOps Implementation Journey
DevSecOps Implementation JourneyDevSecOps Implementation Journey
DevSecOps Implementation Journey
DevOps Indonesia
 
DevSecOps: Taking a DevOps Approach to Security
DevSecOps: Taking a DevOps Approach to SecurityDevSecOps: Taking a DevOps Approach to Security
DevSecOps: Taking a DevOps Approach to Security
Alert Logic
 
DevSecOps Basics with Azure Pipelines
DevSecOps Basics with Azure Pipelines DevSecOps Basics with Azure Pipelines
DevSecOps Basics with Azure Pipelines
Abdul_Mujeeb
 
DevSecOps : an Introduction
DevSecOps : an IntroductionDevSecOps : an Introduction
DevSecOps : an Introduction
Prashanth B. P.
 
Secure Coding 101 - OWASP University of Ottawa Workshop
Secure Coding 101 - OWASP University of Ottawa WorkshopSecure Coding 101 - OWASP University of Ottawa Workshop
Secure Coding 101 - OWASP University of Ottawa Workshop
Paul Ionescu
 
CI/CD Overview
CI/CD OverviewCI/CD Overview
CI/CD Overview
An Nguyen
 
Building an API Security Strategy
Building an API Security StrategyBuilding an API Security Strategy
Building an API Security Strategy
SmartBear
 
ELK stack introduction
ELK stack introduction ELK stack introduction
ELK stack introduction
abenyeung1
 
Cyber Threat Hunting Workshop
Cyber Threat Hunting WorkshopCyber Threat Hunting Workshop
Cyber Threat Hunting Workshop
Digit Oktavianto
 
Recon with Nmap
Recon with Nmap Recon with Nmap
Recon with Nmap
OWASP Delhi
 
Threat modeling web application: a case study
Threat modeling web application: a case studyThreat modeling web application: a case study
Threat modeling web application: a case study
Antonio Fontes
 
Security-by-Design and -Default
 Security-by-Design and -Default Security-by-Design and -Default
Security-by-Design and -Default
Mehdi Mirakhorli
 

Viewers also liked (11)

Open Source KMIP Implementation
Open Source KMIP ImplementationOpen Source KMIP Implementation
Open Source KMIP Implementation
sedukull
 
Barbican 1.0 - Open Source Key Management for OpenStack
Barbican 1.0 - Open Source Key Management for OpenStackBarbican 1.0 - Open Source Key Management for OpenStack
Barbican 1.0 - Open Source Key Management for OpenStack
jarito030506
 
MySQL HA with Pacemaker
MySQL HA with  PacemakerMySQL HA with  Pacemaker
MySQL HA with Pacemaker
Kris Buytaert
 
Supriya Shailaja Latest Gallery
 Supriya Shailaja Latest Gallery Supriya Shailaja Latest Gallery
Supriya Shailaja Latest Gallery
telugustop.com
 
MySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the PacemakerMySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the Pacemaker
hastexo
 
High availability and fault tolerance of openstack
High availability and fault tolerance of openstackHigh availability and fault tolerance of openstack
High availability and fault tolerance of openstack
Deepak Mane
 
Open stack HA - Theory to Reality
Open stack HA -  Theory to RealityOpen stack HA -  Theory to Reality
Open stack HA - Theory to Reality
Sriram Subramanian
 
MySQL with DRBD/Pacemaker/Corosync on Linux
 MySQL with DRBD/Pacemaker/Corosync on Linux MySQL with DRBD/Pacemaker/Corosync on Linux
MySQL with DRBD/Pacemaker/Corosync on Linux
Pawan Kumar
 
Continuous Integration, Build Pipelines and Continuous Deployment
Continuous Integration, Build Pipelines and Continuous DeploymentContinuous Integration, Build Pipelines and Continuous Deployment
Continuous Integration, Build Pipelines and Continuous Deployment
Christopher Read
 
Deep dive into highly available open stack architecture openstack summit va...
Deep dive into highly available open stack architecture   openstack summit va...Deep dive into highly available open stack architecture   openstack summit va...
Deep dive into highly available open stack architecture openstack summit va...
Arthur Berezin
 
Chef cookbooks for OpenStack HA
Chef cookbooks for OpenStack HAChef cookbooks for OpenStack HA
Chef cookbooks for OpenStack HA
Adam Spiers
 
Open Source KMIP Implementation
Open Source KMIP ImplementationOpen Source KMIP Implementation
Open Source KMIP Implementation
sedukull
 
Barbican 1.0 - Open Source Key Management for OpenStack
Barbican 1.0 - Open Source Key Management for OpenStackBarbican 1.0 - Open Source Key Management for OpenStack
Barbican 1.0 - Open Source Key Management for OpenStack
jarito030506
 
MySQL HA with Pacemaker
MySQL HA with  PacemakerMySQL HA with  Pacemaker
MySQL HA with Pacemaker
Kris Buytaert
 
Supriya Shailaja Latest Gallery
 Supriya Shailaja Latest Gallery Supriya Shailaja Latest Gallery
Supriya Shailaja Latest Gallery
telugustop.com
 
MySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the PacemakerMySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the Pacemaker
hastexo
 
High availability and fault tolerance of openstack
High availability and fault tolerance of openstackHigh availability and fault tolerance of openstack
High availability and fault tolerance of openstack
Deepak Mane
 
Open stack HA - Theory to Reality
Open stack HA -  Theory to RealityOpen stack HA -  Theory to Reality
Open stack HA - Theory to Reality
Sriram Subramanian
 
MySQL with DRBD/Pacemaker/Corosync on Linux
 MySQL with DRBD/Pacemaker/Corosync on Linux MySQL with DRBD/Pacemaker/Corosync on Linux
MySQL with DRBD/Pacemaker/Corosync on Linux
Pawan Kumar
 
Continuous Integration, Build Pipelines and Continuous Deployment
Continuous Integration, Build Pipelines and Continuous DeploymentContinuous Integration, Build Pipelines and Continuous Deployment
Continuous Integration, Build Pipelines and Continuous Deployment
Christopher Read
 
Deep dive into highly available open stack architecture openstack summit va...
Deep dive into highly available open stack architecture   openstack summit va...Deep dive into highly available open stack architecture   openstack summit va...
Deep dive into highly available open stack architecture openstack summit va...
Arthur Berezin
 
Chef cookbooks for OpenStack HA
Chef cookbooks for OpenStack HAChef cookbooks for OpenStack HA
Chef cookbooks for OpenStack HA
Adam Spiers
 
Ad

Similar to Code Quality - Security (20)

AppSec in an Agile World
AppSec in an Agile WorldAppSec in an Agile World
AppSec in an Agile World
David Lindner
 
Using Analyzers to Resolve Security Problems
Using Analyzers to Resolve Security ProblemsUsing Analyzers to Resolve Security Problems
Using Analyzers to Resolve Security Problems
kiansahafi
 
CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019
Olivera Milenkovic
 
Static Code Analysis
Static Code AnalysisStatic Code Analysis
Static Code Analysis
Obika Gellineau
 
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Denim Group
 
Bringing Security Testing to Development: How to Enable Developers to Act as ...
Bringing Security Testing to Development: How to Enable Developers to Act as ...Bringing Security Testing to Development: How to Enable Developers to Act as ...
Bringing Security Testing to Development: How to Enable Developers to Act as ...
Achim D. Brucker
 
Code Review with Sonar
Code Review with SonarCode Review with Sonar
Code Review with Sonar
Max Kleiner
 
Devops architecture
Devops architectureDevops architecture
Devops architecture
Ojasvi Jagtap
 
Vulnerability Detection Based on Git History
Vulnerability Detection Based on Git HistoryVulnerability Detection Based on Git History
Vulnerability Detection Based on Git History
Kenta Yamamoto
 
How do JavaScript frameworks impact the security of applications?
How do JavaScript frameworks impact the security of applications?How do JavaScript frameworks impact the security of applications?
How do JavaScript frameworks impact the security of applications?
Ksenia Peguero
 
Jason Kent - AppSec Without Additional Tools
Jason Kent - AppSec Without Additional ToolsJason Kent - AppSec Without Additional Tools
Jason Kent - AppSec Without Additional Tools
centralohioissa
 
Software Analytics: Data Analytics for Software Engineering and Security
Software Analytics: Data Analytics for Software Engineering and SecuritySoftware Analytics: Data Analytics for Software Engineering and Security
Software Analytics: Data Analytics for Software Engineering and Security
Tao Xie
 
Security for developers
Security for developersSecurity for developers
Security for developers
Abdelrhman Shawky
 
Zero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically GuaranteedZero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically Guaranteed
Ashley Zupkus
 
Evaluating Web App, Mobile App, and API Security - Matt Cohen
Evaluating Web App, Mobile App, and API Security - Matt CohenEvaluating Web App, Mobile App, and API Security - Matt Cohen
Evaluating Web App, Mobile App, and API Security - Matt Cohen
Inman News
 
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis ToolsGNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
AdaCore
 
Programming languages and techniques for today’s embedded andIoT world
Programming languages and techniques for today’s embedded andIoT worldProgramming languages and techniques for today’s embedded andIoT world
Programming languages and techniques for today’s embedded andIoT world
Rogue Wave Software
 
stackconf 2024 | How to hack and defend (your) open source by Roman Zhukov.pdf
stackconf 2024 | How to hack and defend (your) open source by Roman Zhukov.pdfstackconf 2024 | How to hack and defend (your) open source by Roman Zhukov.pdf
stackconf 2024 | How to hack and defend (your) open source by Roman Zhukov.pdf
NETWAYS
 
Cerberus_Presentation1
Cerberus_Presentation1Cerberus_Presentation1
Cerberus_Presentation1
CIVEL Benoit
 
Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)
CIVEL Benoit
 
AppSec in an Agile World
AppSec in an Agile WorldAppSec in an Agile World
AppSec in an Agile World
David Lindner
 
Using Analyzers to Resolve Security Problems
Using Analyzers to Resolve Security ProblemsUsing Analyzers to Resolve Security Problems
Using Analyzers to Resolve Security Problems
kiansahafi
 
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Denim Group
 
Bringing Security Testing to Development: How to Enable Developers to Act as ...
Bringing Security Testing to Development: How to Enable Developers to Act as ...Bringing Security Testing to Development: How to Enable Developers to Act as ...
Bringing Security Testing to Development: How to Enable Developers to Act as ...
Achim D. Brucker
 
Code Review with Sonar
Code Review with SonarCode Review with Sonar
Code Review with Sonar
Max Kleiner
 
Vulnerability Detection Based on Git History
Vulnerability Detection Based on Git HistoryVulnerability Detection Based on Git History
Vulnerability Detection Based on Git History
Kenta Yamamoto
 
How do JavaScript frameworks impact the security of applications?
How do JavaScript frameworks impact the security of applications?How do JavaScript frameworks impact the security of applications?
How do JavaScript frameworks impact the security of applications?
Ksenia Peguero
 
Jason Kent - AppSec Without Additional Tools
Jason Kent - AppSec Without Additional ToolsJason Kent - AppSec Without Additional Tools
Jason Kent - AppSec Without Additional Tools
centralohioissa
 
Software Analytics: Data Analytics for Software Engineering and Security
Software Analytics: Data Analytics for Software Engineering and SecuritySoftware Analytics: Data Analytics for Software Engineering and Security
Software Analytics: Data Analytics for Software Engineering and Security
Tao Xie
 
Zero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically GuaranteedZero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically Guaranteed
Ashley Zupkus
 
Evaluating Web App, Mobile App, and API Security - Matt Cohen
Evaluating Web App, Mobile App, and API Security - Matt CohenEvaluating Web App, Mobile App, and API Security - Matt Cohen
Evaluating Web App, Mobile App, and API Security - Matt Cohen
Inman News
 
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis ToolsGNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
AdaCore
 
Programming languages and techniques for today’s embedded andIoT world
Programming languages and techniques for today’s embedded andIoT worldProgramming languages and techniques for today’s embedded andIoT world
Programming languages and techniques for today’s embedded andIoT world
Rogue Wave Software
 
stackconf 2024 | How to hack and defend (your) open source by Roman Zhukov.pdf
stackconf 2024 | How to hack and defend (your) open source by Roman Zhukov.pdfstackconf 2024 | How to hack and defend (your) open source by Roman Zhukov.pdf
stackconf 2024 | How to hack and defend (your) open source by Roman Zhukov.pdf
NETWAYS
 
Cerberus_Presentation1
Cerberus_Presentation1Cerberus_Presentation1
Cerberus_Presentation1
CIVEL Benoit
 
Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)
CIVEL Benoit
 
Ad

Recently uploaded (20)

Time Estimation: Expert Tips & Proven Project Techniques
Time Estimation: Expert Tips & Proven Project TechniquesTime Estimation: Expert Tips & Proven Project Techniques
Time Estimation: Expert Tips & Proven Project Techniques
Livetecs LLC
 
Robotic Process Automation (RPA) Software Development Services.pptx
Robotic Process Automation (RPA) Software Development Services.pptxRobotic Process Automation (RPA) Software Development Services.pptx
Robotic Process Automation (RPA) Software Development Services.pptx
julia smits
 
How I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetryHow I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetry
Cees Bos
 
Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509
Fermin Galan
 
Why Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card ProvidersWhy Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card Providers
Tapitag
 
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World ExamplesMastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
jamescantor38
 
Exchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv SoftwareExchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv Software
Shoviv Software
 
Programs as Values - Write code and don't get lost
Programs as Values - Write code and don't get lostPrograms as Values - Write code and don't get lost
Programs as Values - Write code and don't get lost
Pierangelo Cecchetto
 
Autodesk Inventor Crack (2025) Latest
Autodesk Inventor    Crack (2025) LatestAutodesk Inventor    Crack (2025) Latest
Autodesk Inventor Crack (2025) Latest
Google
 
Solar-wind hybrid engery a system sustainable power
Solar-wind  hybrid engery a system sustainable powerSolar-wind  hybrid engery a system sustainable power
Solar-wind hybrid engery a system sustainable power
bhoomigowda12345
 
What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?
HireME
 
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
Ranking Google
 
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business StageA Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
SynapseIndia
 
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdfTop Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
evrigsolution
 
Deploying & Testing Agentforce - End-to-end with Copado - Ewenb Clark
Deploying & Testing Agentforce - End-to-end with Copado - Ewenb ClarkDeploying & Testing Agentforce - End-to-end with Copado - Ewenb Clark
Deploying & Testing Agentforce - End-to-end with Copado - Ewenb Clark
Peter Caitens
 
Unit Two - Java Architecture and OOPS
Unit Two  -   Java Architecture and OOPSUnit Two  -   Java Architecture and OOPS
Unit Two - Java Architecture and OOPS
Nabin Dhakal
 
Digital Twins Software Service in Belfast
Digital Twins Software Service in BelfastDigital Twins Software Service in Belfast
Digital Twins Software Service in Belfast
julia smits
 
Medical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk ScoringMedical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk Scoring
ICS
 
[gbgcpp] Let's get comfortable with concepts
[gbgcpp] Let's get comfortable with concepts[gbgcpp] Let's get comfortable with concepts
[gbgcpp] Let's get comfortable with concepts
Dimitrios Platis
 
How to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryErrorHow to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
 
Time Estimation: Expert Tips & Proven Project Techniques
Time Estimation: Expert Tips & Proven Project TechniquesTime Estimation: Expert Tips & Proven Project Techniques
Time Estimation: Expert Tips & Proven Project Techniques
Livetecs LLC
 
Robotic Process Automation (RPA) Software Development Services.pptx
Robotic Process Automation (RPA) Software Development Services.pptxRobotic Process Automation (RPA) Software Development Services.pptx
Robotic Process Automation (RPA) Software Development Services.pptx
julia smits
 
How I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetryHow I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetry
Cees Bos
 
Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509
Fermin Galan
 
Why Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card ProvidersWhy Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card Providers
Tapitag
 
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World ExamplesMastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
jamescantor38
 
Exchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv SoftwareExchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv Software
Shoviv Software
 
Programs as Values - Write code and don't get lost
Programs as Values - Write code and don't get lostPrograms as Values - Write code and don't get lost
Programs as Values - Write code and don't get lost
Pierangelo Cecchetto
 
Autodesk Inventor Crack (2025) Latest
Autodesk Inventor    Crack (2025) LatestAutodesk Inventor    Crack (2025) Latest
Autodesk Inventor Crack (2025) Latest
Google
 
Solar-wind hybrid engery a system sustainable power
Solar-wind  hybrid engery a system sustainable powerSolar-wind  hybrid engery a system sustainable power
Solar-wind hybrid engery a system sustainable power
bhoomigowda12345
 
What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?
HireME
 
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
Ranking Google
 
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business StageA Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
SynapseIndia
 
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdfTop Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
evrigsolution
 
Deploying & Testing Agentforce - End-to-end with Copado - Ewenb Clark
Deploying & Testing Agentforce - End-to-end with Copado - Ewenb ClarkDeploying & Testing Agentforce - End-to-end with Copado - Ewenb Clark
Deploying & Testing Agentforce - End-to-end with Copado - Ewenb Clark
Peter Caitens
 
Unit Two - Java Architecture and OOPS
Unit Two  -   Java Architecture and OOPSUnit Two  -   Java Architecture and OOPS
Unit Two - Java Architecture and OOPS
Nabin Dhakal
 
Digital Twins Software Service in Belfast
Digital Twins Software Service in BelfastDigital Twins Software Service in Belfast
Digital Twins Software Service in Belfast
julia smits
 
Medical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk ScoringMedical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk Scoring
ICS
 
[gbgcpp] Let's get comfortable with concepts
[gbgcpp] Let's get comfortable with concepts[gbgcpp] Let's get comfortable with concepts
[gbgcpp] Let's get comfortable with concepts
Dimitrios Platis
 
How to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryErrorHow to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
 

Code Quality - Security

  • 1. Code Quality - Security Session Topics: • Understand few terms, terminologies, known Issues and process problems • Software security development cycle, leverage tools and build effective processes. • Example projects(OpenSource and Commercial) Santhosh Kumar Edukulla
  • 3. Twitter hacked by Iranian Army
  • 4. espn site hacked with unicorns
  • 5. Few Numbers, Known Issues • More than 70% of attacks “targeted” are application related, of which web vulnerabilities are getting prevalent. • espn, sony, ebay, yahoo, twitter, facebook, dropbox, microsoft …even google is not spared
  • 6. Few Examples Few Code Samples: • All the samples if we see are functionally wrong, even otherwise lead them to security issues. • All these issues can be caught during code reviews, static analysis, or other code check process.
  • 7. Core pillars of information security (CIA) • Confidentiality – only allow access to data for which the user is permitted • Integrity – ensure data is not tampered or altered by unauthorized users • Availability – ensure systems and data are available to authorized users when they need it In typical SDLC, “Security starts from requirements phase itself and it never ends…”
  • 8. Principles of Information Security • Minimize attack surface area • Establish secure defaults • Principle of least privilege • Principle of defense in depth • Fail securely • Don’t trust services • Avoid security by obscurity • Fix security issues correctly • Keep security simple
  • 9. OWASP Top Web Vulnerabilities OWASP urges all companies to be aware of these concerns within their organization and start the process of ensuring that their web applications do not contain these flaws. • A1 Injection • A2 Broken Authentication and Session Management • A3 Cross Site Scripting (XSS) • A4 Insecure Direct Object References • A5 Security Misconfiguration • A6 Sensitive Data Exposure • A7 Missing Function Level Access Control • A8 Cross Site Request Forgery (CSRF) • A9 Using Components with Known Vulnerabilities • A10 Invalidated Redirects and Forwards
  • 10. Code Quality : Functional (Vs) Non Functional Definition of Quality: Broad…but should not be fixed only to functional quality of a software product. Code Quality ~ (“reliability, efficiency, scalability, security, maintainability, readability”)
  • 11. Application Security Responsibility Definition : Broad… Code Quality ~ (“reliability, efficiency, scalability, security, maintainability, readability”)
  • 12. In abstract.. “Secure” your transports(TCPUDP) “Secure” your application layers(Https) “Secure” your data(Resources, configurations, physical, virtual, sockets, files, users etc) “Secure” your code. “Secure” your interactions.
  • 14. Defense In Depth(SD, client, Server)
  • 19. Code Quality : Goals and Objectives • One of the key goal for every dev team should be to pass on less number of bugs to QA. • One of the key goal for every dev team should be to have less number of design bugs in production and identified more during reviews. • The number of issues identified during design and code reviews quantified with metrics against the total bugs for a release, how many of them were caught in Dev (Vs) QA etc. • The sign off criteria for a build or feature should be from design sign off, code reviews sign off, zero static analysis bugs, zero profiling bugs detected by agreed upon tool etc. • In fact, each sprint definition of done should and must be enforced by quality parameters.
  • 20. Few Gates • Effective SCM, commit process, defining Check-In criteria • Reviews and Walkthroughs( Design and Code ) • Effective code analysis (SAST DAST ), profiling techniques. • Effective Quality CI Pipeline
  • 21. Example 1: Code Quality Open Source Apache Project:
  • 22. Designing HW Independent Code Replace with Simple Simulator proxy
  • 23. Process Improvements 1. CI Cycle Improvements. 2. Categorized the Integration tests to “Self-Service” (Vs) “Hardware” dependent 3. “Two” LGTM(+1s ) for every commit request. No “-1” 4. 100% Unit test coverage. 5. “0” slow static analysis and “0” full Coverity bugs. 6. New Integration Tests should be added, if it’s a new feature commit. 7. Integration test coverage should not regress the previous ones. 8. All Self-Service tests should pass 100%. 9. No new OWASP, sec bugs found with Sonar/Coverity rules engine. 10. Style and license check should pass 100% 11. New feature design document should have at least “2 LGTMs”
  • 24. Tools Used • Jenkins • Git(SCM) • Gerritt • ReviewBoard(Code Review) • Coverity, findbugs, PMD for static analysis • Jira(For bug tracking) • Jacoco, SonarQube for Coverage Analysis. • Nose, coverage for integration tests.
  • 25. Review and Check-In Sign-Off Passed
  • 26. Review and Check-In Sign-Off Failed
  • 28. Sample coverage report with Issues
  • 30. Git - CI process flow Diagram
  • 31. Code Coverage What is is not for:  It does not signify quality “completeness” criteria.  A 100% coverage information does not signify high quality and no bugs.  Tools can report 100% coverage, but still it does not mean code is covered fully. What it is for:  Finding “Covered” and “Uncovered Areas”.  Priority Vs Non Priority Areas  Priority Tests Vs Non Priority Tests
  • 32. Coverage Types • Statement Coverage • Decision Coverage • Condition Coverage • Multiple Condition Coverage • Condition/Decision Coverage • Modified Condition/Decision Coverage • Path Coverage • Function Coverage • Call Coverage • Linear Code Sequence and Jump (LCSAJ) Coverage • Data Flow Coverage • Object Code Branch Coverage • Loop Coverage • Race Coverage • Relational Operator Coverage • Weak Mutation Coverage
  • 33. Code Coverage Typically code coverage has two components viz.,  Collection Component: − Jacoco for Java − gcov for cc++ − SonarSource c++ Component − BullsEye − Rational Purify Plus  Analsysis Component: − Sonar Qube − lcov with gcov output − BullsEye − Rational Purify Plus
  • 34. Check-in Criteria.  We had an integration of coverity with our svn server. Every check-in is first analyzed for coverity run automatically and any checkers marked and finding high severity bugs was not allowed to be checked in with a failed commit.  We had a valgrind running at scheduled intervals on build and emailing the list of issues and creating bugs automatically. Any issue reported on new checkins are reverted automatically.  Zero Coverity and Code Collaborator defects for check-in was adopted, otherwise commit wont be allowed and it is automated.  Failing Sanity run through AutoBVT on staging build wont push the commits to production.  Production push happens automatically only when staging build gets passed.  Peer Review Sign off for every checkin and in case of no signoff, commit wont get committed.
  • 35. Design and Code Reviews Tool Used : Code Collaborator, review board, gerritt, github  Reviews Vs WalkThroughs.  What is important is enforcing the Reviews!!
  • 36. Profiling and Dynamic Analysis Tools Used: Rational purify plus, coverity, valgrind, gprof, vtune, oprofile etc.  Valgrind: It is an effective memory analysis and debugging tool, not an effective for memory analysis with static allocation, anything with dynamic memory allocation, it is very effective. It is limited in support on various platforms and not extensive like Rational Purify Plus, free and lot of community and user support available.  Rational Purify Plus : Supports lots of platforms, wealth of documentation, good support, does static analysis, dynamic analysis, and does provide coverage information as well, but little pricey :)  Gprof with krprof : Easily usable with gcc tools on the fly with limited tool set. A common complaint about these is their excessive rate of false alarms and that the warnings they issue do not correlate very well with real defects.
  • 37. To Summarize.. 1. Don’t trust your inputs, don’t trust your code, any inputs from any sources. Validate all Input Sources EX: • Browser input, headers, request parameters. • Cookies • Property files • External processes • Data feeds • Service responses • Flat files • Command line parameters • Environment variables 2. Follow effective commit and build CI process. 3. Effective Reviews, tools, Coverage, sign-off criteria, early fixes 4. Follow Secure Coding Guidelines, many of them are available at OWASP site. 5. Follow a threat model for your projects. 6. Get to an effective assurance level agreed upon.
  • 38. Code quality, in effect software security -- Thank you  -- Q && A: If(we know) { “We will answer”; } else { “Will find out”; } Santhosh Kumar Edukulla
  翻译: