Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appshark扫描优化 #67

Open
nkbai opened this issue Nov 27, 2023 · 1 comment
Open

Appshark扫描优化 #67

nkbai opened this issue Nov 27, 2023 · 1 comment

Comments

@nkbai
Copy link
Collaborator

nkbai commented Nov 27, 2023

将appshark应用于devsecops流程时,不可避免的会出现同一个App的不同版本反复扫描的情况。 而这些app每一个版本之间的差异可能非常小,并且这些差异对于扫描结果也没有影响。
能否对此进行优化,避免重复的扫描以节省资源呢?

@nkbai
Copy link
Collaborator Author

nkbai commented Nov 27, 2023

基本思路

前置条件

  1. 针对App建立一个Base 数据库版本,然后这个Base 定期更新,比如每个月/季度集中更新一次。
  2. Base数据库中包含以下内容:
  • 为每一个类,函数建立的sha1
  • call graph 图
  • 所有规则匹配到的每一个TaintAnalyzer的内容(包含source,sink,影响到的method)
  • 每个TaintAnalyzer,不管有没有找到漏洞,对应的两张表,指针指向表和数据流表。

新的扫描过程

  1. 对于没有发生变化的函数,不做任何处理
  2. 如果发生变化的函数,包含了规则中的source,或sink。 则按照CHA,对所有相关函数开始从SSA,到entrymethod查找,指针分析,数据流分析重新来一遍。
  3. 如果发生变化的函数,影响到了上述数据库中的某个TaintAnalyzer中的数据流表中的某个函数,则有可能会导致本来连不上的数据流,连上。或者连上的数据流,断掉。 则对这个TaintAnayzer从入口开始相关的函数进行SSA,然后进行指针分析,数据流分析。
  4. 如果发生变化的函数,既不属于2,也不属于3,则忽略此种情况,认为不影响结果。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant