Fortify自定义规则编写教程笔记(五):结构化规则与描述规则
一、结构化规则:
Structural Rules
(1)Predicate(谓词)语言
逻辑运算:and,or,not
正则匹配:matches
比较运算:<,>,<=,>=,==
实例: is (quality onsimple types)
存在: in
子规则:[]
(2)结构化属性
Value:
Type:
Construct:
CompilationUnit
Statement
SwitchCase
Expression
Declaration
CommentFile
Comment
(3)示例:
CatchBlock: emptyand
not exception.type.name =="java.lang.InterruptedException"
(4)语法树:
参考附件:structural-type-reference.rar中index.html
:
二、描述规则:
CharacterizationRules
(1)StructuralMatch
类似于structural rule中的predicate
(2)Definition
TaintSource( inxxx, {+SOME_FLAG} )
TaintEntrypoint( inxxx, {+SOME_FLAG1 +SOME_FLAG2} )
TaintSink( inxxx ,[ !SOME_FLAG1 && (SOME_FLAG2 || SOME_FLAG3)] )
TaintTransfer ( inxxx, outxxx , {+SOME_FLAG1 –SOME_FLAG2})
注意:Sink规则一定要有MetaInfo,VulnKingdom,VulnCategory,VulnSubcategory,Description属性
作者:陈辉军
- 点赞
- 收藏
- 关注作者
评论(0)