Introduction to application security (Arabic)

26
# ر ط خ ي ف ا ن ح ا_ _ ! ات ق ي ب ط ت ل ا ن ي م أ ت ي ف ة م د ق م س$ ب ع ح د م سا

Transcript of Introduction to application security (Arabic)

Page 1: Introduction to application security (Arabic)

احنا_في_خطر#!

مقدمة في تأمين التطبيقاتسامح دعبس

Page 2: Introduction to application security (Arabic)

الفهرسo ! احنا_في_خطر#o)كيف يحدث االختراق )مثال مبسطo..لغة الهاكرزoالناس دي عاوزة مننا إيه؟ !!!STRIDE Modelo...الحاجات اللي الناس بتغلط في تأمينها كثيراThreats

categoriesoاعمل الصحoأنا تهت مني... من أين نبدأ؟o ثغرات 10أهم OWASP top 10o ... أخطر و أشهر و أسهل ثغرة بالتفصيلSQL Injectiono...ماذا بعد

Page 3: Introduction to application security (Arabic)

احنا_في_خطر #oملخص تقرير سيمانتك Symantec 2014 عن سنة:

o5 خترقين 6 من كلoات كبيرة كانت هدفا لمoمؤسس متقدمين

o60% الصغيرة و oاتoمن الهجمات تستهدف المؤسس المتوسطoة

o:خترقون أسرع من المدافعينoالمo24 بل إيجاد حل لهاoثغرة تم استغاللها ق Zero-day

vulnerabilitieso اد حلول لهم بعد 5أولoيوم!!295 منهم تم إيج

o ت317أكثر منoمليون برمجية خبيثة طُور

https://www.symantec.com/security_response/publications/threatreport.jspالمصدر:

Page 4: Introduction to application security (Arabic)

كيف يحدث االختراق؟ )مثال مبسط(

Survey andالمسح و البحث عن نقاطo الضعف 1.assess

استغالل نقاط الضعف و الهجومo عليها 2.Penetrate or Exploit

Escalate Privilegesتوسيع الصالحيات 3.

Maintain access ابتزاز الضحية 4.-backتسهيل الدخول فيما بعد: فتح أبواب خلفية •

doors استخدام حساب ضعيف التأمين, مسح آثار ,االختراق...

Denial of Serviceحجب الخدمة 5.سياسة األرض المحروقة... لو فشل يوقع الدنيا•هدف في حد ذاتها•

Page 5: Introduction to application security (Arabic)

لغة الهاكرز.. We have a valuable “asset” (A resource of value such as

the data in a database or on the file system, or a system resource) that we want to protect.

... That asset has a weakness point (vulnerability) … that raise a “threat تخوف ” … that a “malicious خبيث” user can “penetrate يخترق or

hack يخترق or attackيهاجم or exploitيستغل or compromise بـ, يضر this vulnerability يهدد

… and harm (cause bad things, like retrieve or damage) that asset.

… We need countermeasures وقائية تدابير … to counter نقاوم or address نعالج this threat … and mitigate آثار من .this risk تخفيف

Page 6: Introduction to application security (Arabic)

الناس دي عاوزة مننا إيه؟!!! STRIDE Model

ماo هي دوافع المخترقين لمثل هذه األعمال الخبيثة؟•...oاسأل مايكروسوفت

• STRIDE Model• Spoofing انتحال: use false identity )credentials, IP,

…(• Tampering تالعب, تزوير: unauthorized modification

of data• Repudiation إنكار

• يقتلo القتيل و يمشي في جنازته• Information disclosure اإلفصاح عن/إفشاء المعلومات

• يا رايح كتر من الفضايح• Denial of Service حجب الخدمة• Elevation of privilege توسيع الصالحيات

• ...الفريق المشيoر الزعيم الطبيoب

Page 7: Introduction to application security (Arabic)

الحاجات اللي الناس بتغلط في تأمينها .Threats categories1كثيرا... Input validation: How do you know that the input your application receives is

valid and safe?2. Authentication: Who are you?3. Authorization: What can you do?4. Configuration management: How your application manage its settings?5. Sensitive data: how your application handles any data that must be

protected either in memory, over the network or in persistent stores.6. Session management: A session refers to a series of related interactions

between a user and your Web application.7. Cryptography: Cryptography refers to how your application enforces

confidentiality (privacy) and integrity (tamper-proofing ال يمكن تزويرها).8. Parameter manipulation: Query string parameters; form fields; cookies; HTTP

headers9. Exception management: When your application fails, Do you return friendly

error information to end users? Do you pass valuable exception information back to the caller?

10. Auditing and logging: Who did what and when?

Page 8: Introduction to application security (Arabic)

اعمل الصح... أهم النصائح لتأمين التطبيقات

Page 9: Introduction to application security (Arabic)

- حدد هدفك1%100مفيش برنامج آمن •الهدف هو الوصوoل لبرنامج يصمد أمام االختراقات •

hack-resilient بتقليل نقاط الضعف بقدر المستطاع

Page 10: Introduction to application security (Arabic)

- آمن بنظرية المؤامرة2•If anything can go wrong, it will! –

Murphy’s lawإن كان عدوك نملة, فال تنم له•الباب اللي ييجي لكo منه الريح, سده و استريح•

Page 11: Introduction to application security (Arabic)

3 oال -Firewall oو ال Encryption مش كفاية!!

• Apply defense in depth• Application أكل عيشنا• Platform: OS, SQL Server, Runtime, IIS,…• Infrastructure: Network, routers, ports,

switches, VMs, …• كله منفد على كله• استعن بصديق

Page 12: Introduction to application security (Arabic)

- مش أي حد يقول لك حاجة تصدقها4Input Validation

• Input is evil, unless proven otherwise• Do not trust input including form fields,

cookies, query strings, HTTP headers• Do not rely on client-side validation• Constrain, reject and sanitize input• Validate for type, length, format and

range

Page 13: Introduction to application security (Arabic)

5 -Authentication & Authorization

دايما اسأل... من أنتم؟ -- •Authentication

ما تتكلمش مع حد ما تعرفوش•مش كل الناس اللي تعرفهم ينفع •

Authorizationتقول لهم كل حاجة -- ما تنخدعش بالمظاهر••EFG Hermes office boy!

ما تفتحش الدنيا على البحري لكل •role-based authorizationالناس

Page 14: Introduction to application security (Arabic)

- الصالحيات على قدر الحاجة6• Use least privileged process, service, and user accounts

Page 15: Introduction to application security (Arabic)

7 oاقع واقف ...oلو وقعت -Fail gracefully

• Never expose error details to end user.

Page 16: Introduction to application security (Arabic)

- خليك مصحصح8• Log errors and critical system events• Analyze logs periodically

Page 17: Introduction to application security (Arabic)

- ما تعيدش اختراع العجل9• Use well-known security solutions• Don’t use custom security solutions without test

Page 18: Introduction to application security (Arabic)

secure the wire- أمِّن السلك 10• Use encrypted communication channel (TLS/SSL, VPN)

Page 19: Introduction to application security (Arabic)

- بالش فتحة الصدر الله يكرمك11o!على فكرة...مش شرط يكون ليك أعداء

Page 20: Introduction to application security (Arabic)

بونص ... لو حصل مصيبة و ما حدش عرف إنك أنت السبب؟

لبسها ف أي تيم تاني ... مزحة •

Page 21: Introduction to application security (Arabic)

أنا تهت مني... من أين نبدأ؟o الثغرات كثيرة, و ال يمكن تغطية جميع

البد من البدء باألهم فالمهمالثغرات o بحسب مؤسسةSANS شركة شهيرة(

في مجال التدريب األمني و اعتماد ( certificationsرجال األمن الرقمي

% 60, فإن أكثر من 2015في تقرير OWASPمن المؤسسات تعتمد على

Top 10في تأمين الثغرات التي لديها

Page 22: Introduction to application security (Arabic)

OWASP top 10 ثغرات 10أهم 1. Injection: any data that will pass to a parser/interpreter is susceptible to this

threat, SQL, LDAP, XML, …2. Broken Authentication and Session Management3. Cross-Site Scripting (XSS): inject script in web page

1. The most popular security flaw4. Insecure Direct Object References: ability to access protected resources will id

in url without authorization5. Security Misconfiguration: default settings are insecure, unused services, over-

privileged accounts, …6. Sensitive Data Exposure: no or weak encryption7. Missing Function Level Access Control: Anonymous users could access private

functions that aren’t protected by simply change the URL8. Cross-Site Request Forgery (CSRF): use hijacked cookies to send forget مزور

requests to the application9. Using Components with Known Vulnerabilities: obsolete Adobe Flash version?10. Unvalidated Redirects and Forwards: Attacker links to unvalidated redirect and

tricks victims into clicking it. Victims are more likely to click on it, since the link is to a valid site. Attacker targets unsafe forward to bypass security checks.

Page 23: Introduction to application security (Arabic)

أخطر و أشهر و أسهل ثغرة SQLبالتفصيل ...

Injection

Page 24: Introduction to application security (Arabic)

ماذا بعد؟o oفحص البرامج و قفل ثغرة الSQL

Injection

Page 25: Introduction to application security (Arabic)

حد عنده سؤال؟

Page 26: Introduction to application security (Arabic)

شكرا جزيال...