4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 1
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 2
For an in-depth understanding of use case issues, it is a good idea to refer to
the book provided by the Founder of Use Cases, Jacobson.
https://www.ivarjacobson.com/sites/default/files/field_iji_file/article/use-case_2_0_jan11.pdf
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 3
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 4
Use Case View?
Captures system functionality as seen by users Built in early stages of development Developed
by analysts and domain experts System behavior, that is what functionality it must provide, is
documented in a use case model.
Use Case Model illustrates the system’s intended functions (use cases), its
surroundings (actors), and relationships between the use cases and actors (use
case diagrams)
High level architecture
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 5
 Actor ?
 An actor is a person, organization, or external
system that plays a role in one or more
interactions with your system. Actors are
drawn as stick figures.
 Orderer - someone who places an order to buy.
• Warehouse Office Clerk is to assist in
performing the daily administrative
and organizational functions of the
warehouse office.
o Warehouse Clerk is responsible for
ensuring that products are registered and
packed correctly for shipping or storage.
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 6
Use Case ?
A use case is a list of actions or event steps typically defining
the interactions between a role (known in the Unified Modeling
Language (UML) as an actor) and a system to achieve a goal.
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 7
1. Association:
 A relationship that represents communication between an actor and a use
case; can be navigable in both ways or in only one way.
2. Uses (includes) and extends are two types of relationships between use cases.
•An extends relationship is used to show:
- Optional behavior
- Behavior that is only run under certain conditions,
- Different flows which may be run based on actor selection
•A uses of includes relationship is used to show:
- functionality shared by multiple use cases.
- can be placed in a separate use case, related to these uses cases by a
uses relationship
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 8
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 9
1. Kinds:
“Withdraw Cash” is a kind of “Bank ATM Transaction”.
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 10
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 11
1. The application will record and maintain the product quantity in the
stock in the central database.
2. The storekeeper can remove products from the database.
3. The storekeeper can add products into the database.
4. The storekeeper can change the product quantity in the database.
5. The cashier can bill the item by manually entering the bar code or
with a bar code reader.
6. Only the products recorded in the database can be billed.
7. The billed items can be removed from the bill until it has been closed.
 The retail support application requirements.
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 12
8. The billed item removal must be approved by a store manager by
entering his authentication data.
9. The billed items will be printed on the cash desk bill as they are
entered. The bill will consist of the store name, billed items,
information on removed billed items, the total amount of money to
be paid, and date and time.
10. The product price can be entered or modified only by a properly
authenticated store manager.
 The retail support application requirements.
 Consider each use case as a capability to cover one or more requirements
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 13
 Consider each use case as a capability to cover one or more requirements
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 14
.‫سطح‬ ‫باالترين‬ ‫در‬ ‫دبيرخانه‬ ‫سيستم‬ ‫استفاده‬ ‫موردهاي‬ ‫ديدگاه‬
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 15
2.‫سيست‬ ‫برای‬ ‫استفاده‬ ‫موردهاي‬ ‫ديدگاه‬ ‫از‬ ‫معماری‬
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 163.‫وارده‬ ‫هاي‬‫نامه‬ ‫سرويسهاي‬ ‫بسته‬ ‫براي‬ ‫استفاده‬ ‫موردهاي‬ ‫ديدگاه‬
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 17
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 18
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 19
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 20
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 21
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 22
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 23
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 24
• Each use case is documented with a flow of events, use-case scenario,
which is a description of the events needed to accomplish the required
behavior.
• The scenario is written in the language of the domain and describe what
the system should do and not how the system does it.
• The flow of events should include:
-When and how the use case starts and ends
-What interaction the use case has with the actors
-What data is needed by the use case
-The normal sequence of events for the use case
-The description of any alternate or exceptional flows
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 25
 X Flow of Events for the Use Case
 X.1 Preconditions & Postconditions
 X.2 Main Flow
 X.3 Subflows (if applicable)
 X.4 Alternative Flows
 Where X is a number from 1 to the number of use cases
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 26
• Main flow of events:
(E1) The use case starts when the system prompts the User for a PIN
number. The User can now enter a
PIN number via the keypad.
(E2) The User commits the entry by pressing the Enter button.
(E3) The system then checks this PIN number to see if it is valid. If the
PIN number is valid, the system acknowledges the entry, thus
ending the use case.
• Subflows:
S1: The system invokes Validate use case.
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 27
• Alternative flow of events:
E1: The User can clear a PIN number any time before committing it and
reenter a new PIN number.
E2: The User can cancel a transaction at any time by pressing the Cancel
button, thus restarting the use
case. No changes are made to the User’s account.
E3: If the User enters an invalid PIN number, the use case restarts. If this
happens three times in a row, the
system cancels the entire transaction, preventing the User from
interacting with the ATM for 30
minutes.
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 28
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 29
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 30
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 31
Web Customer actor uses some web site to make purchases
online.
Top level use cases are View Items, Make
Purchase and Client Register.
View Items use case could be used by customer as top level use case
if customer only wants to find and see some products. This use case
could also be used as a part of Make Purchase use case.
Client Register use case allows customer to register on the web site,
for example to get some coupons or be invited to private sales.
Note, that
Checkout use case is included use case not available by itself -
checkout is part of making purchase.
4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
32
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 33
• View Items use case is extended by several optional use cases -
customer may search for items, browse catalog, view items
recommended for him/her, add items to shopping cart or wish list.
• All these use cases are extending use cases because they provide some
optional functions allowing customer to find item.
• Customer Authentication use case is included in view
Recommended Items and Add to Wish List because both
require the customer to be authenticated.
• At the same time, item could be added to the shopping cart without
user authentication.
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 34
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 35
• Checkout use case includes several required uses cases.
• Web customer should be authenticated. It could be done through
user login page, user authentication cookie ("Remember me") or
Single Sign-On (SSO).
• Web site authentication service is used in all these use cases, while
SSO also requires participation of external identity provider.
• Checkout use case also includes Payment use case which could be
done either by using credit card and external credit payment service
or with PayPal.
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 36
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 37
Main functional flow of an online shopping system
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 38
 An example of high level sequence
