capta1n commited on
Commit
2860e80
·
verified ·
1 Parent(s): 0cbce5e

Add 2 files

Browse files
Files changed (2) hide show
  1. index.html +50 -69
  2. prompts.txt +2 -1
index.html CHANGED
@@ -2,7 +2,7 @@
2
  <html lang="zh-CN">
3
  <head>
4
  <meta charset="UTF-8">
5
- <meta name="viewport" content="https://cdn.tailwindcss.com">
6
  <title>AI SDL 数字分身 - 风险项目详情</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
@@ -61,7 +61,12 @@
61
 
62
  .mermaid {
63
  width: 100%;
64
- overflow: auto;
 
 
 
 
 
65
  }
66
 
67
  .risk-marker {
@@ -294,10 +299,12 @@
294
  <h4 class="font-medium text-gray-700 mb-2">STRIDE 威胁建模</h4>
295
  <div class="mermaid">
296
  graph LR
 
297
  A[用户认证] -->|Spoofing| B(冒充管理员)
298
  A -->|Tampering| C(篡改认证令牌)
299
  D[补贴审批] -->|Information Disclosure| E(查看他人申请)
300
  D -->|Elevation of Privilege| F(普通用户执行审批)
 
301
  style B fill:#fee2e2,stroke:#ef4444
302
  style E fill:#fee2e2,stroke:#ef4444
303
  style F fill:#fee2e2,stroke:#ef4444
@@ -1015,18 +1022,47 @@ Accept: application/json</code></pre>
1015
  </div>
1016
 
1017
  <script>
1018
- // Initialize Mermaid
1019
  mermaid.initialize({
1020
  startOnLoad: true,
1021
  theme: 'default',
1022
- flowchart: { useMaxWidth: true }
 
 
 
 
 
 
 
 
 
 
1023
  });
1024
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1025
  // Initialize Highlight.js
1026
  document.addEventListener('DOMContentLoaded', (event) => {
1027
  document.querySelectorAll('pre code').forEach((el) => {
1028
  hljs.highlightElement(el);
1029
  });
 
 
 
1030
  });
1031
 
1032
  // Switch tabs
@@ -1046,6 +1082,9 @@ Accept: application/json</code></pre>
1046
 
1047
  // Add active class to clicked tab
1048
  event.currentTarget.classList.add('active');
 
 
 
1049
  }
1050
 
1051
  // Highlight text in requirements
@@ -1055,10 +1094,13 @@ Accept: application/json</code></pre>
1055
  el.classList.remove('highlight-risk');
1056
  });
1057
 
1058
- const targetElements = document.querySelectorAll(`p:contains('${text}'), h4:contains('${text}')`);
1059
- targetElements.forEach(el => {
1060
- el.classList.add('highlight-risk');
1061
- el.scrollIntoView({ behavior: 'smooth', block: 'center' });
 
 
 
1062
  });
1063
  }
1064
 
@@ -1073,69 +1115,8 @@ Accept: application/json</code></pre>
1073
  if (targetElement) {
1074
  targetElement.classList.add('vulnerable-line-highlight');
1075
  targetElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
1076
-
1077
- // Show fix suggestion if available
1078
- const suggestion = targetElement.nextElementSibling;
1079
- if (suggestion && suggestion.classList.contains('fix-suggestion')) {
1080
- suggestion.style.display = 'block';
1081
-
1082
- // Hide after 5 seconds
1083
- setTimeout(() => {
1084
- suggestion.style.display = 'none';
1085
- }, 5000);
1086
- }
1087
  }
1088
  }
1089
-
1090
- // Polyfill for :contains selector
1091
- (function() {
1092
- const matches = Element.prototype.matches ||
1093
- Element.prototype.matchesSelector ||
1094
- Element.prototype.webkitMatchesSelector;
1095
-
1096
- Element.prototype.matchesSelector = matches;
1097
-
1098
- if (!Element.prototype.matches) {
1099
- Element.prototype.matches = function(selector) {
1100
- return this.matchesSelector(selector);
1101
- };
1102
- }
1103
-
1104
- if (!Element.prototype.contains) {
1105
- Element.prototype.contains = function(node) {
1106
- if (!node) return false;
1107
- if (this === node) return true;
1108
- return this.contains(node.parentNode);
1109
- };
1110
- }
1111
-
1112
- const elements = document.querySelectorAll('*');
1113
-
1114
- Element.prototype.containsText = function(text) {
1115
- return this.textContent.includes(text);
1116
- };
1117
-
1118
- document.querySelectorAll = function(selector) {
1119
- const all = [];
1120
-
1121
- if (selector.includes(':contains(')) {
1122
- const [tag, text] = selector.split(':contains(');
1123
- const searchText = text.replace(')', '');
1124
-
1125
- for (let i = 0; i < elements.length; i++) {
1126
- const el = elements[i];
1127
-
1128
- if ((!tag || el.matches(tag)) && el.containsText(searchText)) {
1129
- all.push(el);
1130
- }
1131
- }
1132
-
1133
- return all;
1134
- }
1135
-
1136
- return this.querySelectorAll.apply(document, arguments);
1137
- };
1138
- })();
1139
  </script>
1140
  <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=capta1n/project8" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
1141
  </html>
 
2
  <html lang="zh-CN">
3
  <head>
4
  <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>AI SDL 数字分身 - 风险项目详情</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
 
61
 
62
  .mermaid {
63
  width: 100%;
64
+ min-height: 300px;
65
+ background: white;
66
+ padding: 1rem;
67
+ border-radius: 0.5rem;
68
+ border: 1px solid #e5e7eb;
69
+ margin: 1rem 0;
70
  }
71
 
72
  .risk-marker {
 
299
  <h4 class="font-medium text-gray-700 mb-2">STRIDE 威胁建模</h4>
300
  <div class="mermaid">
301
  graph LR
302
+ subgraph 支付宝国补系统
303
  A[用户认证] -->|Spoofing| B(冒充管理员)
304
  A -->|Tampering| C(篡改认证令牌)
305
  D[补贴审批] -->|Information Disclosure| E(查看他人申请)
306
  D -->|Elevation of Privilege| F(普通用户执行审批)
307
+ end
308
  style B fill:#fee2e2,stroke:#ef4444
309
  style E fill:#fee2e2,stroke:#ef4444
310
  style F fill:#fee2e2,stroke:#ef4444
 
1022
  </div>
1023
 
1024
  <script>
1025
+ // Initialize Mermaid with proper configuration
1026
  mermaid.initialize({
1027
  startOnLoad: true,
1028
  theme: 'default',
1029
+ flowchart: {
1030
+ useMaxWidth: true,
1031
+ htmlLabels: true
1032
+ },
1033
+ securityLevel: 'loose',
1034
+ themeCSS: `
1035
+ .risk-marker {
1036
+ fill: #ef4444;
1037
+ stroke: #ef4444;
1038
+ }
1039
+ `
1040
  });
1041
 
1042
+ // Re-render Mermaid diagrams when tab is switched
1043
+ function renderMermaidDiagrams() {
1044
+ const mermaidElements = document.querySelectorAll('.mermaid');
1045
+ mermaidElements.forEach(el => {
1046
+ // Only render if not already rendered
1047
+ if (!el.querySelector('svg')) {
1048
+ const graphDefinition = el.textContent.trim();
1049
+ try {
1050
+ mermaid.init(undefined, el);
1051
+ } catch (e) {
1052
+ console.error('Mermaid rendering error:', e);
1053
+ }
1054
+ }
1055
+ });
1056
+ }
1057
+
1058
  // Initialize Highlight.js
1059
  document.addEventListener('DOMContentLoaded', (event) => {
1060
  document.querySelectorAll('pre code').forEach((el) => {
1061
  hljs.highlightElement(el);
1062
  });
1063
+
1064
+ // Initial render of Mermaid diagrams
1065
+ renderMermaidDiagrams();
1066
  });
1067
 
1068
  // Switch tabs
 
1082
 
1083
  // Add active class to clicked tab
1084
  event.currentTarget.classList.add('active');
1085
+
1086
+ // Render Mermaid diagrams in the newly shown tab
1087
+ setTimeout(renderMermaidDiagrams, 100);
1088
  }
