Upload
long-ta
View
110
Download
0
Embed Size (px)
Citation preview
1
WebservicesecuritywithOWASPZAP
LongTV
About me
• Tạ Vũ Long• Dev at GMO-Z.com
Vietnam Lab Center
2
3
Agenda
I– Yêu cầu phichức năng:securityII– Giới thiệu OWASPZAPIII– DemoIV– Kết luận
4
Agenda
I– Yêu cầu phichức năng:securityII– Giới thiệu OWASPZAPIII– DemoIV– Kết luận
5
Non-FunctionalrequirementsVs
Functionalrequirements
6
Ví dụ về Non-Functionalrequirements• Performance– forexampleResponseTime,Throughput, Utilization,Static
Volumetric• Scalability• Capacity• Availability• Reliability• Recoverability• Maintainability• Serviceability• Security• Regulatory• Manageability• Environmental• DataIntegrity• Usability• Interoperability• …
7
8
Vulnerabilities1) SQLInjection2) OSCommandInjection3) UncheckedPathParameter/DirectoryTraversal4) ImproperSessionManagement5) Cross-SiteScripting6) CSRF(Cross-SiteRequestForgery)7) HTTPHeaderInjection8) MailHeaderInjection9) LackofAuthenticationandAuthorization
9
https://www.ipa.go.jp/security/vuln/websecurity.html
10
SQLInjection
11
https://www.ipa.go.jp/security/vuln/websecurity.html
Cross-SiteScripting
12
https://www.ipa.go.jp/security/vuln/websecurity.html
13
Phòng chống SQLInjection
• PreparedStatements(withParameterizedQueries)***
• WhiteListInputValidation• Escapingtất cả những jusernhập• StoredProcedures:tạo các proceduresđểthực thi các khối query
14
Phòng chống XSS
• Mặc định không cho nhập những dữ liệu kotintưởng,chỉ cho phép những nơi cần thiết.
• Escapemọi webpageelementsmà showcontentra trên trình duyệt web:(htmlspecialchars)– VD:<(< ),>(>),&(&)
• Đối với cookiesquan trọng tasử dụng cờHTTPOnly để tránh bị trộm cookiesquajs.
• Thêm header“X-XSS-Protection”vào response
15
Nguy cơ tiềm tàng
• 96%các ứng dụng tồn tại các lỗ hổng bảo mật
16
https://www.info-point-security.com/sites/default/files/cenz ic-vulnerability-report-2014.pdf
Khắc phục sự cố
17
WEB APPLICATIONS SECURITY STATISTICS REPORT 2016
Vấn đề
• Không đưa security requirement vào• Giải quyết ko triệt để
– Team member thiếu kiến thức về bảo mật– Không đủ time, cost,…
18
19
Agenda
I– Yêu cầu phichức năng:securityII– Giới thiệu OWASPZAPIII– DemoIV– Kết luận
20
21
OWASP
• OWASP:OpenWebApplicationSecurityProject
• 2001/09/09byMarkCurphey (đanglà FounderandCEOof SRC:CLR(SourceClean)
22
OWASPProjects
• Hàng trăm projects:– https://www.owasp.org/index.php/Category:OWASP_Project
• Phổ biến:– OWASPtopten:công bố 10loại tấn công phổ biếnnhất (3năm 1?)
– OWASPZAP:securityscanner– Listattacktypes:https://www.owasp.org/index.php/Category:Attack
23
OWASPProjects
24
OWASPZAP• ZAP:ZedAttackProxy• Projecttích cực nhất của OWASP• Cross-Platform• Open-Source:https://github.com/zaproxy/zaproxy/
• Awards– 2015Bossie awardforThebestopensourcenetworkingandsecuritysoftware
– TopSecurityToolsof2014asvotedbyToolsWatch.org:2nd
– TopSecurityToolof2013asvotedbyToolsWatch.org:1st
25
Benchmarks
• TheWIVETScoreofWebApplicationScanners(18/09/2016)– Vị trí thứ 5(Unified)– Vị trí thứ 4(Free/OpenSource)
26
http://sectoolmarket.com/wivet-score-unified-list.html
Tools
• The Spiders: crawler ( sử dụng AJAX Spiders để scan các AJAX request )
• Proxy: Recorder , để giúp tạo những data hợp lệ khi attack.
• Active và Passive Scanning: quét lỗhổng chủ động và bị động
27
Tools
• Fuzzer:gửi những datakhông hợp lệ,khôngmong muốn.
• ChangingrequestsandResponses : allowsyoutospecifyascomplexacriteriaasyouneed
28
Tools
• ZAPRESTAPI:tương tác vsZAPthông quaAPI• ContinuousIntegration:tích hợp securityscannervào vòng phát triển liên tục.
29
30
Đủ chưa??
31
Other
• OSlevel:vulnerabilityscanner– Lynis:http://www.tecmint.com/linux-security-auditing-and-scanning-with-lynis-tool/
• Sourcescanner:– http://techbeacon.com/13-tools-checking-security-risk-open-source-dependencies-0
32
Đủ chưa??
33
34
35
Agenda
I– Yêu cầu phichức năng:securityII– Giới thiệu OWASPZAPIII– DemoIV– Kết luận
36
Kết luận
• Đưa securityrequirementvào process.• Đào tạo kiến thức về securitycho tất cả teammember.
• Có policyvề securitytrong quá trình pháttriển,vận hành,maintain.
• Sử dụng các toolvà nên tích hợp vào CI.
37
38