diagram for online bookshop. Online
customer can search book catalog,
view description of a selected book,
add book to shopping cart, do
checkout
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 39
Each customer has unique id, linked to one account.
Account owns shopping cart and orders.
Customer could register as a web user to buy items online.
Customer could purchases by phone or by ordering from catalogues.
Web user has login name which also serves as unique id.
Web user could be in several states - new, active, temporary blocked,
or banned, and be linked to a shopping cart.
Shopping cart belongs to account.
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 40
Account owns customer orders. Customer may have no orders.
Each order could refer to several payments, possibly none.
Every payment has unique id and is related to exactly one account.
Both order and shopping cart have line items linked to a specific
product.
Each line item is related to exactly one product. A product could be
associated to many line items or no item at all.
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 41
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 42
• As shown in the next slide, the webStore subsystem contains three components:
Search Engine, Shopping Cart, and Authentication.
• Search Engine component allows to search or browse items by exposing provided
interface Product Search and uses required interface
• Search Inventory provided by Inventory component.
• Shopping Cart component uses Manage Orders interface provided by Orders
component during checkout.
• Warehouses subsystem provides two interfaces Search Inventory and Manage
Inventory used by other subsystems and wired through dependencies.
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 43
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 44
 UML Deployment Diagram Example
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 45
• Package diagrams depict the organization of model elements into Packages
and the dependencies amongst them, including Package imports and
Package extensions. They also provide a visualization of the corresponding
namespaces.
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 46
The Nesting connector between ConnSeq and
Controller reflects what the Package contents
reveal. The Package contents can be listed by
clicking on the diagram background to
display the diagram's 'Properties' dialog,
selecting the 'Elements' tab and selecting the
'Package Contents' checkbox in the 'Show
Compartments' panel
The «import» connector indicates that the elements within the
target Integer Package, which in this example is the single Class
Integer, have been imported into the Package Controller
If an element already exists within GenApply, such as Loader
and Time, these elements' definitions are expanded by those
included in the Package Controller. All elements added or
updated by the merge are noted by a generalization
relationship back to that Package.
iCloud
S. Parsa (www.parsa.iust.ac.ir) 47
‫ان‬‫ر‬‫ای‬‫صنعت‬ ‫و‬ ‫دانشگاهعلم‬
‫کامپیوتر‬ ‫مهندسی‬ ‫دانشکده‬
‫موضوع‬:
‫ار‬‫ز‬‫اف‬‫نرم‬ ‫توسعه‬ ‫امن‬‫حیات‬‫چرخه‬
‫دهنده‬ ‫ارایه‬:‫پارسا‬ ‫سعید‬
‫بهار‬1395
4/21/2020
1-1‫هدف‬
‫امنيت‬ ‫تضمين‬
48
‫الف‬-‫محرمانگی‬
(Confidentiality):‫تعيين‬
‫محدوده‬‫دسترسی‬‫برای‬
‫کاربرهای‬‫مجاز‬‫و‬‫ممانعت‬
‫از‬‫دسترسی‬‫کاربرهای‬‫غير‬
‫مجاز‬
‫ب‬-‫يکپارچگی‬(Integrity):
‫قابليت‬‫اطمينان‬‫در‬‫مورد‬
‫عدم‬‫تغيير‬‫نامناسب‬‫و‬
‫غيرمجاز‬‫منابع‬‫اطالعاتی‬‫و‬
‫داده‬‫ها‬
‫سوال‬
‫اين‬ ‫به‬ ‫حيات‬ ‫چرخه‬ ‫طی‬ ‫در‬ ‫توان‬ ‫می‬ ‫چگونه‬
‫؟‬ ‫يافت‬ ‫دست‬ ‫اهداف‬
4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
494
9
1-2‫چرخه‬‫حيات‬‫توليد‬
‫نرم‬‫افزار‬‫امن‬
4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
‫تولی‬ ‫حیات‬‫چرخه‬‫د‬
‫امن‬‫افزار‬‫نرم‬
50
4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
‫نيازها‬ ‫تعيين‬
‫مای‬ ‫آغااز‬ ‫نيازها‬ ‫تعيين‬ ‫با‬ ‫افزار‬ ‫نرم‬ ‫توليد‬ ‫فرايند‬
‫شود‬.‫ذيال‬ ‫منبع‬ ‫چهار‬ ‫از‬ ‫امنيتی‬ ‫نيازهای‬ ‫تعيين‬ ‫برای‬
‫نمود‬ ‫استفاده‬ ‫توان‬ ‫می‬ ‫کلی‬ ‫حالت‬ ‫در‬:
1-‫نيازهای‬ ‫برای‬ ‫کيفی‬ ‫نيازهای‬ ‫قالب‬ ‫در‬ ‫امنيت‬
‫عملياتی‬
2-‫عملياتی‬ ‫نيازهای‬ ‫قالب‬ ‫در‬ ‫امنيت‬
3-‫کاربرها‬ ‫روايات‬
4-‫استفاده‬ ‫سوی‬ ‫موردهای‬
514/21/2020 S. Parsa (www.parsa.iust.ac.ir)
‫استفاده‬ ‫سوی‬ ‫موردهای‬
‫دهاد‬‫مي‬ ‫پاسخ‬ ‫سئوال‬ ‫اين‬ ‫به‬ ‫استفاده‬ ‫مورد‬
‫كااري‬ ‫چه‬ ‫واقعي‬ ‫كاربر‬ ‫يك‬ ‫براي‬ ‫سيستم‬ ‫كه‬
‫دهد‬ ‫انجام‬ ‫بايد‬.
‫اساتفاده‬ ‫موردا‬ ‫مخالف‬ ‫استفاده‬ ‫سوء‬ ‫مورد‬
‫ياا‬ ‫و‬ ‫سيساتم‬ ‫كاه‬ ‫اسات‬ ‫رفتااري‬ ‫توضيح‬ ‫و‬
‫آن‬ ‫خواهناد‬‫نمي‬ ‫سيستم‬ ‫هاي‬‫موجوديت‬‫رفتاار‬
‫شود‬ ‫انجام‬.
‫نمادها‬
•‫مهااجم‬ ‫با‬ ‫ارتباط‬ ‫در‬ ‫استفاده‬ ‫سوء‬ ‫مورد‬
‫پذيری‬ ‫آسيب‬ ‫يک‬ ‫داخلی‬
•‫ياک‬ ‫پاذيری‬ ‫آسيب‬ ‫با‬ ‫داخلی‬ ‫مهاجم‬ ‫رابطه‬
‫اکسپلويت‬
•‫مهااجم‬ ‫با‬ ‫ارتباط‬ ‫در‬ ‫استفاده‬ ‫سوء‬ ‫مورد‬
‫تهديد‬ ‫يک‬ ‫بيرونی‬
55
"‫حفاظت‬‫کن‬‫اطالعات‬‫را‬"‫در‬‫واقع‬
‫مانع‬‫مورد‬‫سوی‬‫استفاده‬ً‫سرقت‬‫کن‬
‫اطالعات‬‫کارت‬‫اعتباری‬‫را‬"‫می‬
‫باشد‬.4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
565
6
‫چرخه‬‫حيات‬‫امن‬
‫مايکروسافت‬(SDL)
‫نیازها‬ ‫مهندسی‬
‫سازی‬ ‫پیاده‬
‫تحلیل‬
‫طراحی‬
‫پشتیبانی‬ ‫و‬ ‫نصب‬
‫کد‬ ‫مرور‬ ‫و‬ ‫بررسی‬
‫آزمون‬ ‫کارهای‬ ‫راه‬
‫محصول‬
Threat
Modeling
4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
‫تهديد‬ ‫مدلسازی‬
574/21/2020 S. Parsa (www.parsa.iust.ac.ir)
‫بدافزار‬ ‫رفتاری‬ ‫تحليل‬ ‫های‬‫مکانيزم‬
‫تهديد‬ ‫مدلسازی‬
58
1-‫ها‬ ‫دارايی‬ ‫و‬ ‫منابع‬ ‫تعيين‬
،‫کد‬ ،‫اطالعات‬ ،‫داده‬ ‫گونه‬ ‫هر‬ ‫شامل‬ ‫منابع‬
‫محافظت‬ ‫بايست‬ ‫می‬ ‫که‬ ‫است‬ ‫چيزی‬ ‫و‬ ‫سايت‬ ‫وب‬
‫شوند‬.
،‫است‬ ‫مهاجم‬ ‫عالقه‬ ‫مورد‬ ‫که‬ ‫چيزی‬ ‫آن‬ ‫هر‬
‫باشد‬ ‫می‬ ‫دارايی‬.‫ليست‬ ‫نمونه‬ ‫برای‬
‫باشد‬ ‫دارايی‬ ‫يک‬ ‫تواند‬ ‫می‬ ‫خود‬ ‫کارمندها‬.
‫های‬ ‫مدل‬ ‫از‬ ‫توان‬ ‫می‬BPMN‫دارايی‬ ‫تعيين‬ ‫برای‬
‫نمود‬ ‫استفاده‬ ‫ها‬.
‫توجه‬:‫تماس‬ ‫اطلالعات‬:‫ايميل‬ ‫و‬ ‫نام‬ ‫شامل‬
‫باشد‬ ‫می‬ ‫تماس‬ ‫جزييات‬ ‫و‬ ‫گيرنده‬ ‫تماس‬.
2-‫سيستم‬ ‫معماری‬ ‫از‬ ‫ای‬ ‫خالصه‬ ‫ايجاد‬
59
-‫ديدگاه‬ ‫از‬ ‫معماری‬ ‫تعيين‬
‫سوی‬ ‫و‬ ‫استفاده‬ ‫موردهای‬
‫استفاده‬
-‫و‬ ‫ها‬ ‫سيستم‬ ‫زير‬ ‫تعيين‬ ‫تعيين‬
‫دسترسی‬ ‫مجوزهای‬
3-‫سيستم‬ ‫تجزيه‬
-‫زير‬ ‫هر‬ ‫های‬ ‫خروجی‬ ‫و‬ ‫ها‬ ‫ورودی‬ ‫بررسی‬
‫آنها‬ ‫امنيت‬ ‫و‬ ‫سيستم‬
-‫و‬ ‫اجزا‬ ‫به‬ ‫سيستم‬ ‫زير‬ ‫هر‬ ‫تجزيه‬
‫برای‬ ‫مجاز‬ ‫های‬ ‫فراخواننده‬ ‫تعيين‬
‫هرجزء‬
-‫های‬ ‫پيام‬ ‫و‬ ‫ها‬ ‫داده‬ ‫جريان‬ ‫تعيين‬
‫اجزا‬ ‫بين‬ ‫شونده‬ ‫مبادله‬
-‫امنيتی‬ ‫پروفايل‬ ‫تعيين‬
4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
60
‫اساس‬ ‫بر‬ ‫زمانبندي‬ ‫بهبود‬ ‫و‬ ‫كار‬ ‫گراف‬ ‫زمانبندی‬ ‫پیش‬
‫بازی‬ ‫نظریه‬‫ها‬
60
3-‫تجزيه‬‫سيستم‬
‫امنيتی‬ ‫پروفايل‬ ‫تعيين‬:‫سيستم‬ ‫طراحی‬ ‫در‬ ‫مطرح‬ ‫سواالت‬
‫امن‬
‫مطمئن‬ ‫سرحدات‬ ‫نشست‬ ‫مديريت‬ ‫ورودی‬ ‫ارزيابی‬
‫ها‬ ‫داده‬ ‫جريان‬ ‫پنهان‬‫نگاری‬ ‫هويت‬ ‫تعيين‬
‫ورودی‬ ‫نقاط‬ ‫دستکاری‬
‫پارامترها‬
‫مجوز‬ ‫تعيين‬
‫امتياز‬ ‫با‬ ‫کد‬
‫ويژه‬
‫مديريت‬‫استثنا‬ ‫مديريت‬‫ترکيب‬
‫ثبت‬ ‫و‬ ‫مميزی‬
‫سابقه‬
‫حساس‬ ‫های‬ ‫داده‬
‫مطرح‬ ‫سوال‬ ‫نوع‬
‫بررسی‬
‫بطور‬ ‫هويت‬ ‫آيا‬‫ارسال‬ ‫شبکه‬ ‫در‬ ‫امن‬
‫؟‬ ‫شود‬ ‫می‬
‫تعيين‬
‫هويت‬
‫را‬ ‫عبور‬ ‫کلمه‬ ‫و‬ ‫کاربری‬ ‫نام‬ ‫آيا‬‫می‬
‫توان‬‫حدس‬‫؟‬ ‫زد‬
‫قرار‬ ‫استفاده‬ ‫مورد‬ ‫سويه‬ ‫يک‬ ‫هش‬ ‫آيا‬
‫؟‬ ‫گرفته‬
‫هويت‬ ‫شناسايی‬ ‫اساس‬ ‫بر‬ ‫دسترسی‬ ‫آيا‬
‫؟‬ ‫شده‬ ‫بندی‬ ‫طبقه‬
‫مجوز‬
‫دسترسی‬
‫ميزان‬ ‫اساس‬ ‫بر‬ ‫ها‬ ‫داده‬ ‫آيا‬
‫؟‬ ‫اند‬ ‫شده‬ ‫بندی‬ ‫طبقه‬ ‫محرمانگی‬
‫پيشنهاد‬:‫سواالت‬ ‫به‬ ‫توجه‬
‫ليست‬ ‫چک‬ ‫در‬ ‫مطرح‬
‫سيستم‬ ‫امنيتی‬ ‫های‬
‫شود‬ ‫طراحی‬ ‫امن‬.
4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
4-‫تهديدات‬ ‫تعيين‬
61
،‫اما‬‫جهت‬‫شناسايی‬
‫تهديدات‬‫نياز‬‫به‬‫دانش‬
‫انواع‬‫آسيب‬‫پذيری‬‫ها‬‫و‬
‫حمالت‬‫است‬.‫آسيب‬‫پذيری‬
‫و‬‫انواع‬‫آن‬‫؟‬
4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
6262
‫تهديدهای‬‫يک‬‫سيستم‬‫ا‬‫معموال‬‫به‬‫شش‬‫دسته‬‫کلی‬
‫تحت‬‫عنوان‬STRIDE‫تقسيم‬‫می‬‫شوند‬‫که‬
‫بترتيب‬‫عبارتند‬‫از‬:
1.‫جعل‬‫هويت‬Spoofing identity
‫در‬‫يك‬‫تهديد‬‫جعل‬،‫هويت‬‫عامل‬‫تهديد‬
‫خودش‬‫را‬‫يك‬‫كاربر‬‫مشروع‬‫سيستم‬‫جا‬
‫زند‬‫مي‬.
2.‫دستکاری‬‫داده‬‫ها‬Tampering with data
‫يك‬‫سيستم‬‫هر‬‫داده‬‫ورودي‬‫را‬‫قبل‬‫از‬
‫ذخيره‬‫و‬‫يا‬‫استفاده‬‫براي‬‫پردازش‬‫آنرا‬
‫اعتبار‬‫سنجي‬‫كند‬‫مي‬.
‫ها‬‫داده‬‫در‬‫هر‬‫رسانه‬‫ذخيره‬‫سازي‬‫محافظت‬
‫شود‬‫مي‬.
‫عامل‬‫تهديد‬‫نبايد‬‫بتواند‬‫ها‬‫داده‬‫را‬
4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
63
4‫افشاي‬‫اطالعات‬-Information disclosure
.1‫يك‬‫سيستم‬‫بايد‬‫كنترل‬‫قوي‬‫براي‬‫جلوگيري‬
‫از‬‫افشاي‬‫اطالعات‬‫داشته‬‫باشد‬.
5.‫انکار‬‫سرويس‬-DoS
‫طراح‬‫سيستم‬‫از‬‫موضوعات‬‫سيستم‬‫خود‬‫كه‬
‫ممكن‬‫است‬‫مورد‬‫حمله‬DoS‫قرار‬‫گيرد‬‫بايد‬
‫آگاه‬‫باشد‬‫و‬‫اقدامات‬‫متقابل‬‫را‬‫در‬
‫سيستم‬‫سازي‬‫پياده‬‫كند‬.
6.‫افزايش‬‫حق‬‫امتياز‬–Elevation of privilege
‫در‬‫يك‬‫سيستم‬‫نقش‬‫كاربر‬‫و‬‫نقش‬‫مدير‬
‫سيستم‬‫بايد‬‫جدا‬‫باشد‬.
-‫از‬‫عدم‬‫امكان‬‫افزايش‬‫مجوز‬‫كاربر‬‫بايد‬
‫مطمئن‬‫شد‬.
4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
‫توجه‬:
‫تايی‬ ‫شش‬ ‫مجموعه‬Stride‫آسيب‬ ‫کليت‬ ‫بيانگر‬
‫هستند‬ ‫ها‬ ‫پذيری‬.
‫تهديدات‬ ‫مدل‬ ‫ها‬ ‫پذيری‬ ‫آسيب‬ ‫به‬ ‫توجه‬ ‫با‬
‫شود‬ ‫می‬ ‫ايجاد‬.
4/21/2020 S. Parsa (www.parsa.iust.ac.ir) 64
‫تهديد‬ ‫درخت‬ ‫از‬ ‫ای‬ ‫نمونه‬
65
‫اطالعات‬ ‫به‬ ‫دسترسی‬
‫کاربر‬ ‫شخصی‬
1
‫دسترسی‬
‫مستقيم‬
‫پايگاه‬ ‫به‬
‫ها‬ ‫داده‬
1.1
Login‫در‬
‫قالب‬
‫کاربر‬
‫نظر‬ ‫مورد‬
1.2
‫ربودن‬
‫يا‬ ‫نشست‬
Session
‫کاربر‬
1.3
‫داده‬ ‫قطع‬
‫های‬
‫شخصی‬
1.4
‫بهره‬
‫برداری‬
‫يک‬ ‫از‬
‫منفذ‬
1.1.1
Login
‫وحشيانه‬
‫يا‬brute-
force
1.2.1
‫ربودن‬
‫کوکی‬
‫نشست‬
‫کاربر‬
1.3.1
‫تعيين‬
‫اتصال‬
‫آغازين‬
‫کاربر‬
1.4.1
‫سرقت‬
‫اعتبار‬
‫کاربر‬
1.2.2
‫شبکه‬ ‫شنود‬
‫برای‬
‫داده‬‫های‬
‫شخصی‬
1.4.1
‫تعيين‬
‫کلمه‬
‫عبور‬
‫کاربر‬
1.2.1.2
‫تعيين‬
‫نام‬
‫کاربر‬
1.2.1.1
and
‫تهديد‬ ‫اصلی‬ ‫هدف‬ ‫درخت‬ ‫ريشه‬ ‫در‬
‫طريقی‬ ‫کدام‬ ‫هر‬ ‫ريشه‬ ‫فرزندان‬
‫هدف‬ ‫به‬ ‫رسيدن‬ ‫برای‬ ‫متفاوت‬
‫درخت‬‫تهديد‬‫فوق‬‫به‬‫صورت‬‫ذيل‬‫نيز‬‫مشخص‬‫می‬‫ش‬‫ود‬:
.1‫دسترسی‬‫به‬‫اطالعات‬‫شخصی‬‫کاربر‬
Or1.1‫دسترسی‬‫مستقيم‬‫به‬‫پايگاه‬‫داده‬
‫ها‬
1.2login‫درقالب‬‫کاربر‬‫مورد‬‫نظر‬
or1.2.1login‫وحشيانه‬‫يا‬brute-
force
and1.2.1.1‫تعيين‬‫نام‬‫کاربر‬‫يا‬
user name
1.2.1.2‫تعيين‬‫کلمه‬‫عبور‬
1.2.2‫سرقت‬‫اعتبار‬‫کاربر‬
1.3‫ربودن‬‫نشست‬‫يا‬session‫کاربر‬
1.3.1‫ربودن‬‫کوکی‬‫نشست‬‫کاربر‬
1.4‫قطع‬‫داده‬‫های‬‫شخصی‬
or1.4.1‫تعيين‬‫اتصال‬‫آغازين‬‫کاربر‬
1.4.2‫شنود‬‫شبکه‬‫برای‬‫داده‬‫های‬4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
66
‫اطالعات‬ ‫به‬ ‫دسترسی‬
‫کاربر‬ ‫شخصی‬
1
‫دسترسی‬
‫مستقيم‬
‫پايگاه‬ ‫به‬
‫ها‬ ‫داده‬
1.1
Login‫در‬
‫قالب‬
‫مورد‬ ‫کاربر‬
‫نظر‬
1.2
‫نشست‬ ‫ربودن‬
‫يا‬
Session
‫کاربر‬
1.3
‫داده‬ ‫قطع‬
‫های‬
‫شخصی‬
1.4
‫بهره‬
‫برداری‬
‫يک‬ ‫از‬
‫منفذ‬
1.1.1
Login‫با‬
‫فشار‬
‫يا‬brute-
force
1.2.1
‫ربودن‬
‫کوکی‬
‫نشست‬
‫کاربر‬
1.3.1
‫تعيين‬
‫اتصال‬
‫آغازين‬
‫کاربر‬
1.4.1
‫سرقت‬
‫اعتبار‬
‫کاربر‬
1.2.2
‫شبکه‬ ‫شنود‬
‫برای‬
‫داده‬‫های‬
‫شخصی‬
1.4.1
‫تعيين‬
‫کلمه‬
‫عبور‬
‫کاربر‬
1.2.1.2
‫تعيين‬
‫نام‬
‫کاربر‬
1.2.1.1
‫بروز‬
‫رسانی‬
‫يا‬ ‫وصله‬
patch
‫به‬ ‫نياز‬
HTTPS
‫به‬ ‫نياز‬
HTTPS
and
and
‫مشخص‬‫نمودن‬‫هر‬‫گونه‬‫تمهيداتی‬‫برای‬‫مقابله‬
‫با‬‫تهديد‬‫يا‬‫به‬‫عبارت‬‫ديگر‬‫سبک‬‫کردن‬
‫تهديد‬‫ها‬‫در‬‫داخل‬‫درخت‬‫حمله‬:
4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
6.‫ريسک‬ ‫تعيين‬
67
1-‫پتانسيل‬‫صدمه‬:‫در‬‫صورتی‬‫که‬‫تهديد‬‫با‬‫موفقيت‬
‫مورد‬‫بهره‬‫برداری‬‫قرار‬‫گيرد‬‫سختی‬‫بازگشت‬‫چيست‬.
2-‫قابليت‬‫تکثير‬:‫ميزان‬‫سهولت‬‫ايجاد‬‫مجدد‬‫حمله‬
‫حاصل‬‫از‬‫تهديد‬‫چقدر‬‫است‬.
3-‫بهره‬‫برداری‬:‫ميزان‬‫سهولت‬‫انجام‬‫حمله‬‫حاصل‬
‫از‬‫تهديد‬‫چقدر‬‫است‬.
4-‫کاربرهای‬‫تحت‬‫تاثير‬:‫در‬‫صورت‬‫موفقيت‬‫حمله‬‫چه‬
‫تعداد‬‫کاربر‬‫تحت‬‫تاثير‬‫قرار‬‫می‬‫گيرند‬‫و‬‫تا‬‫چه‬
‫حدی‬‫آن‬‫کاربرها‬‫مهم‬‫هستند‬.
5-‫قابليت‬‫کشف‬:‫تا‬‫چه‬‫حدی‬‫تشخيص‬‫آسيب‬‫پذيری‬
‫ساده‬‫است‬.
5/(‫جمع‬‫فاکتورهای‬1‫تا‬5)=
‫ريسک‬(‫تهديد‬)4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
7.‫تهديدها‬ ‫سازی‬ ‫مستند‬
68
‫تهديد‬:login‫با‬‫فشار‬‫يا‬‫بروت‬-‫فورس‬
‫مولفه‬‫تحت‬‫تاثير‬:‫قطعه‬‫يا‬‫مولفه‬login
‫برنامه‬‫تحت‬‫وب‬
‫شرح‬:‫کاربر‬‫می‬‫تواند‬‫با‬،‫آزمون‬‫کلمه‬‫عبور‬‫و‬
‫نام‬‫کاربری‬‫پس‬‫از‬‫چند‬‫مرتبه‬‫تالش‬‫بدست‬‫آورد‬.
‫نتيجه‬:‫دسترسی‬‫غيرمجاز‬‫کالينت‬‫ها‬‫از‬‫طريق‬
‫نام‬‫کاربری‬‫و‬‫کلمه‬‫عبور‬‫سرقت‬‫شده‬.
‫روش‬‫مقابله‬:‫پيام‬‫خطا‬‫که‬‫غير‬‫قابل‬‫فهم‬‫برای‬
‫مهاجم‬‫است‬‫داده‬‫و‬‫ثبت‬‫شود‬‫و‬‫عالوه‬‫بر‬‫اين‬‫پس‬
‫از‬‫چند‬‫بار‬‫تالش‬‫ناموفق‬‫برای‬‫ورود‬‫به‬‫سيستم‬
‫نام‬‫کاربر‬‫و‬‫کلمه‬‫عبور‬‫قفل‬‫شوند‬.
‫ريسک‬:1.
‫پتانسيل‬‫صدمه‬:6
2.‫قابليت‬‫ايجاد‬‫مجدد‬:8
3.‫قابليت‬‫بهره‬‫برداری‬:4
4.‫کاربرهای‬‫تخت‬‫تاثير‬:5
4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
‫سوال‬
‫ای‬‫امن‬‫کد‬ ‫توان‬ ‫می‬ ‫چگونه‬‫جاد‬
‫کرد؟‬
‫سال‬ ‫بهار‬1395
Second Page
‫امن‬ ‫نويسی‬ ‫برنامه‬ ‫اصول‬
714/21/2020 S. Parsa (www.parsa.iust.ac.ir)
‫امن‬ ‫نويسی‬ ‫برنامه‬ ‫اصول‬
72
1-‫حمله‬ ‫سطح‬ ‫حداقل‬
2-‫سيستم‬ ‫ساير‬ ‫ايمني‬ ‫عدم‬ ‫بر‬ ‫فرض‬‫ها‬
3-‫خطا‬ ‫پذيري‬ ‫تحمل‬
4-‫دسترسي‬ ‫امکان‬ ‫حداقل‬
5-‫کد‬ ‫و‬ ‫داده‬ ‫ادغام‬ ‫امکان‬ ‫عدم‬
6-‫ها‬ ‫مسئوليت‬ ‫مناسب‬ ‫توزيع‬
4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
73
1-‫حمله‬ ‫سطح‬ ‫حداقل‬
2-‫ايمني‬ ‫عدم‬ ‫بر‬ ‫فرض‬
‫سيستم‬ ‫ساير‬‫ها‬
3-‫خطا‬ ‫پذيري‬ ‫تحمل‬
4-‫دسترسي‬ ‫امکان‬ ‫حداقل‬
5-‫ادغام‬ ‫امکان‬ ‫عدم‬
‫کد‬ ‫و‬ ‫داده‬
6-‫اليه‬ ‫چند‬ ‫دفاع‬
‫حمالتي‬‫مثل‬‫تزريق‬‫کد‬‫بواسطه‬‫ادغام‬
‫اسکريپت‬‫با‬‫آدرس‬‫و‬‫درخواستهاي‬‫وب‬
‫امکان‬‫پذير‬‫شده‬‫است‬.‫ادغام‬‫اسکريپت‬‫با‬
‫پست‬‫الکترونيک‬‫نيز‬‫امکان‬‫حمله‬‫را‬‫از‬
‫اين‬‫طريق‬‫بوجود‬‫آورده‬‫است‬.
‫چند‬‫نمونه‬:
1-‫حمالت‬‫تزريق‬‫کد‬‫و‬‫تزريق‬‫اسکيوال‬
2-‫ارسال‬‫اسکريپت‬‫از‬‫طريق‬‫پست‬
‫الکترونيک‬
3-‫ادغام‬‫اسکريپت‬‫در‬‫تصاوير‬
4-‫مکروهای‬WORD
-‫مفسرها‬‫قابلبت‬‫تبديل‬‫داده‬‫به‬‫کد‬
‫اجرايی‬‫را‬‫در‬‫زمان‬‫اجرا‬‫دارند‬.
-‫داده‬‫اي‬‫که‬‫قابل‬‫اجرا‬‫باشد‬‫مي‬‫تواند‬
4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
74
‫عمده‬‫تهديدات‬‫امنيتی‬‫بواسطه‬‫آسيب‬‫پذيری‬‫زبان‬‫های‬
‫برنامه‬‫سازی‬‫است‬.
‫از‬‫ديدگاه‬‫امنيتی‬‫می‬‫بايست‬‫زبان‬‫برنامه‬‫سازی‬‫ای‬
‫انتخاب‬‫کرد‬‫که‬:
-‫نباشد‬ ‫توجه‬ ‫مورد‬
-‫باشد‬ ‫داشته‬ ‫را‬ ‫های‬ ‫پذيری‬ ‫آسيب‬ ‫حداقل‬.
‫سوال‬:‫؟‬ ‫چيست‬ ‫خطا‬ ‫با‬ ‫پذيری‬ ‫آسيب‬ ‫تفاوت‬
4/21/2020 S. Parsa (www.parsa.iust.ac.ir)
‫بدافزار‬ ‫رفتاری‬ ‫تحليل‬ ‫های‬‫مکانيزم‬
‫نیروه‬ ‫به‬ ‫هشدار‬‫ای‬
‫مسلح‬
By Kaspersky Lab on October 30, 2013. 2:44 am
1-‫زمانی‬‫که‬‫جاوا‬‫طراحی‬،‫شد‬‫درعمل‬‫حمالت‬‫از‬‫طريق‬
‫سوی‬‫استفاده‬‫از‬‫آسيب‬‫پذيری‬‫ها‬‫وجود‬‫نداشت‬.
2-‫استفاده‬‫بيش‬‫از‬‫حد‬‫از‬‫جاوا‬‫موجب‬‫توجه‬‫بيش‬‫از‬
‫حد‬‫مهاجمين‬‫و‬‫هکرها‬‫به‬‫اين‬‫زبان‬‫شده‬‫است‬.‫بنا‬‫بر‬
‫اظهارات‬‫اوراکل‬‫زبان‬‫جاوا‬‫مورد‬‫استفاده‬‫در‬‫بيش‬
‫از‬‫سه‬‫بيليون‬‫ابزار‬‫در‬‫سراسر‬‫جهان‬‫بوده‬‫است‬.
3-‫استفاده‬‫زياد‬‫از‬‫جاوا‬‫دليل‬‫آشکار‬‫شدن‬‫آسيب‬
‫نتايح‬‫بررسی‬‫های‬‫انجام‬‫شده‬
‫در‬‫مرکز‬‫تحقيقات‬‫کسپراسکی‬‫برای‬‫مدت‬12‫ماه‬‫از‬
‫سال‬2012‫تا‬2013‫در‬‫پاسخ‬‫به‬‫سوال‬:‫چرا‬‫آسيب‬
‫پذيری‬‫های‬‫جاوا‬‫به‬‫اين‬‫تعداد‬‫زياد‬‫هستند‬‫؟‬
‫بدافزار‬ ‫رفتاری‬ ‫تحليل‬ ‫های‬‫مکانيزم‬
The U.S. Department of Homeland Security warned that a
security update of Oracle Corp's Java software for Web
browsers does not do enough to protect computers from attack,
sticking to its previous advice that the program be disabled.
Technology | Mon Jan 14, 2013 4:16pm ESTRelated: TECH
U.S. says Java still risky, even after security update
BY JIM FINKLE
Java was responsible for 50 percent of all cyber attacks last
year in which hackers broke into computers by exploiting
software bugs, according to Kaspersky Lab (2012).
‫مرکز‬‫امنيتی‬‫هوملند‬‫آمريکا‬‫هشدار‬‫داد‬‫که‬
‫به‬‫روز‬‫رسانی‬‫و‬‫تصحيح‬‫جاوا‬‫توسط‬‫شرکت‬
‫اوراکل‬‫برای‬‫مرورگرهای‬‫وب‬‫نتيجه‬‫بخش‬‫نبوده‬
‫و‬‫نمی‬‫تواند‬‫مانع‬‫حمالت‬‫به‬‫سيستم‬‫های‬
‫کامپيوتری‬‫شود‬.
‫متخصصهای‬‫امنيت‬‫هشدار‬‫داده‬‫اند‬‫که‬
‫کامپيوترهای‬‫شخصی‬‫که‬‫در‬‫مرورگر‬‫خود‬‫جاوا‬
‫را‬‫به‬‫اجرا‬‫در‬‫می‬‫آورند‬‫ممکن‬‫است‬‫مورد‬
‫تهاجم‬‫مجرمين‬‫قرار‬‫گيرند‬.
‫بنا‬‫بر‬‫بيانيه‬‫کسپراسکی‬50%‫کليه‬‫حمالت‬
‫سايبری‬‫در‬‫سال‬،‫گذشته‬‫با‬‫ورود‬‫هکرها‬‫از‬
‫طريق‬‫آسيب‬‫پذيری‬‫های‬‫جاوا‬‫انجام‬‫شد‬
‫مسلح‬ ‫نیروهای‬ ‫به‬ ‫هشدار‬
‫بدافزار‬ ‫رفتاری‬ ‫تحليل‬ ‫های‬‫مکانيزم‬
The Web Just Became More Secure:
Google Drops Support for Java
Written by Matthew HughesSeptember 11, 2015
Ads by Google
It’s safe to say that Java – particularly in the browser – has lost
its shine. A large part of this is due to security concerns. The
next version of Google Chrome (version 45, scheduled for
December) has removed support for it entirely.
‫مسلح‬ ‫نیروهای‬ ‫به‬ ‫هشدار‬
Second Page