1089
 
1090
  // Highlight text in requirements
 
1094
  el.classList.remove('highlight-risk');
1095
  });
1096
 
1097
+ // Simple text matching for demonstration
1098
+ const allElements = document.querySelectorAll('#requirements p, #requirements h4');
1099
+ allElements.forEach(el => {
1100
+ if (el.textContent.includes(text)) {
1101
+ el.classList.add('highlight-risk');
1102
+ el.scrollIntoView({ behavior: 'smooth', block: 'center' });
1103
+ }
1104
  });
1105
  }
1106
 
 
1115
  if (targetElement) {
1116
  targetElement.classList.add('vulnerable-line-highlight');
1117
  targetElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
 
 
 
 
 
 
 
 
 
 
 
1118
  }
1119
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1120
  </script>
1121
  <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=capta1n/project8" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
1122
  </html>
prompts.txt CHANGED
@@ -1 +1,2 @@
1
- 风险项目 AI SDL数字分身在每个环节发现的风险,最终将信息聚合成"某个项目在某个环节存在某风险" 的形式产出告警(项目是唯一维度,如果一个项目在多个环节存在风险需聚合在一起),例 支付宝国补项目在代码和需求环节存在越权和sql注入风险。 项目详情 告警出来的风险项目,点击进入详情页,将项目分为需求-代码-安全测试-发布-线上5个模块,每个模块都包含内容--安全分析结果,需要在内容上动态展示分析过程和同步展示风险对应的内容,因为安全分析是对内容进行分析最终产出安全分析结果。 项目概要内容: 项目名称:支付宝国补项目 项目参与人:形知、铸梦、洞悉、隐迹、晨熙 风险概述:总结每个环节发现的风险以及修复进度 需求模块: ● 内容:展示项目对应的需求文档文字内容(长度是两千字)包含对应的技术架构图 ● 分析结果:需求对应的STRIDE威胁建模图需包含风险功能标记(集成mermaid.js)、安全风险:业务场景-风险点-风险类型-整改建议 代码模块: ● 内容:展示项目对应的多文件全部代码内容和接口地址,代码内容是java代码 ● 分析结果:安全风险:漏洞名称、风险接口、漏洞类型、漏洞级别、漏洞描述、漏洞代码、修复建议(展示推荐的修复代码) 安全测试: ● 内容:展示对应的风险接口以及每个风险接口对应的攻击payload和攻击结果 ● 分析结果:风险接口地址、风险描述、攻击payload请求内容、攻击手法(1、攻击者登录自己的账号,获取一个合法的订单 ID(如 1001)2、修改请求中的 orderid 参数,尝试访问其他订单 ID(如 1002、1003 等)3、如果服务器未进行权限校验,攻击者将成功获取其他用户的订单信息4、通过自动化工具(如 Burp Suite 或编写脚本),攻击者可以批量枚举订单 ID,获取大量用户的敏感数据。) 发布: ● 内容:展示在发布环节进行安全检查的内容,检查之前环节积累下来的风险是否修复 ● 分析结果:未修复的风险,在之前的每个环节发现但未修复的风险,例代码环节的越权风险未修复、发布决策:拒绝发布 线上: ● 内容:展示发现的漏洞或者入侵事件风险 ● 分析结果:展示漏洞的修复情况 设计要求 每个模块的布局都是左右布局,左边展示原始内容、右边展示安全分析结果,并且不同风险等级展示不同的颜色 需求模块: 1. 完整展示项目对应的需求内容,需求内容的长度是一千字并且风险需求内容红色高亮展示 2. 技术架构图支持缩放/平移(集成mermaid.js) 3. 威胁建模图是对需求文档进行STRIDE威胁建模分析后集成mermaid.js展示威胁建模图,并且在图上标记出风险点 4. 安全风险分析点击可以定位到对应的需求文档内容 代码模块: 1. 代码高亮显示(支持多种语言) 2. 漏洞代码行用红色高亮展示,点击弹出修复建议浮层 3. 分析出来的漏洞代码点击后可以直接定位并且高亮对应的原文代码 安全测试模块: 1. Payload展示采用代码块样式并支持修复
 
 
1
+ 风险项目 AI SDL数字分身在每个环节发现的风险,最终将信息聚合成"某个项目在某个环节存在某风险" 的形式产出告警(项目是唯一维度,如果一个项目在多个环节存在风险需聚合在一起),例 支付宝国补项目在代码和需求环节存在越权和sql注入风险。 项目详情 告警出来的风险项目,点击进入详情页,将项目分为需求-代码-安全测试-发布-线上5个模块,每个模块都包含内容--安全分析结果,需要在内容上动态展示分析过程和同步展示风险对应的内容,因为安全分析是对内容进行分析最终产出安全分析结果。 项目概要内容: 项目名称:支付宝国补项目 项目参与人:形知、铸梦、洞悉、隐迹、晨熙 风险概述:总结每个环节发现的风险以及修复进度 需求模块: ● 内容:展示项目对应的需求文档文字内容(长度是两千字)包含对应的技术架构图 ● 分析结果:需求对应的STRIDE威胁建模图需包含风险功能标记(集成mermaid.js)、安全风险:业务场景-风险点-风险类型-整改建议 代码模块: ● 内容:展示项目对应的多文件全部代码内容和接口地址,代码内容是java代码 ● 分析结果:安全风险:漏洞名称、风险接口、漏洞类型、漏洞级别、漏洞描述、漏洞代码、修复建议(展示推荐的修复代码) 安全测试: ● 内容:展示对应的风险接口以及每个风险接口对应的攻击payload和攻击结果 ● 分析结果:风险接口地址、风险描述、攻击payload请求内容、攻击手法(1、攻击者登录自己的账号,获取���个合法的订单 ID(如 1001)2、修改请求中的 orderid 参数,尝试访问其他订单 ID(如 1002、1003 等)3、如果服务器未进行权限校验,攻击者将成功获取其他用户的订单信息4、通过自动化工具(如 Burp Suite 或编写脚本),攻击者可以批量枚举订单 ID,获取大量用户的敏感数据。) 发布: ● 内容:展示在发布环节进行安全检查的内容,检查之前环节积累下来的风险是否修复 ● 分析结果:未修复的风险,在之前的每个环节发现但未修复的风险,例代码环节的越权风险未修复、发布决策:拒绝发布 线上: ● 内容:展示发现的漏洞或者入侵事件风险 ● 分析结果:展示漏洞的修复情况 设计要求 每个模块的布局都是左右布局,左边展示原始内容、右边展示安全分析结果,并且不同风险等级展示不同的颜色 需求模块: 1. 完整展示项目对应的需求内容,需求内容的长度是一千字并且风险需求内容红色高亮展示 2. 技术架构图支持缩放/平移(集成mermaid.js) 3. 威胁建模图是对需求文档进行STRIDE威胁建模分析后集成mermaid.js展示威胁建模图,并且在图上标记出风险点 4. 安全风险分析点击可以定位到对应的需求文档内容 代码模块: 1. 代码高亮显示(支持多种语言) 2. 漏洞代码行用红色高亮展示,点击弹出修复建议浮层 3. 分析出来的漏洞代码点击后可以直接定位并且高亮对应的原文代码 安全测试模块: 1. Payload展示采用代码块样式并支持修复
2
+ 重新生成,并且保证里面的威胁建模图可以展示集成mermaid.js