1 / 23

模型检测原理

模型检测原理. 报告人:许团. Outline. ⦁ 摘要 ⦁ 研究背景 ⦁ 技术框架 ⦁ 方法特点 ⦁ 方法实现 ⦁ 总结. 摘要. □ 模型检测是一种基于有限状态模型检验程序安全特性的技术,程序被抽象为状态转换系统,相关安全属性规范被描述成命题时态逻辑公式,检测过程就是对模型的状态空间进行穷尽搜索。. Outline. ⦁ 摘要 ⦁ 研究背景 ⦁ 技术框架 ⦁ 方法特点 ⦁ 方法实现 ⦁ 总结. 研究背景. □ 软件安全研究方法与软件系统发展之间关系. 研究背景.

jett
Download Presentation

模型检测原理

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 模型检测原理 报告人:许团

  2. Outline ⦁摘要 ⦁研究背景 ⦁技术框架 ⦁方法特点 ⦁方法实现 ⦁总结

  3. 摘要 □模型检测是一种基于有限状态模型检验程序安全特性的技术,程序被抽象为状态转换系统,相关安全属性规范被描述成命题时态逻辑公式,检测过程就是对模型的状态空间进行穷尽搜索。

  4. Outline ⦁摘要 ⦁研究背景 ⦁技术框架 ⦁方法特点 ⦁方法实现 ⦁总结

  5. 研究背景 • □ 软件安全研究方法与软件系统发展之间关系

  6. 研究背景 • □ Clarke和Emerson提出了有穷状态并发系统的模型检验(model checking)方法 • ⦁时态逻辑 • ⦁ 穷尽搜索 • ⦁ 数学抽象

  7. Outline ⦁摘要 ⦁研究背景 ⦁技术框架 ⦁方法特点 ⦁方法实现 ⦁总结

  8. 技术框架 • □ 模型检查方法主要内容 • ⦁ 软件提取需要验证的属性规范 • ⦁ 对程序系统及其属性进行抽象 • ⦁ 根据抽象结果构建程序的模型 • ⦁ 检测系统模型满足安全规范情况 • ⦁ 对检测结果进行精细化验证分析

  9. Outline ⦁摘要 ⦁研究背景 ⦁技术框架 ⦁方法特点 ⦁方法实现 ⦁总结

  10. 方法特点 • □应用数学方法验证软件系统的安全属性 • ⦁程序属性的抽象层次较高 • −模态/时序逻辑,化简具体操作等 • ⦁自动化程度高 • −属性规范,终止性,验证信息等 • ⦁方法存在不足 • −状态空间爆炸,抽象存在误差

  11. Outline ⦁摘要 ⦁研究背景 ⦁技术框架 ⦁方法特点 ⦁方法实现 ⦁总结

  12. 方法实现 • □程序基本模型为转换系统(Transition System),通常表示为Kripke五元组结构 • ⦁M = (S, s0, Ʃ, △, L) • −s0S, △⊆S*Ʃ*S, L: S→2AP • ⦁自动机五元组(S, s0, L, T, F) • −s0S, T⊆ (S×L×S), • −ɛ L, tS (s, ɛ, t) T,

  13. 抽象建模 程序代码 程序代码 抽象 系统建模语言表示 时序模型 变换 时序模型 漏洞检测 程序漏洞 方法实现 □程序模型检查包括三个阶段 □抽象建模包括以下步骤

  14. 示例程序 mtype = { P, C }; mtype turn = P; active proctype producer() { do :: (turn == P) -> printf("Produce\n"); turn = C od } active proctype consumer() { wait: if :: (turn == C) -> printf("Consume\n"); turn = P; goto wait :: else -> break fi } PROMELA程序 enum Name = { P, C, R}; Name turn = Name.P, result = Name.C; void producer() { do{ printf("Produce\n"); turn = Name.C; }while(turn == Name.P) } void consumer() { do{ printf("Consume\n"); turn = Name.P; }while(turn == Name.C) do{ result = Name. R; }while(result == Name. C) } 生产和消费者C程序

  15. 时序模型构建 state_1: if :: (!p) || (q) -> goto state_1 :: (1) -> goto state_2 fi; state_2: if :: (1) -> goto state_2 :: (q) -> goto state_1 fi; PROMELA程序段 □( p→ ◇q )

  16. 系统状态空间 1 bool wantP = false, wantQ = false; 2 3 active proctype P() { 4 do :: wantP = true; 5 !wantQ; 6 wantP = false 7 od 8 } 9 10 active proctype Q() { 11 do :: wantQ = true; 12 !wantP; 13 wantQ = false 14 od 15 }

  17. 属性描述 • □设定的安全属性转换为时序逻辑公式的形式化表示形式 • ⦁ • ⦁为提高验证效率,对安全属性取非:¬ϕ • 例如ϕ :程序执行过程中,如果具有属性 p 的程序状态得到执行,那么具有属性 q 的状态一定会得到执行,并且在此期间 p 状态始终保持为真。 • 则¬ϕ对应的时序逻辑公式为

  18. 属性描述 never { S0: do :: p && !q -> break :: true od; S1: accept: do :: !q :: !(p || q) -> break od } 描述¬ϕ规则声明

  19. 程序漏洞检查 • □遍历系统可达状态图 • ⦁将时序模型M表示为自动机AM; • ⦁转换公式 𝜑 为自动机Af; • ⦁搜索AM状态空间,测试是否包含Af; • ⦁若 ,则 M ⊨ 𝜑,存在漏洞。

  20. Outline ⦁摘要 ⦁研究背景 ⦁技术框架 ⦁方法特点 ⦁方法实现 ⦁总结

  21. 总结 □首先介绍了模型检测的研究背景,其次阐述其技术框架和特点,然后分析了该方法的实现过程,最后给出实例。

More Related