42

Anna Völkl - MM15NL

Embed Size (px)

Citation preview

Page 1: Anna Völkl - MM15NL
Page 2: Anna Völkl - MM15NL

Magento Application

SecurityAnna Völkl / @rescueAnn

Page 3: Anna Völkl - MM15NL

Anna Völkl / @rescueAnn• Magento Certified Developer• IT & Telecommunicatios, IT-Security• PHP (2004), Magento (2011)• LimeSoda (Vienna, AT)

Page 4: Anna Völkl - MM15NL

Anna Völkl / @rescueAnn• 200 Magento Installations*• 68 good passwords**• 10 endless loops***• 3 forgotten phpinfo.php• 1 Stroopwafel purchase

* roughly estimated, including test-setups

** thanks to KeePass

*** last one 12/2012

Page 5: Anna Völkl - MM15NL
Page 6: Anna Völkl - MM15NL
Page 7: Anna Völkl - MM15NL

Security-TechnologyDepartment of Defense Computer Security Initiative1980

Page 8: Anna Völkl - MM15NL

Magento Application Security Logins & Passwords Admin Backend protected SSL installed

Page 9: Anna Völkl - MM15NL

Magento Application Security Logins & Passwords Admin Backend protected SSL installed

…there‘s more!

Page 10: Anna Völkl - MM15NL

Magento Application Security

Magento Application Security

Software Development Life Cycle

Software Development Life Cycle

UserUser

DatabaseDatabaseWebserverWebserver

Version control & delivery

Version control & delivery

RequirementsRequirements

Software-DesignSoftware-Design DevelopmentDevelopment Extensions /3rd Party

Extensions /3rd Party

Out of serviceOut of service

Updates & PatchesUpdates & Patches

LoginsLogins

PasswordsPasswords

Web-Application Firewall

Web-Application Firewall

FirewallFirewallFile owner & permissionsFile owner & permissions

Config filesConfig files

IDS, IPSIDS, IPS

Page 11: Anna Völkl - MM15NL

http://blogs.technet.com/b/rhalbheer/archive/2011/01/14/real-physical-security.aspx

Page 12: Anna Völkl - MM15NL

Security

ConfidentialityConfidentiality

IntegrityIntegrity

AvailabilityAvailability

Page 13: Anna Völkl - MM15NL

Unsecure Software?•No time•No knowledge•No priorities

• Performance• SEO• New features

Page 14: Anna Völkl - MM15NL

Potential attackers✗ (organized) criminals✗ Defacer✗ Script-Kiddies✗ Former developers, agencies✗ Competitors✗ The merchant theirselves

Page 15: Anna Völkl - MM15NL

Interest?➢Payment data➢Customer data➢Personal gain➢Damage competitors

Page 16: Anna Völkl - MM15NL

Most critical web application security flawsA1 Injection

A2 Broken Authentication and Session Management

A3 Cross-Site Scripting (XSS)

A4 Insecure Direct Object References

A5 Security Misconfiguration

More: https://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project

Page 17: Anna Völkl - MM15NL

web application security flaws

OWASP Top 10 2013,

https://www.owasp.org/images/4/42/OWASP_Top_10_2013_DE_Version_1_0.pdf, modified version

Page 18: Anna Völkl - MM15NL

Secure Coding Principles

Page 19: Anna Völkl - MM15NL

Minimize attack surface area

Every feature adds a risk.

Page 20: Anna Völkl - MM15NL

Secure defaults

Secure configuration „out of the box“

Page 21: Anna Völkl - MM15NL

Least Privilege

Least amount of privilege required to perform actions

Page 22: Anna Völkl - MM15NL

Fail secure

Fail secure vs. Fail safe

Page 23: Anna Völkl - MM15NL

Don't trust services

...they can be wrong.

Page 24: Anna Völkl - MM15NL

Don't trust user input

Validate the expectedExpect the unexpected

Page 25: Anna Völkl - MM15NL

Longest place name (1 word)

Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu

(New Zealand, 85 letters)

Page 26: Anna Völkl - MM15NL

Security by obscurity

Security by lack of knowledge?!

Page 27: Anna Völkl - MM15NL

KISS

Keep security simpleSimplicity vs. complexity

Page 28: Anna Völkl - MM15NL

Fix security issues correctly

Understand the problemFind related code

Write tests

Page 29: Anna Völkl - MM15NL

...now what?!

Page 30: Anna Völkl - MM15NL

Functional & non functional

Requirements

Page 31: Anna Völkl - MM15NL

Be curious!Read, learn, try to understand.

Secure Coding Guidelines:OWASP Secure Coding Practices

Secure Coding

Page 32: Anna Völkl - MM15NL

Validate your inputExpected input: Whitelist vs. Blacklist

Secure Coding

Page 33: Anna Völkl - MM15NL

https://quadhead.de/cola-hack-sicherheitsluecke-auf-meinecoke-de/

Page 34: Anna Völkl - MM15NL

User:allowed to access a resource?

Admins:ACLsMage::getSingleton('admin/session')

->isAllowed('admin/sales/order/actions/create');

Secure Coding

Page 35: Anna Völkl - MM15NL

● PHPSniffer● Magento ECG Coding Standard● Dependencies:

Sensio Labs composer.lock check

Security Testing

Page 36: Anna Völkl - MM15NL

Scrutinizer CICode Climate

SensioLabsInsight

Security Testing

Page 37: Anna Völkl - MM15NL

Scrutinizer CICode Climate

SensioLabsInsight

Security Testing

Page 38: Anna Völkl - MM15NL

● .git, .git/config● composer.lock● Standard /admin path● /downloader● app/etc/local.xml● Logfiles● phpinfo.php● Database-Dumps: livedb.sql.gz

Block access to

Page 39: Anna Völkl - MM15NL

SUPEE-5344SUPEE-5994

Latest security patches

Page 40: Anna Völkl - MM15NL

●Magento Community Edition 1.9.1.1 & Enterprise Edition 1.14.2 contain SUPEE-5344

●Magento Shoplift Bug Tester: https://shoplift.byte.nl

●Coming soon: Magento Alert Registry●@magesecurity

PATCH!

Page 41: Anna Völkl - MM15NL

Leave your code more secure (better) than you

found it.

Page 42: Anna Völkl - MM15NL