3-use-casemodelling

Editor's Notes

  • #37 n example of activity diagram for online shopping. Online customer can browse or search items, view specific item, add it to shopping cart, view and update shopping cart, checkout. User can view shopping cart at any time. Checkout is assumed to include user registration and login. This example does not use partitions, most of the actions are assumed to be fulfilled by online customer.
  • #38 n example of activity diagram for online shopping. Online customer can browse or search items, view specific item, add it to shopping cart, view and update shopping cart, checkout. User can view shopping cart at any time. Checkout is assumed to include user registration and login. This example does not use partitions, most of the actions are assumed to be fulfilled by online customer.
  • #45 An example of web application UML deployment diagram. Book club web application artifact book_club_app.war is deployed on Catalina Servlet 2.4 / JSP 2.0 Container which is part of Apache Tomcat 5.5 web server. The book_club_app.war artifact manifests (embodies) OnlineOrders component. The artifact contains three other artifacts, one of which manifests UserServices component. The Application Server «device» (computer server) has communication path to Database Server «device» (another server).
  • #50 امنیت نرم افزار به مفهوم مهندسی کردن نرم افزار به صورتی است که نرم افزارهای مورد نیاز ه صورت بی وقفه عمل نموده قادر یه کنترل تهدیدات امنیتی در هنگام حملات بدخواهای باشد. روش صحیح مهندسی نرم افزار این است که در مورد امنیت هم از آغاز چرخه حیات، اقدام شود. بر طبق تعریف اطمینان از نرم افزار یا سافتویر اشورنس میزان اطمینان از عدم آسیب پذیری نرم افزار می باشد. در شکل فوق جرخه حیات تولید نرم افزار امن مشخص شده است. این چرخه حیات ذاتاً تکراری است. اگر کمبودی بعداً برای مرحله ای مشاهده شود، باید به آن مرحله برگشت و کمبد را جبران گرد. برای نمونه اگر یک سیستم پنهان نگاری را ایجاد می کنید و بعداً مشاهده کنید که نیازهایی نادیده گرفته شده باید به مرحله تعیین نیاز بازگشت نمود و آن نیازها را بروزرسانی کرد.
  • #52 Before defining security requirements, security engineers need to identify those parts of the software system that requires security. These parts of the software system are called Target of Evaluation (TOE). Once TOE is identified then finding security functional requirements (SFR) for those parts becomes simple. [8] lists different set of classes depending on the nature of application. Different set of SFRs can be chosen for the required TOE. Once required SFRs are chosen, then table can be designed to monitor its implementation in required software application. SFRs are chosen to counter threats in TOE of software system. For example; if we are trying to gather SFR of a web application; Table 1 lists related SFR’s and their activity. There can be different TOE in a single software application; therefore different set of SFRs are collected for each TOE. Once the uncertain requirements are refined by SFR module, then we are ready to start designing our software. Design phase is important and requires more consideration in terms of security. Based on the information provided by analysis phase (Security Requirements by user stories and SFR) a threat model is developed. If security engineer feels some of the information is missing or some other security threats are possible then it goes back to analysis for the refinement of the security requirements. If security expert finds no problems, then a mitigation plan is designed to cater all those threats listed in threat model. Requirements engineering is the main building block for any software development. Security engineers try to elicit security requirements by different methods, e.g. user stories, abuse cases, etc. Most of the occasion requirements gathered from user stories and other sources are not well defined. These requirements can be refined by security functional requirements (SFR) module (Details are given in section ‘IV-A’).
  • #60 تعیین زیرسیستم ها و مجوزهای دسترسی به هر زیر سیستم – برای نمونه دسترسی به زیر سیستم مالی – تعیین نرم افزارها بر اساس میزان اضطرار
  • #61 Privileged Code When you design and build secure assemblies, be able to identify privileged code. This has important implications for code access security. Privileged code is managed code that accesses secured resources or performs other security sensitive operations such as calling unmanaged code, using serialization, or using reflection. It is referred to as privileged code because it must be granted permission by code access security policy to be able to function. Non-privileged code only requires the permission to execute. Auditing is the practice of inspecting logs for the purpose of verifying that the system is in a desirable state In software engineering, software configuration management (SCM) is the task of tracking and controlling changes in the software
  • #63 باید با توجه به شش دسته تهدیدات مدل تهدید را مشخص نمود.