Slide 1

Slide 1 text

Auditing Symfony apps Lenard Palko

Slide 2

Slide 2 text

PHP Community Manager @ PITECH+PLUS Symfony Certified Developer Husband and full time dad Who is this guy ? lenard.palko@gmail.com @lenardpalko

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Software quality What is an audit ? How to ? Benefits

Slide 5

Slide 5 text

Lorem ipsum tempus STRUCTURAL FUNCTIONAL PROCESS Software quality

Slide 6

Slide 6 text

Functional quality Lorem ipsum tempus STRUCTURAL FUNCTIONAL PROCESS Meeting requirements Ease of use Few defects

Slide 7

Slide 7 text

Process quality Meeting deadlines Meeting budgets Repeatable process Lorem ipsum tempus STRUCTURAL FUNCTIONAL PROCESS

Slide 8

Slide 8 text

Structural quality Testability Maintainability Efficiency Security Lorem ipsum tempus STRUCTURAL FUNCTIONAL PROCESS

Slide 9

Slide 9 text

Increasing quality in one aspect can lower the quality on other aspects =TECHNICAL DEBT Software quality

Slide 10

Slide 10 text

What is an audit ?

Slide 11

Slide 11 text

“A software code audit is a comprehensive analysis of source code in a programming project with the intent of discovering bugs, security breaches or violations of programming conventions.” www.wikipedia.org

Slide 12

Slide 12 text

A useful step along the path to a better application

Slide 13

Slide 13 text

Why do you need an audit ?

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

Taking over an application

Slide 16

Slide 16 text

Performance / Security issues

Slide 17

Slide 17 text

High cost of change

Slide 18

Slide 18 text

Types of audits

Slide 19

Slide 19 text

Performance audit Layer based Load testing

Slide 20

Slide 20 text

Process audit Requirements User stories Methodologies Planning

Slide 21

Slide 21 text

Penetration testing Security audit

Slide 22

Slide 22 text

Architecture Code analysis Code audit

Slide 23

Slide 23 text

The process

Slide 24

Slide 24 text

Preparing the audit Functional context System overview Project Analysis Report The process 1 2 3 4 5

Slide 25

Slide 25 text

Set clear expectations purpose access Preparing the audit 1 2 3 4 5

Slide 26

Slide 26 text

Preparing the audit Gather prerequisites functional/technical specs code git history wiki/confluence pages 1 2 3 4 5

Slide 27

Slide 27 text

Functional Context Understand the application Application flows 1 2 3 4 5

Slide 28

Slide 28 text

System overview Technical Stack High Level Architecture 1 2 3 4 5

Slide 29

Slide 29 text

System overview - sample 1 2 3 4 5

Slide 30

Slide 30 text

Project Analysis Hands on code analysis Static code analysis 1 2 3 4 5

Slide 31

Slide 31 text

Hands on code analysis What to look for ● project structure, version control ● OOP, design patterns ● mixture of layers ● logging, exception handling 1 2 3 4 5

Slide 32

Slide 32 text

“When I wrote this, only God and I understood what I was doing. Now, God only knows.” Comments comments to look for : “fix, xxx, wtf, todo, temporary” 1 2 3 4 5

Slide 33

Slide 33 text

phploc Static code analysis 1 2 3 4 5

Slide 34

Slide 34 text

Static code analysis phpqa 1 2 3 4 5

Slide 35

Slide 35 text

Static code analysis phpqa - phpdepend 1 2 3 4 5

Slide 36

Slide 36 text

Static code analysis phpqa - dependencies 1 2 3 4 5

Slide 37

Slide 37 text

Static code analysis SensioLabs Insights 1 2 3 4 5

Slide 38

Slide 38 text

Tests Test Coverage Test Quality 1 2 3 4 5

Slide 39

Slide 39 text

Security Dependency security Automated Security Scan 1 2 3 4 5

Slide 40

Slide 40 text

Automated Security Scan ZAP, Nikto2 1 2 3 4 5

Slide 41

Slide 41 text

Performance Database slow queries Blackfire Page speed JMeter 1 2 3 4 5

Slide 42

Slide 42 text

Deployment Continuous integration Release versioning Deployment tools Hardware infrastructure 1 2 3 4 5

Slide 43

Slide 43 text

The report

Slide 44

Slide 44 text

The report Analysis summary Recommendations Conclusions Annexes 1 2 3 4 5

Slide 45

Slide 45 text

The report Structure

Slide 46

Slide 46 text

The report 1 2 3 4 5

Slide 47

Slide 47 text

Reduce risks Identify low velocity factors Reduce cost of change Performance/security Benefits

Slide 48

Slide 48 text

Key points Impact on users Make a bridge to nontechnical people Audit -> Plan -> Implement -> Follow up Learn

Slide 49

Slide 49 text

Summary Prepare Understand Analyse Report Recommend

Slide 50

Slide 50 text

Questions

Slide 51

Slide 51 text

Thank you https://joind.in/talk/0b163

Slide 52

Slide 52 text

https://github.com/EdgedesignCZ/phpqa https://insight.sensiolabs.com https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project https://cirt.net/Nikto2 https://matthiasnoback.nl/2013/01/dependency-injection-smells/ Images : http://wiep.net/talk/wp-content/uploads/2010/05/why.jpg http://cdn.list25.com/wp-content/uploads/2013/10/711-610x360.jpg https://i1.wp.com/4kwallpapers.site/wp-content/uploads/2011/01/Red-And-Green-Apples.jpg https://www.shutterstock.com/image-photo/conceptual-image-businessman-looking-on-working-301775756 https://ak2.picdn.net/shutterstock/videos/31494802/thumb/1.jpg References