225 Commits

Author SHA1 Message Date
朱明明
a2cbffc976 Settings 2020-06-01 19:32:46 +08:00
朱明明
8fad91d01b Add new directory 2020-06-01 19:28:52 +08:00
朱明明
3d14162622 修改CreatePolicyFile关键字与添加CreateRequest 2020-06-01 19:25:42 +08:00
朱明明
1060974d23 修改因为传参是list,dict导致json无法替换的bug 2020-06-01 18:14:41 +08:00
朱明明
88bd5b8d27 添加setting的成功初始json 2020-06-01 18:10:53 +08:00
dongxiaoyan
0ab1736a27 提前公共部分关键字,简化case。给朱明明示例,朱明明需要添加测试数据的清除,已经沟通。 2020-06-01 18:07:00 +08:00
dongxiaoyan
af934cf8e7 删除无用的绝对路径引用 2020-06-01 10:36:24 +08:00
dongxiaoyan
fc3b969ce9 Merge branch 'develop' of https://git.mesalab.cn/dongxiaoyan/tsg_autotest.git into develop 2020-05-29 20:18:08 +08:00
dongxiaoyan
7352b6c059 更目录和实际大小写一致 2020-05-29 20:17:44 +08:00
liuyuanfang
4252b9cbc7 提交“Policy Verify”关键字 2020-05-29 18:57:17 +08:00
dongxiaoyan
d958900f8b 修改目录为区分大小写 2020-05-29 17:08:22 +08:00
dongxiaoyan
8e6e71074f 添加正确目录 2020-05-29 17:01:46 +08:00
dongxiaoyan
41aec9ced2 删除错误目录 2020-05-29 16:51:59 +08:00
dongxiaoyan
74753b01d2 删除错误目录,提交正确目录 2020-05-29 16:43:28 +08:00
dongxiaoyan
fbfeca5b60 删除uicase目录 2020-05-29 16:24:28 +08:00
dongxiaoyan
d1cea4a619 删除目录 2020-05-29 16:14:49 +08:00
姬巍川
a2daa3a288 推荐url查询测试用例 2020-05-28 19:34:30 +08:00
liuyuanfang
27a9718c0c 修改Category的case 2020-05-28 18:30:02 +08:00
liuyuanfang
bc52210587 为case添加搜索代码 2020-05-28 17:53:00 +08:00
liuyuanfang
bacfd34392 临时提交 2020-05-28 17:51:15 +08:00
liuyuanfang
fdbb24130e 提交ip关键字,添加post函数 2020-05-28 17:50:45 +08:00
liuyuanfang
7b7f8e85f2 修改ip关键字,添加post参数 2020-05-28 17:49:37 +08:00
dongxiaoyan
f1b3db9c57 删除本系统ip对象时,添加是否存在判断 2020-05-28 17:31:58 +08:00
姬巍川
d400d20a95 命中趋势测试用例 2020-05-28 14:38:56 +08:00
姬巍川
fa0ad0f9f2 时间与计数查询测试用例 2020-05-28 14:38:24 +08:00
姬巍川
2d83bc6b24 添加推荐、趋势、时间和计数关键字 2020-05-28 14:14:12 +08:00
liuyuanfang
912a6c54ae 补充case 2020-05-28 11:32:23 +08:00
liuyuanfang
3890069132 提交修改settings关键字 2020-05-28 11:31:01 +08:00
朱明明
8966353886 因 svg 需要修改content type + 需要转义修改类型 2020-05-28 10:58:12 +08:00
liuyuanfang
40701aea01 上传htm文件 2020-05-27 17:47:22 +08:00
liuyuanfang
6f96d8c654 上传css文件 2020-05-27 17:45:38 +08:00
liuyuanfang
2e50b80d1d 上传js文件 2020-05-27 17:44:15 +08:00
liuyuanfang
7284a6cb23 优化Objects关键字 2020-05-27 17:41:02 +08:00
liuyuanfang
ad5a7728fa 提交修改case 2020-05-27 17:38:05 +08:00
liuyuanfang
11df2b381c 提交修改case 2020-05-27 17:37:46 +08:00
liuyuanfang
74ee1af695 提交修改case 2020-05-27 17:37:10 +08:00
liuyuanfang
96546bc1af 提交修改case 2020-05-27 17:36:46 +08:00
liuyuanfang
672d8842e3 提交修改case 2020-05-27 17:36:28 +08:00
liuyuanfang
edad34e62d 提交修改case 2020-05-27 17:36:08 +08:00
liuyuanfang
7102ae70b7 提交修改case 2020-05-27 17:35:50 +08:00
liuyuanfang
3f54d493ff Delete object-url-case.robot 2020-05-27 17:35:23 +08:00
liuyuanfang
ff1f2ae4ac Delete object-keywords-case.robot 2020-05-27 17:35:18 +08:00
liuyuanfang
1926823772 Delete object-ip-case.robot 2020-05-27 17:35:14 +08:00
liuyuanfang
fa7de05b62 Delete object-fqdn-case.robot 2020-05-27 17:35:08 +08:00
liuyuanfang
b1fff687bf Delete object-account-case.robot 2020-05-27 17:35:03 +08:00
liuyuanfang
a4254072d2 Delete object-Subscriber-ID-case.robot 2020-05-27 17:34:58 +08:00
liuyuanfang
9d6f0858b1 Delete Object-category-case.robot 2020-05-27 17:34:53 +08:00
liuyuanfang
99b9778d21 Replace Object-category-case.robot 2020-05-27 17:34:04 +08:00
liuyuanfang
85de3db2b4 提交修改case 2020-05-27 17:32:57 +08:00
liuyuanfang
9681c4a71d Replace Object-category-case.robot 2020-05-27 17:19:46 +08:00
liuyuanfang
b9f53b7bde Replace Object-HTTPSignature-Case.robot 2020-05-27 17:19:19 +08:00
liuyuanfang
0cd8077f16 Delete Trusted_Certificate_Authorities_case.robot 2020-05-27 17:17:51 +08:00
liuyuanfang
556a990c6f Delete Traffic_Mirror_Profiles_case.robot 2020-05-27 17:17:47 +08:00
liuyuanfang
fee63fcd9d Delete Search_Cached_Intermediate_Certificates_case.robot 2020-05-27 17:17:42 +08:00
liuyuanfang
b42ab15a45 Delete SSL_Decryption_Exclusion_case.robot 2020-05-27 17:17:38 +08:00
liuyuanfang
b99eb5a9b3 Delete Response_Pages_case.robot 2020-05-27 17:17:32 +08:00
liuyuanfang
5831787d1b Delete Insert_Scripts_case.robot 2020-05-27 17:17:27 +08:00
liuyuanfang
b9c41bcfd2 Delete Hijack_Files_case.robot 2020-05-27 17:17:22 +08:00
liuyuanfang
6d23a8a2f7 Delete .gitkeep 2020-05-27 17:17:10 +08:00
liuyuanfang
18103464e4 上传修改后的case 2020-05-27 17:16:53 +08:00
liuyuanfang
408d45001f 上传修改后的case 2020-05-27 17:16:25 +08:00
liuyuanfang
0bbc3b2d44 上传修改后的case 2020-05-27 17:16:02 +08:00
liuyuanfang
6a42b7f4f5 上传修改后的case 2020-05-27 17:15:46 +08:00
liuyuanfang
df4abb091d 上传修改后的case 2020-05-27 17:15:12 +08:00
liuyuanfang
62413cfaa9 上传修改后的case 2020-05-27 17:14:16 +08:00
liuyuanfang
9edfbad87b 上传修改后的case 2020-05-27 17:11:48 +08:00
liuyuanfang
c9c3a554df 修改目录大小写 2020-05-27 17:09:15 +08:00
liuyuanfang
8e07490a81 修改目录大小写 2020-05-27 17:02:57 +08:00
liuyuanfang
8072ec113e 修改目录大小写 2020-05-27 17:00:01 +08:00
朱明明
6b19fc2c75 hijack24种类型文件 2020-05-27 16:52:03 +08:00
朱明明
40361dd5c9 新增 hijack 24种类型新增case 2020-05-27 16:28:42 +08:00
朱明明
b550eb52ec 添加通用文件新增关键字 2020-05-27 16:27:18 +08:00
朱明明
5c246e436a 添加hijack初始化json 2020-05-27 16:25:39 +08:00
yyq
24311d4231 日志统计用例完善 2020-05-27 16:19:37 +08:00
dongxiaoyan
c3158a37ef 删除无用参数 2020-05-26 19:59:56 +08:00
yyq
b84fd34e11 Merge branch 'develop' of https://git.mesalab.cn/dongxiaoyan/tsg_autotest into develop 2020-05-26 19:55:08 +08:00
yyq
854a9add36 统计日志自动化代码 2020-05-26 19:54:19 +08:00
liuyuanfang
58f65fa26e 修改settings的Policy Verify的关键字 2020-05-26 19:48:17 +08:00
liuyuanfang
527d32c491 Replace Decryption_Profile_case.robot 2020-05-26 18:52:42 +08:00
liuyuanfang
1eafa6ba5d Replace Settings.robot 2020-05-26 18:51:48 +08:00
dongxiaoyan
77103b2736 添加命令执行比对包含和不包含两类字符串关键字:SystemCommandReturnCompare
参数说明:要执行的系统命令    命令返回结果要包含的字符串列表    命令返回结果不能包含的字符串列表
2020-05-26 18:38:10 +08:00
dongxiaoyan
6d2ecc6ca3 调整UI退出时,调用删除方法错误,即修改UiLoginAndAaddLocalIP名称为UiLoginAndAddLocalIP 2020-05-26 17:48:17 +08:00
朱明明
6741755396 新增通用对象json修改关键字 2020-05-26 14:45:35 +08:00
朱明明
2793a0b6ed 新增替换json内容关键字 2020-05-26 14:42:12 +08:00
朱明明
dff0aa2090 新增替换json内容关键字 2020-05-26 14:41:02 +08:00
liuyuanfang
55859818b6 上传Decryption_Profile的用例 2020-05-26 11:52:49 +08:00
liuyuanfang
542d053655 提交settings关键字 2020-05-26 11:51:05 +08:00
姬巍川
4e62dd8dd1 命令文件 2020-05-25 19:48:01 +08:00
姬巍川
cd8f68b15b Upload New File 2020-05-25 19:45:40 +08:00
姬巍川
de950718b6 Replace SecurityPolicy_Intercept_SSL003.bat 2020-05-25 19:45:17 +08:00
姬巍川
c6c1599442 Replace SecurityPolicy_Intercept_SSL003.bat 2020-05-25 19:44:59 +08:00
姬巍川
2769ef1ac9 Upload New File 2020-05-25 19:44:13 +08:00
姬巍川
db44d04763 Upload New File 2020-05-25 19:43:45 +08:00
姬巍川
12bb7f5b44 Upload New File 2020-05-25 19:43:33 +08:00
姬巍川
5c1d0de996 Upload New File 2020-05-25 19:43:19 +08:00
姬巍川
1bff03c59e Upload New File 2020-05-25 19:42:44 +08:00
姬巍川
25fecd2c4b Upload New File 2020-05-25 19:41:55 +08:00
姬巍川
b9ff0094ac Upload New File 2020-05-25 19:41:42 +08:00
姬巍川
07564d602c Upload New File 2020-05-25 19:41:12 +08:00
姬巍川
b5c6420d04 Upload New File 2020-05-25 19:40:46 +08:00
姬巍川
4fa6dc027d 拦截ssl属性自动化测试用例 2020-05-25 19:39:37 +08:00
liuyuanfang
e8a75a94cb Delete Response_Pages_case-1.robot 2020-05-25 10:14:01 +08:00
姬巍川
70719998e4 更换目录 2020-05-24 16:24:28 +08:00
姬巍川
d4a099e521 Delete Intercept_SSL_Tests.robot 2020-05-24 16:22:07 +08:00
liuyuanfang
864556c687 优化新增Settings关键字 2020-05-22 21:27:57 +08:00
liuyuanfang
1717e61286 优化objects关键字 2020-05-22 21:26:21 +08:00
liuyuanfang
df1816a30e 上传settings模块case 2020-05-22 21:25:05 +08:00
liuyuanfang
ce15c1fa81 上传settings模块case 2020-05-22 21:24:52 +08:00
liuyuanfang
3aec148091 上传settings模块case 2020-05-22 21:24:23 +08:00
liuyuanfang
9958de351c 上传settings模块case 2020-05-22 21:23:54 +08:00
liuyuanfang
422ead6a27 上传settings模块case 2020-05-22 21:23:27 +08:00
liuyuanfang
b2eaf3aba8 上传settings模块case 2020-05-22 21:23:08 +08:00
liuyuanfang
25c5647270 上传settings模块case 2020-05-22 21:22:45 +08:00
liuyuanfang
d509e6340b 上传settings模块case 2020-05-22 21:22:25 +08:00
liuyuanfang
bbf391895f 上传settings模块case 2020-05-22 21:22:01 +08:00
liuyuanfang
0e0a701ada 新增目录Ui-settings 2020-05-22 21:20:44 +08:00
姬巍川
5746e51f26 添加请求体、应答体and和or关系自动化用例 2020-05-22 19:27:59 +08:00
姬巍川
58695a1eb6 添加请求体、应答体and和or关系自动化用例 2020-05-22 19:00:55 +08:00
姬巍川
27e2587ab6 添加请求体、应答体and和or关系自动化用例 2020-05-22 18:13:07 +08:00
姬巍川
071cceb815 添加请求体、应答体and和or关系自动化用例 2020-05-22 18:11:32 +08:00
姬巍川
c92c29c256 添加请求体、应答体and和or关系自动化用例 2020-05-22 18:08:57 +08:00
姬巍川
8957977994 添加请求体、应答体and和or关系自动化用例 2020-05-22 17:59:00 +08:00
姬巍川
824e91837d 添加请求体、应答体and和or关系自动化用例 2020-05-22 17:57:23 +08:00
姬巍川
b629e91b05 添加请求体and和or关系自动化用例 2020-05-22 17:55:03 +08:00
姬巍川
96a1db6049 添加请求体and和or关系自动化用例 2020-05-22 17:53:06 +08:00
姬巍川
4268d2a803 优化标签 2020-05-22 11:58:40 +08:00
姬巍川
1bc90e7157 优化标签 2020-05-22 11:54:53 +08:00
姬巍川
11eeefb700 优化标签 2020-05-22 11:50:08 +08:00
姬巍川
c211fe89c2 优化标签 2020-05-22 11:43:41 +08:00
姬巍川
3788e08e82 优化标签 2020-05-22 11:37:07 +08:00
姬巍川
d2b395ce20 优化标签 2020-05-22 11:31:14 +08:00
姬巍川
5c1e221c3b 优化标签 2020-05-21 19:50:19 +08:00
姬巍川
7a56cfc09f 优化标签 2020-05-21 19:37:52 +08:00
姬巍川
ebd43f58cd 标签优化 2020-05-21 19:35:11 +08:00
姬巍川
cf26959d27 优化标签 2020-05-21 19:32:23 +08:00
姬巍川
c4b66ae7d9 优化标签 2020-05-21 19:29:38 +08:00
姬巍川
81570782b1 优化标签 2020-05-21 19:26:11 +08:00
姬巍川
cdadf50ddd 优化标签 2020-05-21 19:23:12 +08:00
姬巍川
c772b0139c 优化标签 2020-05-21 19:20:41 +08:00
姬巍川
ef12808d54 证书自动化用例 2020-05-21 19:17:39 +08:00
姬巍川
da2527526a 添加安全策略allow动作mail用例 2020-05-20 19:08:16 +08:00
姬巍川
0f25501a4d 添加安全策略allow动作ftp用例 2020-05-20 19:07:50 +08:00
姬巍川
32013269b2 添加安全策略allow动作dns用例 2020-05-20 19:07:23 +08:00
姬巍川
2b2da4f330 修改23用例无功能端效果问题 2020-05-20 17:55:15 +08:00
姬巍川
e132e6fe4a 修改用例2dns_qname"' does not contain 'toutiao.com'问题 2020-05-20 16:36:38 +08:00
姬巍川
bd5ea2f005 修改验证 2020-05-18 15:38:26 +08:00
姬巍川
eee0a5656e 修改执行命令 2020-05-18 15:37:05 +08:00
姬巍川
bd7fc29e97 修改9用例策略验证 2020-05-18 15:35:40 +08:00
姬巍川
25e63c2999 修改39验证 2020-05-18 15:27:50 +08:00
姬巍川
780958834d 添加修改用例 2020-05-15 19:29:59 +08:00
姬巍川
36e6eac6fb 添加修改用例 2020-05-15 19:22:08 +08:00
姬巍川
e28834faea 添加修改策略 2020-05-15 19:00:43 +08:00
姬巍川
725af89b5e 添加修改策略 2020-05-15 18:42:34 +08:00
姬巍川
b133a2a0c5 添加修改策略 2020-05-15 18:41:42 +08:00
姬巍川
98e0f26590 添加修改策略 2020-05-15 18:40:35 +08:00
姬巍川
877e83508e 添加修改策略 2020-05-15 18:40:01 +08:00
姬巍川
d9affb656d 添加修改策略 2020-05-15 18:39:23 +08:00
姬巍川
928f9ab468 添加修改策略 2020-05-15 18:38:44 +08:00
姬巍川
6209f78123 添加修改策略 2020-05-15 18:37:22 +08:00
姬巍川
a1abfa0ea0 添加修改策略 2020-05-15 18:36:00 +08:00
姬巍川
215f2325e2 添加修改策略 2020-05-15 18:35:04 +08:00
姬巍川
7d0a7d905f 添加修改策略 2020-05-15 18:33:36 +08:00
姬巍川
a6a3150559 添加修改策略 2020-05-15 18:32:50 +08:00
姬巍川
011bd85d7c 添加修改策略 2020-05-15 18:31:35 +08:00
姬巍川
4940d40bd7 添加修改策略 2020-05-15 18:30:24 +08:00
姬巍川
341fef6b25 修改7和8用例策略无法命中问题 2020-05-15 11:30:01 +08:00
姬巍川
3b7fcbd312 Update Insert_Ssl_Tests.robot 2020-05-14 18:55:07 +08:00
姬巍川
76416aa61f 修改错误用例 2020-05-14 18:54:01 +08:00
姬巍川
4b9559e2a5 Upload New File 2020-05-14 18:52:59 +08:00
姬巍川
9e6d5781ed Upload New File 2020-05-14 17:18:29 +08:00
姬巍川
297527a7d8 修改错误用例 2020-05-14 17:17:29 +08:00
姬巍川
cf084d960f 修改对象关系 2020-05-14 16:31:56 +08:00
姬巍川
6631a62cc8 修改对象关系 2020-05-14 16:29:25 +08:00
姬巍川
03af892ecc 修改对象关系 2020-05-14 16:23:40 +08:00
姬巍川
8174fd0096 修改对象关系 2020-05-14 16:22:04 +08:00
姬巍川
e685710564 修改对象关系 2020-05-14 16:17:23 +08:00
姬巍川
7c8bbc0449 修改对象关系 2020-05-14 16:16:00 +08:00
姬巍川
18f96331f1 修改执行命令 2020-05-14 15:29:27 +08:00
姬巍川
e0cf3918ac 修改错误验证 2020-05-14 14:13:32 +08:00
姬巍川
3484569cd3 修改功能验证 2020-05-14 11:04:45 +08:00
姬巍川
4e2723eeef 修改ftp未通过的用例 2020-05-13 19:47:26 +08:00
姬巍川
bf78d75754 Replace Deny_FTP_Tests.robot 2020-05-13 17:27:43 +08:00
姬巍川
2861fd42b1 修改错误用例 2020-05-13 11:15:42 +08:00
姬巍川
0f0c8e0931 修改错误用例 2020-05-12 19:33:05 +08:00
姬巍川
d17463e8f3 修改35无法命中问题 2020-05-12 19:12:04 +08:00
姬巍川
0997ba286d 修改38liunx执行命令 2020-05-12 18:58:40 +08:00
姬巍川
87c3446034 修改liunx执行命令 2020-05-12 15:56:50 +08:00
姬巍川
da6206d3dd 修改21用例功能验证 2020-05-12 14:40:28 +08:00
姬巍川
e73a96649a 修改liunx执行命令 2020-05-12 14:32:43 +08:00
姬巍川
e6e554b9fb 修改21-23功能验证问题 2020-05-11 19:41:59 +08:00
姬巍川
446bf773db 解决1用例日志验证问题 2020-05-11 18:41:42 +08:00
姬巍川
cf756fbdaa Upload New File 2020-05-11 18:31:11 +08:00
姬巍川
fdc66e4cd1 解决23无法命中问题 2020-05-11 18:30:22 +08:00
姬巍川
345ce5e294 修改34liunx命令错误 2020-05-11 17:51:35 +08:00
姬巍川
7c6b010947 修改29日志验证问题 2020-05-11 16:01:47 +08:00
姬巍川
c67a374f0d 修改30和39liunx验证问题 2020-05-11 15:25:37 +08:00
姬巍川
affdad6405 修改url错误 2020-05-11 14:51:10 +08:00
姬巍川
ae838a4695 解决编号1用例日志验证问题 2020-05-11 11:05:27 +08:00
姬巍川
62b729e5bb 修改编号16用例验证问题 2020-05-11 10:59:19 +08:00
姬巍川
037d4929d8 补充ftp自动化测试用例 2020-05-10 17:56:34 +08:00
姬巍川
dcde0159e5 补充mail自动化测试用例 2020-05-10 17:55:40 +08:00
姬巍川
8fd0cd03bd 修改liunx系统验证问题 2020-05-10 17:54:49 +08:00
姬巍川
3895b2097d Update 姬巍川测试文件.txt 2020-05-10 17:03:58 +08:00
姬巍川
106d2a8bbf 修改部分用例liunx验证问题 2020-05-09 19:31:38 +08:00
姬巍川
a630ae5e6e 修改liunx验证问题 2020-05-09 19:29:36 +08:00
姬巍川
b45705e492 因版本导致,修改userRegion内容 2020-05-09 19:27:40 +08:00
姬巍川
13c9c05fb6 完善ssl自动化测试用例 2020-05-09 19:26:02 +08:00
姬巍川
9f78d943a9 完善dns用例 2020-05-09 19:25:12 +08:00
dongxiaoyan
219a44eb60 删除错误字符 2020-05-09 13:35:42 +08:00
dongxiaoyan
5460b8e84e 中间件比率测试 2020-05-09 12:59:36 +08:00
姬巍川
7cd6e0cbc2 完善block和aler用例 2020-05-08 20:13:36 +08:00
姬巍川
30e4d5ddb0 Upload New File 2020-05-08 20:10:22 +08:00
姬巍川
8a1715bde8 Update proxyPolicy-Redirect-HTTP-00023.bat 2020-05-08 20:06:33 +08:00
姬巍川
dbef3700cd 因版本导致,修改userRegion内容 2020-05-08 14:21:02 +08:00
姬巍川
6a875a986c 因版本导致,修改userRegion内容 2020-05-08 14:19:55 +08:00
姬巍川
f7b419cf86 因版本导致,修改userRegion内容 2020-05-08 14:19:32 +08:00
姬巍川
a9ccd2cbe1 因版本导致,修改userRegion内容 2020-05-08 14:18:49 +08:00
姬巍川
99f325ac85 Replace Hijack_Ssl_Tests.robot 2020-05-08 14:17:57 +08:00
姬巍川
06ceb6c256 因版本导致,修改userRegion内容 2020-05-08 14:15:45 +08:00
姬巍川
01efec7927 因版本导致,修改userRegion内容 2020-05-08 14:15:14 +08:00
姬巍川
4077eb1620 因版本导致,修改userRegion内容 2020-05-08 14:14:40 +08:00
姬巍川
4dad8eb12e 因版本导致,修改userRegion内容 2020-05-08 14:13:21 +08:00
dongxiaoyan
f57de338f7 tsg_show返回恢复换行,代码恢复为使用换行截取命令结果 2020-05-08 13:55:18 +08:00
dongxiaoyan
560c6dd61e Merge branch 'develop' of https://git.mesalab.cn/dongxiaoyan/tsg_autotest.git into develop 2020-05-08 13:54:01 +08:00
dongxiaoyan
29ffbbe225 cli命令代码调整为结束换行,恢复tsg_show返回结果使用换行命令截取 2020-05-08 13:51:03 +08:00
142 changed files with 15083 additions and 2414 deletions

View File

@@ -1,81 +0,0 @@
*** Settings ***
Force Tags tsg-ui objects ip
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/Tsg_Ui/Objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/Tsg_Ui/Objects/Objects.robot
*** Test Cases ***
create-ipv4-range-001
#新建iprange
CreatePage Ip create-ipv4-range-001 ipads=ipv4 ipclient=range ipclienttext1=192.168.1.1 ipclienttext2=192.168.1.1
#验证新建是否成功
ui-object-search-name create-ipv4-range-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-ipv4-cidr-002
#新建iprange
CreatePage Ip create-ipv4-cidr-001 ipads=ipv4 ipclient=cidr ipclienttext1=192.168.1.1 ipclienttext2=24
#验证新建是否成功
ui-object-search-name create-ipv4-cidr-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-ipv4-masks-003
#新建iprange
CreatePage Ip create-ipv4-masks-001 ipads=ipv4 ipclient=masks ipclienttext1=192.168.1.1 ipclienttext2=255.255.255.0
#验证新建是否成功
ui-object-search-name create-ipv4-masks-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-ipv6-range-004
#新建iprange
CreatePage Ip create-ipv6-range-004 ipads=ipv6 ipclient=range ipclienttext1=0:0:0:0:0:0:0:0 ipclienttext2=FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF
#验证新建是否成功
ui-object-search-name create-ipv6-range-004
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-ipv6-cidr-005
#新建iprange
CreatePage Ip create-ipv6-cidr-005 ipads=ipv6 ipclient=cidr ipclienttext1=0:0:0:0:0:0:0:0 ipclienttext2=64
#验证新建是否成功
ui-object-search-name create-ipv6-cidr-005
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-ipv6-masks-006
#新建iprange
CreatePage Ip create-ipv6-masks-006 ipads=ipv6 ipclient=masks ipclienttext1=0:0:0:0:0:0:0:0 ipclienttext2=0:0:0:0:0:0:0:0
#验证新建是否成功
ui-object-search-name create-ipv6-masks-006
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
edit-ip-007
#新建iprange
CreatePage Ip create-ipv6-masks-006 ipads=ipv6 ipclient=masks ipclienttext1=0:0:0:0:0:0:0:0 ipclienttext2=0:0:0:0:0:0:0:0
#验证新建是否成功
ui-object-search-name create-ipv6-masks-006
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#修改对象
object-edit-ip edit-ip-007 ipv4 range 192.168.100.1 192.168.100.1
#查询修改对象
ui-object-search-name edit-ip-007
#删除对象
objects-delete

View File

@@ -0,0 +1,761 @@
*** Settings ***
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
Force Tags tsg_adc Security_Policy
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /policy/profile/decryption
${profileId} ${EMPTY}
*** Test Cases ***
Intercept_SSL_Decryption-00001
[Tags] intercpt-服务器证书校验开关关闭
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*badssl.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL005.bat
... ELSE set variable curl -kv https://wrong.host.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni wrong.host.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006.bat
... ELSE set variable curl -kv https://untrusted-root.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni untrusted-root.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL004.bat
... ELSE set variable curl -kv https://self-signed.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni self-signed.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL003.bat
... ELSE set variable curl -kv https://expired.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni expired.badssl.com
Intercept_SSL_Decryption-00002
[Tags] 拦截intercpt-服务器证书校验打开-failclose
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*badssl.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL005.bat
... ELSE set variable curl -kv https://wrong.host.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni wrong.host.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006.bat
... ELSE set variable curl -kv https://untrusted-root.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni untrusted-root.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL004.bat
... ELSE set variable curl -kv https://self-signed.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni self-signed.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL003.bat
... ELSE set variable curl -kv https://expired.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni expired.badssl.com
Intercept_SSL_Decryption-00003
[Tags] 拦截intercpt-服务器证书校验打开-pass-through
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"pass-through"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*badssl.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL005.bat
... ELSE set variable curl -kv https://wrong.host.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni wrong.host.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006.bat
... ELSE set variable curl -kv https://untrusted-root.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni untrusted-root.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL004.bat
... ELSE set variable curl -kv https://self-signed.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni self-signed.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL003.bat
... ELSE set variable curl -kv https://expired.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni expired.badssl.com
Intercept_SSL_Decryption-00004
[Tags] intercpt-EV关闭
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":1,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*myssl.com,*myssl.cn
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00004 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL003_004.bat
... ELSE set variable curl -kv https://myssl.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni myssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL005_007.bat
... ELSE set variable curl -kv https://www.myssl.cn
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni myssl.cn
Intercept_SSL_Decryption-00005
[Tags] intercpt-EV开启
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":1,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*myssl.com,*myssl.cn
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00005 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL003_004.bat
... ELSE set variable curl -kv https://myssl.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni myssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL005_007.bat
... ELSE set variable curl -kv https://www.myssl.cn
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni myssl.cn
Intercept_SSL_Decryption-00006
[Tags] 拦截intercpt-CT关闭
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*vip.com,*jd.com,*mail.ru
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00006 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_008.bat
... ELSE set variable curl -kv https://coll.jd.com/?e=illegalTopic/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni coll.jd.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_010.bat
... ELSE set variable curl -kv https://www.vip.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni www.vip.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_007.bat
... ELSE set variable curl -kv https://mail.ru/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni mail.ru
Intercept_SSL_Decryption-00007
[Tags] 拦截intercpt-CT开启
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":1,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*vip.com,*jd.com,*mail.ru
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00007 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_008.bat
... ELSE set variable curl -kv https://coll.jd.com/?e=illegalTopic/
${stringlist} run keyword if '${systemType}'=='Windows' set variable GlobalSign RSA OV SSL CA 2018
... ELSE set variable GlobalSign RSA OV SSL CA 2018
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni coll.jd.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_010.bat
... ELSE set variable curl -kv https://www.vip.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Secure Site Pro CA G2
... ELSE set variable Secure Site Pro CA G2
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni www.vip.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_007.bat
... ELSE set variable curl -kv https://mail.ru/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni mail.ru
Intercept_SSL_Decryption-00008
[Tags] 拦截intercpt-MA关闭
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*badssl.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00008 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL008_9.bat
... ELSE set variable curl -kv https://client.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni client.badssl.com
Intercept_SSL_Decryption-00009
[Tags] 拦截intercpt-MA开启
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":1,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*badssl.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00009 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL008_9.bat
... ELSE set variable curl -kv https://client.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable DigiCert SHA2 Secure Server CA
... ELSE set variable DigiCert SHA2 Secure Server CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni client.badssl.com
Intercept_SSL_Decryption-00010
[Tags] 拦截intercpt-协议版本-SSL3
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"ssl3","mirror_client":0,"allow_http2":0}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*newdaynews.ru,*ya.ru,*yandex.ru
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00010 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL010_10.bat
... ELSE set variable curl -kv https://newdaynews.ru/moskow/665390.html/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni newdaynews.ru
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL010_11.bat
... ELSE set variable curl -kv https://ya.ru
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni ya.ru
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL010_12.bat
... ELSE set variable curl -kv https://yandex.ru
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni yandex.ru
Intercept_SSL_Decryption-00011
[Tags] 拦截intercpt-协议版本-TLS1.0
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"tls10","max":"tls10","mirror_client":0,"allow_http2":0}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*newdaynews.ru,*github.com,*jd.com,*mi.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00011 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL010_10.bat
... ELSE set variable curl -kv https://newdaynews.ru/moskow/665390.html/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni newdaynews.ru
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL011_12.bat
... ELSE set variable curl -kv https://github.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni github.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL009.bat
... ELSE set variable curl -kv https:///www.mi.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni mi.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_008.bat
... ELSE set variable curl -kv https://coll.jd.com/?e=illegalTopic/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni coll.jd.com
Intercept_SSL_Decryption-00012
[Tags] 拦截intercpt-协议版本-TLS1.1
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"tls11","max":"tls11","mirror_client":0,"allow_http2":0}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*newdaynews.ru,*github.com,*jd.com,*mi.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00012 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL010_10.bat
... ELSE set variable curl -kv https://newdaynews.ru/moskow/665390.html/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni newdaynews.ru
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL011_12.bat
... ELSE set variable curl -kv https://github.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni github.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL009.bat
... ELSE set variable curl -kv https:///www.mi.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni mi.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_008.bat
... ELSE set variable curl -kv https://coll.jd.com/?e=illegalTopic/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni coll.jd.com
Intercept_SSL_Decryption-00013
[Tags] 拦截intercpt-协议版本-TLS1.2
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"tls12","max":"tls12","mirror_client":0,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*jd.com,*taobao.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00013 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_008.bat
... ELSE set variable curl -kv https://coll.jd.com/?e=illegalTopic/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni coll.jd.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL011.bat
... ELSE set variable curl -kv https://www.taobao.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni taobao.com
Intercept_SSL_Decryption-00014
[Tags] 拦截intercpt-协议版本-TLS1.3
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"tls13","max":"tls13","mirror_client":0,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*vip.com,*github.com,*halfrost.com,*mi.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00014 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_010.bat
... ELSE set variable curl -kv https://www.vip.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni vip.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL012.bat
... ELSE set variable curl -kv https://halfrost.com/tls1-3_start/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni halfrost.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL009.bat
... ELSE set variable curl -kv https:///www.mi.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni mi.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL011_12.bat
... ELSE set variable curl -kv https://github.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni github.com

View File

@@ -0,0 +1,196 @@
*** Settings ***
Test Teardown DeleteAfterCase ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security selfserver
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../03-Variable/PolicyObjectDefault.txt
Resource ../../../02-Keyword/tsg_common/StmpHandle.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../03-Variable/BifangApiVariable.txt
Library Custometest
Library json
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /policy/profile/responsepages
${profiledId} ${EMPTY}
${dict} ${None}
${caseName} SecurityPolicy-Deny-AllProtol-00001
*** Keywords ***
create-object-policy
[Arguments] @{flag}
Comment 创建目标IP
${objectDict} Create Dictionary
... objectType=IP
... isValid=1
... objectSubType=${Default_ObjectSubType}
... isInitialize=${Default_IsInitialize}
... isExclusion=${Default_IsExclusion}
... objectName=${caseName}_IPobject
... objectDesc=${Default_ObjectDesc}
... subObjectIds=${Default_SubObjectIds}
... addItemList=CIDR|192.168.100.5|32|0/0&${Default_AddItem_ServerIpFormat}|${Default_AddItem_ServerIp1}|${Default_AddItem_ServerIp2}|${Default_AddItem_ServerPort}|${Default_AddItem_IsInitialize}|${Default_AddItem_ItemName}|${Default_AddItem_ItemDesc}
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Run Keyword If '${testPart}'=='all' set Variable ${objectId}
Comment 创建安全策略针对所有协议相当于BlackIP
${policyDict} Create Dictionary
... policyName=${caseName}
... policyType=tsg_security
... policyDesc=${Default_PolicyDesc}
... action=deny
... effectiveRange=${Default_EffectiveRange}
... userRegion=${Default_UserRegion}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR
... isValid=${Default_IsValid}
... appObjectIdArray=2,3,4,5,6
... userTags=${Default_UserTags}
... doLog=2
... scheduleId=${Default_ScheduleId}
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
${policyIds} Run Keyword If '${testPart}'=='all' Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
# 区分执行方式
${value} Run Keyword If ${flag}==[] insert_policyId_to_file ${caseName} ${policyId} ${objectids}
... ELSE Create Dictionary policyId=${policyId} objectId=${objectids}
Set Test Variable ${dict} ${value}
function-test
Run Keyword If '${testPart}'=='all' Sleep ${policyVerificationSleepSeconds}s
${starttime} Get Time
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/${caseName}_HTTP.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime_http} Get Time
${rescode} SystemCommands ${commandstr} ${stringlist}
Run Keyword If '${testPart}'=='all' Sleep ${policyLogVerificationSleepSeconds}s
${endtime_http} Get Time
#日志验证
#GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 功能端验证SSL验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/${caseName}_SSL.bat
... ELSE set variable curl -kv https://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
#OpenSSL SSL_connect: Connection was reset in connection to
#Send failure: Connection was reset
... ELSE Create List OpenSSL SSL_connect: Connection reset by peer in connection to
${starttime_ssl} Get Time
${rescode} SystemCommands ${commandstr} ${stringlist}
Run Keyword If '${testPart}'=='all' Sleep ${policyLogVerificationSleepSeconds}s
${endtime_ssl} Get Time
#日志验证
#GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni open.node.com
Comment 功能端验证DNS验证
Comment 功能端验证MAIL验证
#${mail} EmailLogin mail.tsgmail.com 25 dongxiaoyan@mail.tsgmail.com dxy123
${starttime_mail} Get Time
${Smtp服务器} Set Variable 192.168.100.5
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable dongxiaoyan@mail.tsgmail.com
${邮箱密码} Set Variable dxy123
${邮件主题} Set Variable что- иностранныеsuject
${发送者} Set Variable dongxiaoyan@mail.tsgmail.com
${附件} Set Variable ["${mailpath}/朱明明测试文件.txt"]
${接收者} Set Variable ["jwctest@mail.tsgmail.com"]
${抄送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${密送者} Set Variable ["lyftest@mail.tsgmail.com"]
${邮件正文} Set Variable 朱明明contentчто-иностранныеsuject
${mail} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
should contain ${mail} mail_fail
Run Keyword If '${testPart}'=='all' Sleep ${policyLogVerificationSleepSeconds}s
${endtime_mail} Get Time
#日志验证
#GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_protocol_type SMTP
Comment 功能端验证FTP验证
${starttime_ftp} Get Time
${ftpLogin} FTP_login ftp://192.168.100.5:21 -u"ftp_user:qazXSW@edc" test.txt
should contain ${ftpLogin} ftp_fail
#日志验证
#GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ''
Run Keyword If '${testPart}'=='all' Sleep ${policyLogVerificationSleepSeconds}s
${endtime_ftp} Get Time
${endtime} Get Time
# 区分执行方式
Run Keyword If ${dict}==${None} insert_time_to_file ${caseName} ${starttime} ${endtime}
... ELSE Run Keyword Set To Dictionary ${dict} ${starttime} ${endtime}
log-test
# 日志验证
${obj} Run Keyword If ${dict}==${None} json.Loads ${caseName}
... ELSE Set Variable ${dict}
${policyId} Set Variable ${obj}[policyId]
${s} Convert to String ${policyId}
${objectids} Run Keyword If '${testPart}'!='all' set Variable ${obj}[objectids]
${policyIds} Run Keyword If '${testPart}'!='all' Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
#日志验证
GetLogList security_event_log ${starttime_http} ${endtime_http} ${testClentIP} ${s} http_host open.node.com
${obj}[starttime] ${obj}[endtime]
Comment 功能端验证SSL验证
#日志验证
GetLogList security_event_log ${starttime_ssl} ${endtime_ssl} ${testClentIP} ${s} ssl_sni open.node.com
Comment 功能端验证DNS验证
Comment 功能端验证MAIL验证
#日志验证
GetLogList security_event_log ${starttime_mail} ${endtime_mail} ${testClentIP} ${s} mail_protocol_type SMTP
Comment 功能端验证FTP验证
#日志验证
GetLogList security_event_log ${starttime_ftp} ${endtime_ftp} ${testClentIP} ${s} ftp_account ''
log-test_bak
# 日志验证
${obj} Run Keyword If ${dict}==${None} json.Loads ${caseName}
... ELSE Set Variable ${dict}
${policyId} Set Variable ${obj}[policyId]
${s} Convert to String ${policyId}
${objectids} Run Keyword If '${testPart}'!='all' set Variable ${obj}[objectids]
${policyIds} Run Keyword If '${testPart}'!='all' Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
#日志验证
#GetLogList security_event_log ${starttime_http} ${endtime_http} ${testClentIP} ${s} http_host open.node.com
GetLogList security_event_log ${obj}[starttime_http] ${obj}[endtime_http] ${testClentIP} ${s} http_host open.node.com
${obj}[starttime] ${obj}[endtime]
Comment 功能端验证SSL验证
#日志验证
#GetLogList security_event_log ${starttime_ssl} ${endtime_ssl} ${testClentIP} ${s} ssl_sni open.node.com
GetLogList security_event_log ${obj}[starttime_ssl} ${obj}[endtime_ssl} ${testClentIP} ${s} ssl_sni open.node.com
Comment 功能端验证DNS验证
Comment 功能端验证MAIL验证
#日志验证
#GetLogList security_event_log ${starttime_mail} ${endtime_mail} ${testClentIP} ${s} mail_protocol_type SMTP
GetLogList security_event_log ${obj}[starttime_mail} ${obj}[endtime_mail} ${testClentIP} ${s} mail_protocol_type SMTP
Comment 功能端验证FTP验证
#日志验证
#GetLogList security_event_log ${starttime_ftp} ${endtime_ftp} ${testClentIP} ${s} ftp_account ''
GetLogList security_event_log ${obj}[starttime_ftp} ${obj}[endtime_ftp} ${testClentIP} ${s} ftp_account ''
*** Test Cases ***
MultiSecurityPolicy-Deny-AllProtol-00001
[Tags] securitypolciy deny allprotol multistep
#${caseName} set variable SecurityPolicy-Deny-AllProtol-00001
Run Keyword If '${testPart}'=='all' Run Keywords create-object-policy True
... AND function-test
... AND log-test
... ELSE IF ${testPart}==1 Run Keyword create-object-policy
... ELSE IF ${testPart}==2 Run Keyword function-test
... ELSE IF ${testPart}==3 Run Keyword log-test
#{"opAction":"add","policyList":{"policyId":"","policyName":"dxytest","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"method":"rst"},"referenceObject":[{"objectId":6926,"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":6943,"protocolFields":["TSG_SECURITY_DESTINATION_ADDR"]}],"isValid":0,"scheduleId":[],"appObjectIdArray":[2,3,4,5,6]}}

View File

@@ -14,7 +14,7 @@ ${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Allow-Http-00001
[Tags] selfserver ip http allow
[Tags] selfserver ip
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -46,7 +46,7 @@ ProxyPolicy-Allow-Http-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00002
[Tags] selfserver ip+fqdn完整匹配 http allow
[Tags] selfserver ip+fqdn完整匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -82,7 +82,7 @@ ProxyPolicy-Allow-Http-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00003
[Tags] selfserver ip+cat右匹配 http allow
[Tags] selfserver ip+cat右匹配
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
@@ -118,7 +118,7 @@ ProxyPolicy-Allow-Http-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00004
[Tags] selfserver http allow ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -150,7 +150,7 @@ ProxyPolicy-Allow-Http-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00005
[Tags] selfserver http allow ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -182,7 +182,7 @@ ProxyPolicy-Allow-Http-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00006
[Tags] selfserver http allow ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/tengrinews/tengrinews.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -214,7 +214,7 @@ ProxyPolicy-Allow-Http-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00007
[Tags] selfserver http allow ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -246,7 +246,7 @@ ProxyPolicy-Allow-Http-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00008
[Tags] selfserver http allow ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -282,7 +282,7 @@ ProxyPolicy-Allow-Http-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00009
[Tags] selfserver http allow ip+请求头字串匹配
[Tags] selfserver ip+请求头字串匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -318,7 +318,7 @@ ProxyPolicy-Allow-Http-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00010
[Tags] selfserver http allow ip+请求头完整匹配
[Tags] selfserver ip+请求头完整匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -354,7 +354,7 @@ ProxyPolicy-Allow-Http-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00011
[Tags] selfserver http allow ip+请求头左匹配
[Tags] selfserver ip+请求头左匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -390,7 +390,7 @@ ProxyPolicy-Allow-Http-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00012
[Tags] selfserver http allow ip+cookie字串匹配
[Tags] selfserver ip+cookie字串匹配
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -426,7 +426,7 @@ ProxyPolicy-Allow-Http-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00013
[Tags] selfserver http allow ip+应答头右匹配
[Tags] selfserver ip+应答头右匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -462,7 +462,7 @@ ProxyPolicy-Allow-Http-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00014
[Tags] selfserver http allow ip+应答头字串匹配
[Tags] selfserver ip+应答头字串匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -498,7 +498,7 @@ ProxyPolicy-Allow-Http-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00015
[Tags] selfserver http allow ip+应答头完整匹配
[Tags] selfserver ip+应答头完整匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=utf-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -534,7 +534,7 @@ ProxyPolicy-Allow-Http-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00016
[Tags] selfserver http allow ip+应答头左匹配
[Tags] selfserver ip+应答头左匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -570,7 +570,7 @@ ProxyPolicy-Allow-Http-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00017
[Tags] selfserver http allow ip+set-cookie右匹配
[Tags] selfserver ip+set-cookie右匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -606,7 +606,7 @@ ProxyPolicy-Allow-Http-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00018
[Tags] selfserver http allow ip+set-cookie字串匹配
[Tags] selfserver ip+set-cookie字串匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -642,7 +642,7 @@ ProxyPolicy-Allow-Http-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00019
[Tags] selfserver http allow ip+set-cookie完整匹配
[Tags] selfserver ip+set-cookie完整匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -678,7 +678,7 @@ ProxyPolicy-Allow-Http-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00020
[Tags] selfserver http allow ip+set-cookie左匹配
[Tags] selfserver ip+set-cookie左匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -714,7 +714,7 @@ ProxyPolicy-Allow-Http-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00021
[Tags] selfserver 最大组合 http allow
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -760,3 +760,56 @@ ProxyPolicy-Allow-Http-00021
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00022
[Tags] selfserver 修改
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${object_rq_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_rq_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Allow-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 酒店式公寓
... ELSE Create List 酒店式公寓
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Allow-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_rq_Id}|TSG_FIELD_HTTP_REQ_HDR policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0008.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' \ http://open.node.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 发送POST请求
... ELSE Create List 发送POST请求
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -14,13 +14,13 @@ ${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Allow-Ssl-00001
[Tags] selfserver ip ssl allow
[Tags] selfserver ip
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -46,7 +46,7 @@ ProxyPolicy-Allow-Ssl-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00002
[Tags] selfserver ip+fqdn完整匹配 ssl allow
[Tags] selfserver ip+fqdn完整匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -56,7 +56,7 @@ ProxyPolicy-Allow-Ssl-00002
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -82,7 +82,7 @@ ProxyPolicy-Allow-Ssl-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00003
[Tags] selfserver ip+cat右匹配 ssl allow
[Tags] selfserver ip+cat右匹配
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
@@ -92,7 +92,7 @@ ProxyPolicy-Allow-Ssl-00003
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -118,13 +118,13 @@ ProxyPolicy-Allow-Ssl-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00004
[Tags] selfserver ssl allow ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -150,13 +150,13 @@ ProxyPolicy-Allow-Ssl-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00005
[Tags] selfserver ssl allow ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -182,13 +182,13 @@ ProxyPolicy-Allow-Ssl-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00006
[Tags] selfserver ssl allow ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/bytedance/bytedance.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -214,13 +214,13 @@ ProxyPolicy-Allow-Ssl-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00007
[Tags] selfserver ssl allow ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -246,7 +246,7 @@ ProxyPolicy-Allow-Ssl-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00008
[Tags] selfserver ssl allow ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -256,7 +256,7 @@ ProxyPolicy-Allow-Ssl-00008
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -282,7 +282,7 @@ ProxyPolicy-Allow-Ssl-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00009
[Tags] selfserver ssl allow ip+请求头字串匹配
[Tags] selfserver ip+请求头字串匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -292,7 +292,7 @@ ProxyPolicy-Allow-Ssl-00009
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -318,7 +318,7 @@ ProxyPolicy-Allow-Ssl-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00010
[Tags] selfserver ssl allow ip+请求头完整匹配
[Tags] selfserver ip+请求头完整匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -328,7 +328,7 @@ ProxyPolicy-Allow-Ssl-00010
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -354,7 +354,7 @@ ProxyPolicy-Allow-Ssl-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00011
[Tags] selfserver ssl allow ip+请求头左匹配
[Tags] selfserver ip+请求头左匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -364,7 +364,7 @@ ProxyPolicy-Allow-Ssl-00011
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -390,7 +390,7 @@ ProxyPolicy-Allow-Ssl-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00012
[Tags] selfserver ssl allow ip+cookie字串匹配
[Tags] selfserver ip+cookie字串匹配
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -400,7 +400,7 @@ ProxyPolicy-Allow-Ssl-00012
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -426,7 +426,7 @@ ProxyPolicy-Allow-Ssl-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00013
[Tags] selfserver ssl allow ip+应答头右匹配
[Tags] selfserver ip+应答头右匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -436,7 +436,7 @@ ProxyPolicy-Allow-Ssl-00013
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -462,7 +462,7 @@ ProxyPolicy-Allow-Ssl-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00014
[Tags] selfserver ssl allow ip+应答头字串匹配
[Tags] selfserver ip+应答头字串匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -472,7 +472,7 @@ ProxyPolicy-Allow-Ssl-00014
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -498,7 +498,7 @@ ProxyPolicy-Allow-Ssl-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00015
[Tags] selfserver ssl allow ip+应答头完整匹配
[Tags] selfserver ip+应答头完整匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -508,7 +508,7 @@ ProxyPolicy-Allow-Ssl-00015
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -534,7 +534,7 @@ ProxyPolicy-Allow-Ssl-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00016
[Tags] selfserver ssl allow ip+应答头左匹配
[Tags] selfserver ip+应答头左匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -544,7 +544,7 @@ ProxyPolicy-Allow-Ssl-00016
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -570,7 +570,7 @@ ProxyPolicy-Allow-Ssl-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00017
[Tags] selfserver ssl allow ip+set-cookie右匹配
[Tags] selfserver ip+set-cookie右匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -580,7 +580,7 @@ ProxyPolicy-Allow-Ssl-00017
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -606,7 +606,7 @@ ProxyPolicy-Allow-Ssl-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00018
[Tags] selfserver ssl allow ip+set-cookie字串匹配
[Tags] selfserver ip+set-cookie字串匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -616,7 +616,7 @@ ProxyPolicy-Allow-Ssl-00018
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -642,7 +642,7 @@ ProxyPolicy-Allow-Ssl-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00019
[Tags] selfserver ssl allow ip+set-cookie完整匹配
[Tags] selfserver ip+set-cookie完整匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -652,7 +652,7 @@ ProxyPolicy-Allow-Ssl-00019
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -678,7 +678,7 @@ ProxyPolicy-Allow-Ssl-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00020
[Tags] selfserver ssl allow ip+set-cookie左匹配
[Tags] selfserver ip+set-cookie左匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -688,7 +688,7 @@ ProxyPolicy-Allow-Ssl-00020
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -714,7 +714,7 @@ ProxyPolicy-Allow-Ssl-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00021
[Tags] selfserver 最大组合 ssl allow
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -735,7 +735,7 @@ ProxyPolicy-Allow-Ssl-00021
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=charset|Content-Type
${rescode} ${object_re_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_re_Id}
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -759,3 +759,56 @@ ProxyPolicy-Allow-Ssl-00021
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00022
[Tags] selfserver 修改
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${object_re_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_re_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Allow-SSL-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_url_Id}|TSG_FIELD_HTTP_URL,${objectId}|TSG_SECURITY_DESTINATION_ADDR
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.html
@{stringlist} run keyword if '${systemType}'=='Windows' Create List twitter Tango Secure Gateway CA
... ELSE Create List twitter Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Allow-SSL-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_re_Id}|TSG_FIELD_HTTP_RES_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0001.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/rutube/rutube.html
@{stringlist} run keyword if '${systemType}'=='Windows' Create List трейлеры Tango Secure Gateway CA
... ELSE Create List трейлеры Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -16,7 +16,7 @@ ${profiledId} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Deny-Http-00001
[Tags] selfserver ip http deny
[Tags] selfserver ip
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -48,7 +48,7 @@ ProxyPolicy-Deny-Http-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00002
[Tags] selfserver ip+fqdn完整匹配 http deny
[Tags] selfserver ip+fqdn完整匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -80,7 +80,7 @@ ProxyPolicy-Deny-Http-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00003
[Tags] selfserver ip+cat右匹配 http deny
[Tags] selfserver ip+cat右匹配
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -112,7 +112,7 @@ ProxyPolicy-Deny-Http-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00004
[Tags] selfserver http deny ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -146,7 +146,7 @@ ProxyPolicy-Deny-Http-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00005
[Tags] selfserver http deny ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -180,7 +180,7 @@ ProxyPolicy-Deny-Http-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00006
[Tags] selfserver http deny ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/nationalbank/nationalbank.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -212,7 +212,7 @@ ProxyPolicy-Deny-Http-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00007
[Tags] selfserver http deny ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -247,7 +247,7 @@ ProxyPolicy-Deny-Http-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00008
[Tags] selfserver http deny ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -281,7 +281,7 @@ ProxyPolicy-Deny-Http-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00009
[Tags] selfserver http deny ip+请求头字串匹配
[Tags] selfserver ip+请求头字串匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -315,7 +315,7 @@ ProxyPolicy-Deny-Http-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00010
[Tags] selfserver http deny ip+请求头完整匹配
[Tags] selfserver ip+请求头完整匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -347,7 +347,7 @@ ProxyPolicy-Deny-Http-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00011
[Tags] selfserver http deny ip+请求头左匹配
[Tags] selfserver ip+请求头左匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -382,7 +382,7 @@ ProxyPolicy-Deny-Http-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00012
[Tags] selfserver http deny ip+cookie字串匹配
[Tags] selfserver ip+cookie字串匹配
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -414,7 +414,7 @@ ProxyPolicy-Deny-Http-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00013
[Tags] selfserver http deny ip+应答头右匹配
[Tags] selfserver ip+应答头右匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -446,7 +446,7 @@ ProxyPolicy-Deny-Http-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00014
[Tags] selfserver http deny ip+应答头字串匹配
[Tags] selfserver ip+应答头字串匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -480,7 +480,7 @@ ProxyPolicy-Deny-Http-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00015
[Tags] selfserver http deny ip+应答头完整匹配
[Tags] selfserver ip+应答头完整匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -512,7 +512,7 @@ ProxyPolicy-Deny-Http-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00016
[Tags] selfserver http deny ip+应答头左匹配
[Tags] selfserver ip+应答头左匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -544,7 +544,7 @@ ProxyPolicy-Deny-Http-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00017
[Tags] selfserver http deny ip+set-cookie右匹配
[Tags] selfserver ip+set-cookie右匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -576,7 +576,7 @@ ProxyPolicy-Deny-Http-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00018
[Tags] selfserver http deny ip+set-cookie字串匹配
[Tags] selfserver ip+set-cookie字串匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -610,7 +610,7 @@ ProxyPolicy-Deny-Http-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00019
[Tags] selfserver http deny ip+set-cookie完整匹配
[Tags] selfserver ip+set-cookie完整匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -642,7 +642,7 @@ ProxyPolicy-Deny-Http-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00020
[Tags] selfserver http deny ip+set-cookie左匹配
[Tags] selfserver ip+set-cookie左匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -674,7 +674,7 @@ ProxyPolicy-Deny-Http-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00021
[Tags] selfserver http deny ip+请求体字串匹配
[Tags] selfserver ip+请求体字串匹配
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -686,7 +686,7 @@ ProxyPolicy-Deny-Http-00021
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00021 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
@@ -694,8 +694,8 @@ ProxyPolicy-Deny-Http-00021
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Извините
... ELSE Create List Извините
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -706,7 +706,7 @@ ProxyPolicy-Deny-Http-00021
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00022
[Tags] selfserver http deny ip+应答体字串匹配
[Tags] selfserver ip+应答体字串匹配
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response Body
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -738,7 +738,7 @@ ProxyPolicy-Deny-Http-00022
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00023
[Tags] selfserver 最大组合 http deny
[Tags] selfserver 最大组合
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -783,4 +783,182 @@ ProxyPolicy-Deny-Http-00023
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00024
[Tags] selfserver 修改
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${object_yd_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_yd_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404english.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00024 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","html_profile":${profiledId},"code":404,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0001.bat
... ELSE set variable curl http://open.node.com/test/xiaozhu/xiaozhu.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00024 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","html_profile":${profiledId},"code":404,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_yd_Id}|TSG_FIELD_HTTP_RES_HDR policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0002.bat
... ELSE set variable curl http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00025
[Tags] selfserver ip+请求体and关系
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=ctes&t123
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00025 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00026
[Tags] selfserver ip+请求体或更新
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test,qazx
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00026 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00027
[Tags] selfserver ip+应答体and关系
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response& Body
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00027 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Http-00028
[Tags] selfserver ip+应答体或关系
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response,12345
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00028 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -16,13 +16,13 @@ ${profiledId} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Deny-Ssl-00001
[Tags] selfserver ip deny ssl
[Tags] selfserver ip
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -48,13 +48,13 @@ ProxyPolicy-Deny-Ssl-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00002
[Tags] selfserver ip+fqdn完整匹配 deny ssl
[Tags] selfserver ip+fqdn完整匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -80,13 +80,13 @@ ProxyPolicy-Deny-Ssl-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00003
[Tags] selfserver ip+cat右匹配 deny ssl
[Tags] selfserver ip+cat右匹配
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -112,13 +112,13 @@ ProxyPolicy-Deny-Ssl-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00004
[Tags] selfserver deny ip+url右匹配 ssl
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -146,13 +146,13 @@ ProxyPolicy-Deny-Ssl-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00005
[Tags] selfserver deny ip+url字串匹配 ssl
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -180,13 +180,13 @@ ProxyPolicy-Deny-Ssl-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00006
[Tags] selfserver deny ip+url完整匹配 ssl
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/bytedance/bytedance.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -212,13 +212,13 @@ ProxyPolicy-Deny-Ssl-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00007
[Tags] selfserver deny ip+url左匹配 ssl
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -247,13 +247,13 @@ ProxyPolicy-Deny-Ssl-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00008
[Tags] selfserver deny ssl ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -281,13 +281,13 @@ ProxyPolicy-Deny-Ssl-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00009
[Tags] selfserver deny ip+请求头字串匹配 ssl
[Tags] selfserver ip+请求头字串匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -315,13 +315,13 @@ ProxyPolicy-Deny-Ssl-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00010
[Tags] selfserver deny ip+请求头完整匹配 ssl
[Tags] selfserver ip+请求头完整匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -347,13 +347,13 @@ ProxyPolicy-Deny-Ssl-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00011
[Tags] selfserver deny ip+请求头左匹配 ssl
[Tags] selfserver ip+请求头左匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -382,13 +382,13 @@ ProxyPolicy-Deny-Ssl-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00012
[Tags] selfserver deny ip+cookie字串匹配 ssl
[Tags] selfserver ip+cookie字串匹配
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -414,13 +414,13 @@ ProxyPolicy-Deny-Ssl-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00013
[Tags] selfserver deny ip+应答头右匹配 ssl
[Tags] selfserver ip+应答头右匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -446,13 +446,13 @@ ProxyPolicy-Deny-Ssl-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00014
[Tags] selfserver deny ip+应答头字串匹配 ssl
[Tags] selfserver ip+应答头字串匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -480,13 +480,13 @@ ProxyPolicy-Deny-Ssl-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00015
[Tags] selfserver deny ip+应答头完整匹配 ssl
[Tags] selfserver ip+应答头完整匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -512,13 +512,13 @@ ProxyPolicy-Deny-Ssl-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00016
[Tags] selfserver deny ip+应答头左匹配 ssl
[Tags] selfserver ip+应答头左匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -544,13 +544,13 @@ ProxyPolicy-Deny-Ssl-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00017
[Tags] selfserver deny ip+set-cookie右匹配 ssl
[Tags] selfserver ip+set-cookie右匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -576,13 +576,13 @@ ProxyPolicy-Deny-Ssl-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00018
[Tags] selfserver deny ip+set-cookie字串匹配 ssl
[Tags] selfserver ip+set-cookie字串匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -610,13 +610,13 @@ ProxyPolicy-Deny-Ssl-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00019
[Tags] selfserver deny ip+set-cookie完整匹配 ssl
[Tags] selfserver ip+set-cookie完整匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -629,7 +629,7 @@ ProxyPolicy-Deny-Ssl-00019
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0019.bat
... ELSE set variable curl -kv \ -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=yyyyy" https://open.node.com/action
... ELSE set variable curl -kv \ -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List qwerty Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List qwerty Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
@@ -642,13 +642,13 @@ ProxyPolicy-Deny-Ssl-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00020
[Tags] selfserver deny ip+set-cookie左匹配 ssl
[Tags] selfserver ip+set-cookie左匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -674,19 +674,19 @@ ProxyPolicy-Deny-Ssl-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00021
[Tags] selfserver deny ip+请求体字串匹配 ssl
[Tags] selfserver ip+请求体字串匹配
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-SSL-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-SSL-00021 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
@@ -694,8 +694,8 @@ ProxyPolicy-Deny-Ssl-00021
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0019.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List Извините Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List Извините Tango Secure Gateway CA X-TG-Construct-By
@{stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset Tango Secure Gateway CA
... ELSE Create List Connection reset by peer Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
@@ -706,13 +706,13 @@ ProxyPolicy-Deny-Ssl-00021
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00022
[Tags] selfserver deny ip+应答体字串匹配 ssl
[Tags] selfserver ip+应答体字串匹配
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response Body
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -726,8 +726,8 @@ ProxyPolicy-Deny-Ssl-00022
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0019.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List Empty reply from server Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List Connection reset by peer Tango Secure Gateway CA X-TG-Construct-By
@{stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset Tango Secure Gateway CA
... ELSE Create List Connection reset by peer Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
@@ -738,7 +738,7 @@ ProxyPolicy-Deny-Ssl-00022
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00023
[Tags] selfserver 最大组合 deny ssl
[Tags] selfserver 最大组合
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -760,7 +760,7 @@ ProxyPolicy-Deny-Ssl-00023
${rescode} ${object_by_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_by_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -774,8 +774,8 @@ ProxyPolicy-Deny-Ssl-00023
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00023.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' \ https://open.node.com/test/bytedance/bytedance.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Empty reply from server X-TG-Construct-By
... ELSE Create List Connection reset by peer X-TG-Construct-By
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset Tango Secure Gateway CA
... ELSE Create List Connection reset by peer Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -784,3 +784,180 @@ ProxyPolicy-Deny-Ssl-00023
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00024
[Tags] selfserver 修改
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*bytedance.html
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-Ssl-00024 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"你好,五一","code":403,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_HOST
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0001.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/rutube/rutube.html
@{stringlist} run keyword if '${systemType}'=='Windows' Create List 你好,五一 Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List 你好,五一 Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-Ssl-00024 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"QAZWSX星期天песни","code":403,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_url_Id}|TSG_FIELD_HTTP_URL policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0003.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/bytedance/bytedance.html
@{stringlist} run keyword if '${systemType}'=='Windows' Create List QAZWSX星期天 песни Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List QAZWSX星期天 песни Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00025
[Tags] selfserver ip+请求体and关系
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=ctes&t123
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-SSL-00025 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-SSL-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset Tango Secure Gateway CA
... ELSE Create List Connection reset by peer Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00026
[Tags] selfserver ip+请求体或关系
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test,你好明天
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-SSL-00026 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-SSL-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset Tango Secure Gateway CA
... ELSE Create List Connection reset by peer Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00027
[Tags] selfserver ip+应答体and关系
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response& Body
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-ssl-00027 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0019.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset Tango Secure Gateway CA
... ELSE Create List Connection reset by peer Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Deny-Ssl-00028
[Tags] selfserver ip+应答体或关系
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response,你好明天
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-ssl-00028 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0019.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset Tango Secure Gateway CA
... ELSE Create List Connection reset by peer Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -16,7 +16,7 @@ ${profiledId} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Hijack-Http-00001
[Tags] selfserver http hijack ip+url
[Tags] selfserver ip+url
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -55,7 +55,7 @@ ProxyPolicy-Hijack-Http-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00002
[Tags] selfserver http hijack ip+fqdn完整匹配+url
[Tags] selfserver ip+fqdn完整匹配+url
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -94,7 +94,7 @@ ProxyPolicy-Hijack-Http-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00003
[Tags] selfserver http hijack ip+cat右匹配+url
[Tags] selfserver ip+cat右匹配+url
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -133,7 +133,7 @@ ProxyPolicy-Hijack-Http-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00004
[Tags] selfserver http hijack ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -168,7 +168,7 @@ ProxyPolicy-Hijack-Http-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00005
[Tags] selfserver http hijack ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -203,7 +203,7 @@ ProxyPolicy-Hijack-Http-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00006
[Tags] selfserver http hijack ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/nationalbank/nationalbank.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -238,7 +238,7 @@ ProxyPolicy-Hijack-Http-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00007
[Tags] selfserver http hijack ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -273,7 +273,7 @@ ProxyPolicy-Hijack-Http-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00008
[Tags] selfserver http hijack ip+请求头右匹配+url
[Tags] selfserver ip+请求头右匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -312,7 +312,7 @@ ProxyPolicy-Hijack-Http-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00009
[Tags] selfserver http hijack ip+请求头字串匹配+url
[Tags] selfserver ip+请求头字串匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -351,7 +351,7 @@ ProxyPolicy-Hijack-Http-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00010
[Tags] selfserver http hijack ip+请求头完整匹配+url
[Tags] selfserver ip+请求头完整匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -390,7 +390,7 @@ ProxyPolicy-Hijack-Http-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00011
[Tags] selfserver http hijack ip+请求头左匹配+url
[Tags] selfserver ip+请求头左匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -429,7 +429,7 @@ ProxyPolicy-Hijack-Http-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00012
[Tags] selfserver http hijack ip+cookie字串匹配+url
[Tags] selfserver ip+cookie字串匹配+url
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -468,7 +468,7 @@ ProxyPolicy-Hijack-Http-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00013
[Tags] selfserver http hijack ip+应答头右匹配+url
[Tags] selfserver ip+应答头右匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -507,7 +507,7 @@ ProxyPolicy-Hijack-Http-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00014
[Tags] selfserver http hijack ip+应答头字串匹配+url
[Tags] selfserver ip+应答头字串匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -546,7 +546,7 @@ ProxyPolicy-Hijack-Http-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00015
[Tags] selfserver http hijack ip+应答头完整匹配+url
[Tags] selfserver ip+应答头完整匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -585,7 +585,7 @@ ProxyPolicy-Hijack-Http-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00016
[Tags] selfserver http hijack ip+应答头左匹配+url
[Tags] selfserver ip+应答头左匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -624,7 +624,7 @@ ProxyPolicy-Hijack-Http-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00017
[Tags] selfserver http hijack ip+set-cookie右匹配+url
[Tags] selfserver ip+set-cookie右匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -663,7 +663,7 @@ ProxyPolicy-Hijack-Http-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00018
[Tags] selfserver http hijack ip+set-cookie字串匹配+url
[Tags] selfserver ip+set-cookie字串匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -702,7 +702,7 @@ ProxyPolicy-Hijack-Http-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00019
[Tags] selfserver http hijack ip+set-cookie完整匹配+url
[Tags] selfserver ip+set-cookie完整匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -741,7 +741,7 @@ ProxyPolicy-Hijack-Http-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00020
[Tags] selfserver http hijack ip+set-cookie左匹配+url
[Tags] selfserver ip+set-cookie左匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -780,7 +780,7 @@ ProxyPolicy-Hijack-Http-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00021
[Tags] selfserver 最大组合 http hijack
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -829,3 +829,59 @@ ProxyPolicy-Hijack-Http-00021
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00022
[Tags] selfserver 修改
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${object_ck_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_ck_Id}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-1.exe hijack {"isValid":1,"contentType":"application/x-msdos-program","opAction":"add","profileName":"test2","contentName":"Create-Hijack Files-test-1.exe","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Hijack-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0008.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' \ http://open.node.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac
... ELSE Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Hijack-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_ck_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0012.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac
... ELSE Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -16,7 +16,7 @@ ${profiledId} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Hijack-Ssl-00001
[Tags] selfserver ssl hijack ip+url
[Tags] selfserver ip+url
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -25,7 +25,7 @@ ProxyPolicy-Hijack-Ssl-00001
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test.apk hijack {"isValid":1,"contentType":"application/vnd.android.package-archive","opAction":"add","profileName":"test1","contentName":"Create-Hijack Files-test.apk","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -51,7 +51,7 @@ ProxyPolicy-Hijack-Ssl-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00002
[Tags] selfserver ssl hijack ip+fqdn完整匹配+url
[Tags] selfserver ip+fqdn完整匹配+url
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -64,7 +64,7 @@ ProxyPolicy-Hijack-Ssl-00002
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -90,7 +90,7 @@ ProxyPolicy-Hijack-Ssl-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00003
[Tags] selfserver ssl hijack ip+cat右匹配+url
[Tags] selfserver ip+cat右匹配+url
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
@@ -103,7 +103,7 @@ ProxyPolicy-Hijack-Ssl-00003
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-1.exe hijack {"isValid":1,"contentType":"application/x-msdos-program","opAction":"add","profileName":"test2","contentName":"Create-Hijack Files-test-1.exe","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -129,7 +129,7 @@ ProxyPolicy-Hijack-Ssl-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00004
[Tags] selfserver ssl hijack ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -138,7 +138,7 @@ ProxyPolicy-Hijack-Ssl-00004
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -164,7 +164,7 @@ ProxyPolicy-Hijack-Ssl-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00005
[Tags] selfserver ssl hijack ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -173,7 +173,7 @@ ProxyPolicy-Hijack-Ssl-00005
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-5.png hijack {"isValid":1,"contentType":"image/png","opAction":"add","profileName":"test4","contentName":"Create-Hijack Files-test-5.png","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -199,7 +199,7 @@ ProxyPolicy-Hijack-Ssl-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00006
[Tags] selfserver ssl hijack ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/bytedance/bytedance.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -208,7 +208,7 @@ ProxyPolicy-Hijack-Ssl-00006
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-4.jpeg hijack {"isValid":1,"contentType":"image/jpeg","opAction":"add","profileName":"test5","contentName":"Create-Hijack Files-test-4.jpeg","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -234,7 +234,7 @@ ProxyPolicy-Hijack-Ssl-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00007
[Tags] selfserver ssl hijack ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -243,7 +243,7 @@ ProxyPolicy-Hijack-Ssl-00007
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-2.gif hijack {"isValid":1,"contentType":"image/gif","opAction":"add","profileName":"test6","contentName":"Create-Hijack Files-test-2.gif","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -269,7 +269,7 @@ ProxyPolicy-Hijack-Ssl-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00008
[Tags] selfserver ssl hijack ip+请求头右匹配+url
[Tags] selfserver ip+请求头右匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -282,7 +282,7 @@ ProxyPolicy-Hijack-Ssl-00008
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -308,7 +308,7 @@ ProxyPolicy-Hijack-Ssl-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00009
[Tags] selfserver ssl hijack ip+请求头字串匹配+url
[Tags] selfserver ip+请求头字串匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -321,7 +321,7 @@ ProxyPolicy-Hijack-Ssl-00009
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -347,7 +347,7 @@ ProxyPolicy-Hijack-Ssl-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00010
[Tags] selfserver ssl hijack ip+请求头完整匹配+url
[Tags] selfserver ip+请求头完整匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -360,7 +360,7 @@ ProxyPolicy-Hijack-Ssl-00010
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -386,7 +386,7 @@ ProxyPolicy-Hijack-Ssl-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00011
[Tags] selfserver ssl hijack ip+请求头左匹配+url
[Tags] selfserver ip+请求头左匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -399,7 +399,7 @@ ProxyPolicy-Hijack-Ssl-00011
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-1.exe hijack {"isValid":1,"contentType":"application/x-msdos-program","opAction":"add","profileName":"test2","contentName":"Create-Hijack Files-test-1.exe","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -425,7 +425,7 @@ ProxyPolicy-Hijack-Ssl-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00012
[Tags] selfserver ssl hijack ip+cookie字串匹配+url
[Tags] selfserver ip+cookie字串匹配+url
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -438,7 +438,7 @@ ProxyPolicy-Hijack-Ssl-00012
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-5.png hijack {"isValid":1,"contentType":"image/png","opAction":"add","profileName":"test4","contentName":"Create-Hijack Files-test-5.png","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -464,7 +464,7 @@ ProxyPolicy-Hijack-Ssl-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00013
[Tags] selfserver ssl hijack ip+应答头右匹配+url
[Tags] selfserver ip+应答头右匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -477,7 +477,7 @@ ProxyPolicy-Hijack-Ssl-00013
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-4.jpeg hijack {"isValid":1,"contentType":"image/jpeg","opAction":"add","profileName":"test5","contentName":"Create-Hijack Files-test-4.jpeg","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -503,7 +503,7 @@ ProxyPolicy-Hijack-Ssl-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00014
[Tags] selfserver ssl hijack ip+应答头字串匹配+url
[Tags] selfserver ip+应答头字串匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -516,7 +516,7 @@ ProxyPolicy-Hijack-Ssl-00014
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-2.gif hijack {"isValid":1,"contentType":"image/gif","opAction":"add","profileName":"test6","contentName":"Create-Hijack Files-test-2.gif","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -542,7 +542,7 @@ ProxyPolicy-Hijack-Ssl-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00015
[Tags] selfserver ssl hijack ip+应答头完整匹配+url
[Tags] selfserver ip+应答头完整匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -555,7 +555,7 @@ ProxyPolicy-Hijack-Ssl-00015
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -581,7 +581,7 @@ ProxyPolicy-Hijack-Ssl-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00016
[Tags] selfserver ssl hijack ip+应答头左匹配+url
[Tags] selfserver ip+应答头左匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -594,7 +594,7 @@ ProxyPolicy-Hijack-Ssl-00016
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -620,7 +620,7 @@ ProxyPolicy-Hijack-Ssl-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00017
[Tags] selfserver ssl hijack ip+set-cookie右匹配+url
[Tags] selfserver ip+set-cookie右匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -633,7 +633,7 @@ ProxyPolicy-Hijack-Ssl-00017
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -659,7 +659,7 @@ ProxyPolicy-Hijack-Ssl-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00018
[Tags] selfserver ssl hijack ip+set-cookie字串匹配+url
[Tags] selfserver ip+set-cookie字串匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -672,7 +672,7 @@ ProxyPolicy-Hijack-Ssl-00018
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-5.png hijack {"isValid":1,"contentType":"image/png","opAction":"add","profileName":"test4","contentName":"Create-Hijack Files-test-5.png","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -698,7 +698,7 @@ ProxyPolicy-Hijack-Ssl-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00019
[Tags] selfserver ssl hijack ip+set-cookie完整匹配+url
[Tags] selfserver ip+set-cookie完整匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -711,7 +711,7 @@ ProxyPolicy-Hijack-Ssl-00019
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-4.jpeg hijack {"isValid":1,"contentType":"image/jpeg","opAction":"add","profileName":"test5","contentName":"Create-Hijack Files-test-4.jpeg","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -737,7 +737,7 @@ ProxyPolicy-Hijack-Ssl-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00020
[Tags] selfserver ssl hijack ip+set-cookie左匹配+url
[Tags] selfserver ip+set-cookie左匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -750,7 +750,7 @@ ProxyPolicy-Hijack-Ssl-00020
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-2.gif hijack {"isValid":1,"contentType":"image/gif","opAction":"add","profileName":"test6","contentName":"Create-Hijack Files-test-2.gif","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -776,7 +776,7 @@ ProxyPolicy-Hijack-Ssl-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00021
[Tags] selfserver 最大组合 ssl hijack
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -800,7 +800,7 @@ ProxyPolicy-Hijack-Ssl-00021
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -824,3 +824,60 @@ ProxyPolicy-Hijack-Ssl-00021
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00022
[Tags] selfserver 修改
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${object_rq_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_rq_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Hijack-SSL-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Hijack-SSL-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_rq_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0008.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' \ https://open.node.com
@{stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA X-TG-Construct-By
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -16,9 +16,9 @@ ${profiledId} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Insert-Http-00001
[Tags] selfserver http Insert ip+url
[Tags] selfserver ip+url
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*node.com/
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建insert文件
@@ -37,8 +37,8 @@ ProxyPolicy-Insert-Http-00001
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv \ http://open.node.com/test/xiaozhu/xiaozhu.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -51,13 +51,13 @@ ProxyPolicy-Insert-Http-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00002
[Tags] selfserver http Insert ip+fqdn完整匹配+url
[Tags] selfserver ip+fqdn完整匹配+url
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*node.com/
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建insert文件
@@ -76,8 +76,8 @@ ProxyPolicy-Insert-Http-00002
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -90,13 +90,13 @@ ProxyPolicy-Insert-Http-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00003
[Tags] selfserver http Insert ip+cat右匹配+url
[Tags] selfserver ip+cat右匹配+url
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_cat_Id}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*youtube.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*node.com/
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建insert文件
@@ -115,8 +115,8 @@ ProxyPolicy-Insert-Http-00003
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0002.bat
... ELSE set variable curl \ http://open.node.com/test/youtube/youtube.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -129,9 +129,9 @@ ProxyPolicy-Insert-Http-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00004
[Tags] selfserver http Insert ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*node.com/
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建insert文件
@@ -150,8 +150,8 @@ ProxyPolicy-Insert-Http-00004
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -164,9 +164,9 @@ ProxyPolicy-Insert-Http-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00005
[Tags] selfserver http Insert ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建insert文件
@@ -185,8 +185,8 @@ ProxyPolicy-Insert-Http-00005
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -199,9 +199,9 @@ ProxyPolicy-Insert-Http-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00006
[Tags] selfserver http Insert ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/nationalbank/nationalbank.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建insert文件
@@ -220,8 +220,8 @@ ProxyPolicy-Insert-Http-00006
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0003.bat
... ELSE set variable curl -kv http://open.node.com/test/nationalbank/nationalbank.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -234,7 +234,7 @@ ProxyPolicy-Insert-Http-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00007
[Tags] selfserver http Insert ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -255,8 +255,8 @@ ProxyPolicy-Insert-Http-00007
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0002.bat
... ELSE set variable curl \ \ http://open.node.com/test/youtube/youtube.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -269,7 +269,7 @@ ProxyPolicy-Insert-Http-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00008
[Tags] selfserver http Insert ip+请求头右匹配+url
[Tags] selfserver ip+请求头右匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -308,7 +308,7 @@ ProxyPolicy-Insert-Http-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00009
[Tags] selfserver http Insert ip+请求头字串匹配+url
[Tags] selfserver ip+请求头字串匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -347,7 +347,7 @@ ProxyPolicy-Insert-Http-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00010
[Tags] selfserver http Insert ip+请求头完整匹配+url
[Tags] selfserver ip+请求头完整匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -386,7 +386,7 @@ ProxyPolicy-Insert-Http-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00011
[Tags] selfserver http Insert ip+请求头左匹配+url
[Tags] selfserver ip+请求头左匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -425,13 +425,13 @@ ProxyPolicy-Insert-Http-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00012
[Tags] selfserver http Insert ip+cookie字串匹配+url
[Tags] selfserver ip+cookie字串匹配+url
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建insert文件
@@ -450,8 +450,8 @@ ProxyPolicy-Insert-Http-00012
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0012.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://open.node.com/test/nationalbank/nationalbank.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-insert-HTTP-0012.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -464,7 +464,7 @@ ProxyPolicy-Insert-Http-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00013
[Tags] selfserver http Insert ip+应答头右匹配+url
[Tags] selfserver ip+应答头右匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -489,8 +489,8 @@ ProxyPolicy-Insert-Http-00013
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -503,7 +503,7 @@ ProxyPolicy-Insert-Http-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00014
[Tags] selfserver http Insert ip+应答头字串匹配+url
[Tags] selfserver ip+应答头字串匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -528,8 +528,8 @@ ProxyPolicy-Insert-Http-00014
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -542,9 +542,9 @@ ProxyPolicy-Insert-Http-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00015
[Tags] selfserver http Insert ip+应答头完整匹配+url
[Tags] selfserver ip+应答头完整匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=utf-8|Content-Type
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html;charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
@@ -567,8 +567,8 @@ ProxyPolicy-Insert-Http-00015
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0003.bat
... ELSE set variable curl -kv http://open.node.com/test/nationalbank/nationalbank.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -581,7 +581,7 @@ ProxyPolicy-Insert-Http-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00016
[Tags] selfserver http Insert ip+应答头左匹配+url
[Tags] selfserver ip+应答头左匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -606,8 +606,8 @@ ProxyPolicy-Insert-Http-00016
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0002.bat
... ELSE set variable curl -kv \ http://open.node.com/test/youtube/youtube.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -620,7 +620,7 @@ ProxyPolicy-Insert-Http-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00017
[Tags] selfserver http Insert ip+set-cookie右匹配+url
[Tags] selfserver ip+set-cookie右匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -659,7 +659,7 @@ ProxyPolicy-Insert-Http-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00018
[Tags] selfserver http Insert ip+set-cookie字串匹配+url
[Tags] selfserver ip+set-cookie字串匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -698,7 +698,7 @@ ProxyPolicy-Insert-Http-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00019
[Tags] selfserver http Insert ip+set-cookie完整匹配+url
[Tags] selfserver ip+set-cookie完整匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -737,7 +737,7 @@ ProxyPolicy-Insert-Http-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00020
[Tags] selfserver http Insert ip+set-cookie左匹配+url
[Tags] selfserver ip+set-cookie左匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -776,7 +776,7 @@ ProxyPolicy-Insert-Http-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00021
[Tags] selfserver 最大组合 http Insert
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -825,3 +825,59 @@ ProxyPolicy-Insert-Http-00021
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00022
[Tags] selfserver 修改
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${object_sk_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_sk_Id}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Insert-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-insert-HTTP-0012.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Insert-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_sk_Id}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -16,16 +16,16 @@ ${profiledId} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Insert-Ssl-00001
[Tags] selfserver ssl Hijack ip+url
[Tags] selfserver ip+url
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*node.com/
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -37,10 +37,10 @@ ProxyPolicy-Insert-Ssl-00001
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0001.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/rutube/rutube.html
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
@@ -51,20 +51,20 @@ ProxyPolicy-Insert-Ssl-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00002
[Tags] selfserver ssl Insert ip+fqdn完整匹配+url
[Tags] selfserver ip+fqdn完整匹配+url
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*node.com/
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -76,8 +76,8 @@ ProxyPolicy-Insert-Ssl-00002
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0001.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/rutube/rutube.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA \ \ \ Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
@@ -90,20 +90,20 @@ ProxyPolicy-Insert-Ssl-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00003
[Tags] selfserver ssl Insert ip+cat右匹配+url
[Tags] selfserver ip+cat右匹配+url
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_cat_Id}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*action
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*node.com/
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -115,8 +115,8 @@ ProxyPolicy-Insert-Ssl-00003
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0019.bat
... ELSE set variable curl -kv \ -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" https://open.node.com/action
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
@@ -129,16 +129,16 @@ ProxyPolicy-Insert-Ssl-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00004
[Tags] selfserver ssl Insert ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*node.com/
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -150,8 +150,8 @@ ProxyPolicy-Insert-Ssl-00004
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0001.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/rutube/rutube.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
@@ -164,16 +164,16 @@ ProxyPolicy-Insert-Ssl-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00005
[Tags] selfserver ssl Insert ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -185,8 +185,8 @@ ProxyPolicy-Insert-Ssl-00005
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
@@ -199,16 +199,16 @@ ProxyPolicy-Insert-Ssl-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00006
[Tags] selfserver ssl Insert ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/bytedance/bytedance.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -220,8 +220,8 @@ ProxyPolicy-Insert-Ssl-00006
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0003.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/bytedance/bytedance.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
@@ -234,7 +234,7 @@ ProxyPolicy-Insert-Ssl-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00007
[Tags] selfserver ssl Insert ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -243,7 +243,7 @@ ProxyPolicy-Insert-Ssl-00007
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -255,8 +255,8 @@ ProxyPolicy-Insert-Ssl-00007
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0019.bat
... ELSE set variable curl -kv \ -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" https://open.node.com/action
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
@@ -269,7 +269,7 @@ ProxyPolicy-Insert-Ssl-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00008
[Tags] selfserver ssl Insert ip+请求头右匹配+url
[Tags] selfserver ip+请求头右匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -282,7 +282,7 @@ ProxyPolicy-Insert-Ssl-00008
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -308,7 +308,7 @@ ProxyPolicy-Insert-Ssl-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00009
[Tags] selfserver ssl Insert ip+请求头字串匹配+url
[Tags] selfserver ip+请求头字串匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -321,7 +321,7 @@ ProxyPolicy-Insert-Ssl-00009
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -347,7 +347,7 @@ ProxyPolicy-Insert-Ssl-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00010
[Tags] selfserver ssl Insert ip+请求头完整匹配+url
[Tags] selfserver ip+请求头完整匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -360,7 +360,7 @@ ProxyPolicy-Insert-Ssl-00010
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -386,7 +386,7 @@ ProxyPolicy-Insert-Ssl-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00011
[Tags] selfserver ssl Insert ip+请求头左匹配+url
[Tags] selfserver ip+请求头左匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -399,7 +399,7 @@ ProxyPolicy-Insert-Ssl-00011
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -425,20 +425,20 @@ ProxyPolicy-Insert-Ssl-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00012
[Tags] selfserver ssl Insert ip+cookie字串匹配+url
[Tags] selfserver ip+cookie字串匹配+url
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -450,8 +450,8 @@ ProxyPolicy-Insert-Ssl-00012
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0012.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'https://www.baidu.com/' \ https://open.node.com/test/nationalbank/nationalbank.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-insert-SSL-0012.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'https://www.baidu.com/' \ https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
@@ -464,9 +464,9 @@ ProxyPolicy-Insert-Ssl-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00013
[Tags] selfserver ssl Insert ip+应答头右匹配+url
[Tags] selfserver ip+应答头右匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
@@ -477,7 +477,7 @@ ProxyPolicy-Insert-Ssl-00013
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -489,8 +489,8 @@ ProxyPolicy-Insert-Ssl-00013
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0001.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/rutube/rutube.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
@@ -503,7 +503,7 @@ ProxyPolicy-Insert-Ssl-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00014
[Tags] selfserver ssl Insert ip+应答头字串匹配+url
[Tags] selfserver ip+应答头字串匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -516,7 +516,7 @@ ProxyPolicy-Insert-Ssl-00014
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -528,8 +528,8 @@ ProxyPolicy-Insert-Ssl-00014
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0001.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/rutube/rutube.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
@@ -542,9 +542,9 @@ ProxyPolicy-Insert-Ssl-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00015
[Tags] selfserver ssl Insert ip+应答头完整匹配+url
[Tags] selfserver ip+应答头完整匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html;charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
@@ -555,7 +555,7 @@ ProxyPolicy-Insert-Ssl-00015
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -567,8 +567,8 @@ ProxyPolicy-Insert-Ssl-00015
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0003.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/bytedance/bytedance.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
@@ -581,7 +581,7 @@ ProxyPolicy-Insert-Ssl-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00016
[Tags] selfserver ssl Insert ip+应答头左匹配+url
[Tags] selfserver ip+应答头左匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -594,7 +594,7 @@ ProxyPolicy-Insert-Ssl-00016
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -606,8 +606,8 @@ ProxyPolicy-Insert-Ssl-00016
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
@@ -620,7 +620,7 @@ ProxyPolicy-Insert-Ssl-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00017
[Tags] selfserver ssl Insert ip+set-cookie右匹配+url
[Tags] selfserver ip+set-cookie右匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -633,7 +633,7 @@ ProxyPolicy-Insert-Ssl-00017
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -659,7 +659,7 @@ ProxyPolicy-Insert-Ssl-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00018
[Tags] selfserver ssl Insert ip+set-cookie字串匹配+url
[Tags] selfserver ip+set-cookie字串匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -672,7 +672,7 @@ ProxyPolicy-Insert-Ssl-00018
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -698,7 +698,7 @@ ProxyPolicy-Insert-Ssl-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00019
[Tags] selfserver ssl Insert ip+set-cookie完整匹配+url
[Tags] selfserver ip+set-cookie完整匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -711,7 +711,7 @@ ProxyPolicy-Insert-Ssl-00019
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -724,7 +724,7 @@ ProxyPolicy-Insert-Ssl-00019
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0019.bat
... ELSE set variable curl -kv \ -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" https://open.node.com/action
... ELSE set variable curl -kv \ -H "Content-Type:application/x-www-form-urlencoded" \ POST -d "reqBody=test&setCookie=12345678&resBody=Response Body" https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
@@ -737,7 +737,7 @@ ProxyPolicy-Insert-Ssl-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00020
[Tags] selfserver ssl Insert ip+set-cookie左匹配+url
[Tags] selfserver ip+set-cookie左匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -750,7 +750,7 @@ ProxyPolicy-Insert-Ssl-00020
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -776,7 +776,7 @@ ProxyPolicy-Insert-Ssl-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00021
[Tags] selfserver 最大组合 ssl Insert
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -800,7 +800,7 @@ ProxyPolicy-Insert-Ssl-00021
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -813,7 +813,7 @@ ProxyPolicy-Insert-Ssl-00021
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-SSL-00023.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' https://open.node.com/action
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" \ POST -d "reqBody=test&setCookie=12345678&resBody=Response Body" -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
@@ -824,3 +824,59 @@ ProxyPolicy-Insert-Ssl-00021
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00022
[Tags] selfserver 修改
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${object_rq_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_rq_Id}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Insert-SSL-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Insert-SSL-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_rq_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0008.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' \ https://open.node.com
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -14,7 +14,7 @@ ${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Monitor-Http-00001
[Tags] selfserver ip http monitor
[Tags] selfserver ip
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -46,7 +46,7 @@ ProxyPolicy-Monitor-Http-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00002
[Tags] selfserver ip+fqdn完整匹配 http monitor
[Tags] selfserver ip+fqdn完整匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -78,7 +78,7 @@ ProxyPolicy-Monitor-Http-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00003
[Tags] selfserver ip+cat右匹配 http monitor
[Tags] selfserver ip+cat右匹配
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -110,7 +110,7 @@ ProxyPolicy-Monitor-Http-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00004
[Tags] selfserver http monitor ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -142,7 +142,7 @@ ProxyPolicy-Monitor-Http-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00005
[Tags] selfserver http monitor ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -174,9 +174,9 @@ ProxyPolicy-Monitor-Http-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00006
[Tags] selfserver http monitor ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/nationalbank/nationalbank.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/tengrinews/tengrinews.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
@@ -206,7 +206,7 @@ ProxyPolicy-Monitor-Http-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00007
[Tags] selfserver http monitor ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -238,7 +238,7 @@ ProxyPolicy-Monitor-Http-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00008
[Tags] selfserver http monitor ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -270,7 +270,7 @@ ProxyPolicy-Monitor-Http-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00009
[Tags] selfserver http monitor ip+请求头字串匹配
[Tags] selfserver ip+请求头字串匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -302,7 +302,7 @@ ProxyPolicy-Monitor-Http-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00010
[Tags] selfserver http monitor ip+请求头完整匹配
[Tags] selfserver ip+请求头完整匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -334,7 +334,7 @@ ProxyPolicy-Monitor-Http-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00011
[Tags] selfserver http monitor ip+请求头左匹配
[Tags] selfserver ip+请求头左匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -366,7 +366,7 @@ ProxyPolicy-Monitor-Http-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00012
[Tags] selfserver http monitor ip+cookie字串匹配
[Tags] selfserver ip+cookie字串匹配
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -398,7 +398,7 @@ ProxyPolicy-Monitor-Http-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00013
[Tags] selfserver http monitor ip+应答头右匹配
[Tags] selfserver ip+应答头右匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -430,7 +430,7 @@ ProxyPolicy-Monitor-Http-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00014
[Tags] selfserver http monitor ip+应答头字串匹配
[Tags] selfserver ip+应答头字串匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -462,7 +462,7 @@ ProxyPolicy-Monitor-Http-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00015
[Tags] selfserver http monitor ip+应答头完整匹配
[Tags] selfserver ip+应答头完整匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -494,7 +494,7 @@ ProxyPolicy-Monitor-Http-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00016
[Tags] selfserver http monitor ip+应答头左匹配
[Tags] selfserver ip+应答头左匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -526,7 +526,7 @@ ProxyPolicy-Monitor-Http-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00017
[Tags] selfserver http monitor ip+set-cookie右匹配
[Tags] selfserver ip+set-cookie右匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -558,7 +558,7 @@ ProxyPolicy-Monitor-Http-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00018
[Tags] selfserver http monitor ip+set-cookie字串匹配
[Tags] selfserver ip+set-cookie字串匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -590,7 +590,7 @@ ProxyPolicy-Monitor-Http-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00019
[Tags] selfserver http monitor ip+set-cookie完整匹配
[Tags] selfserver ip+set-cookie完整匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -622,7 +622,7 @@ ProxyPolicy-Monitor-Http-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00020
[Tags] selfserver http monitor ip+set-cookie左匹配
[Tags] selfserver ip+set-cookie左匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -654,7 +654,7 @@ ProxyPolicy-Monitor-Http-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00021
[Tags] selfserver http monitor ip+请求体字串匹配
[Tags] selfserver ip+请求体字串匹配
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -666,7 +666,7 @@ ProxyPolicy-Monitor-Http-00021
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Monitor-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${policyDict} Create Dictionary policyName=proxyPolicy-Monitor-HTTP-00021 policyType=pxy_manipulation policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
@@ -686,7 +686,7 @@ ProxyPolicy-Monitor-Http-00021
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00022
[Tags] selfserver http monitor ip+应答体字串匹配
[Tags] selfserver ip+应答体字串匹配
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response Body
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -718,7 +718,7 @@ ProxyPolicy-Monitor-Http-00022
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00023
[Tags] selfserver 最大组合 http monitor
[Tags] selfserver 最大组合
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -764,3 +764,179 @@ ProxyPolicy-Monitor-Http-00023
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00024
[Tags] selfserver 修改
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${object_rq_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_rq_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Monitor-HTTP-00024 policyType=pxy_manipulation policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"method":"monitor","protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0001.bat
... ELSE set variable curl http://open.node.com/test/xiaozhu/xiaozhu.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 酒店式公寓
... ELSE Create List 酒店式公寓
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Monitor-HTTP-00024 policyType=pxy_manipulation policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"method":"monitor","protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_rq_Id}|TSG_FIELD_HTTP_REQ_HDR policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0008.bat
... ELSE set variable curl \ --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' \ http://open.node.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 发送POST请求
... ELSE Create List 发送POST请求
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00025
[Tags] selfserver ip+请求体and关系
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=ctes&t123
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Monitor-HTTP-00025 policyType=pxy_manipulation policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List jwctest
... ELSE Create List jwctest
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00026
[Tags] selfserver ip+请求体或更新
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test,qazx
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Monitor-HTTP-00026 policyType=pxy_manipulation policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"method":"monitor","protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List jwctest
... ELSE Create List jwctest
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00027
[Tags] selfserver ip+应答体and关系
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response& Body
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Monitor-HTTP-00027 policyType=pxy_manipulation policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"method":"monitor","protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Response Body
... ELSE Create List Response Body
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00028
[Tags] selfserver ip+应答体或关系
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response,你好明天
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Monitor-HTTP-00028 policyType=pxy_manipulation policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"method":"monitor","protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Response Body
... ELSE Create List Response Body
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -14,7 +14,7 @@ ${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Redirect-Http-00001
[Tags] selfserver ip http redirect
[Tags] selfserver ip+url
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -46,7 +46,7 @@ ProxyPolicy-Redirect-Http-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00002
[Tags] selfserver ip+fqdn完整匹配 http redirect
[Tags] selfserver ip+fqdn完整匹配+url
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -82,7 +82,7 @@ ProxyPolicy-Redirect-Http-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00003
[Tags] selfserver ip+cat右匹配 http redirect
[Tags] selfserver ip+cat右匹配+url
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
@@ -118,7 +118,7 @@ ProxyPolicy-Redirect-Http-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00004
[Tags] selfserver http redirect ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -150,7 +150,7 @@ ProxyPolicy-Redirect-Http-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00005
[Tags] selfserver http redirect ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -182,7 +182,7 @@ ProxyPolicy-Redirect-Http-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00006
[Tags] selfserver http redirect ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/nationalbank/nationalbank.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -214,7 +214,7 @@ ProxyPolicy-Redirect-Http-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00007
[Tags] selfserver http redirect ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -246,7 +246,7 @@ ProxyPolicy-Redirect-Http-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00008
[Tags] selfserver http redirect ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -282,7 +282,7 @@ ProxyPolicy-Redirect-Http-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00009
[Tags] selfserver http redirect ip+请求头字串匹配
[Tags] selfserver ip+请求头字串匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -318,7 +318,7 @@ ProxyPolicy-Redirect-Http-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00010
[Tags] selfserver http redirect ip+请求头完整匹配
[Tags] selfserver ip+请求头完整匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -354,7 +354,7 @@ ProxyPolicy-Redirect-Http-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00011
[Tags] selfserver http redirect ip+请求头左匹配
[Tags] selfserver ip+请求头左匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -390,7 +390,7 @@ ProxyPolicy-Redirect-Http-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00012
[Tags] selfserver http redirect ip+cookie字串匹配
[Tags] selfserver ip+cookie字串匹配+url
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -426,7 +426,7 @@ ProxyPolicy-Redirect-Http-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00013
[Tags] selfserver http redirect ip+应答头右匹配
[Tags] selfserver ip+应答头右匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -462,7 +462,7 @@ ProxyPolicy-Redirect-Http-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00014
[Tags] selfserver http redirect ip+应答头字串匹配
[Tags] selfserver ip+应答头字串匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -498,7 +498,7 @@ ProxyPolicy-Redirect-Http-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00015
[Tags] selfserver http redirect ip+应答头完整匹配
[Tags] selfserver ip+应答头完整匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -534,7 +534,7 @@ ProxyPolicy-Redirect-Http-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00016
[Tags] selfserver http redirect ip+应答头左匹配
[Tags] selfserver ip+应答头左匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -570,7 +570,7 @@ ProxyPolicy-Redirect-Http-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00017
[Tags] selfserver http redirect ip+set-cookie右匹配
[Tags] selfserver ip+set-cookie右匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -606,7 +606,7 @@ ProxyPolicy-Redirect-Http-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00018
[Tags] selfserver http redirect ip+set-cookie字串匹配
[Tags] selfserver ip+set-cookie字串匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -642,7 +642,7 @@ ProxyPolicy-Redirect-Http-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00019
[Tags] selfserver http redirect ip+set-cookie完整匹配
[Tags] selfserver ip+set-cookie完整匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -678,7 +678,7 @@ ProxyPolicy-Redirect-Http-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00020
[Tags] selfserver http redirect ip+set-cookie左匹配
[Tags] selfserver ip+set-cookie左匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -714,7 +714,7 @@ ProxyPolicy-Redirect-Http-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00021
[Tags] selfserver http redirect ip+请求体字串匹配
[Tags] selfserver ip+请求体字串匹配+url
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -750,7 +750,7 @@ ProxyPolicy-Redirect-Http-00021
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00022
[Tags] selfserver 最大组合 http redirect
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -800,3 +800,123 @@ ProxyPolicy-Redirect-Http-00022
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00023
[Tags] selfserver 修改
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${object_yd_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_yd_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Redirect-HTTP-00023 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://www.ziroom.com/","code":301,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv \ http://open.node.com/test/xiaozhu/xiaozhu.html
@{stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.ziroom.com/ 301 X-TG-Construct-By
... ELSE Create List http://www.ziroom.com/ 301 X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Redirect-HTTP-00023 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://www.icbc.com.cn/","code":301,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL,${object_yd_Id}|TSG_FIELD_HTTP_RES_HDR policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv \ http://open.node.com/test/xiaozhu/xiaozhu.html
@{stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.icbc.com.cn/ 301 X-TG-Construct-By
... ELSE Create List http://www.icbc.com.cn/ 301 X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00024
[Tags] selfserver ip+请求体and关系+url
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=jwcte&st12
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Redirect-HTTP-00021 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://www.cmbchina.com/","code":301,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.cmbchina.com/ 301 X-TG-Construct-By
... ELSE Create List http://www.cmbchina.com/ 301 X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00025
[Tags] selfserver ip+请求体或关系+url
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test,yyyyy
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Redirect-HTTP-00021 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://www.cmbchina.com/","code":301,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.cmbchina.com/ 301 X-TG-Construct-By
... ELSE Create List http://www.cmbchina.com/ 301 X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -14,13 +14,13 @@ ${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Redirect-Ssl-00001
[Tags] selfserver ip ssl redirect
[Tags] selfserver ip+url
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -46,7 +46,7 @@ ProxyPolicy-Redirect-Ssl-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00002
[Tags] selfserver ip+fqdn完整匹配 ssl redirect
[Tags] selfserver ip+fqdn完整匹配+url
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -56,7 +56,7 @@ ProxyPolicy-Redirect-Ssl-00002
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -82,7 +82,7 @@ ProxyPolicy-Redirect-Ssl-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00003
[Tags] selfserver ip+cat右匹配 ssl redirect
[Tags] selfserver ip+cat右匹配+url
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
@@ -92,7 +92,7 @@ ProxyPolicy-Redirect-Ssl-00003
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -118,13 +118,13 @@ ProxyPolicy-Redirect-Ssl-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00004
[Tags] selfserver ssl redirect ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -150,13 +150,13 @@ ProxyPolicy-Redirect-Ssl-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00005
[Tags] selfserver ssl redirect ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -182,13 +182,13 @@ ProxyPolicy-Redirect-Ssl-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00006
[Tags] selfserver ssl redirect ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/bytedance/bytedance.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -214,13 +214,13 @@ ProxyPolicy-Redirect-Ssl-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00007
[Tags] selfserver ssl redirect ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -246,7 +246,7 @@ ProxyPolicy-Redirect-Ssl-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00008
[Tags] selfserver ssl redirect ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -256,7 +256,7 @@ ProxyPolicy-Redirect-Ssl-00008
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -282,7 +282,7 @@ ProxyPolicy-Redirect-Ssl-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00009
[Tags] selfserver ssl redirect ip+请求头字串匹配
[Tags] selfserver ip+请求头字串匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -292,7 +292,7 @@ ProxyPolicy-Redirect-Ssl-00009
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -318,7 +318,7 @@ ProxyPolicy-Redirect-Ssl-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00010
[Tags] selfserver ssl redirect ip+请求头完整匹配
[Tags] selfserver ip+请求头完整匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -328,7 +328,7 @@ ProxyPolicy-Redirect-Ssl-00010
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -354,7 +354,7 @@ ProxyPolicy-Redirect-Ssl-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00011
[Tags] selfserver ssl redirect ip+请求头左匹配
[Tags] selfserver ip+请求头左匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -364,7 +364,7 @@ ProxyPolicy-Redirect-Ssl-00011
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -390,7 +390,7 @@ ProxyPolicy-Redirect-Ssl-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00012
[Tags] selfserver ssl redirect ip+cookie字串匹配
[Tags] selfserver ip+cookie字串匹配+url
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -400,7 +400,7 @@ ProxyPolicy-Redirect-Ssl-00012
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -426,7 +426,7 @@ ProxyPolicy-Redirect-Ssl-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00013
[Tags] selfserver ssl redirect ip+应答头右匹配
[Tags] selfserver ip+应答头右匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -436,7 +436,7 @@ ProxyPolicy-Redirect-Ssl-00013
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -462,7 +462,7 @@ ProxyPolicy-Redirect-Ssl-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00014
[Tags] selfserver ssl redirect ip+应答头字串匹配
[Tags] selfserver ip+应答头字串匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -472,7 +472,7 @@ ProxyPolicy-Redirect-Ssl-00014
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -498,7 +498,7 @@ ProxyPolicy-Redirect-Ssl-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00015
[Tags] selfserver ssl redirect ip+应答头完整匹配
[Tags] selfserver ip+应答头完整匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -508,7 +508,7 @@ ProxyPolicy-Redirect-Ssl-00015
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -534,7 +534,7 @@ ProxyPolicy-Redirect-Ssl-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00016
[Tags] selfserver ssl redirect ip+应答头左匹配
[Tags] selfserver ip+应答头左匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -544,7 +544,7 @@ ProxyPolicy-Redirect-Ssl-00016
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -570,7 +570,7 @@ ProxyPolicy-Redirect-Ssl-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00017
[Tags] selfserver ssl redirect ip+set-cookie右匹配
[Tags] selfserver ip+set-cookie右匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -580,7 +580,7 @@ ProxyPolicy-Redirect-Ssl-00017
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -606,7 +606,7 @@ ProxyPolicy-Redirect-Ssl-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00018
[Tags] selfserver ssl redirect ip+set-cookie字串匹配
[Tags] selfserver ip+set-cookie字串匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -616,7 +616,7 @@ ProxyPolicy-Redirect-Ssl-00018
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -642,7 +642,7 @@ ProxyPolicy-Redirect-Ssl-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00019
[Tags] selfserver ssl redirect ip+set-cookie完整匹配
[Tags] selfserver ip+set-cookie完整匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -652,7 +652,7 @@ ProxyPolicy-Redirect-Ssl-00019
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -678,7 +678,7 @@ ProxyPolicy-Redirect-Ssl-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00020
[Tags] selfserver ssl redirect ip+set-cookie左匹配
[Tags] selfserver ip+set-cookie左匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -688,7 +688,7 @@ ProxyPolicy-Redirect-Ssl-00020
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -714,7 +714,7 @@ ProxyPolicy-Redirect-Ssl-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00021
[Tags] selfserver ssl redirect ip+请求体字串匹配
[Tags] selfserver ip+请求体字串匹配+url
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -724,7 +724,7 @@ ProxyPolicy-Redirect-Ssl-00021
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -750,7 +750,7 @@ ProxyPolicy-Redirect-Ssl-00021
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00022
[Tags] selfserver 最大组合 ssl redirect
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -776,7 +776,7 @@ ProxyPolicy-Redirect-Ssl-00022
${rescode} ${object_by_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_by_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -800,3 +800,127 @@ ProxyPolicy-Redirect-Ssl-00022
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00023
[Tags] selfserver 修改
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_cat_Id}
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Redirect-SSL-00023 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.douyu.com/","code":301,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0012.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'https://www.baidu.com/' \ https://open.node.com/test/nationalbank/nationalbank.html
@{stringlist} run keyword if '${systemType}'=='Windows' Create List https://www.douyu.com/ 301 X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List https://www.douyu.com/ 301 X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Redirect-SSL-00023 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.sojson.com","code":301,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_cat_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List https://www.sojson.com 301 X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List https://www.sojson.com 301 X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00024
[Tags] selfserver ip+请求体and关系+url
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=jwct&est123
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Redirect-SSL-00024 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://www.cmbchina.com/","code":301,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-SSL-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.cmbchina.com/ 301 X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List http://www.cmbchina.com/ 301 X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00025
[Tags] selfserver ip+请求体或关系+url
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=jwct,est123
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Redirect-SSL-00025 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://www.cmbchina.com/","code":301,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-SSL-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.cmbchina.com/ 301 X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List http://www.cmbchina.com/ 301 X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -14,7 +14,7 @@ ${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Replace-Http-00001
[Tags] selfserver ip http replace
[Tags] selfserver ip+url
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -46,7 +46,7 @@ ProxyPolicy-Replace-Http-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00002
[Tags] selfserver ip+fqdn完整匹配 http replace
[Tags] selfserver ip+fqdn完整匹配+url
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -82,7 +82,7 @@ ProxyPolicy-Replace-Http-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00003
[Tags] selfserver ip+cat右匹配 http replace
[Tags] selfserver ip+cat右匹配+url
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
@@ -118,7 +118,7 @@ ProxyPolicy-Replace-Http-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00004
[Tags] selfserver http replace ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -150,7 +150,7 @@ ProxyPolicy-Replace-Http-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00005
[Tags] selfserver http replace ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -182,7 +182,7 @@ ProxyPolicy-Replace-Http-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00006
[Tags] selfserver http replace ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/nationalbank/nationalbank.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -214,7 +214,7 @@ ProxyPolicy-Replace-Http-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00007
[Tags] selfserver http replace ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -246,7 +246,7 @@ ProxyPolicy-Replace-Http-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00008
[Tags] selfserver http replace ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -282,7 +282,7 @@ ProxyPolicy-Replace-Http-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00009
[Tags] selfserver http replace ip+请求头字串匹配
[Tags] selfserver ip+请求头字串匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -318,7 +318,7 @@ ProxyPolicy-Replace-Http-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00010
[Tags] selfserver http replace ip+请求头完整匹配
[Tags] selfserver ip+请求头完整匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -354,7 +354,7 @@ ProxyPolicy-Replace-Http-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00011
[Tags] selfserver http replace ip+请求头左匹配
[Tags] selfserver ip+请求头左匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -390,7 +390,7 @@ ProxyPolicy-Replace-Http-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00012
[Tags] selfserver http replace ip+cookie字串匹配
[Tags] selfserver ip+cookie字串匹配+url
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -426,7 +426,7 @@ ProxyPolicy-Replace-Http-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00013
[Tags] selfserver http replace ip+应答头右匹配
[Tags] selfserver ip+应答头右匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -462,7 +462,7 @@ ProxyPolicy-Replace-Http-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00014
[Tags] selfserver http replace ip+应答头字串匹配
[Tags] selfserver ip+应答头字串匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -498,7 +498,7 @@ ProxyPolicy-Replace-Http-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00015
[Tags] selfserver http replace ip+应答头完整匹配
[Tags] selfserver ip+应答头完整匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=utf-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -534,7 +534,7 @@ ProxyPolicy-Replace-Http-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00016
[Tags] selfserver http replace ip+应答头左匹配
[Tags] selfserver ip+应答头左匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -570,7 +570,7 @@ ProxyPolicy-Replace-Http-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00017
[Tags] selfserver http replace ip+set-cookie右匹配
[Tags] selfserver ip+set-cookie右匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -606,7 +606,7 @@ ProxyPolicy-Replace-Http-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00018
[Tags] selfserver http replace ip+set-cookie字串匹配
[Tags] selfserver ip+set-cookie字串匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -642,7 +642,7 @@ ProxyPolicy-Replace-Http-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00019
[Tags] selfserver http replace ip+set-cookie完整匹配
[Tags] selfserver ip+set-cookie完整匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -678,7 +678,7 @@ ProxyPolicy-Replace-Http-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00020
[Tags] selfserver http replace ip+set-cookie左匹配
[Tags] selfserver ip+set-cookie左匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -714,7 +714,7 @@ ProxyPolicy-Replace-Http-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00021
[Tags] selfserver 最大组合 http replace
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -760,3 +760,57 @@ ProxyPolicy-Replace-Http-00021
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00022
[Tags] selfserver 修改
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${object_sk_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_sk_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Replace-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"json"}],"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0002.bat
... ELSE set variable curl -kv \ http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List text/json
... ELSE Create List text/json
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Replace-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"replace","rules":[{"search_in":"http_resp_body","find":"发送POST请求","replace_with":"лайн"}],"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_url_Id}|TSG_FIELD_HTTP_URL,${object_sk_Id}|TSG_FIELD_HTTP_RES_HDR policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List лайн
... ELSE Create List лайн
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -14,13 +14,13 @@ ${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Replace-Ssl-00001
[Tags] selfserver ip ssl replace
[Tags] selfserver ip+url
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -46,7 +46,7 @@ ProxyPolicy-Replace-Ssl-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00002
[Tags] selfserver ip+fqdn完整匹配 ssl replace
[Tags] selfserver ip+fqdn完整匹配+url
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -56,7 +56,7 @@ ProxyPolicy-Replace-Ssl-00002
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -82,7 +82,7 @@ ProxyPolicy-Replace-Ssl-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00003
[Tags] selfserver ip+cat右匹配 ssl replace
[Tags] selfserver ip+cat右匹配+url
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
@@ -92,7 +92,7 @@ ProxyPolicy-Replace-Ssl-00003
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -118,13 +118,13 @@ ProxyPolicy-Replace-Ssl-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00004
[Tags] selfserver ssl replace ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -150,13 +150,13 @@ ProxyPolicy-Replace-Ssl-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00005
[Tags] selfserver ssl replace ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -182,13 +182,13 @@ ProxyPolicy-Replace-Ssl-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00006
[Tags] selfserver ssl replace ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/bytedance/bytedance.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -214,13 +214,13 @@ ProxyPolicy-Replace-Ssl-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00007
[Tags] selfserver ssl replace ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -246,7 +246,7 @@ ProxyPolicy-Replace-Ssl-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00008
[Tags] selfserver ssl replace ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -256,7 +256,7 @@ ProxyPolicy-Replace-Ssl-00008
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -282,7 +282,7 @@ ProxyPolicy-Replace-Ssl-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00009
[Tags] selfserver ssl replace ip+请求头字串匹配
[Tags] selfserver ip+请求头字串匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -292,7 +292,7 @@ ProxyPolicy-Replace-Ssl-00009
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -318,7 +318,7 @@ ProxyPolicy-Replace-Ssl-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00010
[Tags] selfserver ssl replace ip+请求头完整匹配
[Tags] selfserver ip+请求头完整匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -328,7 +328,7 @@ ProxyPolicy-Replace-Ssl-00010
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -354,7 +354,7 @@ ProxyPolicy-Replace-Ssl-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00011
[Tags] selfserver ssl replace ip+请求头左匹配
[Tags] selfserver ip+请求头左匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -364,7 +364,7 @@ ProxyPolicy-Replace-Ssl-00011
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -390,7 +390,7 @@ ProxyPolicy-Replace-Ssl-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00012
[Tags] selfserver ssl replace ip+cookie字串匹配
[Tags] selfserver ip+cookie字串匹配+url
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -400,7 +400,7 @@ ProxyPolicy-Replace-Ssl-00012
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -426,7 +426,7 @@ ProxyPolicy-Replace-Ssl-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00013
[Tags] selfserver ssl replace ip+应答头右匹配
[Tags] selfserver ip+应答头右匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -436,7 +436,7 @@ ProxyPolicy-Replace-Ssl-00013
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -462,7 +462,7 @@ ProxyPolicy-Replace-Ssl-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00014
[Tags] selfserver ssl replace ip+应答头字串匹配
[Tags] selfserver ip+应答头字串匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -472,7 +472,7 @@ ProxyPolicy-Replace-Ssl-00014
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -498,7 +498,7 @@ ProxyPolicy-Replace-Ssl-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00015
[Tags] selfserver ssl replace ip+应答头完整匹配
[Tags] selfserver ip+应答头完整匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -508,7 +508,7 @@ ProxyPolicy-Replace-Ssl-00015
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -534,7 +534,7 @@ ProxyPolicy-Replace-Ssl-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00016
[Tags] selfserver ssl replace ip+应答头左匹配
[Tags] selfserver ip+应答头左匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -544,7 +544,7 @@ ProxyPolicy-Replace-Ssl-00016
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -570,7 +570,7 @@ ProxyPolicy-Replace-Ssl-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00017
[Tags] selfserver ssl replace ip+set-cookie右匹配
[Tags] selfserver ip+set-cookie右匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -580,7 +580,7 @@ ProxyPolicy-Replace-Ssl-00017
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -606,7 +606,7 @@ ProxyPolicy-Replace-Ssl-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00018
[Tags] selfserver ssl replace ip+set-cookie字串匹配
[Tags] selfserver ip+set-cookie字串匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -616,7 +616,7 @@ ProxyPolicy-Replace-Ssl-00018
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -642,7 +642,7 @@ ProxyPolicy-Replace-Ssl-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00019
[Tags] selfserver ssl replace ip+set-cookie完整匹配
[Tags] selfserver ip+set-cookie完整匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -652,7 +652,7 @@ ProxyPolicy-Replace-Ssl-00019
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -678,7 +678,7 @@ ProxyPolicy-Replace-Ssl-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00020
[Tags] selfserver ssl replace ip+set-cookie左匹配
[Tags] selfserver ip+set-cookie左匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -688,7 +688,7 @@ ProxyPolicy-Replace-Ssl-00020
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -714,7 +714,7 @@ ProxyPolicy-Replace-Ssl-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00021
[Tags] selfserver 最大组合 ssl replace
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -735,7 +735,7 @@ ProxyPolicy-Replace-Ssl-00021
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=charset|Content-Type
${rescode} ${object_re_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_re_Id}
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -759,3 +759,57 @@ ProxyPolicy-Replace-Ssl-00021
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00022
[Tags] selfserver 修改
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${object_re_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_re_Id}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${object_rq_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_rq_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Replace-SSL-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"replace","rules":[{"search_in":"http_resp_body","find":"видео","replace_with":"酒店式公寓"}],"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL,${object_re_Id}|TSG_FIELD_HTTP_RES_HDR
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0001.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/rutube/rutube.html
@{stringlist} run keyword if '${systemType}'=='Windows' Create List 酒店式公寓 Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List 酒店式公寓 Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Replace-SSL-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"replace","rules":[{"search_in":"http_resp_body","find":"发送POST请求","replace_with":"你好明天"}],"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL,${object_rq_Id}|TSG_FIELD_HTTP_REQ_HDR policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0008.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' \ https://open.node.com
@{stringlist} run keyword if '${systemType}'=='Windows' Create List 你好明天 Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List 你好明天 Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -0,0 +1,35 @@
*** Settings ***
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
Force Tags tsg_adc Security_Policy
Library OperatingSystem
Resource ../../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Library Custometest
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-DNS-00001
[Tags] selfserver monitor dns
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-DNS-00001 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol": "DNS"} isValid=${1} appObjectIdArray=4
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.yhd.com
... ELSE set variable nslookup -d www.yhd.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List canonical name = www.yhd.com
... ELSE Create List canonical name = www.yhd.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} common_sled_ip 192.168.40.161

View File

@@ -0,0 +1,32 @@
*** Settings ***
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
Force Tags tsg_adc Security_Policy
Library OperatingSystem
Resource ../../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Library Custometest
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-Ftp-00001
[Tags] selfserver monitor ftp
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-FTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol":"FTP"} isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_success
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} common_server_ip 192.168.100.5

View File

@@ -43,11 +43,11 @@ SecurityPolicy-Allow-Http-00002
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-HTTP-00002 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -72,11 +72,11 @@ SecurityPolicy-Allow-Http-00003
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-HTTP-00003 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -101,11 +101,11 @@ SecurityPolicy-Allow-Http-00004
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-HTTP-00003 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}

View File

@@ -0,0 +1,45 @@
*** Settings ***
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
Force Tags tsg_adc Security_Policy
Library OperatingSystem
Resource ../../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../../03-Variable/AllFlowCaseVariable.txt
Library Custometest
Resource ../../../../02-Keyword/tsg_common/StmpHandle.robot
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-Mail-00001
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Mail-00001 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol":"MAIL"} isValid=${1} appObjectIdArray=5
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${Smtp服务器} Set Variable 192.168.100.5
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable jwctest@mail.tsgmail.com
${邮箱密码} Set Variable jwctest
${邮件主题} Set Variable 123test
${发送者} Set Variable jwctest@mail.tsgmail.com
${附件} Set Variable ["${mailpath}/朱明明测试文件.txt"]
${接收者} Set Variable ["zmmtest@mail.tsgmail.com"]
${抄送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${密送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
should contain ${发送邮件返回结果} mail_success
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com

View File

@@ -43,11 +43,11 @@ SecurityPolicy-Allow-SSL-00002
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -72,11 +72,11 @@ SecurityPolicy-Allow-SSL-00003
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}

View File

@@ -14,7 +14,7 @@ ${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Deny-DNS-00001
[Tags] Selfserver Deny Dns Ip+Fqdn右匹配
[Tags] selfserver dns deny ip+fqdn右匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*yhd.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -26,7 +26,7 @@ SecurityPolicy-Deny-DNS-00001
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.yhd.com
... ELSE set variable nslookup -d www.yhd.com
... ELSE set variable nslookup \ www.yhd.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 超时
... ELSE Create List canonical name = www.yhd.com
${starttime} Get Time
@@ -39,19 +39,19 @@ SecurityPolicy-Deny-DNS-00001
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} dns_qname yhd.com
SecurityPolicy-Deny-DNS-00002
[Tags] Selfserver Deny Dns Ip+Cat完整匹配
Comment 创建fqdn
[Tags] selfserver Ip+cat完整匹配 dns deny
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$www.toutiao.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_cat_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00001 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"A","answer":[{"atype":"CNAME","value":"www.vip.com","ttl":{"min":300,"max":300}}]}]} isValid=${1} appObjectIdArray=4
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00002 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"A","answer":[{"atype":"CNAME","value":"www.vip.com","ttl":{"min":300,"max":300}}]}]} isValid=${1} appObjectIdArray=4 referenceObject=${object_cat_Id}|TSG_FIELD_DNS_QNAME
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.toutiao.com
... ELSE set variable nslookup \ www.toutiao.com
... ELSE set variable nslookup -debug -query=A \ www.toutiao.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List canonical name = www.vip.com
... ELSE Create List canonical name = www.vip.com
${starttime} Get Time
@@ -62,3 +62,204 @@ SecurityPolicy-Deny-DNS-00002
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} dns_qname toutiao.com
SecurityPolicy-Deny-DNS-00003
[Tags] dns deny selfserver 多Ip+fqdn网站匹配
Comment 创建第二个源IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.50.18|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.douban.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00003 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"AAAA","answer":[{"atype":"CNAME","value":"www.taobao.com","ttl":{"min":350,"max":350}}]}]} isValid=${1} appObjectIdArray=4 referenceObject=${object_fqdn_Id}|TSG_FIELD_DNS_QNAME,${objectId}|TSG_SECURITY_SOURCE_ADDR
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.douban.com
... ELSE set variable nslookup -debug -query=AAAA \ www.douban.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List canonical name = www.taobao.com
... ELSE Create List canonical name = www.taobao.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} dns_qname www.douban.com
SecurityPolicy-Deny-DNS-00004
[Tags] selfserver Ip+cat完整匹配 dns deny
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$www.mgtv.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_cat_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00004 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"A","answer":[{"atype":"A","value":"192.168.50.18","ttl":{"min":400,"max":400}}]}]} isValid=${1} appObjectIdArray=4 referenceObject=${object_cat_Id}|TSG_FIELD_DNS_QNAME
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.mgtv.com
... ELSE set variable nslookup -debug -query=A \ www.mgtv.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 192.168.50.18
... ELSE Create List 192.168.50.18
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} dns_qname www.mgtv.com
SecurityPolicy-Deny-DNS-00005
[Tags] selfserver dns deny ip+fqdn右匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*suning.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00005 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"AAAA","answer":[{"atype":"AAAA","value":"fc00::2:66","ttl":{"min":500,"max":500}}]}]} isValid=${1} appObjectIdArray=4 referenceObject=${object_fqdn_Id}|TSG_FIELD_DNS_QNAME
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.suning.com
... ELSE set variable nslookup -debug -query=AAAA \ www.suning.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List fc00::2:66
... ELSE Create List fc00::2:66
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} dns_qname www.suning.com
SecurityPolicy-Deny-DNS-00006
[Tags] selfserver dns deny Ip+fqdn+cat
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*suning.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_cat_Id}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.mgtv.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00006 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"AAAA","answer":[{"atype":"AAAA","value":"fc00::2:66","ttl":{"min":500,"max":500}}]}]} isValid=${1} appObjectIdArray=4 referenceObject=${object_fqdn_Id}|TSG_FIELD_DNS_QNAME
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.mgtv.com
... ELSE set variable nslookup -debug -query=AAAA \ www.mgtv.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List fc00::2:66
... ELSE Create List fc00::2:66
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} dns_qname www.mgtv.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00006 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"A","answer":[{"atype":"A","value":"192.168.50.18","ttl":{"min":400,"max":400}}]}]} referenceObject=${object_cat_Id}|TSG_FIELD_DNS_QNAME isValid=${1} appObjectIdArray=4 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.suning.com
... ELSE set variable nslookup -debug -query=A \ www.suning.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 192.168.50.18
... ELSE Create List 192.168.50.18
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} dns_qname www.suning.com
SecurityPolicy-Deny-DNS-00007
[Tags] selfserver dns deny ip+fqdn右匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*suning.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00007 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"answer":[{"atype":"AAAA","value":"fc00::2:66","ttl":{"min":300,"max":300}},{"atype":"CNAME","value":"www.zhihu.com","ttl":{"min":300,"max":300}}],"qtype":"AAAA"}]} isValid=${1} appObjectIdArray=4 referenceObject=${object_fqdn_Id}|TSG_FIELD_DNS_QNAME
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.suning.com
... ELSE set variable nslookup -debug -query=AAAA www.suning.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List fc00::2:66 www.zhihu.com ttl = 300
... ELSE Create List fc00::2:66 www.zhihu.com ttl = 300
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} dns_qname www.suning.com
SecurityPolicy-Deny-DNS-00008
[Tags] selfserver dns deny ip+fqdn完整匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.zealer.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00008 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"answer":[{"atype":"A","value":"192.168.50.18","ttl":{"min":500,"max":500}},{"atype":"CNAME","value":"www.bilibili.com","ttl":{"min":500,"max":500}}],"qtype":"A"}]} isValid=${1} appObjectIdArray=4 referenceObject=${object_fqdn_Id}|TSG_FIELD_DNS_QNAME
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.zealer.com
... ELSE set variable nslookup -debug -query=A \ www.zealer.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 192.168.50.18 www.bilibili.com ttl = 500
... ELSE Create List 192.168.50.18 www.bilibili.com ttl = 500
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} dns_qname zealer.com
SecurityPolicy-Deny-DNS-00009
[Tags] selfserver dns deny ip+fqdn完整匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.douyu.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00009 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"answer":[{"atype":"AAAA","value":"fc00::2:66","ttl":{"min":500,"max":500}},{"atype":"CNAME","value":"www.booking.com","ttl":{"min":500,"max":500}}],"qtype":"AAAA"},{"qtype":"A","answer":[{"atype":"CNAME","value":"www.tuniu.com","ttl":{"min":500,"max":500}},{"atype":"A","value":"192.168.50.18","ttl":{"min":500,"max":500}}]}]} isValid=${1} appObjectIdArray=4 referenceObject=${object_fqdn_Id}|TSG_FIELD_DNS_QNAME
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.douyu.com
... ELSE set variable nslookup -debug -query=A www.douyu.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 192.168.50.18 www.tuniu.com ttl = 500 www.booking.com fc00::2:66
... ELSE Create List 192.168.50.18 www.tuniu.com ttl = 500
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.douyu.com
... ELSE set variable nslookup -debug -query=AAAA www.douyu.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 192.168.50.18 www.tuniu.com ttl = 500 www.booking.com fc00::2:66
... ELSE Create List ttl = 500 www.booking.com fc00::2:66
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} dns_qname www.douyu.com

View File

@@ -14,7 +14,7 @@ ${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Deny-Ftp-00001
[Tags] Selfserver Deny Ftp Account子串匹配
[Tags] selfserver deny ftp account子串匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=ftp_user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -36,7 +36,7 @@ SecurityPolicy-Deny-Ftp-00001
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Deny-Ftp-00002
[Tags] Selfserver Deny Ftp Account右匹配
[Tags] selfserver deny ftp account右匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -58,7 +58,7 @@ SecurityPolicy-Deny-Ftp-00002
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Deny-Ftp-00003
[Tags] Selfserver Deny Ftp Account完整匹配
[Tags] selfserver deny ftp account完整匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$ftp_user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -80,7 +80,7 @@ SecurityPolicy-Deny-Ftp-00003
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Deny-Ftp-00004
[Tags] Selfserver Deny Ftp Account左匹配
[Tags] selfserver deny ftp account左匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=ftp_u*
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -102,23 +102,244 @@ SecurityPolicy-Deny-Ftp-00004
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Deny-Ftp-00005
[Tags] Selfserver Deny Ftp Account子串匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=ftp_user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_Account_Id}
[Tags] selfserver deny ftp url子串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=168.100
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00005 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT isValid=${1} appObjectIdArray=6
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00005 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_down ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 435814 zmmtext123.txt
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
SecurityPolicy-Deny-Ftp-00006
[Tags] selfserver deny ftp url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*t.txt
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00006 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
SecurityPolicy-Deny-Ftp-00007
[Tags] selfserver deny ftp url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$ftp://192.168.100.5/test.txt
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00007 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
SecurityPolicy-Deny-Ftp-00008
[Tags] selfserver deny ftp url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=ftp://192.168.100*
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00008 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
SecurityPolicy-Deny-Ftp-00009
[Tags] selfserver deny ftp content子串匹配
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=中文test
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_content_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00009 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_content_Id}|TSG_FIELD_FTP_CONTENT isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
SecurityPolicy-Deny-Ftp-00010
[Tags] selfserver deny ftp content右匹配
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=*test.txt
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_content_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00010 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_content_Id}|TSG_FIELD_FTP_CONTENT isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
SecurityPolicy-Deny-Ftp-00011
[Tags] selfserver deny ftp content完整匹配
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=$中文test.txt
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_content_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00011 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_content_Id}|TSG_FIELD_FTP_CONTENT isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
SecurityPolicy-Deny-Ftp-00012
[Tags] selfserver deny ftp content左匹配
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=中文te*
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_content_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00012 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_content_Id}|TSG_FIELD_FTP_CONTENT isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
SecurityPolicy-Deny-Ftp-00013
[Tags] selfserver deny ftp 多ip+修改
Comment 创建第二个源IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.50.10|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_Account_Id}
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=中文te*
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_content_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00013 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_content_Id}|TSG_FIELD_FTP_CONTENT,${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00013 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_SOURCE_ADDR,${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT isValid=${1} appObjectIdArray=6 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Deny-Ftp-00014
[Tags] selfserver deny ftp 最大组合
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=168.100
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_url_Id}
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=中文test
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_content_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00014 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_content_Id}|TSG_FIELD_FTP_CONTENT,${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt

View File

@@ -16,7 +16,7 @@ ${profiledId} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Deny-Http-00001
[Tags] Selfserver Ip Deny Http
[Tags] deny http p selfserver
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -30,7 +30,7 @@ SecurityPolicy-Deny-Http-00001
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0001.bat
... ELSE set variable curl http://open.node.com/test/xiaozhu/xiaozhu.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Message content over the limit has been removed
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -38,10 +38,10 @@ SecurityPolicy-Deny-Http-00001
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} common_server_ip 192.168.100.5
SecurityPolicy-Deny-Http-00002
[Tags] Selfserver Deny Http Ip+Fqdn右匹配
[Tags] selfserver deny http ip+fqdn右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -59,7 +59,7 @@ SecurityPolicy-Deny-Http-00002
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0002.bat
... ELSE set variable curl http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Message content over the limit has been removed
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -70,7 +70,7 @@ SecurityPolicy-Deny-Http-00002
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00003
[Tags] Selfserver Deny Http Ip+Cat完整匹配
[Tags] selfserver deny http ip+cat完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -99,7 +99,7 @@ SecurityPolicy-Deny-Http-00003
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00004
[Tags] Selfserver Deny Http Ip+Url字串匹配
[Tags] selfserver deny http ip+url字串匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -128,7 +128,7 @@ SecurityPolicy-Deny-Http-00004
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00005
[Tags] Selfserver Deny Http Ip+Url右匹配
[Tags] selfserver deny http ip+url右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -157,7 +157,7 @@ SecurityPolicy-Deny-Http-00005
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00006
[Tags] Selfserver Deny Http Ip+Url完整匹配
[Tags] selfserver deny http ip+url完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -186,7 +186,7 @@ SecurityPolicy-Deny-Http-00006
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00007
[Tags] Selfserver Deny Http Ip+Url左匹配
[Tags] selfserver deny http ip+url左匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -215,7 +215,7 @@ SecurityPolicy-Deny-Http-00007
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00008
[Tags] Selfserver Deny Ip+请求头字串匹配 Http
[Tags] selfserver deny ip+请求头字串匹配 http
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -244,7 +244,7 @@ SecurityPolicy-Deny-Http-00008
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00009
[Tags] Selfserver Deny Http Ip+请求头右匹配
[Tags] selfserver deny http ip+请求头右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -273,7 +273,7 @@ SecurityPolicy-Deny-Http-00009
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00010
[Tags] Selfserver Deny Http Ip+请求头完整匹配
[Tags] selfserver deny http ip+请求头完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -302,7 +302,7 @@ SecurityPolicy-Deny-Http-00010
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00011
[Tags] Selfserver Deny Http Ip+请求头左匹配
[Tags] selfserver deny http ip+请求头左匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -331,7 +331,7 @@ SecurityPolicy-Deny-Http-00011
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00012
[Tags] Selfserver Http Ip+Cookie子串匹配 Deny
[Tags] selfserver http ip+cookie子串匹配 deny
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -360,7 +360,7 @@ SecurityPolicy-Deny-Http-00012
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00013
[Tags] Selfserver Deny Http Ip+应答头字串匹配
[Tags] selfserver deny http ip+应答头字串匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -389,7 +389,7 @@ SecurityPolicy-Deny-Http-00013
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00014
[Tags] Selfserver Deny Http Ip+应答头右匹配
[Tags] selfserver deny http ip+应答头右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -418,7 +418,7 @@ SecurityPolicy-Deny-Http-00014
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00015
[Tags] Selfserver Deny Http Ip+应答头完整匹配
[Tags] selfserver deny http ip+应答头完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -447,7 +447,7 @@ SecurityPolicy-Deny-Http-00015
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00016
[Tags] Selfserver Deny Http Ip+应答头左匹配
[Tags] selfserver deny http ip+应答头左匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -476,7 +476,7 @@ SecurityPolicy-Deny-Http-00016
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00017
[Tags] Selfserver Deny Http Ip+Set-Cookie字串匹配
[Tags] selfserver deny http ip+set-cookie字串匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -492,7 +492,7 @@ SecurityPolicy-Deny-Http-00017
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl \ http://open.node.com/
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
@@ -505,7 +505,7 @@ SecurityPolicy-Deny-Http-00017
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00018
[Tags] Selfserver Deny Http Ip+Set-Cookie右匹配
[Tags] selfserver deny http ip+set-cookie右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -521,7 +521,7 @@ SecurityPolicy-Deny-Http-00018
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl \ http://open.node.com/
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
@@ -534,7 +534,7 @@ SecurityPolicy-Deny-Http-00018
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00019
[Tags] Selfserver Deny Ip+Set-Cookie完整匹配 Http
[Tags] selfserver deny ip+set-cookie完整匹配 http
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -550,7 +550,7 @@ SecurityPolicy-Deny-Http-00019
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl \ http://open.node.com/
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
@@ -563,7 +563,7 @@ SecurityPolicy-Deny-Http-00019
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00020
[Tags] Selfserver Deny Ip+Set-Cookie左匹配 Http
[Tags] selfserver deny ip+set-cookie左匹配 http
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -579,7 +579,7 @@ SecurityPolicy-Deny-Http-00020
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl \ http://open.node.com/
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
@@ -592,7 +592,7 @@ SecurityPolicy-Deny-Http-00020
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00021
[Tags] Selfserver Deny Ip+请求体 Http
[Tags] selfserver deny ip+请求体 http
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -621,7 +621,7 @@ SecurityPolicy-Deny-Http-00021
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00022
[Tags] Selfserver Deny Http Ip+应答体
[Tags] selfserver deny http ip+应答体
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -650,7 +650,7 @@ SecurityPolicy-Deny-Http-00022
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00023
[Tags] Selfserver Deny Http 最大组合
[Tags] selfserver deny http 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -660,11 +660,11 @@ SecurityPolicy-Deny-Http-00023
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建url
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node.com
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_uid|Cookie
${rescode} ${object_CK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CK_Id}
Comment 创建应答头
@@ -672,19 +672,19 @@ SecurityPolicy-Deny-Http-00023
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Ұлттық
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=новости
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00023 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "HTTP","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_CK_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR,${object_RQ_Id} |TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appObjectIdArray=2
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00023 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"drop"} referenceObject=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_CK_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR,${object_RQ_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0012.bat
... ELSE set variable curl --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://open.node.com/test/nationalbank/nationalbank.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0023.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \http://open.node.com/test/tengrinews/tengrinews.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Message content over the limit has been removed
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -693,9 +693,8 @@ SecurityPolicy-Deny-Http-00023
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00024
[Tags] selfserver deny Http IP+host block
[Tags] selfserver deny http ip+host block
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -723,7 +722,7 @@ SecurityPolicy-Deny-Http-00024
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00025
[Tags] selfserver deny Http IP+host alert
[Tags] selfserver deny http ip+host alert
Comment 创建第二个源IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.50.10|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -752,13 +751,13 @@ SecurityPolicy-Deny-Http-00025
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00026
[Tags] selfserver deny Http IP+host alert
[Tags] selfserver deny http ip+host alert
Comment 创建第二个源IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.50.10|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
#创建引用文件
@@ -784,7 +783,7 @@ SecurityPolicy-Deny-Http-00026
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00027
[Tags] Selfserver Deny Http 最大组合
[Tags] selfserver deny http 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -818,7 +817,7 @@ SecurityPolicy-Deny-Http-00027
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00023.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Message content over the limit has been removed
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -847,7 +846,7 @@ SecurityPolicy-Deny-Http-00028
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0002.bat
... ELSE set variable curl http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Message content over the limit has been removed
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -872,7 +871,7 @@ SecurityPolicy-Deny-Http-00029
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0002.bat
... ELSE set variable curl http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Message content over the limit has been removed
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -880,7 +879,7 @@ SecurityPolicy-Deny-Http-00029
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} common_server_ip 192.168.100.5
SecurityPolicy-Deny-Http-00030
[Tags] selfserver deny http 新增Filter条件 ip+fqdn
@@ -901,7 +900,7 @@ SecurityPolicy-Deny-Http-00030
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0002.bat
... ELSE set variable curl http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Message content over the limit has been removed
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -917,7 +916,7 @@ SecurityPolicy-Deny-Http-00030
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Message content over the limit has been removed
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -925,3 +924,575 @@ SecurityPolicy-Deny-Http-00030
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00031
[Tags] selfserver deny alert http ip+url+请求头字串匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=node
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${object_UA_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
#创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00031 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"block","code":404,"html_profile":${profiledId}} referenceObject=${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00031 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_UA_Id}|TSG_FIELD_HTTP_REQ_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0008.bat
... ELSE set variable curl \ --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' \ http://open.node.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00032
[Tags] selfserver deny alert http ip+url+请求头左匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=node
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${object_UA_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00032 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"message":"Главная страница"} referenceObject=${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Главная страница
... ELSE Create List Главная страница
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00032 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"message":"Главная страница"} referenceObject=${object_UA_Id}|TSG_FIELD_HTTP_REQ_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0008.bat
... ELSE set variable curl \ --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' \ http://open.node.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List Главная страница
... ELSE Create List Главная страница
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00033
[Tags] selfserver deny alert http ip+url+请求头右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*nationalbank.html
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${object_UA_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
#创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404english.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00033 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"block","code":403,"html_profile":${profiledId}} referenceObject=${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00033 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_UA_Id}|TSG_FIELD_HTTP_REQ_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0008.bat
... ELSE set variable curl \ --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' \ http://open.node.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00034
[Tags] selfserver deny alert http ip+url+请求头完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/xiaozhu/xiaozhu.html
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${object_UA_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
#创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00034 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0001.bat
... ELSE set variable curl http://open.node.com/test/xiaozhu/xiaozhu.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00034 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_UA_Id}|TSG_FIELD_HTTP_REQ_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0008.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' \ curl \ http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00035
[Tags] selfserver deny alert http ip+set-cookie+应答头字串匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=UTF-8|Content-Type
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${object_SK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_SK_Id}
#创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00035 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00035 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_SK_Id}|TSG_FIELD_HTTP_RES_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-HTTP-00017.bat
... ELSE set variable curl http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00036
[Tags] selfserver deny alert http ip+set-cookie+应答头左匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text*|Content-Type
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=1234*|Set-Cookie
${rescode} ${object_SK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_SK_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00036 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"message":"Главная страница"} referenceObject=${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Главная страница
... ELSE Create List Главная страница
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00036 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"message":"Главная страница"} referenceObject=${object_SK_Id}|TSG_FIELD_HTTP_RES_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Главная страница
... ELSE Create List Главная страница
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00037
[Tags] selfserver deny alert http ip+set-cookie+应答头完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=UTF-8|Content-Type
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${object_SK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_SK_Id}
#创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00037 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0001.bat
... ELSE set variable curl http://open.node.com/test/xiaozhu/xiaozhu.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00037 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_SK_Id}|TSG_FIELD_HTTP_RES_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00038
[Tags] selfserver deny alert http ip+set-cookie+应答头右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*utf-8|Content-Type
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*5678|Set-Cookie
${rescode} ${object_SK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_SK_Id}
#创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00038 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0002.bat
... ELSE set variable curl \ http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00038 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_SK_Id}|TSG_FIELD_HTTP_RES_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00039
[Tags] selfserver deny alert http ip+cookie+请求体+应答体
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${object_CK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CK_Id}
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Ұлттық
${rescode} ${object_yq_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_yq_Id}
#创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00039 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_RQ_Id}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00039 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_CK_Id}|TSG_FIELD_HTTP_REQ_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_yq_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0012.bat
... ELSE set variable curl --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00040
[Tags] selfserver ip+请求体and关系
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=ctes&t123
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00040 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "HTTP","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00041
[Tags] selfserver ip+请求体或关系
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test,qazx
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00041 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "HTTP","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00042
[Tags] selfserver ip+应答体and关系
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Ұлттық&жайлы
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00022 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "HTTP","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00043
[Tags] selfserver ip+应答体或关系
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Ұлттық,1234
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00022 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "HTTP","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -16,7 +16,7 @@ ${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Deny-Mail-00001
[Tags] Selfserver Subject右匹配 Mail Deny
[Tags] selfserver subject右匹配 mail deny
Comment 创建Subject
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=*test
${rescode} ${object_Subject_Id} AddObject2 ${1} ${objectDict}
@@ -50,7 +50,7 @@ SecurityPolicy-Deny-Mail-00001
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00002
[Tags] Selfserver Subject完整匹配 Mail Deny
[Tags] selfserver subject完整匹配 mail deny
Comment 创建Subject
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=$你好明天
${rescode} ${object_Subject_Id} AddObject2 ${1} ${objectDict}
@@ -84,7 +84,7 @@ SecurityPolicy-Deny-Mail-00002
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00003
[Tags] Selfserver Subject字串匹配 Mail Deny
[Tags] selfserver subject字串匹配 mail deny
Comment 创建Subject
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=стопо
${rescode} ${object_Subject_Id} AddObject2 ${1} ${objectDict}
@@ -118,7 +118,7 @@ SecurityPolicy-Deny-Mail-00003
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00004
[Tags] Selfserver Subject左匹配 Mail Deny
[Tags] selfserver subject左匹配 mail deny
Comment 创建Subject
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=zxcv*
${rescode} ${object_Subject_Id} AddObject2 ${1} ${objectDict}
@@ -152,7 +152,7 @@ SecurityPolicy-Deny-Mail-00004
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00005
[Tags] Selfserver Content字串匹配 Mail Deny
[Tags] selfserver content字串匹配 mail deny
Comment 创建Content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=стопо
${rescode} ${object_Content_Id} AddObject2 ${1} ${objectDict}
@@ -186,7 +186,7 @@ SecurityPolicy-Deny-Mail-00005
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00006
[Tags] Selfserver Deny ATT_CONT字串匹配 Mail
[Tags] selfserver deny att_cont字串匹配 mail
Comment 创建ATT_CONT
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=стопо
${rescode} ${object_ATT_CONT_Id} AddObject2 ${1} ${objectDict}
@@ -220,7 +220,7 @@ SecurityPolicy-Deny-Mail-00006
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00007
[Tags] Selfserver Deny From右匹配 Mail
[Tags] selfserver deny from右匹配 mail
Comment 创建From
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*il.com
${rescode} ${object_From_Id} AddObject2 ${1} ${objectDict}
@@ -254,7 +254,7 @@ SecurityPolicy-Deny-Mail-00007
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00008
[Tags] Selfserver Deny From完整匹配 Mail
[Tags] selfserver deny from完整匹配 mail
Comment 创建From
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$jwctest@mail.tsgmail.com
${rescode} ${object_From_Id} AddObject2 ${1} ${objectDict}
@@ -288,7 +288,7 @@ SecurityPolicy-Deny-Mail-00008
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00009
[Tags] Selfserver Deny From字串匹配 Mail
[Tags] selfserver deny from字串匹配 mail
Comment 创建From
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=tsgmail
${rescode} ${object_From_Id} AddObject2 ${1} ${objectDict}
@@ -322,7 +322,7 @@ SecurityPolicy-Deny-Mail-00009
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00010
[Tags] Selfserver Deny From左匹配 Mail
[Tags] selfserver deny from左匹配 mail
Comment 创建From
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=jwct*
${rescode} ${object_From_Id} AddObject2 ${1} ${objectDict}
@@ -356,7 +356,7 @@ SecurityPolicy-Deny-Mail-00010
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00011
[Tags] Selfserver Deny To右匹配 Mail
[Tags] selfserver deny to右匹配 mail
Comment 创建To
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*il.com
${rescode} ${object_To_Id} AddObject2 ${1} ${objectDict}
@@ -390,7 +390,7 @@ SecurityPolicy-Deny-Mail-00011
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00012
[Tags] Selfserver Mali Deny To完整匹配
[Tags] selfserver mali deny to完整匹配
Comment 创建To
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$zmmtest@mail.tsgmail.com
${rescode} ${object_To_Id} AddObject2 ${1} ${objectDict}
@@ -424,7 +424,7 @@ SecurityPolicy-Deny-Mail-00012
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00013
[Tags] Selfserver Mali Deny To字串匹配
[Tags] selfserver mali deny to字串匹配
Comment 创建To
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=zmmtes
${rescode} ${object_To_Id} AddObject2 ${1} ${objectDict}
@@ -458,7 +458,7 @@ SecurityPolicy-Deny-Mail-00013
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00014
[Tags] Selfserver Mali Deny To左匹配
[Tags] selfserver mali deny to左匹配
Comment 创建To
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=zmmt*
${rescode} ${object_To_Id} AddObject2 ${1} ${objectDict}
@@ -492,7 +492,7 @@ SecurityPolicy-Deny-Mail-00014
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00015
[Tags] Selfserver Mali Deny Account右匹配
[Tags] selfserver mali deny account右匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*ail.com
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -526,7 +526,7 @@ SecurityPolicy-Deny-Mail-00015
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00016
[Tags] Selfserver Mali Deny Account完整匹配
[Tags] selfserver mali deny account完整匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$jwctest@mail.tsgmail.com
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -560,7 +560,7 @@ SecurityPolicy-Deny-Mail-00016
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00017
[Tags] Selfserver Mali Deny Account字串匹配
[Tags] selfserver mali deny account字串匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=jwcte
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -594,7 +594,7 @@ SecurityPolicy-Deny-Mail-00017
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00018
[Tags] Selfserver Mali Deny Account左匹配
[Tags] selfserver mali deny account左匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=jwctest*
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -626,3 +626,122 @@ SecurityPolicy-Deny-Mail-00018
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00019
[Tags] selfserver mali deny 最大组合
Comment 创建Subject
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=*vbnm
${rescode} ${object_Subject_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_Subject_Id}
Comment 创建Content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=content
${rescode} ${object_Content_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_Content_Id}
Comment 创建ATT_CONT
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=стопо
${rescode} ${object_ATT_CONT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_ATT_CONT_Id}
Comment 创建From
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=il.com
${rescode} ${object_From_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_From_Id}
Comment 创建To
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=zmmtes
${rescode} ${object_To_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_To_Id}
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=jwctest*
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_Account_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00019 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"drop"} referenceObject=${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT,${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Content_Id}|TSG_FIELD_MAIL_CONTENT,${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_To_Id}|TSG_FIELD_MAIL_TO,${object_ATT_CONT_Id}|TSG_FIELD_MAIL_ATT_CONTENT isValid=${1} appObjectIdArray=5
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${Smtp服务器} Set Variable 192.168.100.5
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable jwctest@mail.tsgmail.com
${邮箱密码} Set Variable jwctest
${邮件主题} Set Variable zxcvbnm
${发送者} Set Variable jwctest@mail.tsgmail.com
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["zmmtest@mail.tsgmail.com"]
${抄送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${密送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
should contain ${发送邮件返回结果} mail_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00020
[Tags] selfserver mali deny 多ip+修改
Comment 创建第二个源IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.50.10|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=jwctest*
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_Account_Id}
Comment 创建Subject
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=*cvbnm
${rescode} ${object_Subject_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_Subject_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00020 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"drop"} referenceObject=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${1} appObjectIdArray=5
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${Smtp服务器} Set Variable 192.168.100.5
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable jwctest@mail.tsgmail.com
${邮箱密码} Set Variable jwctest
${邮件主题} Set Variable zxcvbnm
${发送者} Set Variable jwctest@mail.tsgmail.com
${附件} Set Variable ["${mailpath}/朱明明测试文件.txt"]
${接收者} Set Variable ["zmmtest@mail.tsgmail.com"]
${抄送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${密送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
should contain ${发送邮件返回结果} mail_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00020 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"drop"} referenceObject=${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT,${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${1} appObjectIdArray=5 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${Smtp服务器} Set Variable 192.168.100.5
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable jwctest@mail.tsgmail.com
${邮箱密码} Set Variable jwctest
${邮件主题} Set Variable zxcvbnm
${发送者} Set Variable jwctest@mail.tsgmail.com
${附件} Set Variable ["${mailpath}/朱明明测试文件.txt"]
${接收者} Set Variable ["zmmtest@mail.tsgmail.com"]
${抄送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${密送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
should contain ${发送邮件返回结果} mail_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com

View File

@@ -14,13 +14,17 @@ ${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Deny-SSL-00001
[Tags] Selfserver Ip Deny Ssl
[Tags] selfserver deny ssl ip+fqdn
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00001 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"rst"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00001 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"rst"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -39,17 +43,17 @@ SecurityPolicy-Deny-SSL-00001
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-SSL-00002
[Tags] Selfserver Ssl Deny Sni Ip+Fqdn右匹配
[Tags] selfserver ssl deny sni ip+fqdn右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -57,7 +61,7 @@ SecurityPolicy-Deny-SSL-00002
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Operation timed out after
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -68,17 +72,17 @@ SecurityPolicy-Deny-SSL-00002
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-SSL-00003
[Tags] Selfserver Deny Sni Ssl Ip+Cat完整匹配
[Tags] selfserver deny ssl sni ip+Cat完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -86,7 +90,7 @@ SecurityPolicy-Deny-SSL-00003
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0003.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/bytedance/bytedance.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Operation timed out after
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -97,17 +101,17 @@ SecurityPolicy-Deny-SSL-00003
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-SSL-00004
[Tags] Selfserver Ssl Deny Ip+Fqdn右匹配 Cn
[Tags] selfserver ssl deny ip+fqdn右匹配 cn
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SSL-00004 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00004 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -126,17 +130,17 @@ SecurityPolicy-Deny-SSL-00004
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-SSL-00005
[Tags] Selfserver Deny Cn Ssl Ip+Cat完整匹配
[Tags] deny selfserver cn ssl ip+cat完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SSL-00005 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"rst"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00005 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"rst"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -155,17 +159,17 @@ SecurityPolicy-Deny-SSL-00005
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-SSL-00006
[Tags] Selfserver Ssl Deny Ip+Fqdn右匹配 San
[Tags] selfserver ssl deny san ip+fqdn右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SSL-00006 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"rst"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SAN isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00006 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"rst"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SAN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -184,17 +188,17 @@ SecurityPolicy-Deny-SSL-00006
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-SSL-00007
[Tags] Selfserver Deny San Ssl Ip+Cat完整匹配
[Tags] selfserver deny san ssl ip+cat完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SSL-00007 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SAN isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00007 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SAN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -211,3 +215,76 @@ SecurityPolicy-Deny-SSL-00007
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-SSL-00008
[Tags] selfserver deny ssl 最大组合 ip+cat+fqdn
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_cat_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00008 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SAN,${object_fqdn_Id}|TSG_FIELD_SSL_SNI,${object_fqdn_Id}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0003.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/bytedance/bytedance.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00008 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${object_cat_Id}|TSG_FIELD_SSL_SAN,${object_cat_Id}|TSG_FIELD_SSL_SNI,${object_cat_Id}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-SSL-00009
[Tags] selfserver ssl deny san 多ip+fqdn右匹配
Comment 创建第二个源IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.50.18|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00009 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"rst"} referenceObject=${objectId}|TSG_SECURITY_SOURCE_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SAN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -43,11 +43,11 @@ SecurityPolicy-Intercept-Http-00002
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00002 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -72,11 +72,11 @@ SecurityPolicy-Intercept-Http-00003
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -95,3 +95,74 @@ SecurityPolicy-Intercept-Http-00003
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Intercept-Http-00004
[Tags] Selfserver Intercept Http 双协议
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00004 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2,3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List nationalbank
... ELSE Create List nationalbank
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Intercept-Http-00005
[Tags] Selfserver Intercept Http 修改
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*open.node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_cat_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00006 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List nationalbank
... ELSE Create List nationalbank
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00006 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_cat_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0002.bat
... ELSE set variable curl http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 您可以免费加入成为频道会员
... ELSE Create List 关闭播放器
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -20,7 +20,7 @@ SecurityPolicy-Intercept-SSL-00001
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -43,13 +43,13 @@ SecurityPolicy-Intercept-SSL-00002
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -72,13 +72,13 @@ SecurityPolicy-Intercept-SSL-00003
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -95,3 +95,50 @@ SecurityPolicy-Intercept-SSL-00003
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Intercept-SSL-00004
[Tags] Selfserver Intercept Ssl 修改
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_cat_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0003.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/bytedance/bytedance.html
@{stringlist} run keyword if '${systemType}'=='Windows' set variable 字节跳动 Tango Secure Gateway CA
... ELSE set variable 字节跳动 Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_cat_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.html
@{stringlist} run keyword if '${systemType}'=='Windows' set variable Twitter Tango Secure Gateway CA
... ELSE set variable 新鲜事一网打尽 Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -0,0 +1,200 @@
*** Settings ***
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
Force Tags tsg_adc Security_Policy
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Library Custometest
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /policy/profile/keyringobj
${keyringId} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Intercept-SSL-00001
[Tags] ip root selfserver
Comment 创建证书
${response} CreatePolicyMutipartFile ${url} keyrings/root/ mesalab-ca-cert.pem mesalab-ca-key.pem
${keyringId} Get From Dictionary ${response} keyringId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":${keyringId},"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0001.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/rutube/rutube.html
@{stringlist} run keyword if '${systemType}'=='Windows' set variable видео mesalab-ca
... ELSE set variable рутуб mesalab-ca
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Intercept-SSL-00002
[Tags] root selfserver ip+cat
Comment 创建证书
${response} CreatePolicyMutipartFile ${url} keyrings/root/ tango-ca-root-01-cer.pem tango-ca-root-01-key.pem
${keyringId} Get From Dictionary ${response} keyringId
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":${keyringId},"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.html
@{stringlist} run keyword if '${systemType}'=='Windows' set variable Twitter tango-ca-root
... ELSE set variable Twitter tango-ca-root
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Intercept-SSL-00003
[Tags] root ip+fqdn selfserver
Comment 创建证书
${response} CreatePolicyMutipartFile ${url} keyrings/root/ tango-ca-trust-ca-cer.pem tango-ca-trust-ca-key.pem
${keyringId} Get From Dictionary ${response} keyringId
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":${keyringId},"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0003.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/bytedance/bytedance.html
@{stringlist} run keyword if '${systemType}'=='Windows' set variable 字节跳动 Tango National Proxy CA
... ELSE set variable 字节跳动 Tango National Proxy CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Intercept-SSL-00004
[Tags] Selfserver ip intermediate
Comment 创建证书
${response} CreatePolicyMutipartFile ${url} keyrings/intermediate/ tang-ca-v3-intermediate-01-cer.pem tang-ca-v3-intermediate-01-key.pem {"isValid":1,"opAction":"add","returnData":1,"keyringName":"test1","keyringType":"intermediate","reissueExpiryHour":0,"crl":"null","publicKeyAlgo":"rsa1024","keyringId":null,"includeRoot":0}
${keyringId} Get From Dictionary ${response} keyringId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00004 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":${keyringId},"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0001.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/rutube/rutube.html
@{stringlist} run keyword if '${systemType}'=='Windows' set variable видео tang-ca-v3-intermediate-01
... ELSE set variable рутуб tang-ca-v3-intermediate-01
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Intercept-SSL-00005
[Tags] selfserver ip+cat intermediate
Comment 创建证书
${response} CreatePolicyMutipartFile ${url} keyrings/intermediate/ tang-ca-v3-intermediate-02-cer.pem tang-ca-v3-intermediate-02-key.pem {"isValid":1,"opAction":"add","returnData":1,"keyringName":"test2","keyringType":"intermediate","reissueExpiryHour":0,"crl":"null","publicKeyAlgo":"rsa1024","keyringId":null,"includeRoot":0}
${keyringId} Get From Dictionary ${response} keyringId
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00005 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":${keyringId},"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.html
@{stringlist} run keyword if '${systemType}'=='Windows' set variable tang-ca-v3-intermediate-02 Twitter
... ELSE set variable Twitter tang-ca-v3-intermediate-02
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Intercept-SSL-00006
[Tags] ip+fqdn selfserver end-entity
Comment 创建证书
${response} CreatePolicyMutipartFile ${url} keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem tang-ca-v3-www.amazon.cn-key.pem {"isValid":1,"opAction":"add","returnData":1,"keyringName":"test3","keyringType":"end-entity","reissueExpiryHour":0,"crl":"null","publicKeyAlgo":"rsa1024","keyringId":null,"includeRoot":0}
${keyringId} Get From Dictionary ${response} keyringId
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00006 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":${keyringId},"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0003.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/bytedance/bytedance.html
@{stringlist} run keyword if '${systemType}'=='Windows' set variable 字节跳动 Tango Secure Gateway CA
... ELSE set variable 字节跳动 Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Intercept-SSL-00007
[Tags] Selfserver ip end-entity
Comment 创建证书
${response} CreatePolicyMutipartFile ${url} keyrings/end-entity/ tang-ca-v3-www.bing.com-cer.pem tang-ca-v3-www.bing.com-key.pem {"isValid":1,"opAction":"add","returnData":1,"keyringName":"test4","keyringType":"end-entity","reissueExpiryHour":0,"crl":"null","publicKeyAlgo":"rsa1024","keyringId":null,"includeRoot":0}
${keyringId} Get From Dictionary ${response} keyringId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00004 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":${keyringId},"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0001.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/rutube/rutube.html
@{stringlist} run keyword if '${systemType}'=='Windows' set variable видео Tango Secure Gateway CA
... ELSE set variable рутуб Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -45,7 +45,7 @@ SecurityPolicy-Monitor-DNS-00002
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00001 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol":"DNS"} isValid=${1} appObjectIdArray=4
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00001 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol":"DNS"} isValid=${1} appObjectIdArray=4 referenceObject=${object_fqdn_Id}|TSG_FIELD_DNS_QNAME
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}

View File

@@ -14,7 +14,7 @@ ${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Monitor-Ftp-00001
[Tags] Selfserver Ftp Monitor Account字串匹配
[Tags] selfserver monitor account字串匹配 ftp
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=ftp_user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -27,7 +27,7 @@ SecurityPolicy-Monitor-Ftp-00001
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_success
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
@@ -36,7 +36,7 @@ SecurityPolicy-Monitor-Ftp-00001
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Monitor-Ftp-00002
[Tags] Selfserver Ftp Monitor Account右匹配
[Tags] selfserver ftp monitor account右匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -49,7 +49,7 @@ SecurityPolicy-Monitor-Ftp-00002
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_success
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
@@ -58,7 +58,7 @@ SecurityPolicy-Monitor-Ftp-00002
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Monitor-Ftp-00003
[Tags] Selfserver Ftp Account完整匹配 Monitor
[Tags] selfserver ftp account完整匹配 monitor
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$ftp_user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -71,7 +71,7 @@ SecurityPolicy-Monitor-Ftp-00003
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_success
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
@@ -80,7 +80,7 @@ SecurityPolicy-Monitor-Ftp-00003
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Monitor-Ftp-00004
[Tags] Selfserver Ftp Monitor Account左匹配
[Tags] selfserver ftp monitor account左匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=ftp_u*
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -93,32 +93,10 @@ SecurityPolicy-Monitor-Ftp-00004
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_success
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Monitor-Ftp-00005
[Tags] Selfserver Ftp Account字串 Monitor
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=ftp_user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_Account_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-FTP-00005 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol":"FTP"} referenceObject=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_down ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 7 zmmtext123.txt
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user

View File

@@ -43,11 +43,11 @@ SecurityPolicy-Monitor-Http-00002
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00002 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -72,11 +72,11 @@ SecurityPolicy-Monitor-Http-00003
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00003 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -101,11 +101,11 @@ SecurityPolicy-Monitor-Http-00004
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node.com
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_url_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00004 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -130,11 +130,11 @@ SecurityPolicy-Monitor-Http-00005
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*youtube.html
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_url_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00005 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -159,11 +159,11 @@ SecurityPolicy-Monitor-Http-00006
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/nationalbank/nationalbank.html
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_url_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00006 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -188,11 +188,11 @@ SecurityPolicy-Monitor-Http-00007
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open*
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_url_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00007 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -217,11 +217,11 @@ SecurityPolicy-Monitor-Http-00008
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${object_UA_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_UA_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00008 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_UA_Id}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -246,11 +246,11 @@ SecurityPolicy-Monitor-Http-00009
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${object_UA_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_UA_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00009 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_UA_Id}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -275,11 +275,11 @@ SecurityPolicy-Monitor-Http-00010
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${object_UA_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_UA_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00010 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_UA_Id}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -304,11 +304,11 @@ SecurityPolicy-Monitor-Http-00011
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${object_UA_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_UA_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00011 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_UA_Id}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -333,11 +333,11 @@ SecurityPolicy-Monitor-Http-00012
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${object_CK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_CK_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CK_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00012 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_CK_Id}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -362,11 +362,11 @@ SecurityPolicy-Monitor-Http-00013
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=utf-8|Content-Type
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_CT_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00013 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -391,11 +391,11 @@ SecurityPolicy-Monitor-Http-00014
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*utf-8|Content-Type
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_CT_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00014 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -420,11 +420,11 @@ SecurityPolicy-Monitor-Http-00015
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=UTF-8|Content-Type
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_CT_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00015 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -449,11 +449,11 @@ SecurityPolicy-Monitor-Http-00016
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text*|Content-Type
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_CT_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00016 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -462,7 +462,7 @@ SecurityPolicy-Monitor-Http-00016
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List ақстан Республ
${stringlist} run keyword if '${systemType}'=='Windows' Create List switch=kazakh
... ELSE Create List ақстан Республ
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
@@ -478,11 +478,11 @@ SecurityPolicy-Monitor-Http-00017
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=4567|Set-Cookie
${rescode} ${object_SK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_SK_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_SK_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00017 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_SK_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -507,11 +507,11 @@ SecurityPolicy-Monitor-Http-00018
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*5678|Set-Cookie
${rescode} ${object_SK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_SK_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_SK_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00018 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_SK_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -536,11 +536,11 @@ SecurityPolicy-Monitor-Http-00019
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${object_SK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_SK_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_SK_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00019 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_SK_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -565,11 +565,11 @@ SecurityPolicy-Monitor-Http-00020
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=1234*|Set-Cookie
${rescode} ${object_SK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_SK_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_SK_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00020 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_SK_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -594,11 +594,11 @@ SecurityPolicy-Monitor-Http-00021
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_RQ_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00021 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -623,11 +623,11 @@ SecurityPolicy-Monitor-Http-00022
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Ұлттық
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_RQ_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00022 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -646,3 +646,118 @@ SecurityPolicy-Monitor-Http-00022
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Monitor-Http-00023
[Tags] selfserver ip+请求体and关系
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=ctes&t123
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00023 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Response Body
... ELSE Create List Response Body
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Monitor-Http-00024
[Tags] selfserver ip+请求体或关系
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test,qazx
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00024 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Response Body
... ELSE Create List Response Body
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Monitor-Http-00025
[Tags] selfserver ip+应答体and关系
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Ұлттық&жайлы
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00025 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List nationalbank
... ELSE Create List nationalbank
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Monitor-Http-00026
[Tags] selfserver ip+应答体或关系
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Ұлттық,1234
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00026 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List nationalbank
... ELSE Create List nationalbank
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -43,11 +43,11 @@ SecurityPolicy-Monitor-SSL-00002
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -72,11 +72,11 @@ SecurityPolicy-Monitor-SSL-00003
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -101,11 +101,11 @@ SecurityPolicy-Monitor-SSL-00004
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SSL-00004 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -130,11 +130,11 @@ SecurityPolicy-Monitor-SSL-00005
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SSL-00005 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol":"SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -159,11 +159,11 @@ SecurityPolicy-Monitor-SSL-00006
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SSL-00006 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol":"SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SAN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -188,11 +188,11 @@ SecurityPolicy-Monitor-SSL-00007
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SSL-00007 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SAN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}

View File

View File

@@ -9,9 +9,9 @@ Statistics-Country-00001
#请求地址 例如:/report/domain/recommend
${url} set variable /report/country/sourceipnum
#开始时间格式Y-M-D h:i:s
${startTime} set variable 2020-4-11 13:36:35.000
${startTime} set variable 2020-05-10 15:56:05
#结束时间格式Y-M-D h:i:s
${endTime} set variable 2020-4-30 13:36:35.000
${endTime} set variable 2020-05-25 15:56:35
#limit int型
${limit} set variable 50
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} limit=${limit}

View File

@@ -8,5 +8,5 @@ Statistics-domain-00001
#请求地址 例如:/report/domain/recommend
${url} set variable /report/domain/recommend
# \ 统计时间, \ 查询最近24小时数据例如当前时间为2020-03-26 15:14:00, 查询时间应设为推前1小时的整点实际传入参数为 "2020-03-26 14:00:00"
${statisticTime} set variable 2020-04-26 23:00:00
${statisticTime} set variable 2020-05-10 15:56:05
GetApi ${apiName} ${url} statisticTime=${statisticTime}

View File

@@ -0,0 +1,19 @@
*** Settings ***
Library DateTime
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
*** Test Cases ***
LogStatistics-domain_resource-00001
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable domain_resource
#请求地址 例如:/report/domain/recommend
${url} set variable /report/domain/resource/analyze
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime} -30 days
${startTime} Get Substring ${startTime} \ -4
${policyId} set variable 0
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_id=${policyId}

View File

@@ -9,9 +9,9 @@ Statistics-hijack_srcip_location-00001
#请求地址 例如:/report/domain/recommend
${url} set variable /report/hijack_srcip_location
#开始时间格式Y-M-D h:i:s
${startTime} set variable 2020-04-01 16:43:48
${startTime} set variable 2020-04-26 16:40:01
#结束时间格式Y-M-D h:i:s
${endTime} set variable 2020-04-26 16:40:01
${endTime} set variable 2020-05-26 10:57:47
#策略ID
${policy_id} set variable 0
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_id=${policy_id}

View File

@@ -0,0 +1,98 @@
*** Settings ***
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
Library DateTime
*** Test Cases ***
LogStatistics-hijack_scrip_num-00001
#120未更新
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable hijack_srcip_num
#请求地址 例如:/report/domain/recommend
${url} set variable /report/hijack_srcip_num
#开始时间格式Y-M-D h:i:s
${startTime} set variable 2020-04-26 16:40:01
#结束时间格式Y-M-D h:i:s
${endTime} set variable 2020-05-26 10:57:47
#策略ID列表多个逗号分隔
${policy_ids} set variable 0
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}
LogStatistics-hijack_scrip_num-00002
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable hijack_srcip_num
#请求地址 例如:/report/domain/recommend
${url} set variable /report/hijack_srcip_num
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -01:00:00
${startTime} Get Substring ${startTime} \ -4
#策略ID列表多个逗号分隔
${policy_ids} set variable 0,1
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}
LogStatistics-hijack_scrip_num-00003
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable hijack_srcip_num
#请求地址 例如:/report/domain/recommend
${url} set variable /report/hijack_srcip_num
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#结束时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -1 days
${startTime} Get Substring ${startTime} \ -4
#策略ID列表多个逗号分隔
${policy_ids} set variable 0,1
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}
LogStatistics-hijack_scrip_num-00004
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable hijack_srcip_num
#请求地址 例如:/report/domain/recommend
${url} set variable /report/hijack_srcip_num
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -7 days
${startTime} Get Substring ${startTime} \ -4
#策略ID列表多个逗号分隔
${policy_ids} set variable 0,1
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}
LogStatistics-hijack_scrip_num-00005
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable hijack_srcip_num
#请求地址 例如:/report/domain/recommend
${url} set variable /report/hijack_srcip_num
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -30 days
${startTime} Get Substring ${startTime} \ -4
#策略ID列表多个逗号分隔
${policy_ids} set variable 0,1
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}
LogStatistics-hijack_scrip_num-00006
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable hijack_srcip_num
#请求地址 例如:/report/domain/recommend
${url} set variable /report/hijack_srcip_num
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -365 days
${startTime} Get Substring ${startTime} \ -4
#策略ID列表多个逗号分隔
${policy_ids} set variable 0,1
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}

View File

@@ -0,0 +1,111 @@
*** Settings ***
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
Library DateTime
*** Test Cases ***
LogStatistics-injectionstatistics-00001
#120未更新
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable injectionstatistics
#请求地址 例如:/report/domain/recommend
${url} set variable /report/traffic/injectionstatistics
#开始时间格式Y-M-D h:i:s
${startTime} set variable 2020-04-26 16:40:01
#结束时间格式Y-M-D h:i:s
${endTime} set variable 2020-05-26 10:57:47
#返回结果记录数
${limit} set variable 50
#设备id多个id逗号分隔 \ 支持设备列表查询 后台查询条件如device_id in ($device_ids)
${device_ids} set variable CBT2201925000001
#统计时间粒度单位秒最小统计粒度为30秒
${timeGranularity} set variable 30
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity} limit=${limit} device_ids=${device_ids}
LogStatistics-injectionstatistics-00002
#120未更新
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable injectionstatistics
#请求地址 例如:/report/domain/recommend
${url} set variable /report/traffic/injectionstatistics
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -01:00:00
${startTime} Get Substring ${startTime} \ -4
#统计时间粒度单位秒最小统计粒度为30秒
${timeGranularity} set variable 30
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity}
LogStatistics-injectionstatistics-00003
#120未更新
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable injectionstatistics
#请求地址 例如:/report/domain/recommend
${url} set variable /report/traffic/injectionstatistics
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -1 days
${startTime} Get Substring ${startTime} \ -4
${device_ids} set variable CBT2201925000001
#统计时间粒度单位秒最小统计粒度为30秒
${timeGranularity} set variable 30
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity}
LogStatistics-injectionstatistics-00004
#120未更新
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable injectionstatistics
#请求地址 例如:/report/domain/recommend
${url} set variable /report/traffic/injectionstatistics
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -7 days
${startTime} Get Substring ${startTime} \ -4
${device_ids} set variable CBT2201925000001
#统计时间粒度单位秒最小统计粒度为30秒
${timeGranularity} set variable 30
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity}
LogStatistics-injectionstatistics-00005
#120未更新
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable injectionstatistics
#请求地址 例如:/report/domain/recommend
${url} set variable /report/traffic/injectionstatistics
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -30 days
${startTime} Get Substring ${startTime} \ -4
${device_ids} set variable CBT2201925000001
#统计时间粒度单位秒最小统计粒度为30秒
${timeGranularity} set variable 30
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity}
LogStatistics-injectionstatistics-00006
#120未更新
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable injectionstatistics
#请求地址 例如:/report/domain/recommend
${url} set variable /report/traffic/injectionstatistics
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -365 days
${startTime} Get Substring ${startTime} \ -4
${device_ids} set variable CBT2201925000001
#统计时间粒度单位秒最小统计粒度为30秒
${timeGranularity} set variable 30
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity}

View File

@@ -0,0 +1,19 @@
*** Settings ***
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
*** Test Cases ***
LogStatistics-topn-00001
#131已通过
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable topn
#请求地址 例如:/report/domain/recommend
${url} set variable /report/traffic/topn/domain
#开始时间格式Y-M-D h:i:s
${startTime} set variable 2020-04-26 18:38:07
#结束时间格式Y-M-D h:i:s
${endTime} set variable 2020-05-26 18:38:20
#排序依据: \ sessions、bytes、packets
${orderBy} set variable sessions
#limit int型
${limit} set variable 50
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} orderBy=${orderBy} limit=${limit}

View File

@@ -0,0 +1,14 @@
*** Settings ***
Resource ../../02-Keyword/tsg_bfapi/LogStatistics.robot
Library DateTime
*** Variables ***
${url} /report/url/recommend
*** Test Cases ***
LogStatistics-Recommend-00001
${Time} get current date
${endTime} add time to date ${Time} -01:00:00
${endTime} Get Substring ${endTime} \ -9
LOG ${endTime}00:00
Recommend ${url} ${endTime}00:00

View File

@@ -0,0 +1,30 @@
*** Settings ***
Resource ../../02-Keyword/tsg_bfapi/LogStatistics.robot
*** Variables ***
${url} /report/policyevent/hit/timeandcount
*** Test Cases ***
LogStatistics-Timeandcount-00001
[Tags] security_event_hits_log类型正常输出 单policyId
Timeandcount ${url} security_event_hits_log 20515
LogStatistics_Timeandcount-00002
[Tags] security_event_hits_log类型正常输出 多ip
Timeandcount ${url} security_event_hits_log 14385,32601
LogStatistics_Timeandcount-00003
[Tags] proxy_event_hits_log类型正常输出 单ip
Timeandcount ${url} proxy_event_hits_log 34736
LogStatistics-Timeandcount-00004
[Tags] proxy_event_hits_log类型正常输出 多ip
Timeandcount ${url} proxy_event_hits_log 34752,34748
LogStatistics-Timeandcount-00005
[Tags] policyid与日志类型不符合 单ip
Timeandcount ${url} proxy_event_hits_log 20515
LogStatistics-Timeandcount-00006
[Tags] policyid与日志类型不符合 多ip
Timeandcount ${url} proxy_event_hits_log 14385,32601

View File

@@ -0,0 +1,26 @@
*** Settings ***
Resource ../../02-Keyword/tsg_bfapi/LogStatistics.robot
*** Variables ***
${url} /report/policyevent/hit/trend
*** Test Cases ***
LogStatistics-Trend-00001
[Tags] security_event_hits_log类型正常输出
Trend ${url} 2020-05-27 00:00:00 2020-05-27 15:00:00 security_event_hits_log 32601
LogStatistics-Trend-00002
[Tags] proxy_event_hits_log类型正常输出
Trend ${url} 2020-05-27 00:00:00 2020-05-27 17:00:00 proxy_event_hits_log 34358
LogStatistics-Trend-00003
[Tags] 日志类型和policyId不一致
Trend ${url} 2020-05-27 00:00:00 2020-05-27 15:00:00 proxy_event_hits_log 32601
LogStatistics-Trend-00004
[Tags] policyId不在此时间段产生流量
Trend ${url} 2020-05-27 00:00:00 2020-05-27 15:00:00 proxy_event_hits_log 34358
LogStatistics-Trend-00005
[Tags] policyId不在此时间段产生流量
Trend ${url} 2020-05-27 00:00:00 2020-05-27 15:00:00 security_event_hits_log 14385

View File

@@ -0,0 +1,283 @@
*** Settings ***
Test Teardown TeardownDelete ${url} profileIds ${profileId}
Force Tags tsg_adc Security_Policy
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Library Custometest
*** Variables ***
${url} /policy/profile/hijackfiles
${profileId} ${EMPTY}
*** Keywords ***
ProfileComman
[Arguments] ${objectedit} ${type}
${default_json} ${default_files} ${default_url} Run Keyword If "${type}"=="hijack" Set Variable ${setting_proxy_profiles_hijack} hijack_files/ /policy/profile/hijackfiles
... ELSE IF Run Keyword If "${type}"=="insert" Set Variable ${setting_proxy_profiles_insert} insert_files/ /policy/profile/insertfiles
... ELSE Set Variable a b c
${objectDict} Jsoneditmanu ${default_json} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${default_url} ${default_files} ${objectDict}
[Return] ${response}
*** Test Cases ***
Hijack_file_24_type-test
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=Hijack_file_24_type-00000 contentName=Create-Hijack Files-test-0.apk contentType=application/vnd.android.package-archive
${response} ProfileComman ${objectedit} hijack
Hijack_file_24_type-00000
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=Hijack_file_24_type-00000 contentName=Create-Hijack Files-test-0.apk contentType=application/vnd.android.package-archive
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00001
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-1.exe contentType=application/x-msdos-program
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00002
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-2.gif contentType=image/gif
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00003
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-3.html contentType=text/html
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00004
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-4.jpeg contentType=image/jpeg
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00005
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-5.png contentType=image/png
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00005-1
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-5.png contentType=application/x-png
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00006
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-6.svg contentType=image/svg%2Bxml
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00007
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-7.rpm contentType=audio/x-pn-realaudio-plugin
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00008
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-8.dmg contentType=application/x-apple-diskimage
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00009
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-9.js contentType=application/x-javascript
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00010
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-10.rar contentType=application/octet-stream
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00011
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-11.zip contentType=application/x-zip-compressed
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00012
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-12.doc contentType=application/msword
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00013
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-13.docx contentType=application/vnd.openxmlformats-officedocument.wordprocessingml.document
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00014
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-14.json contentType=application/json
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00015
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-15.xml contentType=text/xml
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00016
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-16.pdf contentType=application/pdf
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00017
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-17.xls contentType=application/vnd.ms-excel
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00017-1
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-17.xls contentType=application/x-xls
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00018
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-18.xlsx contentType=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00019
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-19.ppt contentType=application/vnd.ms-powerpoint
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00019-1
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-19.ppt contentType=application/x-ppt
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00020
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-20.pptx contentType=application/vnd.openxmlformats-officedocument.presentationml.presentation
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00021
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-21.odt contentType=application/vnd.oasis.opendocument.text
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00022
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-22.css contentType=text/css
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00023
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-23.csv contentType=text/comma-separated-values
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
Hijack_file_24_type-00024
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-24.plain contentType=text/plain
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}

View File

@@ -0,0 +1,50 @@
*** Settings ***
Force Tags tsg_bf_api Clear_All_Policys
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
*** Variables ***
${url1} /policy/profile/keyringobj
${url2} /policy/profile/trustedcacertobj
${url3} /policy/profile/responsepages
${url4} /policy/profile/hijackfiles
${url5} /policy/profile/insertscripts
${url6} /policy/profile/trafficmirror
*** Test Cases ***
Keyring Policy delete all case
# 清空所有策略!!!
${reqData} Create Dictionary isClear=true
DeletePolicyFile ${url1} ${reqData}
Trusted Cert Policy delete all case
# 清空所有策略!!!
${reqData} Create Dictionary isClear=true
DeletePolicyFile ${url2} ${reqData}
Response Pages Policy delete all case
# 清空所有策略!!!
${reqData} Create Dictionary isClear=true
DeletePolicyFile ${url3} ${reqData}
Hijack Files Policy delete all case
# 清空所有策略!!!
${reqData} Create Dictionary isClear=true
DeletePolicyFile ${url4} ${reqData}
Insert Scripts Policy delete all case
# 清空所有策略!!!
${reqData} Create Dictionary isClear=true
DeletePolicyFile ${url5} ${reqData}
Traffic Mirror Policy delete all case
# 清空所有策略!!!
${reqData} Create Dictionary isClear=true
DeletePolicyFile ${url6} ${reqData}

View File

@@ -0,0 +1,248 @@
*** Settings ***
Test Teardown TeardownDelete ${url} profileIds ${profileId}
Force Tags tsg_bf_api Response_Pages
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Library Custometest
*** Variables ***
${url} /policy/profile/decryption
${profileId} ${EMPTY}
*** Test Cases ***
Decryption_Profile-00001
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profile_decryption_profile} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"profileName":"zmmtest","profileDesc":"","profileId":"525","isValid":1,"decryption":{"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"fail_action":"fail-close","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1}}}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
Decryption_Profile-00002
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest cn=1
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profile_decryption_profile} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"profileName":"zmmtest","profileDesc":"","profileId":"525","isValid":1,"decryption":{"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"fail_action":"fail-close","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1}}}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
Decryption_Profile-00003
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest issuer=1
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profile_decryption_profile} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"profileName":"zmmtest","profileDesc":"","profileId":"525","isValid":1,"decryption":{"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"fail_action":"fail-close","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1}}}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
Decryption_Profile-00004
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest self-signed=1
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profile_decryption_profile} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"profileName":"zmmtest","profileDesc":"","profileId":"525","isValid":1,"decryption":{"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"fail_action":"fail-close","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1}}}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
Decryption_Profile-00005
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest expiration=1
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profile_decryption_profile} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"profileName":"zmmtest","profileDesc":"","profileId":"525","isValid":1,"decryption":{"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"fail_action":"fail-close","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1}}}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
Decryption_Profile-00006
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest fail_action=pass-through
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profile_decryption_profile} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"profileName":"zmmtest","profileDesc":"","profileId":"525","isValid":1,"decryption":{"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"fail_action":"fail-close","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1}}}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
Decryption_Profile-00007
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest ev_cert=1
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profile_decryption_profile} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"profileName":"zmmtest","profileDesc":"","profileId":"525","isValid":1,"decryption":{"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"fail_action":"fail-close","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1}}}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
Decryption_Profile-00008
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest cert_transparency=1
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profile_decryption_profile} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"profileName":"zmmtest","profileDesc":"","profileId":"525","isValid":1,"decryption":{"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"fail_action":"fail-close","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1}}}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
Decryption_Profile-00009
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest mutual_authentication=1
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profile_decryption_profile} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"profileName":"zmmtest","profileDesc":"","profileId":"525","isValid":1,"decryption":{"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"fail_action":"fail-close","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1}}}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
Decryption_Profile-00010
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest cert_pinning=1
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profile_decryption_profile} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"profileName":"zmmtest","profileDesc":"","profileId":"525","isValid":1,"decryption":{"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"fail_action":"fail-close","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1}}}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
Decryption_Profile-00011
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest protocol_errors=1
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profile_decryption_profile} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"profileName":"zmmtest","profileDesc":"","profileId":"525","isValid":1,"decryption":{"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"fail_action":"fail-close","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1}}}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
Decryption_Profile-00012
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest trusted_root_cert_is_not_installed_on_client=1
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profile_decryption_profile} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"profileName":"zmmtest","profileDesc":"","profileId":"525","isValid":1,"decryption":{"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"fail_action":"fail-close","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1}}}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
Decryption_Profile-00013
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest allow_http2=0
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profile_decryption_profile} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"profileName":"zmmtest","profileDesc":"","profileId":"525","isValid":1,"decryption":{"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"fail_action":"fail-close","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1}}}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
Decryption_Profile-00014
#Hijack 需要修改的内容
${protocol_version} Create Dictionary min=ssl3 max=tls13 mirror_client=1 allow_http2=1
${objectedit} Create Dictionary profileName=zmminserttest protocol_version=${protocol_version}
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profile_decryption_profile} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"profileName":"zmmtest","profileDesc":"","profileId":"525","isValid":1,"decryption":{"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"fail_action":"fail-close","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1}}}]}
UpdatePolicyFile2 ${url} ${reqData_edit}

View File

@@ -0,0 +1,163 @@
*** Settings ***
Test Teardown TeardownDelete ${url} profileIds ${profileId}
Force Tags tsg_adc Security_Policy
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Library Custometest
*** Variables ***
${url} /policy/profile/dnsrecords
${profileId} ${EMPTY}
*** Test Cases ***
Dnsrecords_A_-00001
#Hijack 需要修改的内容
${Dict1} Create Dictionary value=192.168.0.1
${Dict2} Create Dictionary value=192.168.0.2
${list} Create List ${Dict1} ${Dict2}
${objectedit} Create Dictionary recordName=12 recordType=A recordValues=${list}
Comment 打印需要修改的json内容
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
log ${objectDict}
${response} Post-Request ${url} ${objectDict}
#查询
${profileId} Set Variable ${response['data']['list'][0]["recordId"]}
${profileName} Set Variable ${response['data']['list'][0]["recordName"]}
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
# 修改
log ${profileId}
${reqHeader_edit} Set Variable { \ \ \ \ "opAction": "update", \ \ \ \ "returnData": 1, \ \ \ \ "dnsRecordList": [ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "recordId": 1, \ \ \ \ \ \ \ \ \ \ \ \ "recordName": "12", \ \ \ \ \ \ \ \ \ \ \ \ "recordType": "A", \ \ \ \ \ \ \ \ \ \ \ \ "recordValues": [ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.1" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.2" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "isValid": 1, \ \ \ \ \ \ \ \ \ \ \ \ "profileDesc": "" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
${aaa} Evaluate type(${reqHeader_edit} )
log ${aaa}
UpdatePolicyFile2 ${url} ${reqHeader_edit}
Dnsrecords_MX_-00002
#Hijack 需要修改的内容
${Dict1} Create Dictionary value=abc.com priority=10
${Dict2} Create Dictionary value=edf.com priority=12
${list} Create List ${Dict1} ${Dict2}
${objectedit} Create Dictionary recordName=12 recordType=MX recordValues=${list}
Comment 打印需要修改的json内容
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
log ${objectDict}
${response} Post-Request ${url} ${objectDict}
#查询
${profileId} Set Variable ${response['data']['list'][0]["recordId"]}
${profileName} Set Variable ${response['data']['list'][0]["recordName"]}
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
# 修改
log ${profileId}
${reqHeader_edit} Set Variable { \ \ \ \ "opAction": "update", \ \ \ \ "returnData": 1, \ \ \ \ "dnsRecordList": [ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "recordId": ${profileId}, \ \ \ \ \ \ \ \ \ \ \ \ "recordName": "12", \ \ \ \ \ \ \ \ \ \ \ \ "recordType": "A", \ \ \ \ \ \ \ \ \ \ \ \ "recordValues": [ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.1" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.2" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "isValid": 1, \ \ \ \ \ \ \ \ \ \ \ \ "profileDesc": "" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
${aaa} Evaluate type(${reqHeader_edit} )
log ${aaa}
UpdatePolicyFile2 ${url} ${reqHeader_edit}
Dnsrecords_CNAME_-00003
#Hijack 需要修改的内容
${Dict1} Create Dictionary value=abc.com
${Dict2} Create Dictionary value=edf.com
${list} Create List ${Dict1} ${Dict2}
${objectedit} Create Dictionary recordName=12 recordType=CNAME recordValues=${list}
Comment 打印需要修改的json内容
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
log ${objectDict}
${response} Post-Request ${url} ${objectDict}
#查询
${profileId} Set Variable ${response['data']['list'][0]["recordId"]}
${profileName} Set Variable ${response['data']['list'][0]["recordName"]}
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
# 修改
log ${profileId}
${reqHeader_edit} Set Variable { \ \ \ \ "opAction": "update", \ \ \ \ "returnData": 1, \ \ \ \ "dnsRecordList": [ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "recordId": ${profileId}, \ \ \ \ \ \ \ \ \ \ \ \ "recordName": "12", \ \ \ \ \ \ \ \ \ \ \ \ "recordType": "A", \ \ \ \ \ \ \ \ \ \ \ \ "recordValues": [ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.1" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.2" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "isValid": 1, \ \ \ \ \ \ \ \ \ \ \ \ "profileDesc": "" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
${aaa} Evaluate type(${reqHeader_edit} )
log ${aaa}
UpdatePolicyFile2 ${url} ${reqHeader_edit}
Dnsrecords_AAAA_-00004
#Hijack 需要修改的内容
${Dict1} Create Dictionary value=2000db8:2de::e13
${Dict2} Create Dictionary value=2000db8:2de::e13
${list} Create List ${Dict1} ${Dict2}
${objectedit} Create Dictionary recordName=12 recordType=AAAA recordValues=${list}
Comment 打印需要修改的json内容
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
log ${objectDict}
${response} Post-Request ${url} ${objectDict}
#查询
${profileId} Set Variable ${response['data']['list'][0]["recordId"]}
${profileName} Set Variable ${response['data']['list'][0]["recordName"]}
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
# 修改
log ${profileId}
${reqHeader_edit} Set Variable { \ \ \ \ "opAction": "update", \ \ \ \ "returnData": 1, \ \ \ \ "dnsRecordList": [ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "recordId": ${profileId}, \ \ \ \ \ \ \ \ \ \ \ \ "recordName": "12", \ \ \ \ \ \ \ \ \ \ \ \ "recordType": "A", \ \ \ \ \ \ \ \ \ \ \ \ "recordValues": [ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.1" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.2" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "isValid": 1, \ \ \ \ \ \ \ \ \ \ \ \ "profileDesc": "" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
${aaa} Evaluate type(${reqHeader_edit} )
log ${aaa}
UpdatePolicyFile2 ${url} ${reqHeader_edit}
Dnsrecords_TXT_-00005
#Hijack 需要修改的内容
${Dict1} Create Dictionary value=abc.com
${Dict2} Create Dictionary value=edf.com
${list} Create List ${Dict1} ${Dict2}
${objectedit} Create Dictionary recordName=12 recordType=CNAME recordValues=${list}
Comment 打印需要修改的json内容
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
log ${objectDict}
${response} Post-Request ${url} ${objectDict}
#查询
${profileId} Set Variable ${response['data']['list'][0]["recordId"]}
${profileName} Set Variable ${response['data']['list'][0]["recordName"]}
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
# 修改
log ${profileId}
${reqHeader_edit} Set Variable { \ \ \ \ "opAction": "update", \ \ \ \ "returnData": 1, \ \ \ \ "dnsRecordList": [ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "recordId": ${profileId}, \ \ \ \ \ \ \ \ \ \ \ \ "recordName": "12", \ \ \ \ \ \ \ \ \ \ \ \ "recordType": "A", \ \ \ \ \ \ \ \ \ \ \ \ "recordValues": [ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.1" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.2" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "isValid": 1, \ \ \ \ \ \ \ \ \ \ \ \ "profileDesc": "" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
${aaa} Evaluate type(${reqHeader_edit} )
log ${aaa}
UpdatePolicyFile2 ${url} ${reqHeader_edit}
Dnsrecords_NS_-00006
#Hijack 需要修改的内容
${Dict1} Create Dictionary value=abc.com
${Dict2} Create Dictionary value=edf.com
${list} Create List ${Dict1} ${Dict2}
${objectedit} Create Dictionary recordName=12 recordType=CNAME recordValues=${list}
Comment 打印需要修改的json内容
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
log ${objectDict}
${response} Post-Request ${url} ${objectDict}
#查询
${profileId} Set Variable ${response['data']['list'][0]["recordId"]}
${profileName} Set Variable ${response['data']['list'][0]["recordName"]}
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
# 修改
log ${profileId}
${reqHeader_edit} Set Variable { \ \ \ \ "opAction": "update", \ \ \ \ "returnData": 1, \ \ \ \ "dnsRecordList": [ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "recordId": ${profileId}, \ \ \ \ \ \ \ \ \ \ \ \ "recordName": "12", \ \ \ \ \ \ \ \ \ \ \ \ "recordType": "A", \ \ \ \ \ \ \ \ \ \ \ \ "recordValues": [ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.1" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.2" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "isValid": 1, \ \ \ \ \ \ \ \ \ \ \ \ "profileDesc": "" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
${aaa} Evaluate type(${reqHeader_edit} )
log ${aaa}
UpdatePolicyFile2 ${url} ${reqHeader_edit}
Dnsrecords_PTR_-00007
#Hijack 需要修改的内容
${Dict1} Create Dictionary value=abc.com
${Dict2} Create Dictionary value=edf.com
${list} Create List ${Dict1} ${Dict2}
${objectedit} Create Dictionary recordName=12 recordType=CNAME recordValues=${list}
Comment 打印需要修改的json内容
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
log ${objectDict}
${response} Post-Request ${url} ${objectDict}
#查询
${profileId} Set Variable ${response['data']['list'][0]["recordId"]}
${profileName} Set Variable ${response['data']['list'][0]["recordName"]}
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
# 修改
log ${profileId}
${reqHeader_edit} Set Variable { \ \ \ \ "opAction": "update", \ \ \ \ "returnData": 1, \ \ \ \ "dnsRecordList": [ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "recordId": ${profileId}, \ \ \ \ \ \ \ \ \ \ \ \ "recordName": "12", \ \ \ \ \ \ \ \ \ \ \ \ "recordType": "A", \ \ \ \ \ \ \ \ \ \ \ \ "recordValues": [ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.1" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.2" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "isValid": 1, \ \ \ \ \ \ \ \ \ \ \ \ "profileDesc": "" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
${aaa} Evaluate type(${reqHeader_edit} )
log ${aaa}
UpdatePolicyFile2 ${url} ${reqHeader_edit}

View File

@@ -0,0 +1,481 @@
*** Settings ***
Test Teardown TeardownDelete ${url} profileIds ${profileId}
Force Tags tsg_adc Security_Policy
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Library Custometest
*** Variables ***
${url} /policy/profile/hijackfiles
${profileId} ${EMPTY}
*** Test Cases ***
Hijack_file_24_type_apk-00000
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-0.apk contentType=application/vnd.android.package-archive
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-0.apk ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
#DeletePolicyFile ${url} ${profileId}
Hijack_file_24_type_exe-00001
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-1.exe contentType=application/x-msdos-program
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-1.exe ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_gif-00002
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-2.gif contentType=image/gif
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-2.gif ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_html-00003
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-3.html contentType=text/html
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-3.html ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_jpeg-00004
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-4.jpeg contentType=image/jpeg
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-4.jpeg ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_png-00005
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-5.png contentType=image/png
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-5.png ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_png-00005-1
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-5.png contentType=application/x-png
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-5.png ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_svg-00006
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-6.svg contentType=image/svg%2Bxml
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-6.svg ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_rpm-00007
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-7.rpm contentType=audio/x-pn-realaudio-plugin
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-7.rpm ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_dmg-00008
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-8.dmg contentType=application/x-apple-diskimage
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-8.dmg ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_js-00009
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-9.js contentType=application/x-javascript
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-9.js ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_rar-00010
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-10.rar contentType=application/octet-stream
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-10.rar ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_zip-00011
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-11.zip contentType=application/x-zip-compressed
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-11.zip ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_doc-00012
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-12.doc contentType=application/msword
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-12.doc ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_docx-00013
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-13.docx contentType=application/vnd.openxmlformats-officedocument.wordprocessingml.document
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-13.docx ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_json-00014
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-14.json contentType=application/json
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-14.json ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_xml-00015
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-15.xml contentType=text/xml
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-15.xml ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_pdf-00016
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-16.pdf contentType=application/pdf
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-16.pdf ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_xls-00017
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-17.xls contentType=application/vnd.ms-excel
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-17.xls ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_xls-00017-1
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-17.xls contentType=application/x-xls
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-17.xls ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_xlsx-00018
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-18.xlsx contentType=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-18.xlsx ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_ppt-00019
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-19.ppt contentType=application/vnd.ms-powerpoint
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-19.ppt ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_ppt-00019-1
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-19.ppt contentType=application/x-ppt
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-19.ppt ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_pptx-00020
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-20.pptx contentType=application/vnd.openxmlformats-officedocument.presentationml.presentation
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-20.pptx ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_odt-00021
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-21.odt contentType=application/vnd.oasis.opendocument.text
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-21.odt ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_css-00022
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-22.css contentType=text/css
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-22.css ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_csv-00023
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-23.csv contentType=text/comma-separated-values
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-23.csv ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_plain-00024
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-24.plain contentType=text/plain
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-24.plain ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
Hijack_file_24_type_txt-00025
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-24.txt contentType=text/plain
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-24.txt ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}

View File

@@ -0,0 +1,81 @@
*** Settings ***
Test Teardown TeardownDelete ${url} profileIds ${profileId}
Force Tags tsg_adc Security_Policy
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Library Custometest
*** Variables ***
${url} /policy/profile/insertscripts
${profileId} ${EMPTY}
*** Test Cases ***
Insert_Scripts_js_before-00001
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest format=js insertOn=before_page_load
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_insert} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} insert_files/ Create-Insert Scripts-test-1.js ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqHeader_edit} Set Variable {"isValid":1,"format":"css","insertOn":"","opAction":"update","profileName":"test_edit","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} insert_files/ Create-Insert Scripts-test.css ${reqHeader_edit}
Insert_Scripts_js_after-00002
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest format=js insertOn=after_page_load
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_insert} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} insert_files/ Create-Insert Scripts-test-1.js ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqHeader_edit} Set Variable {"isValid":1,"format":"css","insertOn":"","opAction":"update","profileName":"test_edit","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} insert_files/ Create-Insert Scripts-test.css ${reqHeader_edit}
Insert_Scripts_css_before-00003
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest format=css insertOn=""
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_insert} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} insert_files/ Create-Insert Scripts-test.css ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqHeader_edit} Set Variable {"isValid":1,"format":"js","insertOn":"before_page_load ","opAction":"update","profileName":"test_edit","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} insert_files/ Create-Insert Scripts-test-1.js ${reqHeader_edit}
Insert_Scripts_css_after-00004
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest format=css insertOn=""
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_insert} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} insert_files/ Create-Insert Scripts-test.css ${objectDict}
log 12313123123123213123213
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqHeader_edit} Set Variable {"isValid":1,"format":"js","insertOn":"after_page_load \ ","opAction":"update","profileName":"test_edit","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} insert_files/ Create-Insert Scripts-test-1.js ${reqHeader_edit}

View File

@@ -0,0 +1,35 @@
*** Settings ***
Force Tags tsg_bf_api Cached_Intermediate_Certificates
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
*** Variables ***
${url} /policy/exch/intermediacert
*** Test Cases ***
Intermedia Cert Policy case
# 查询1
${suffix_quary} Catenate SEPARATOR=& certId=269 sni=nationalbank.kz
QueryPolicyFile ${url} ${suffix_quary}
# 查询2
${suffix_quary} Catenate SEPARATOR=& certIds=263,265 sni=dw-online.ksosoft
QueryPolicyFile ${url} ${suffix_quary}
# 启用/暂停
${certId} QueryPolicyFile2 ${url} isValid=1
${certIds} Create List ${certId}
${data} Set Variable {"opAction":"disable","certIds":${certIds}}
UpdatePolicyFile2 ${url} ${data}
${data2} Set Variable {"opAction":"enable","certIds":${certIds}}
UpdatePolicyFile2 ${url} ${data2}

View File

@@ -0,0 +1,48 @@
*** Settings ***
Test Teardown TeardownDelete ${url} keyringIds ${keyringId}
Force Tags tsg_bf_api Decryption_Keyrings
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
*** Variables ***
${url} /policy/profile/keyringobj
${keyringId} ${EMPTY}
*** Test Cases ***
Settings-ProxyProfiles-KeyringFile_root-00001
# 新增 root
${response} CreatePolicyMutipartFile ${url} keyrings/root/ mesalab-ca-cert.pem mesalab-ca-key.pem root
# 查询
${keyringId} Get From Dictionary ${response} keyringId
${keyringName} Get From Dictionary ${response} keyringName
QueryPolicyFile ${url} keyringId=${keyringId}&keyringName=${keyringName}
# 修改
${header_edit} Set Variable {"isValid":1,"opAction":"update","returnData":1,"keyringName":"test_edit","keyringType":"end-entity","reissueExpiryHour":0,"crl":"null","publicKeyAlgo":"rsa2048","keyringId":"${keyringId}","includeRoot":0}
UpdatePolicyMutipartFile ${url} Keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem tang-ca-v3-www.amazon.cn-key.pem ${header_edit}
Settings-ProxyProfiles-KeyringFile_end-entity-00002
# 新增 end-entity
${response} CreatePolicyMutipartFile ${url} keyrings/end-entity/ tang-ca-v3-www.bing.com-cer.cer tang-ca-v3-www.bing.com-key.pem end-entity
# 查询
${keyringId} Get From Dictionary ${response} keyringId
${keyringName} Get From Dictionary ${response} keyringName
QueryPolicyFile ${url} keyringId=${keyringId}&keyringName=${keyringName}
# 修改
${header_edit} Set Variable {"isValid":1,"opAction":"update","returnData":1,"keyringName":"test_edit","keyringType":"end-entity","reissueExpiryHour":0,"crl":"null","publicKeyAlgo":"rsa2048","keyringId":"${keyringId}","includeRoot":0}
UpdatePolicyMutipartFile ${url} Keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem tang-ca-v3-www.amazon.cn-key.pem ${header_edit}
Settings-ProxyProfiles-KeyringFile_Intermediate-00003
# 新增 end-entity
${response} CreatePolicyMutipartFile ${url} keyrings/Intermediate/ tang-ca-v3-intermediate-01-cer.pem tang-ca-v3-intermediate-01-key.pem Intermediate
# 查询
${keyringId} Get From Dictionary ${response} keyringId
${keyringName} Get From Dictionary ${response} keyringName
QueryPolicyFile ${url} keyringId=${keyringId}&keyringName=${keyringName}
# 修改
${header_edit} Set Variable {"isValid":1,"opAction":"update","returnData":1,"keyringName":"test_edit","keyringType":"end-entity","reissueExpiryHour":0,"crl":"null","publicKeyAlgo":"rsa2048","keyringId":"${keyringId}","includeRoot":0}
UpdatePolicyMutipartFile ${url} keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem tang-ca-v3-www.amazon.cn-key.pem ${header_edit}

View File

@@ -0,0 +1,38 @@
*** Settings ***
Test Teardown TeardownDelete ${url} profileIds ${profileId}
Force Tags tsg_bf_api Response_Pages
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Library Custometest
*** Variables ***
${url} /policy/profile/responsepages
${profileId} ${EMPTY}
*** Test Cases ***
Response_page_html-00001
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest format=html
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_reponse_page} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} response_pages_files/ Create-Response Pages-test.html ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${header_edit} Set Variable {"isValid":1,"format":"html","opAction":"update","profileName":"test_edit","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} response_pages_files/ Create-Response Pages-test.html ${header_edit}

View File

@@ -0,0 +1,97 @@
*** Settings ***
Test Teardown TeardownDelete ${url} profileIds ${profileId}
Force Tags tsg_bf_api Traffic_Mirror_Profiles
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Library Custometest
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../03-Variable/BifangApiVariable.txt
*** Variables ***
${url} /policy/profile/trafficmirror
${profileId} ${EMPTY}
*** Test Cases ***
TrafficMirrorPolicy_vlan_Single_object-00001
#Hijack 需要修改的内容
${list} Create List 1
${objectedit} Create Dictionary profileName=zmminserttest addrType=vlan addrArray=${list}
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_traffic_mirror_profiles} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"trafficMirrorList":[{"profileId":"${profileId}","profileName":"test_edit","addrType":"vlan","isValid":1,"addrArray":["256"]}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
TrafficMirrorPolicy_vlan_Multi_object-00002
#Hijack 需要修改的内容
${list} Create List 1 2
${objectedit} Create Dictionary profileName=zmminserttest addrType=vlan addrArray=${list}
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_traffic_mirror_profiles} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"trafficMirrorList":[{"profileId":"${profileId}","profileName":"test_edit","addrType":"vlan","isValid":1,"addrArray":["256"]}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
TrafficMirrorPolicy_mac_Single_object-00003
#Hijack 需要修改的内容
${list} Create List 13:13:13:13:13:13
${objectedit} Create Dictionary profileName=zmminserttest addrType=mac addrArray=${list}
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_traffic_mirror_profiles} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"trafficMirrorList":[{"profileId":"${profileId}","profileName":"test_edit","addrType":"vlan","isValid":1,"addrArray":["256"]}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
TrafficMirrorPolicy_mac_Multi_object-00004
#Hijack 需要修改的内容
${list} Create List 13:13:13:13:13:13 13:13:13:13:13:13
${objectedit} Create Dictionary profileName=zmminserttest addrType=mac addrArray=${list}
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_traffic_mirror_profiles} ${objectedit}
log ${objectDict}
${response} CreateRequest ${url} ${objectDict}
# 查询
log ${response}
${profileId} Get From Dictionary ${response} profileId
${profileName} Get From Dictionary ${response} profileName
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"trafficMirrorList":[{"profileId":"${profileId}","profileName":"test_edit","addrType":"vlan","isValid":1,"addrArray":["256"]}]}
${aaa} Evaluate type(${reqData_edit})
log ${aaa}
UpdatePolicyFile2 ${url} ${reqData_edit}

View File

@@ -0,0 +1,56 @@
*** Settings ***
Test Teardown TeardownDelete ${url} certIds ${certId}
Force Tags tsg_bf_api Trusted_Certificate_Authorities
Library String
Library OperatingSystem
Library Selenium2Library
Library Collections
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Library Custometest
*** Variables ***
${url} /policy/profile/trustedcacertobj
${certId} ${EMPTY}
*** Test Cases ***
TrustedCertPolicy_root-00001
# 新增
${response} CreatePolicyFile ${url} keyrings/root/ tango-ca-trust-ca-cer.pem
# 查询
${certId} Get From Dictionary ${response} certId
${certName} Get From Dictionary ${response} certName
QueryPolicyFile ${url} certId=${certId}&certName=${certName}
# 修改
${header_edit} Set Variable {"isValid":1,"opAction":"update","certName":"test_edit","certId":"${certId}","returnData":1}
UpdatePolicyFile ${url} keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem ${header_edit}
TrustedCertPolicy_end-entity-00002
# 新增
${response} CreatePolicyFile ${url} keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem
# 查询
${certId} Get From Dictionary ${response} certId
${certName} Get From Dictionary ${response} certName
QueryPolicyFile ${url} certId=${certId}&certName=${certName}
# 修改
${header_edit} Set Variable {"isValid":1,"opAction":"update","certName":"test_edit","certId":"${certId}","returnData":1}
UpdatePolicyFile ${url} keyrings/root/ tango-ca-trust-ca-cer.pem ${header_edit}
TrustedCertPolicy_Intermediate-00003
# 新增
${response} CreatePolicyFile ${url} keyrings/Intermediate/ tang-ca-v3-intermediate-01-cer.pem
# 查询
${certId} Get From Dictionary ${response} certId
${certName} Get From Dictionary ${response} certName
QueryPolicyFile ${url} certId=${certId}&certName=${certName}
# 修改
${header_edit} Set Variable {"isValid":1,"opAction":"update","certName":"test_edit","certId":"${certId}","returnData":1}
UpdatePolicyFile ${url} keyrings/root/ tango-ca-trust-ca-cer.pem ${header_edit}

View File

@@ -0,0 +1,33 @@
*** Settings ***
Test Teardown TeardownDelete ${url} profileIds ${profileId}
Force Tags tsg_adc Security_Policy
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Library Custometest
*** Variables ***
${url} policy/profile/claimedsrcip
${profileId} ${EMPTY}
*** Test Cases ***
claimedsrcip-00001
#Hijack 需要修改的内容
${list} Create List 192.168.0.1/16 192.168.0.2/16 192.168.0.3/24
${objectedit} Create Dictionary profileName=12313 addrType=4 ipList=${list}
Comment 打印需要修改的json内容
${objectDict} Jsoneditmanu ${setting_proxy_profiles_claimedsrcip} ${objectedit}
log ${objectDict}
${response} Post-Request ${url} ${objectDict}
#查询
${profileId} Set Variable ${response['data']['list'][0]["profileId"]}
${profileName} Set Variable ${response['data']['list'][0]["profileName"]}
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
# 修改
log ${profileId}
${reqHeader_edit} Set Variable {"opAction": "add","returnData": 1,"claimedSrcIpList":[{"profileId":1,"profileName":"1231","addrType":4,"ipList":["192.168.0.1/16","192.168.0.2/16","192.168.0.3/24"],"isValid":1,"profileDesc":""}],"isValid":1,"profileDesc":""}
UpdatePolicyFile2 ${url} ${reqHeader_edit}

View File

@@ -0,0 +1,33 @@
*** Settings ***
Test Teardown TeardownDelete ${url} profileIds ${profileId}
Force Tags tsg_adc Security_Policy
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Library Custometest
*** Variables ***
${url} policy/profile/redirectdestination
${profileId} ${EMPTY}
*** Test Cases ***
claimedsrcip-00001
#Hijack 需要修改的内容
${list} Create List 192.168.0.1/16 192.168.0.2/16 192.168.0.3/24
${objectedit} Create Dictionary profileName=12313 addrType=4 ipList=${list}
Comment 打印需要修改的json内容
${objectDict} Jsoneditmanu ${setting_proxy_profiles_claimedsrcip} ${objectedit}
log ${objectDict}
${response} Post-Request ${url} ${objectDict}
#查询
${profileId} Set Variable ${response['data']['list'][0]["profileId"]}
${profileName} Set Variable ${response['data']['list'][0]["profileName"]}
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
# 修改
log ${profileId}
${reqHeader_edit} Set Variable {"opAction": "add","returnData": 1,"claimedSrcIpList":[{"profileId":1,"profileName":"1231","addrType":4,"ipList":["192.168.0.1/16","192.168.0.2/16","192.168.0.3/24"],"isValid":1,"profileDesc":""}],"isValid":1,"profileDesc":""}
UpdatePolicyFile2 ${url} ${reqHeader_edit}

View File

@@ -0,0 +1,33 @@
*** Settings ***
Test Teardown TeardownDelete ${url} profileIds ${profileId}
Force Tags tsg_adc Security_Policy
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Library Custometest
*** Variables ***
${url} policy/profile/reflector
${profileId} ${EMPTY}
*** Test Cases ***
reflector-00001
#Hijack 需要修改的内容
${list} Create List 192.168.0.1 192.168.0.2 192.168.0.3
${objectedit} Create Dictionary profileName=12313 reflectorType=DNS ipList=${list}
Comment 打印需要修改的json内容
${objectDict} Jsoneditmanu ${setting_proxy_profiles_reflector} ${objectedit}
log ${objectDict}
${response} Post-Request ${url} ${objectDict}
#查询
${profileId} Set Variable ${response['data']['list'][0]["profileId"]}
${profileName} Set Variable ${response['data']['list'][0]["profileName"]}
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
# 修改
log ${profileId}
${reqHeader_edit} Set Variable {"opAction": "update","returnData": 1,"reflectorList":[{"profileId":${profileId} ,"profileName":"12313","addrType":4,"reflectorType":"dns","ipList":["192.168.0.1","192.168.0.2","192.168.0.3"],"isValid":1,"profileDesc":""}]}
UpdatePolicyFile2 ${url} ${reqHeader_edit}

View File

@@ -0,0 +1,32 @@
*** Settings ***
Test Teardown TeardownDelete ${url} profileIds ${profileId}
Force Tags tsg_adc Security_Policy
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../03-Variable/AllFlowCaseVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Library Custometest
*** Variables ***
${url} policy/profile/reflector/payload
${profileId} ${EMPTY}
*** Test Cases ***
reflector-00001
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=12313 reflectorType=dns payload=SSBMT1ZFIFlPVSDmiJHniLHkvaA=
Comment 打印需要修改的json内容
${objectDict} Jsoneditmanu ${settig_proxy_profiles_reflector_payload} ${objectedit}
log ${objectDict}
${response} Post-Request ${url} ${objectDict}
#查询
${profileId} Set Variable ${response['data']['list'][0]["profileId"]}
${profileName} Set Variable ${response['data']['list'][0]["profileName"]}
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
# 修改
log ${profileId}
${reqHeader_edit} Set Variable {"opAction": "update","returnData": 1,"reflectorList":[{"profileId":1,"profileName":"zzzzzzz","reflectorType":"dns","payload":"SSBMT1ZFIFlPVSDmiJHniLHkvaA=","isValid":1,"profileDesc":""}]}
UpdatePolicyFile2 ${url} ${reqHeader_edit}

View File

@@ -1,190 +1,191 @@
*** Settings ***
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/Tsg_Ui/Objects/ObjectPages.robot
Resource ../../../02-Keyword/Tsg_Ui/Objects/Objects.robot
Library OperatingSystem
*** Test Cases ***
create-HTTPSignature-Request-User-Agent-prefix-001
#新建user-agent
CreatePage ReqRes create-HTTPSignature-Request-User-Agent-prefix-001 reqrestype=req reqresheader=ua keywordtext=Mozilla/5.0*
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-User-Agent-prefix-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-HTTPSignature-Request-User-Agent-sub-002
#新建user-agent
CreatePage ReqRes create-HTTPSignature-Request-User-Agent-sub-002 reqrestype=req reqresheader=ua keywordtext=Mozilla/5.
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-User-Agent-sub-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-HTTPSignature-Request-User-Agent-exactly-003
#新建user-agent
CreatePage ReqRes create-HTTPSignature-Request-User-Agent-exactly-003 reqrestype=req reqresheader=ua keywordtext=$Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-User-Agent-exactly-003
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-HTTPSignature-Request-User-Agent-suffix-004
#新建user-agent
CreatePage ReqRes create-HTTPSignature-Request-User-Agent-suffix-004 reqrestype=req reqresheader=ua keywordtext=*Safari/537.36
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-User-Agent-suffix-004
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-HTTPSignature-Request-Cookie-prefix-005
#新建cookie
CreatePage ReqRes create-HTTPSignature-Request-Cookie-prefix-005 reqrestype=req reqresheader=ck keywordtext=cookie*
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-Cookie-prefix-005
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-HTTPSignature-Request-Cookie-sub-006
#新建cookie
CreatePage ReqRes create-HTTPSignature-Request-Cookie-sub-006 reqrestype=req reqresheader=ck keywordtext=cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-Cookie-sub-006
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-HTTPSignature-Request-Cookie-exactly-007
#新建cookie
CreatePage ReqRes create-HTTPSignature-Request-Cookie-exactly-007 reqrestype=req reqresheader=ck keywordtext=$cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-Cookie-exactly-007
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-HTTPSignature-Request-Cookie-suffix-008
#新建cookie
CreatePage ReqRes create-HTTPSignature-Request-Cookie-suffix-008 reqrestype=req reqresheader=ck keywordtext=*cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-Cookie-suffix-008
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-HTTPSignature-Response-Set-Cookie-prefix-009
#新建set-cookie
CreatePage ReqRes create-HTTPSignature-Response-Set-Cookie-prefix-009 reqrestype=res reqresheader=sck keywordtext=set-cookie*
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Set-Cookie-prefix-009
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-HTTPSignature-Response-Set-Cookie-sub-010
#新建set-cookie
CreatePage ReqRes create-HTTPSignature-Response-Set-Cookie-sub-010 reqrestype=res reqresheader=sck keywordtext=set-cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Set-Cookie-sub-010
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-HTTPSignature-Response-Set-Cookie-exactly-011
#新建set-cookie
CreatePage ReqRes create-HTTPSignature-Response-Set-Cookie-exactly-011 reqrestype=res reqresheader=sck keywordtext=$set-cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Set-Cookie-exactly-011
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-HTTPSignature-Response-Set-Cookie-suffix-012
#新建set-cookie
CreatePage ReqRes create-HTTPSignature-Response-Set-Cookie-suffix-012 reqrestype=res reqresheader=sck keywordtext=*set-cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Set-Cookie-suffix-012
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-HTTPSignature-Response-Content-Type-prefix-0013
#新建content-type
CreatePage ReqRes create-HTTPSignature-Response-Content-Type-prefix-0013 reqrestype=res reqresheader=ct keywordtext=Content-Type*
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Content-Type-prefix-0013
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-HTTPSignature-Response-Content-Type-sub-0014
#新建content-type
CreatePage ReqRes create-HTTPSignature-Response-Content-Type-sub-0014 reqrestype=res reqresheader=ct keywordtext=Content-Type
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Content-Type-sub-0014
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-HTTPSignature-Response-Content-Type-exactly-0015
#新建content-type
CreatePage ReqRes create-HTTPSignature-Response-Content-Type-exactly-0015 reqrestype=res reqresheader=ct keywordtext=$Content-Type
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Content-Type-exactly-0015
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-HTTPSignature-Response-Content-Type-suffix-0016
#新建content-type
CreatePage ReqRes create-HTTPSignature-Response-Content-Type-suffix-0016 reqrestype=res reqresheader=ct keywordtext=*Content-Type
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Content-Type-suffix-0016
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
edit-HTTPSignature-017
#新建user-agent
CreatePage ReqRes create-HTTPSignature-Request-User-Agent-prefix-001 reqrestype=req reqresheader=ua keywordtext=Mozilla/5.0*
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-User-Agent-prefix-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#修改对象
object-edit-HTTPSignature edit-HTTPSignature-017 res sck 8f6c 6362 31 36 8fdb 5236 hex=open
#查询修改对象
ui-object-search-name edit-HTTPSignature-017
#删除对象
objects-delete
create-HTTPSignature-open-16-hex-0018
#新建content-type
CreatePage ReqRes create-HTTPSignature-open-16-hex-0018 reqrestype=res reqresheader=ct keywordtext=*63 6f 6e 74 65 6e 74 hex=open
#验证新建是否成功
ui-object-search-name create-HTTPSignature-open-16-hex-0018
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
*** Settings ***
Force Tags tsg-ui objects HTTPSignature
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/tsg_ui/objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/tsg_ui/objects/Objects.robot
*** Test Cases ***
create-HTTPSignature-Request-User-Agent-prefix-001
#新建user-agent
CreatePage ReqRes create-HTTPSignature-Request-User-Agent-prefix-001 reqrestype=req reqresheader=ua keywordtext=Mozilla/5.0*
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-User-Agent-prefix-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-User-Agent-prefix-001
#删除对象
objects-delete
create-HTTPSignature-Request-User-Agent-sub-002
#新建user-agent
CreatePage ReqRes create-HTTPSignature-Request-User-Agent-sub-002 reqrestype=req reqresheader=ua keywordtext=Mozilla/5.
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-User-Agent-sub-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-User-Agent-sub-002
#删除对象
objects-delete
create-HTTPSignature-Request-User-Agent-exactly-003
#新建user-agent
CreatePage ReqRes create-HTTPSignature-Request-User-Agent-exactly-003 reqrestype=req reqresheader=ua keywordtext=$Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-User-Agent-exactly-003
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-User-Agent-exactly-003
#删除对象
objects-delete
create-HTTPSignature-Request-User-Agent-suffix-004
#新建user-agent
CreatePage ReqRes create-HTTPSignature-Request-User-Agent-suffix-004 reqrestype=req reqresheader=ua keywordtext=*Safari/537.36
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-User-Agent-suffix-004
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-User-Agent-suffix-004
#删除对象
objects-delete
create-HTTPSignature-Request-Cookie-prefix-005
#新建cookie
CreatePage ReqRes create-HTTPSignature-Request-Cookie-prefix-005 reqrestype=req reqresheader=ck keywordtext=cookie*
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-Cookie-prefix-005
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-Cookie-prefix-005
#删除对象
objects-delete
create-HTTPSignature-Request-Cookie-sub-006
#新建cookie
CreatePage ReqRes create-HTTPSignature-Request-Cookie-sub-006 reqrestype=req reqresheader=ck keywordtext=cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-Cookie-sub-006
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-Cookie-sub-006
#删除对象
objects-delete
create-HTTPSignature-Request-Cookie-exactly-007
#新建cookie
CreatePage ReqRes create-HTTPSignature-Request-Cookie-exactly-007 reqrestype=req reqresheader=ck keywordtext=$cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-Cookie-exactly-007
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-Cookie-exactly-007
#删除对象
objects-delete
create-HTTPSignature-Request-Cookie-suffix-008
#新建cookie
CreatePage ReqRes create-HTTPSignature-Request-Cookie-suffix-008 reqrestype=req reqresheader=ck keywordtext=*cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-Cookie-suffix-008
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-Cookie-suffix-008
#删除对象
objects-delete
create-HTTPSignature-Response-Set-Cookie-prefix-009
#新建set-cookie
CreatePage ReqRes create-HTTPSignature-Response-Set-Cookie-prefix-009 reqrestype=res reqresheader=sck keywordtext=set-cookie*
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Set-Cookie-prefix-009
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Response-Set-Cookie-prefix-009
#删除对象
objects-delete
create-HTTPSignature-Response-Set-Cookie-sub-010
#新建set-cookie
CreatePage ReqRes create-HTTPSignature-Response-Set-Cookie-sub-010 reqrestype=res reqresheader=sck keywordtext=set-cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Set-Cookie-sub-010
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Response-Set-Cookie-sub-010
#删除对象
objects-delete
create-HTTPSignature-Response-Set-Cookie-exactly-011
#新建set-cookie
CreatePage ReqRes create-HTTPSignature-Response-Set-Cookie-exactly-011 reqrestype=res reqresheader=sck keywordtext=$set-cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Set-Cookie-exactly-011
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Response-Set-Cookie-exactly-011
#删除对象
objects-delete
create-HTTPSignature-Response-Set-Cookie-suffix-012
#新建set-cookie
CreatePage ReqRes create-HTTPSignature-Response-Set-Cookie-suffix-012 reqrestype=res reqresheader=sck keywordtext=*set-cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Set-Cookie-suffix-012
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Response-Set-Cookie-suffix-012
#删除对象
objects-delete
create-HTTPSignature-Response-Content-Type-prefix-0013
#新建content-type
CreatePage ReqRes create-HTTPSignature-Response-Content-Type-prefix-0013 reqrestype=res reqresheader=ct keywordtext=Content-Type*
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Content-Type-prefix-0013
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Response-Content-Type-prefix-0013
#删除对象
objects-delete
create-HTTPSignature-Response-Content-Type-sub-0014
#新建content-type
CreatePage ReqRes create-HTTPSignature-Response-Content-Type-sub-0014 reqrestype=res reqresheader=ct keywordtext=Content-Type
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Content-Type-sub-0014
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Response-Content-Type-sub-0014
#删除对象
objects-delete
create-HTTPSignature-Response-Content-Type-exactly-0015
#新建content-type
CreatePage ReqRes create-HTTPSignature-Response-Content-Type-exactly-0015 reqrestype=res reqresheader=ct keywordtext=$Content-Type
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Content-Type-exactly-0015
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Response-Content-Type-exactly-0015
#删除对象
objects-delete
create-HTTPSignature-Response-Content-Type-suffix-0016
#新建content-type
CreatePage ReqRes create-HTTPSignature-Response-Content-Type-suffix-0016 reqrestype=res reqresheader=ct keywordtext=*Content-Type
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Content-Type-suffix-0016
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Response-Content-Type-suffix-0016
#删除对象
objects-delete
edit-HTTPSignature-017
#新建user-agent
CreatePage ReqRes create-HTTPSignature-Request-User-Agent-prefix-001 reqrestype=req reqresheader=ua keywordtext=Mozilla/5.0*
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-User-Agent-prefix-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-User-Agent-prefix-001
#修改对象
object-edit-HTTPSignature edit-HTTPSignature-017 res sck 8f6c 6362 31 36 8fdb 5236 hex=open
#查询修改对象
ui-object-search-name edit-HTTPSignature-017
#删除对象
objects-delete
create-HTTPSignature-open-16-hex-0018
#新建content-type
CreatePage ReqRes create-HTTPSignature-open-16-hex-0018 reqrestype=res reqresheader=ct keywordtext=*63 6f 6e 74 65 6e 74 hex=open
#验证新建是否成功
ui-object-search-name create-HTTPSignature-open-16-hex-0018
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-open-16-hex-0018
#删除对象
objects-delete

View File

@@ -1,61 +1,61 @@
*** Settings ***
Force Tags tsg-ui objects account
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/Tsg_Ui/Objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/Tsg_Ui/Objects/Objects.robot
*** Test Cases ***
create-account-prefix-001
#新建Account
CreatePage Account create-account-prefix-001 keywordtext=www.*
#验证新建是否成功
ui-object-search-name create-account-prefix-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-account-sub-002
#新建Account
CreatePage Account create-account-sub-002 keywordtext=1234
#验证新建是否成功
ui-object-search-name create-account-sub-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-account-exactly-003
#新建Account
CreatePage Account create-account-exactly-003 keywordtext=$1234567
#验证新建是否成功
ui-object-search-name create-account-exactly-003
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-account-suffix-004
#新建Account
CreatePage Account create-account-suffix-004 keywordtext=*1234567
#验证新建是否成功
ui-object-search-name create-account-suffix-004
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
edit-account-005
#新建Account
CreatePage Account create-account-suffix-004 keywordtext=*1234567
#验证新建是否成功
ui-object-search-name create-account-suffix-004
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#修改对象
object-edit-account deit-account-005 $www.baidu.com
#查询修改对象
ui-object-search-name deit-account-005
#删除对象
objects-delete
*** Settings ***
Force Tags tsg-ui objects account
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/tsg_ui/objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/tsg_ui/objects/Objects.robot
*** Test Cases ***
create-account-prefix-001
#新建Account
CreatePage Account create-account-prefix-001 keywordtext=www.*
#验证新建是否成功
ui-object-search-name create-account-prefix-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-account-prefix-001
#删除对象
objects-delete
create-account-sub-002
#新建Account
CreatePage Account create-account-sub-002 keywordtext=1234
#验证新建是否成功
ui-object-search-name create-account-sub-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-account-exactly-003
#新建Account
CreatePage Account create-account-exactly-003 keywordtext=$1234567
#验证新建是否成功
ui-object-search-name create-account-exactly-003
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-account-suffix-004
#新建Account
CreatePage Account create-account-suffix-004 keywordtext=*1234567
#验证新建是否成功
ui-object-search-name create-account-suffix-004
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
edit-account-005
#新建Account
CreatePage Account create-account-suffix-004 keywordtext=*1234567
#验证新建是否成功
ui-object-search-name create-account-suffix-004
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#修改对象
object-edit-account deit-account-005 $www.baidu.com
#查询修改对象
ui-object-search-name deit-account-005
#删除对象
objects-delete

View File

@@ -1,41 +1,41 @@
*** Settings ***
Force Tags tsg-ui objects category
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/Tsg_Ui/Objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/Tsg_Ui/Objects/Objects.robot
*** Test Cases ***
create-category-exactly-001
#新建Category
CreatePage Category create-category-exactly-001 keywordtext=$www.baidu.com
#验证新建是否成功
ui-object-search-name create-category-exactly-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-category-suffix-002
#新建Category
CreatePage Category create-category-suffix-002 keywordtext=*baidu.com
#验证新建是否成功
ui-object-search-name create-category-suffix-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
edit-category-003
#新建Category
CreatePage Category create-category-suffix-002 keywordtext=*baidu.com
#验证新建是否成功
ui-object-search-name create-category-suffix-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#修改对象
object-edit-fqdn deit-category-003 $open.node.com
#查询修改对象
ui-object-search-name deit-category-003
#删除对象
objects-delete
*** Settings ***
Force Tags tsg-ui objects category
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/tsg_ui/objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/tsg_ui/objects/Objects.robot
*** Test Cases ***
create-category-exactly-001
#新建Category
CreatePage Category create-category-exactly-001 keywordtext=$www.baidu.com
#验证新建是否成功
ui-object-search-name create-category-exactly-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-category-exactly-001
#删除对象
objects-delete
create-category-suffix-002
#新建Category
CreatePage Category create-category-suffix-002 keywordtext=*baidu.com
#验证新建是否成功
ui-object-search-name create-category-suffix-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-category-suffix-002
#删除对象
objects-delete
edit-category-003
#新建Category
CreatePage Category create-category-suffix-002 keywordtext=*baidu.com
#验证新建是否成功
ui-object-search-name create-category-suffix-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-category-suffix-002
#修改对象
object-edit-fqdn deit-category-003 $open.node.com
#查询修改对象
ui-object-search-name deit-category-003
#删除对象
objects-delete

View File

@@ -1,41 +1,51 @@
*** Settings ***
Force Tags tsg-ui objects fqdn
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/Tsg_Ui/Objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/Tsg_Ui/Objects/Objects.robot
*** Test Cases ***
create-fqdn-exactly-001
#新建fqdn,exactly
CreatePage Fqdn create-fqdn-exactly-001 keywordtext=$open.node.com
#验证新建是否成功
ui-object-search-name create-fqdn-exactly-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-fqdn-suffix-002
#新建fqdn,exactly
CreatePage Fqdn create-fqdn-suffix-002 keywordtext=*open.node.com
#验证新建是否成功
ui-object-search-name create-fqdn-suffix-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
deit-fqdn-003
#新建fqdn,exactly
CreatePage Fqdn create-fqdn-suffix-002 keywordtext=*open.node.com
#验证新建是否成功
ui-object-search-name create-fqdn-suffix-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#修改对象
object-edit-fqdn deit-fqdn-003 $open.node.com
#查询修改对象
ui-object-search-name deit-fqdn-003
#删除对象
objects-delete
*** Settings ***
Force Tags tsg-ui objects fqdn
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/tsg_ui/objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/tsg_ui/objects/Objects.robot
*** Test Cases ***
create-fqdn-exactly-001
#新建fqdn,exactly
CreatePage Fqdn create-fqdn-exactly-001 keywordtext=$open.node.com
#验证新建是否成功
ui-object-search-name create-fqdn-exactly-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-fqdn-exactly-001
#删除对象
objects-delete
create-fqdn-suffix-002
#新建fqdn,exactly
CreatePage Fqdn create-fqdn-suffix-002 keywordtext=*open.node.com
#验证新建是否成功
ui-object-search-name create-fqdn-suffix-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-fqdn-suffix-002
#删除对象
objects-delete
create-fqdn-suffix-003
#新建fqdn,exactly
CreatePage Fqdn create-fqdn-suffix-003 keywordtext=*123-456_abc
#验证新建是否成功
ui-object-search-name create-fqdn-suffix-003
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-fqdn-suffix-003
#删除对象
objects-delete
deit-fqdn-003
#新建fqdn,exactly
CreatePage Fqdn create-fqdn-suffix-002 keywordtext=*open.node.com
#验证新建是否成功
ui-object-search-name create-fqdn-suffix-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-fqdn-suffix-002
#修改对象
object-edit-fqdn deit-fqdn-003 $open.node.com
#查询修改对象
ui-object-search-name deit-fqdn-003
#删除对象
objects-delete

View File

@@ -0,0 +1,164 @@
*** Settings ***
Force Tags tsg-ui objects ip
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/tsg_ui/objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/tsg_ui/objects/Objects.robot
*** Test Cases ***
create-ipv4-range-001
#新建iprange
CreatePage Ip create-ipv4-range-001 ipads=ipv4 ipclient=range ipclienttext1=192.168.1.1 ipclienttext2=192.168.1.1
... post=0/0
#验证新建是否成功
ui-object-search-name create-ipv4-range-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-ipv4-range-001
#删除对象
objects-delete
create-ipv4-cidr-002
#新建ipcidr
CreatePage Ip create-ipv4-cidr-002 ipads=ipv4 ipclient=cidr ipclienttext1=192.168.1.1 ipclienttext2=24
... post=65535/65535
#验证新建是否成功
ui-object-search-name create-ipv4-cidr-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-ipv4-cidr-002
#删除对象
objects-delete
create-ipv4-masks-003
#新建ipmasks
CreatePage Ip create-ipv4-masks-003 ipads=ipv4 ipclient=masks ipclienttext1=192.168.1.1 ipclienttext2=255.255.255.0
... post=1/1
#验证新建是否成功
ui-object-search-name create-ipv4-masks-003
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-ipv4-masks-003
#删除对象
objects-delete
create-ipv6-range-004
#新建iprange
CreatePage Ip create-ipv6-range-004 ipads=ipv6 ipclient=range ipclienttext1=0:0:0:0:0:0:0:0 ipclienttext2=FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF
... post=65535/65535
#验证新建是否成功
ui-object-search-name create-ipv6-range-004
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-ipv6-range-004
#删除对象
objects-delete
create-ipv6-cidr-005
#新建ipcidr
CreatePage Ip create-ipv6-cidr-005 ipads=ipv6 ipclient=cidr ipclienttext1=0:0:0:0:0:0:0:0 ipclienttext2=64
... post=1/1
#验证新建是否成功
ui-object-search-name create-ipv6-cidr-005
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-ipv6-cidr-005
#删除对象
objects-delete
create-ipv6-masks-006
#新建ipmasks
CreatePage Ip create-ipv6-masks-006 ipads=ipv6 ipclient=masks ipclienttext1=0:0:0:0:0:0:0:0 ipclienttext2=0:0:0:0:0:0:0:0
... post=65535/65535
#验证新建是否成功
ui-object-search-name create-ipv6-masks-006
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-ipv6-masks-006
#删除对象
objects-delete
edit-ip-007
#新建ipmasks
CreatePage Ip create-ipv6-masks-007 ipads=ipv6 ipclient=masks ipclienttext1=0:0:0:0:0:0:0:0 ipclienttext2=0:0:0:0:0:0:0:0
#验证新建是否成功
ui-object-search-name create-ipv6-masks-007
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-ipv6-masks-007
#修改对象
object-edit-ip edit-ip-007 ipv4 range 192.168.100.1 192.168.100.1 post=0/0
#查询修改对象
ui-object-search-name edit-ip-007
#删除对象
objects-delete
create-ipv6-range-008
#新建iprange
CreatePage Ip create-ipv6-range-008 ipads=ipv6 ipclient=range ipclienttext1=:: ipclienttext2=::1
... post=0/0
#验证新建是否成功
ui-object-search-name create-ipv6-range-008
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-ipv6-range-008
#删除对象
objects-delete
create-ipv4-range-009
#新建iprange
CreatePage Ip create-ipv4-range-009 ipads=ipv4 ipclient=range ipclienttext1=0.0.0.0 ipclienttext2=255.255.255.255
... post=65535/65535
#验证新建是否成功
ui-object-search-name create-ipv4-range-009
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-ipv4-range-009
#删除对象
objects-delete
create-ipv4-cidr-010
#新建ipcidr
CreatePage Ip create-ipv4-cidr-010 ipads=ipv4 ipclient=cidr ipclienttext1=0.0.0.0 ipclienttext2=0
... post=0/0
#验证新建是否成功
ui-object-search-name create-ipv4-cidr-010
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-ipv4-cidr-010
#删除对象
objects-delete
create-ipv4-cidr-011
#新建ipcidr
CreatePage Ip create-ipv4-cidr-011 ipads=ipv4 ipclient=cidr ipclienttext1=255.255.255.255 ipclienttext2=32
... post=65535/65535
#验证新建是否成功
ui-object-search-name create-ipv4-cidr-011
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-ipv4-cidr-011
#删除对象
objects-delete
create-ipv6-range-012
#新建iprange
CreatePage Ip create-ipv6-range-012 ipads=ipv6 ipclient=range ipclienttext1=:: ipclienttext2=FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF
... post=0/0
#验证新建是否成功
ui-object-search-name create-ipv6-range-012
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-ipv6-range-012
#删除对象
objects-delete
create-ipv6-cidr-013
#新建iprange
CreatePage Ip create-ipv6-cidr-013 ipads=ipv6 ipclient=cidr ipclienttext1=:: ipclienttext2=0
... post=0/0
#验证新建是否成功
ui-object-search-name create-ipv6-cidr-013
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-ipv6-cidr-013
#删除对象
objects-delete
create-ipv6-cidr-014
#新建iprange
CreatePage Ip create-ipv6-cidr-014 ipads=ipv6 ipclient=cidr ipclienttext1=FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF ipclienttext2=128
... post=65535/65535
#验证新建是否成功
ui-object-search-name create-ipv6-cidr-014
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-ipv6-cidr-014
#删除对象
objects-delete

View File

@@ -1,71 +1,71 @@
*** Settings ***
Force Tags tsg-ui objects keywords
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/Tsg_Ui/Objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/Tsg_Ui/Objects/Objects.robot
*** Test Cases ***
create-keywords-prefix-001
#新建keywords
CreatePage Key create-keywords-prefix-001 keywordtext=www.*
#验证新建是否成功
ui-object-search-name create-keywords-prefix-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-keywords-sub-002
#新建keywords
CreatePage Key create-keywords-sub-002 keywordtext=1234
#验证新建是否成功
ui-object-search-name create-keywords-sub-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-keywords-exactly-003
#新建keywords
CreatePage Key create-keywords-exactly-003 keywordtext=$123456
#验证新建是否成功
ui-object-search-name create-keywords-exactly-003
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-keywords-suffix-004
#新建keywords
CreatePage Key create-keywords-suffix-004 keywordtext=*123456
#验证新建是否成功
ui-object-search-name create-keywords-suffix-004
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
edit-keywords-005
#新建keywords
CreatePage Key create-keywords-suffix-004 keywordtext=*123456
#验证新建是否成功
ui-object-search-name create-keywords-suffix-004
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#修改对象
object-edit-keywords edit-keywords-005 $www.baidu.com
#查询修改对象
ui-object-search-name edit-keywords-005
#删除对象
objects-delete
create-keywords-open-16hex-006
#新建keywords
CreatePage Key create-keywords-open-16hex-006 keywordtext=*123456 hex=open
#验证新建是否成功
ui-object-search-name create-keywords-open-16hex-006
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
*** Settings ***
Force Tags tsg-ui objects keywords
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/tsg_ui/objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/tsg_ui/objects/Objects.robot
*** Test Cases ***
create-keywords-prefix-001
#新建keywords
CreatePage Key create-keywords-prefix-001 keywordtext=www.*
#验证新建是否成功
ui-object-search-name create-keywords-prefix-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-keywords-prefix-001
#删除对象
objects-delete
create-keywords-sub-002
#新建keywords
CreatePage Key create-keywords-sub-002 keywordtext=1234@#%
#验证新建是否成功
ui-object-search-name create-keywords-sub-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-keywords-sub-002
#删除对象
objects-delete
create-keywords-exactly-003
#新建keywords
CreatePage Key create-keywords-exactly-003 keywordtext=$支持中文
#验证新建是否成功
ui-object-search-name create-keywords-exactly-003
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-keywords-exactly-003
#删除对象
objects-delete
create-keywords-suffix-004
#新建keywords
CreatePage Key create-keywords-suffix-004 keywordtext=*скрипцияк.
#验证新建是否成功
ui-object-search-name create-keywords-suffix-004
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-keywords-suffix-004
#删除对象
objects-delete
edit-keywords-005
#新建keywords
CreatePage Key create-keywords-suffix-005 keywordtext=*123456
#验证新建是否成功
ui-object-search-name create-keywords-suffix-005
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-keywords-suffix-005
#修改对象
object-edit-keywords edit-keywords-005 $www.baidu.com
#查询修改对象
ui-object-search-name edit-keywords-005
#删除对象
objects-delete
create-keywords-open-16hex-006
#新建keywords
CreatePage Key create-keywords-open-16hex-006 keywordtext=*123456 hex=open
#验证新建是否成功
ui-object-search-name create-keywords-open-16hex-006
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete

View File

@@ -1,31 +1,41 @@
*** Settings ***
Force Tags tsg-ui object sub-id
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/Tsg_Ui/Objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/Tsg_Ui/Objects/Objects.robot
*** Test Cases ***
create-Subscriber-ID-001
#新建sub-id
CreatePage Sub create-sub-id-001 keywordtext=$test37
#验证新建是否成功
ui-object-search-name create-sub-id-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
edit-Subscriber-ID-002
#新建sub-id
CreatePage Sub create-sub-id-001 keywordtext=$test37
#验证新建是否成功
ui-object-search-name create-sub-id-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#修改对象
object-edit-Subscriber-ID deit-sub-id-002 $test20
#查询修改对象
ui-object-search-name deit-sub-id-002
#删除对象
objects-delete
*** Settings ***
Force Tags tsg-ui object sub-id
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/tsg_ui/objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/tsg_ui/objects/Objects.robot
*** Test Cases ***
create-Subscriber-ID-001
#新建sub-id
CreatePage Sub create-sub-id-001 keywordtext=$test37
#验证新建是否成功
ui-object-search-name create-sub-id-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-sub-id-001
#删除对象
objects-delete
create-Subscriber-ID-002
#新建sub-id
CreatePage Sub create-sub-id-002 keywordtext=$abc_%$#@123中文_скрипцияк.
#验证新建是否成功
ui-object-search-name create-sub-id-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-sub-id-002
#删除对象
objects-delete
edit-Subscriber-ID-002
#新建sub-id
CreatePage Sub create-sub-id-001 keywordtext=$test37
#验证新建是否成功
ui-object-search-name create-sub-id-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#修改对象
object-edit-Subscriber-ID deit-sub-id-002 $test20
#查询修改对象
ui-object-search-name deit-sub-id-002
#删除对象
objects-delete

View File

@@ -1,61 +1,61 @@
*** Settings ***
Force Tags tsg-ui objects url
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/Tsg_Ui/Objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/Tsg_Ui/Objects/Objects.robot
*** Test Cases ***
create-url-prefix-001
#新建URL
CreatePage Url create-url-prefix-001 keywordtext=www.*
#验证新建是否成功
ui-object-search-name create-url-prefix-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-url-sub-002
#新建sub-id
CreatePage Url create-url-sub-002 keywordtext=jianshu
#验证新建是否成功
ui-object-search-name create-url-sub-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-url-exactly-003
#新建sub-id
CreatePage Url create-url-exactly-003 keywordtext=$www.vip.com
#验证新建是否成功
ui-object-search-name create-url-exactly-003
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-url-suffix-004
#新建sub-id
CreatePage Url create-url-suffix-004 keywordtext=*.com
#验证新建是否成功
ui-object-search-name create-url-suffix-004
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
edit-url-005
#新建sub-id
CreatePage Url create-url-suffix-004 keywordtext=*.com
#验证新建是否成功
ui-object-search-name create-url-suffix-004
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#修改对象
object-edit-url deit-url-005 $www.baidu.com
#查询修改对象
ui-object-search-name deit-url-005
#删除对象
objects-delete
*** Settings ***
Force Tags tsg-ui objects url
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/tsg_ui/objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/tsg_ui/objects/Objects.robot
*** Test Cases ***
create-url-prefix-001
#新建URL
CreatePage Url create-url-prefix-001 keywordtext=www.*
#验证新建是否成功
ui-object-search-name create-url-prefix-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-url-prefix-001
#删除对象
objects-delete
create-url-sub-002
#新建sub-id
CreatePage Url create-url-sub-002 keywordtext=1234@#%
#验证新建是否成功
ui-object-search-name create-url-sub-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-url-sub-002
#删除对象
objects-delete
create-url-exactly-003
#新建sub-id
CreatePage Url create-url-exactly-003 keywordtext=$支持中文
#验证新建是否成功
ui-object-search-name create-url-exactly-003
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-url-exactly-003
#删除对象
objects-delete
create-url-suffix-004
#新建sub-id
CreatePage Url create-url-suffix-004 keywordtext=*скрипцияк.
#验证新建是否成功
ui-object-search-name create-url-suffix-004
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-url-suffix-004
#删除对象
objects-delete
edit-url-005
#新建sub-id
CreatePage Url create-url-suffix-005 keywordtext=*.com
#验证新建是否成功
ui-object-search-name create-url-suffix-005
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-url-suffix-005
#修改对象
object-edit-url deit-url-005 $www.baidu.com
#查询修改对象
ui-object-search-name deit-url-005
#删除对象
objects-delete

View File

@@ -0,0 +1,66 @@
*** Settings ***
Force Tags tsg-ui settings Decryption Keyrings
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/tsg_ui/setting/Settings.robot
Library OperatingSystem
*** Test Cases ***
Create_Decryption_Keyrings-001
Create-Decryption Keyrings lyf-RF-test-001 ${path}keyrings//root//tango-ca-root-01-cer.pem ${path}keyrings//root//tango-ca-root-01-key.pem 23 id=certificateType_select0 id=keyringsadd_publicKeyAlgoSelet1
Create_Decryption_Keyrings-002
Create-Decryption Keyrings lyf-RF-test-002 ${path}keyrings//root//tango-ca-root-01-cer.pem ${path}keyrings//root//tango-ca-root-01-key.pem 23 id=certificateType_select0 id=keyringsadd_publicKeyAlgoSelet0
Create_Decryption_Keyrings-003
Create-Decryption Keyrings lyf-RF-test-003 ${path}keyrings//root//tango-ca-root-01-cer.pem ${path}keyrings//root//tango-ca-root-01-key.pem 23 id=certificateType_select0 id=keyringsadd_publicKeyAlgoSelet2
Create_Decryption_Keyrings-004
Create-Decryption Keyrings lyf-RF-test-004 ${path}keyrings//root//tango-ca-root-01-cer.pem ${path}keyrings//root//tango-ca-root-01-key.pem 23 id=certificateType_select0 id=keyringsadd_publicKeyAlgoSelet3
Create_Decryption_Keyrings-005
Create-Decryption Keyrings lyf-RF-test-005 ${path}keyrings//root//tango-ca-root-01-cer.pem ${path}keyrings//root//tango-ca-root-01-key.pem 23 id=certificateType_select0 id=keyringsadd_publicKeyAlgoSelet3
... open
Create_Decryption_Keyrings-006
Create-Decryption Keyrings lyf-RF-test-006 ${path}keyrings//Intermediate//tang-ca-v3-intermediate-01-cer.pem ${path}keyrings//Intermediate//tang-ca-v3-intermediate-01-key.pem 23 id=certificateType_select1 id=keyringsadd_publicKeyAlgoSelet3
Create_Decryption_Keyrings-007
Create-Decryption Keyrings lyf-RF-test-006 ${path}keyrings//Intermediate//tang-ca-v3-intermediate-01-cer.pem ${path}keyrings//Intermediate//tang-ca-v3-intermediate-01-key.pem 1 id=certificateType_select1 id=keyringsadd_publicKeyAlgoSelet2
Create_Decryption_Keyrings-008
Create-Decryption Keyrings lyf-RF-test-006 ${path}keyrings//Intermediate//tang-ca-v3-intermediate-01-cer.pem ${path}keyrings//Intermediate//tang-ca-v3-intermediate-01-key.pem 2 id=certificateType_select1 id=keyringsadd_publicKeyAlgoSelet1
Create_Decryption_Keyrings-009
Create-Decryption Keyrings lyf-RF-test-006 ${path}keyrings//Intermediate//tang-ca-v3-intermediate-01-cer.pem ${path}keyrings//Intermediate//tang-ca-v3-intermediate-01-key.pem 2 id=certificateType_select1 id=keyringsadd_publicKeyAlgoSelet0
Create_Decryption_Keyrings-010
Create-Decryption Keyrings lyf-RF-test-006 ${path}keyrings//Intermediate//tang-ca-v3-intermediate-01-cer.pem ${path}keyrings//Intermediate//tang-ca-v3-intermediate-01-key.pem 2 id=certificateType_select1 id=keyringsadd_publicKeyAlgoSelet0
... open
Edit_Decryption_Keyrings-011
Create-Decryption Keyrings lyf-RF-test-006 ${path}keyrings//Intermediate//tang-ca-v3-intermediate-01-cer.pem ${path}keyrings//Intermediate//tang-ca-v3-intermediate-01-key.pem 2 id=certificateType_select1 id=keyringsadd_publicKeyAlgoSelet0
${id} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[1]/div/div/div/p/span
Edit-Decryption Keyrings id=input_list_li1 ${id} lyf-RF-edit-1 ${path}keyrings//root//mesalab-ca-cert.pem ${path}keyrings//root//mesalab-ca-key.pem 1
... id=certificateType_select0 id=keyringsadd_publicKeyAlgoSelet1
Edit_Decryption_Keyrings-012
Create-Decryption Keyrings lyf-RF-test-006 ${path}keyrings//Intermediate//tang-ca-v3-intermediate-01-cer.pem ${path}keyrings//Intermediate//tang-ca-v3-intermediate-01-key.pem 2 id=certificateType_select1 id=keyringsadd_publicKeyAlgoSelet0
${name} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/div/p/span
Edit-Decryption Keyrings id=input_list_li2 ${name} lyf-RF-edit-1 ${path}keyrings//root//mesalab-ca-cert.pem ${path}keyrings//root//mesalab-ca-key.pem 1
... id=certificateType_select0 id=keyringsadd_publicKeyAlgoSelet1
Create_Decryption_Keyrings-013
Create-Decryption Keyrings lyf-RF-test-013 ${path}keyrings//end-entity//tang-ca-v3-www.amazon.cn-cer.pem ${path}keyrings//end-entity//tang-ca-v3-www.amazon.cn-key.pem 23 id=certificateType_select2 id=keyringsadd_publicKeyAlgoSelet0
Create_Decryption_Keyrings-014
Create-Decryption Keyrings lyf-RF-test-014 ${path}keyrings//end-entity//tang-ca-v3-www.amazon.cn-cer.pem ${path}keyrings//end-entity//tang-ca-v3-www.amazon.cn-key.pem 23 id=certificateType_select2 id=keyringsadd_publicKeyAlgoSelet1
Create_Decryption_Keyrings-015
Create-Decryption Keyrings lyf-RF-test-015 ${path}keyrings//end-entity//tang-ca-v3-www.amazon.cn-cer.pem ${path}keyrings//end-entity//tang-ca-v3-www.amazon.cn-key.pem 23 id=certificateType_select2 id=keyringsadd_publicKeyAlgoSelet2
Create_Decryption_Keyrings-016
Create-Decryption Keyrings lyf-RF-test-016 ${path}keyrings//end-entity//tang-ca-v3-www.amazon.cn-cer.pem ${path}keyrings//end-entity//tang-ca-v3-www.amazon.cn-key.pem 23 id=certificateType_select2 id=keyringsadd_publicKeyAlgoSelet3
Create_Decryption_Keyrings-017
Create-Decryption Keyrings lyf-RF-test-017 ${path}keyrings//end-entity//tang-ca-v3-www.amazon.cn-cer.pem ${path}keyrings//end-entity//tang-ca-v3-www.amazon.cn-key.pem 1 id=certificateType_select2 id=keyringsadd_publicKeyAlgoSelet3
... open

View File

@@ -0,0 +1,110 @@
*** Settings ***
Force Tags tsg-ui settings Decryption Profile
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/tsg_ui/setting/Settings.robot
Library OperatingSystem
*** Test Cases ***
Create_Decryption_Profile-001
${dict} Create Dictionary Common Name=1 Issuer=1 Self-signed=1 Expiry Date=1 EV Certificat=1
... Certificate Transparency=1 Mutual Authentication=1 On Protocol Errors=1 Certificate Pinning=1 Certificate Not Installed=1 Mirror Client Versions=1
... Allow HTTP/2=1
Create-Policy_Verify1 lyf-test-1 ${dict}
Create_Decryption_Profile-002
${dict} Create Dictionary Common Name=0 Issuer=0 Self-signed=0 Expiry Date=0 EV Certificat=0e
... Certificate Transparency=0 Mutual Authentication=0 On Protocol Errors=0 Certificate Pinning=0 Certificate Not Installed=0 Mirror Client Versions=0
... Allow HTTP/2=0
Create-Policy_Verify1 lyf-test-2 ${dict}
Create_Decryption_Profile-003
${dict} Create Dictionary Common Name=1 Issuer=1 Self-signed=1 Expiry Date=1 EV Certificat=1
... Certificate Transparency=1 Mutual Authentication=1 On Protocol Errors=1 Certificate Pinning=1 Certificate Not Installed=1 Mirror Client Versions=1
... Allow HTTP/2=1
Create-Policy_Verify1 lyf-test-3 ${dict} fail1=Fail-close
Create_Decryption_Profile-004
${dict} Create Dictionary Common Name=1 Issuer=1 Self-signed=1 Expiry Date=1 EV Certificat=1
... Certificate Transparency=1 Mutual Authentication=1 On Protocol Errors=1 Certificate Pinning=1 Certificate Not Installed=1 Mirror Client Versions=1
... Allow HTTP/2=1
Create-Policy_Verify1 lyf-test-3 ${dict} fail1=Pass-through
Create_Decryption_Profile-005
${dict} Create Dictionary Common Name=0 Issuer=0 Self-signed=0 Expiry Date=0 EV Certificat=0
... Certificate Transparency=0 Mutual Authentication=0 On Protocol Errors=0 Certificate Pinning=0 Certificate Not Installed=0 Mirror Client Versions=0
... Allow HTTP/2=0
Create-Policy_Verify1 lyf-test-5 ${dict} min1=SSLv3.0 max1=SSLv3.0
Create_Decryption_Profile-006
${dict} Create Dictionary Common Name=0 Issuer=0 Self-signed=0 Expiry Date=0 EV Certificat=0
... Certificate Transparency=0 Mutual Authentication=0 On Protocol Errors=0 Certificate Pinning=0 Certificate Not Installed=0 Mirror Client Versions=0
... Allow HTTP/2=0
Create-Policy_Verify1 lyf-test-6 ${dict} min1=TLSv1.0 max1=TLSv1.0
Create_Decryption_Profile-007
${dict} Create Dictionary Common Name=0 Issuer=0 Self-signed=0 Expiry Date=0 EV Certificat=0
... Certificate Transparency=0 Mutual Authentication=0 On Protocol Errors=0 Certificate Pinning=0 Certificate Not Installed=0 Mirror Client Versions=0
... Allow HTTP/2=0
Create-Policy_Verify1 lyf-test-7 ${dict} min1=TLSv1.1 max1=TLSv1.1
Create_Decryption_Profile-008
${dict} Create Dictionary Common Name=0 Issuer=0 Self-signed=0 Expiry Date=0 EV Certificat=0
... Certificate Transparency=0 Mutual Authentication=0 On Protocol Errors=0 Certificate Pinning=0 Certificate Not Installed=0 Mirror Client Versions=0
... Allow HTTP/2=0
Create-Policy_Verify1 lyf-test-8 ${dict} min1=TLSv1.2 max1=TLSv1.2
Create_Decryption_Profile-009
${dict} Create Dictionary Common Name=0 Issuer=0 Self-signed=0 Expiry Date=0 EV Certificat=0
... Certificate Transparency=0 Mutual Authentication=0 On Protocol Errors=0 Certificate Pinning=0 Certificate Not Installed=0 Mirror Client Versions=0
... Allow HTTP/2=0
Create-Policy_Verify1 lyf-test-9 ${dict} min1=TLSv1.3 max1=TLSv1.3
Create_Decryption_Profile-010
${dict} Create Dictionary Common Name=0 Issuer=0 Self-signed=0 Expiry Date=0 EV Certificat=0
... Certificate Transparency=0 Mutual Authentication=1 On Protocol Errors=1 Certificate Pinning=1 Certificate Not Installed=0 Mirror Client Versions=1
... Allow HTTP/2=1
Create-Policy_Verify1 lyf-test-10 ${dict}
Create_Decryption_Profile-011
${dict} Create Dictionary Common Name=1 Issuer=1 Self-signed=1 Expiry Date=1 EV Certificat=0
... Certificate Transparency=0 Mutual Authentication=1 On Protocol Errors=1 Certificate Pinning=1 Certificate Not Installed=0 Mirror Client Versions=1
... Allow HTTP/2=1
Create-Policy_Verify1 lyf-test-11 ${dict} fail1=Fail-close
Create_Decryption_Profile-012
${dict} Create Dictionary Common Name=1 Issuer=1 Self-signed=1 Expiry Date=1 EV Certificat=0
... Certificate Transparency=0 Mutual Authentication=1 On Protocol Errors=1 Certificate Pinning=1 Certificate Not Installed=0 Mirror Client Versions=1
... Allow HTTP/2=1
Create-Policy_Verify1 lyf-test-12 ${dict} fail1=Pass-through
Create_Decryption_Profile-013
${dict} Create Dictionary Common Name=0 Issuer=0 Self-signed=0 Expiry Date=0 EV Certificat=1
... Certificate Transparency=1 Mutual Authentication=1 On Protocol Errors=1 Certificate Pinning=1 Certificate Not Installed=1 Mirror Client Versions=1
... Allow HTTP/2=1
Create-Policy_Verify1 lyf-test-13 ${dict}
Create_Decryption_Profile-014
${dict} Create Dictionary Common Name=0 Issuer=0 Self-signed=0 Expiry Date=0 EV Certificat=0
... Certificate Transparency=0 Mutual Authentication=0 On Protocol Errors=0 Certificate Pinning=0 Certificate Not Installed=0 Mirror Client Versions=1
... Allow HTTP/2=1
Create-Policy_Verify1 lyf-test-14 ${dict}
Create_Decryption_Profile-015
${dict} Create Dictionary Common Name=0 Issuer=0 Self-signed=0 Expiry Date=0 EV Certificat=0
... Certificate Transparency=0 Mutual Authentication=0 On Protocol Errors=0 Certificate Pinning=0 Certificate Not Installed=0 Mirror Client Versions=0
... Allow HTTP/2=1
Create-Policy_Verify1 lyf-test-15 ${dict}
Edit_Dercryption_Profile-16
${dict} Create Dictionary Common Name=1 Issuer=1 Self-signed=1 Expiry Date=1 EV Certificat=1
... Certificate Transparency=1 Mutual Authentication=1 On Protocol Errors=1 Certificate Pinning=1 Certificate Not Installed=1 Mirror Client Versions=0
... Allow HTTP/2=0
Create-Policy_Verify1 lyf-test-16 ${dict} fail1=Pass-through min1=SSLv3.0 max1=SSLv3.0
Sleep 1
${id} get text xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[2]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span
sleep 1
${dict1} Create Dictionary Common Name=0 Issuer=0 Self-signed=1 Expiry Date=1 EV Certificat=0
... Certificate Transparency=0 Mutual Authentication=0 On Protocol Errors=0 Certificate Pinning=0 Certificate Not Installed=0 Mirror Client Versions=0
... Allow HTTP/2=0
Edit_Policy_Verify id=input_list_li1 ${id} lyf-edit-test-1 ${dict1} fail1=Fail-close min1=TLSv1.2
... max1=TLSv1.2

View File

@@ -0,0 +1,48 @@
*** Settings ***
Force Tags tsg-ui settings Hijack Files
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/tsg_ui/setting/Settings.robot
Library OperatingSystem
*** Test Cases ***
Create_Hijack_Files-001
Create-Hijack Files lyf-test-001-apk ${path}hijack_files/Create-Hijack Files-test.apk id=application/vnd.android.package-archive0
Create_Hijack_Files-002
Create-Hijack Files lyf-test-002-exe ${path}hijack_files/Create-Hijack Files-test-1.exe id=application/x-msdos-program0
Create_Hijack_Files-003
Create-Hijack Files lyf-test-003-gif ${path}hijack_files/Create-Hijack Files-test-2.gif id=image/gif0
Create_Hijack_Files-004
Create-Hijack Files lyf-test-004-html ${path}hijack_files/Create-Hijack Files-test-3.html id=text/html0
Create_Hijack_Files-005
Create-Hijack Files lyf-test-005-jpeg ${path}hijack_files/Create-Hijack Files-test-4.jpeg id=image/jpeg1
Create_Hijack_Files-006
Create-Hijack Files lyf-test-006-png ${path}hijack_files/Create-Hijack Files-test-5.png id=image/png2
Create_Hijack_Files-007
Create-Hijack Files lyf-test-007-svg ${path}hijack_files/Create-Hijack Files-test-6.svg id=image/svg+xml3
Edit_Hijack_Files-008
Create-Hijack Files lyf-test-001-apk ${path}hijack_files/Create-Hijack Files-test.apk id=application/vnd.android.package-archive0
${name} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/span
Edit-Hijack Files id=input_list_li2 ${name} lyf-Edit-test-001 ${path}hijack_files\\Create-Hijack Files-test.apk id=application/vnd.android.package-archive0
Edit_Hijack_Files-009
Create-Hijack Files lyf-test-001-apk ${path}hijack_files/Create-Hijack Files-test.apk id=application/vnd.android.package-archive0
${id} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[1]/div/span
Edit-Hijack Files id=input_list_li1 ${id} lyf-Edit-test-002 ${path}hijack_files\\Create-Hijack Files-test.apk id=application/vnd.android.package-archive0
Edit_Hijack_Files-010
Create-Hijack Files lyf-test-001-apk ${path}hijack_files/Create-Hijack Files-test.apk id=application/vnd.android.package-archive0
${id} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[1]/div/span
Edit-Hijack Files id=input_list_li1 ${id} lyf-Edit-test-003 ${path}hijack_files\\Create-Hijack Files-test.apk id=application/vnd.android.package-archive0 close
Create_Hijack_Files-011
Create-Hijack Files lyf-test-011-svg ${path}hijack_files/Create-Hijack Files-test-6.svg id=image/svg+xml3 close shuru
Create_Hijack_Files-012
Create-Hijack Files lyf-test-011-svg ${path}hijack_files/Create-Hijack Files-test-6.svg id=image/svg+xml3 open

View File

@@ -0,0 +1,42 @@
*** Settings ***
Force Tags tsg-ui settings insert_scripts
Resource ../../../03-Variable/bifangapivariable.txt
Library OperatingSystem
Resource ../../../02-Keyword/tsg_ui/setting/Settings.robot
*** Test Cases ***
Create_Insert_Scripts-001
[Tags] css
Create-Insert Scripts lyf-test-001-css ${path}insert_files\\Create-Insert Scripts-test.css xpath=/html/body/div/div[1]/div[1]/ul/li[1]
Create_Insert_Scripts-002
[Tags] js
Create-Insert Scripts lyf-test-002-js ${path}insert_files\\Create-Insert_Scripts-test.js xpath=/html/body/div/div[1]/div[1]/ul/li[2]
Create_Insert_Scripts-003
[Tags] css name最小值
Create-Insert Scripts 1 ${path}insert_files\\Create-Insert Scripts-test.css xpath=/html/body/div/div[1]/div[1]/ul/li[1]
Create_Insert_Scripts-004
[Tags] css name传入超过128字符
Create-Insert Scripts ${path}insert_files\\Create-Insert Scripts-test.css${path}insert_files\\Create-Insert Scripts-test.css${path}insert_files\\Create-Insert Scripts-test.css ${path}insert_files\\Create-Insert Scripts-test.css xpath=/html/body/div/div[1]/div[1]/ul/li[1]
Create_Insert_Scripts-005
[Tags] js name最小值
Create-Insert Scripts 1 ${path}insert_files\\Create-Insert_Scripts-test.js xpath=/html/body/div/div[1]/div[1]/ul/li[2]
Create_Insert_Scripts-006
[Tags] js name传入超过128字符
Create-Insert Scripts ${path}insert_files\\Create-Insert Scripts-test.css${path}insert_files\\Create-Insert Scripts-test.css${path}insert_files\\Create-Insert Scripts-test.css ${path}insert_files\\Create-Insert_Scripts-test.js xpath=/html/body/div/div[1]/div[1]/ul/li[2]
Edit_Insert_Scripts-007
[Tags] css edit
Create-Insert Scripts lyf-test-001-css ${path}insert_files\\Create-Insert Scripts-test.css xpath=/html/body/div/div[1]/div[1]/ul/li[1]
${id} get text xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[2]/div/div[3]/table/tbody/tr/td[1]/div/div/span
Edit-Insert Scripts id=input_list_li1 ${id} lyf-Edit-test-001 ${path}insert_files\\Create-Insert Scripts-test.css xpath=/html/body/div/div[1]/div[1]/ul/li[1]
Edit_Insert_Scripts-008
[Tags] edit js
Create-Insert Scripts 1 ${path}insert_files\\Create-Insert Scripts-test.css xpath=/html/body/div/div[1]/div[1]/ul/li[1]
${name} get text xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[2]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Edit-Insert Scripts id=input_list_li2 ${name} lyf-Edit-test-008 ${path}insert_files\\Create-Insert_Scripts-test.js xpath=/html/body/div/div[1]/div[1]/ul/li[2]

View File

@@ -0,0 +1,38 @@
*** Settings ***
Force Tags tsg-ui settings response_pages
Resource ../../../03-Variable/bifangapivariable.txt
Library OperatingSystem
Resource ../../../02-Keyword/tsg_ui/setting/Settings.robot
*** Test Cases ***
Create_Response_pages-001
[Tags] html
Create-Response Pages Create-Response Pages-001 ${path}response_pages_files\\Create-Response Pages-test.html
Create_Response_pages-002
[Tags] htm
Create-Response Pages Create-Response Pages-001 ${path}response_pages_files\\Create-Response_Pages-test-2.htm
Create_Response_pages-003
[Tags] name最小值
Create-Response Pages 1 ${path}response_pages_files\\Create-Response_Pages-test-2.htm
Create_Response_pages-004
[Tags] name超过128字符
Create-Response Pages ${path}response_pages_files\\Create-Response Pages-test2.htm${path}response_pages_files\\Create-Response Pages-test2.htm${path}response_pages_files\\Create-Response Pages-test2.htm ${path}response_pages_files\\Create-Response_Pages-test-2.htm
Create_Response_pages-005
[Tags] 中英俄特殊字符
Create-Response Pages 中文+absc+моряков+@#¥%……&* ${path}response_pages_files\\Create-Response Pages-test.html
Edit_Response_pages-006
[Tags] 修改+以id为查找对象
Create-Response Pages Create-Response Pages-001 ${path}response_pages_files\\Create-Response Pages-test.html
${id} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[1]/div/div/span
Edit-Response Pages id=input_list_li1 ${id} lyf-Edit-test-001 ${path}response_pages_files\\Create-Response Pages-test-1.html
Edit_Response_pages-007
[Tags] 修改+以name为查找对象
Create-Response Pages Create-Response Pages-001 ${path}response_pages_files\\Create-Response Pages-test.html
${name} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/span
Edit-Response Pages id=input_list_li2 ${name} lyf-Edit-test-007 ${path}response_pages_files\\Create-Response Pages-test-1.html

View File

@@ -0,0 +1,22 @@
*** Settings ***
Force Tags tsg-ui settings SSL Decryption Exclusion
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/tsg_ui/setting/Settings.robot
Library OperatingSystem
*** Test Cases ***
Create_SSL_Decryption_Exclusion-001
Create-SSL Decryption Exclusion $www.jianshu.com jianshu www.jianshu.com
Create_SSL_Decryption_Exclusion-002
Create-SSL Decryption Exclusion *myssl.com myssl.com myssl.com
Edit_SSL_Decryption_Exclusion-003
Create-SSL Decryption Exclusion *myssl.com myssl.com myssl.com
${id} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[1]/div/div/div/p/span
Edit-SSL Decryption Exclusion id=input_list_li1 ${id} $www.jianshu.com 简书
Edit_SSL_Decryption_Exclusion-004
Create-SSL Decryption Exclusion *myssl.com myssl.com myssl.com
${id} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[1]/div/div/div/p/span
Edit-SSL Decryption Exclusion id=input_list_li1 ${id} $www.jianshu.com 简xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[1]/div/div/div/p/spanxpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[1]/div/div/div/p/span书

View File

@@ -0,0 +1,30 @@
*** Settings ***
Force Tags tsg-ui settings Cached Intermediate Certificates
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/tsg_ui/setting/Settings.robot
Library OperatingSystem
*** Test Cases ***
Search_Cached_Intermediate_Certificates-001
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_CertificateManagement #点击二级目录Trusted Certificate Authorities
Sleep 2
click xpath=//*[@id="proxyTabs"]/div/ul/li[4] #点击Cached Intermediate Certificates按钮
Sleep 3
${id} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/div/p/span
Sleep 2
Search-Cached Intermediate Certificates id=input_list_li1 ${id} xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[9]
Search_Cached_Intermediate_Certificates-002
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_CertificateManagement #点击二级目录Trusted Certificate Authorities
Sleep 2
click xpath=//*[@id="proxyTabs"]/div/ul/li[4] #点击Cached Intermediate Certificates按钮
Sleep 3
${sni} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/div/p/span
Sleep 3
Search-Cached Intermediate Certificates id=input_list_li2 ${sni} xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[9]

View File

@@ -0,0 +1,30 @@
*** Settings ***
Force Tags tsg-ui settings Traffic Mirror Profiles
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/tsg_ui/setting/Settings.robot
Library OperatingSystem
*** Test Cases ***
Create_Traffic_Mirror_Profiles-001
[Tags] vlan最小值
Create-Traffic Mirror Profiles lyf-test-004-vlan xpath=/html/body/div/div[1]/div[1]/ul/li[1] 1
Create_Traffic_Mirror_Profiles-002
[Tags] vlan最大值
Create-Traffic Mirror Profiles lyf-test-002-vlan xpath=/html/body/div/div[1]/div[1]/ul/li[1] 4094
Create_Traffic_Mirror_Profiles-003
[Tags] mac
Create-Traffic Mirror Profiles lyf-test-003-mac xpath=/html/body/div/div[1]/div[1]/ul/li[2] 11:11:11:11:11:11
Edit_Traffic_Mirror_Profiles-004
[Tags] mac
Create-Traffic Mirror Profiles lyf-test-003-mac xpath=/html/body/div/div[1]/div[1]/ul/li[2] 11:11:11:11:11:11
${id} get text xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[2]/div/div[3]/table/tbody/tr/td[1]/div/div/span
Edit-Traffic Mirror Profiles id=input_list_li1 ${id} lyf-Edit-test-001 xpath=/html/body/div/div[1]/div[1]/ul/li[2] 11:11:11:11:11:12
Edit_Traffic_Mirror_Profiles-005
[Tags] vlan最大值
Create-Traffic Mirror Profiles lyf-test-002-vlan xpath=/html/body/div/div[1]/div[1]/ul/li[1] 4094
${name} get text xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[2]/div/div[3]/table/tbody/tr/td[2]/div/div/span
Edit-Traffic Mirror Profiles id=input_list_li2 ${name} lyf-Edit-test-002 xpath=/html/body/div/div[1]/div[1]/ul/li[1] 11

View File

@@ -0,0 +1,25 @@
*** Settings ***
Force Tags tsg-ui settings Trusted Certificate Authorities
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/tsg_ui/setting/Settings.robot
Library OperatingSystem
*** Test Cases ***
Create_Trusted_Certificate_Authorities-001
import-Trusted Certificate Authorities lyf-RF-test-001 ${path}keyrings//root//tango-ca-root-01-cer.pem
Create_Trusted_Certificate_Authorities-002
import-Trusted Certificate Authorities test ${path}keyrings//root//tango-ca-root-01-cer.pem
Create_Trusted_Certificate_Authorities-003
import-Trusted Certificate Authorities ${path}keyrings//root//tango-ca-root-01-cer.pem${path}keyrings//root//tango-ca-root-01-cer.pem${path}keyrings//root//tango-ca-root-01-cer.pem ${path}keyrings//root//tango-ca-root-01-cer.pem
Edit_Trusted_Certificate_Authorities-004
import-Trusted Certificate Authorities lyf-RF-test-001 ${path}keyrings//root//tango-ca-root-01-cer.pem
${id} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[1]/div/div/div/p/span
Edit-Trusted Certificate Authorities id=input_list_li1 ${id} lyf-edit-test-001 ${path}keyrings//root//tango-ca-root-01-cer.pem
Edit_Trusted_Certificate_Authorities-005
import-Trusted Certificate Authorities lyf-RF-test-001 ${path}keyrings//root//tango-ca-root-01-cer.pem
${name} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/div/p/span
Edit-Trusted Certificate Authorities id=input_list_li2 ${name} lyf-edit-test-001 ${path}keyrings//root//tango-ca-root-01-cer.pem

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,997 @@
*** Settings ***
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
Force Tags zjj tsg_adc proxy_policy
Library OperatingSystem
Resource ../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../03-Variable/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
ZJJ-ProxyPolicy-Redirect-Http-00001
[Tags] selfserver ip http redirect
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00001 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://www.ziroom.com/","code":301,"protocol":"HTTP","enforcement_ratio":0.1} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |Redirect-Http
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.1访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00002
[Tags] selfserver ip+fqdn完整匹配 http redirect
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-ZJJ-SecurityPolicy-Intercept-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00002 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.yhd.com/","code":302,"protocol":"HTTP","enforcement_ratio":0.2} isValid=${1} appObjectIdArray=2 referenceObject=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.2访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00003
[Tags] selfserver ip+cat右匹配 http redirect
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_cat_Id}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-ZJJ-SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00003 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.toutiao.com/ch/news_hot/","code":301,"protocol":"HTTP","enforcement_ratio":0.3} isValid=${1} appObjectIdArray=2 referenceObject=${object_cat_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.3访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00004
[Tags] selfserver http redirect ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-ZJJ-SecurityPolicy-Intercept-SSL-00004 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00004 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://bbs.tianya.cn/list-lookout-1.shtml","code":301,"protocol":"HTTP","enforcement_ratio":0.4} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.4访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00005
[Tags] selfserver http redirect ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-ZJJ-SecurityPolicy-Intercept-SSL-00005 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00005 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://kefu.ctrip.com/index","code":301,"protocol":"HTTP","enforcement_ratio":0.5} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-0002.bat
... ELSE set variable curl -kv http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.5访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00006
[Tags] selfserver http redirect ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/nationalbank/nationalbank.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-00006 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00006 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.booking.com/","code":302,"protocol":"HTTP","enforcement_ratio":0.6} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-0003.bat
... ELSE set variable curl -kv http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.6访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00007
[Tags] selfserver http redirect ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-00007 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00007 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.eastmoney.com/","code":301,"protocol":"HTTP","enforcement_ratio":0.7} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.7访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00008
[Tags] selfserver http redirect ip+请求头右匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-00008 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00008 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.iqiyi.com/","code":301,"protocol":"HTTP","enforcement_ratio":0.8} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-0008.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' \ http://open.node.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.8访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00009
[Tags] selfserver http redirect ip+请求头字串匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-00009 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00009 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://chaoshi.tmall.com/","code":302,"protocol":"HTTP","enforcement_ratio":0.9} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-0008.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' \ http://open.node.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.9访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00010
[Tags] selfserver http redirect ip+请求头完整匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-000010 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00010 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://military.china.com/zh_cn/","code":301,"protocol":"HTTP","enforcement_ratio":1} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-0008.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' \ http://open.node.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 1访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00011
[Tags] selfserver http redirect ip+请求头左匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-000011 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00011 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://www.tiexue.net/","code":302,"protocol":"HTTP","enforcement_ratio":0.1111} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-0008.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' \ http://open.node.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.1111访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00012
[Tags] selfserver http redirect ip+cookie字串匹配
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-000012 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00012 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.douyu.com/","code":301,"protocol":"HTTP","enforcement_ratio":0.111111} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-0012.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.2222访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00013
[Tags] selfserver http redirect ip+应答头右匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-000013 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00013 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.fang.com/","code":301,"protocol":"HTTP","enforcement_ratio":0.2222} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.3333访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00014
[Tags] selfserver http redirect ip+应答头字串匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-000014 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00014 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.zealer.com/video?ZC_ACCESS_TOKEN=&ZC_UID=","code":302,"protocol":"HTTP","enforcement_ratio":0.3333} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.4444访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00015
[Tags] selfserver http redirect ip+应答头完整匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-000015 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00015 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://stock.stockstar.com/gem/","code":302,"protocol":"HTTP","enforcement_ratio":0.5555} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-0003.bat
... ELSE set variable curl -kv http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.5555访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00016
[Tags] selfserver http redirect ip+应答头左匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-000016 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00016 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.kugou.com/yy/html/rank.html","code":301,"protocol":"HTTP","enforcement_ratio":0.6666} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-0002.bat
... ELSE set variable curl -kv \ http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.6666访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00017
[Tags] selfserver http redirect ip+set-cookie右匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-000017 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00017 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.yy.com/","code":301,"protocol":"HTTP","enforcement_ratio":0.7777} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.7777访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00018
[Tags] selfserver http redirect ip+set-cookie字串匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-000018 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00018 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.xiaohongshu.com/","code":302,"protocol":"HTTP","enforcement_ratio":0.8888} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.8888访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00019
[Tags] selfserver http redirect ip+set-cookie完整匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-000019 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00019 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.zhihu.com/signin?next=%2F","code":301,"protocol":"HTTP","enforcement_ratio":0.9999} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redircet-HTTP-0017.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv \ http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.9999访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00020
[Tags] selfserver http redirect ip+set-cookie左匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-000020 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00020 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.pcauto.com.cn/","code":302,"protocol":"HTTP","enforcement_ratio":0.01} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.comBy
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.01访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00021
[Tags] selfserver http redirect ip+请求体字串匹配
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-000021 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00021 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://www.cmbchina.com/","code":301,"protocol":"HTTP","enforcement_ratio":0} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT,${object_url_Id}|TSG_FIELD_HTTP_URL
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redircet-HTTP-0017.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body"-kv http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ-ProxyPolicy-Redirect-Http-00022
[Tags] selfserver 最大组合 http redirect
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${object_rq_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_rq_Id}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=charset|Content-Type
${rescode} ${object_re_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_re_Id}
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${rescode} ${object_by_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_by_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=ZJJ-SecurityPolicy-Intercept-SSL-000022 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=ZJJ-ProxyPolicy-Redirect-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.yhd.com/","code":301,"protocol":"HTTP","enforcement_ratio":1} isValid=${1} appObjectIdArray=2 referenceObject=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_rq_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_re_Id}|TSG_FIELD_HTTP_RES_HDR,${object_by_Id}|TSG_FIELD_HTTP_REQ_CONTENT,${objectId}|TSG_SECURITY_DESTINATION_ADDR
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/selfserver/ProxyPolicy-Redirect-HTTP-00023.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
... ELSE Create List Connected to open.node.com
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 1访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}

View File

@@ -14,7 +14,7 @@ Library json
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /policy/profile/responsepages
${url} /policy/profile/decryption
${profiledId} ${EMPTY}
*** Test Cases ***
@@ -61,15 +61,16 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00001
... subObjectIds=${Default_SubObjectIds}
... addItemList=$open.node.com
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
#${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":1,"cert_transparency":1,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1}
#${protocol_version} set variable "protocol_version":{"min":"","max":"","mirror_client":1,"allow_http2":1}
#${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
#${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
#${data} Create List ${requestbody}
#${response} CreatePolicyFileNoFile ${url} ${data}
#${mirror_profile} Get From Dictionary ${response} profileId
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":0,"cert_pinning":0,"protocol_errors":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileDesc":"autotest_decryption_add","isValid":1,"decryption":{${dynamic_bypass},${certificate_checks},${protocol_version}}}]}
#{"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"profileDesc":"autotest"}]}}
${data} set variable ${requestbody}
${response} CreatePolicyFileNoFile ${url} ${data}
${decryption_profile} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary
... policyName=${caseName}
@@ -77,8 +78,8 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00001
... policyDesc=${caseName}
... action=intercept
... effectiveRange=${Default_EffectiveRange}
... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
#... userRegion={"protocol":"SSL","keyring":123,"decryption",1,"decrypt_mirror":{"enable":1,"mirror_profile":${mirror_profile}}
#... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_FQDN_Id}|TSG_FIELD_SSL_SNI
... isValid=1
... appObjectIdArray=${3}
@@ -97,7 +98,7 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00001
... policyDesc=${Default_PolicyDesc}
... action=manipulation
... effectiveRange=${Default_EffectiveRange}
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_res_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":0.0001,"protocol":"HTTP"}
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_res_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":0.1,"protocol":"HTTP"}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_URL_Id}|TSG_FIELD_HTTP_URL
... isValid=1
... appObjectIdArray=${2}
@@ -115,7 +116,7 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00001
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/zjj/ZJJ_ProxyPolicy-Replace-00001.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=find&setCookie=set-cookie&contentType=text/html;charset=UTF-8&resBody=Response Body" https://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
${stringlist} run keyword if '${systemType}'=='Windows' Create List schannel
#OpenSSL SSL_connect: Connection was reset in connection toX-TG-Construct-By: tfe
#Send failure: Connection was reset Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
@@ -131,10 +132,11 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00001
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt ${starttime}
Append To File ${path}/enforcement_ratio.txt ${logsize}
Append To File ${path}/enforcement_ratio.txt ${s}
Append To File ${path}/enforcement_ratio.txt ${endtime}
Append To File ${path}/enforcement_ratio.txt |Replace-SSL\r\n
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.1访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00002
[Tags] selfserver SIP+DIP+URL
${caseName} set variable ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00002
@@ -180,13 +182,14 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00002
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
#${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":1,"cert_transparency":1,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1}
#${protocol_version} set variable "protocol_version":{"min":"","max":"","mirror_client":1,"allow_http2":1}
#${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
#${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
#${data} Create List ${requestbody}
#${response} CreatePolicyFileNoFile ${url} ${data}
#${mirror_profile} Get From Dictionary ${response} profileId
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":0,"cert_pinning":0,"protocol_errors":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileDesc":"autotest_decryption_add","isValid":1,"decryption":{${dynamic_bypass},${certificate_checks},${protocol_version}}}]}
#{"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"profileDesc":"autotest"}]}}
${data} set variable ${requestbody}
${response} CreatePolicyFileNoFile ${url} ${data}
${decryption_profile} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary
... policyName=${caseName}
@@ -194,8 +197,8 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00002
... policyDesc=${caseName}
... action=intercept
... effectiveRange=${Default_EffectiveRange}
... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
#... userRegion={"protocol":"SSL","keyring":123,"decryption",1,"decrypt_mirror":{"enable":1,"mirror_profile":${mirror_profile}}
#... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_FQDN_Id}|TSG_FIELD_SSL_SNI
... isValid=1
... appObjectIdArray=${3}
@@ -214,7 +217,7 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00002
... policyDesc=${Default_PolicyDesc}
... action=manipulation
... effectiveRange=${Default_EffectiveRange}
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_res_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":0.1,"protocol":"HTTP"}
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_res_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":0.2,"protocol":"HTTP"}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_URL_Id}|TSG_FIELD_HTTP_URL
... isValid=1
... appObjectIdArray=${2}
@@ -232,7 +235,7 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00002
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/zjj/ZJJ_ProxyPolicy-Replace-00001.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=find&setCookie=set-cookie&contentType=text/html;charset=UTF-8&resBody=Response Body" https://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
${stringlist} run keyword if '${systemType}'=='Windows' Create List schannel
#OpenSSL SSL_connect: Connection was reset in connection toX-TG-Construct-By: tfe
#Send failure: Connection was reset Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
@@ -248,10 +251,10 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00002
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt ${starttime}
Append To File ${path}/enforcement_ratio.txt ${logsize}
Append To File ${path}/enforcement_ratio.txt ${s}
Append To File ${path}/enforcement_ratio.txt ${endtime}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.2访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00003
[Tags] selfserver SIP+DIP+URL
${caseName} set variable ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00003
@@ -297,13 +300,14 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00003
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
#${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":1,"cert_transparency":1,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1}
#${protocol_version} set variable "protocol_version":{"min":"","max":"","mirror_client":1,"allow_http2":1}
#${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
#${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
#${data} Create List ${requestbody}
#${response} CreatePolicyFileNoFile ${url} ${data}
#${mirror_profile} Get From Dictionary ${response} profileId
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":0,"cert_pinning":0,"protocol_errors":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileDesc":"autotest_decryption_add","isValid":1,"decryption":{${dynamic_bypass},${certificate_checks},${protocol_version}}}]}
#{"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"profileDesc":"autotest"}]}}
${data} set variable ${requestbody}
${response} CreatePolicyFileNoFile ${url} ${data}
${decryption_profile} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary
... policyName=${caseName}
@@ -311,8 +315,8 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00003
... policyDesc=${caseName}
... action=intercept
... effectiveRange=${Default_EffectiveRange}
... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
#... userRegion={"protocol":"SSL","keyring":123,"decryption",1,"decrypt_mirror":{"enable":1,"mirror_profile":${mirror_profile}}
#... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_FQDN_Id}|TSG_FIELD_SSL_SNI
... isValid=1
... appObjectIdArray=${3}
@@ -331,7 +335,7 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00003
... policyDesc=${Default_PolicyDesc}
... action=manipulation
... effectiveRange=${Default_EffectiveRange}
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_res_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":0.9,"protocol":"HTTP"}
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_res_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":0.3,"protocol":"HTTP"}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_URL_Id}|TSG_FIELD_HTTP_URL
... isValid=1
... appObjectIdArray=${2}
@@ -349,7 +353,7 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00003
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/zjj/ZJJ_ProxyPolicy-Replace-00001.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=find&setCookie=set-cookie&contentType=text/html;charset=UTF-8&resBody=Response Body" https://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
${stringlist} run keyword if '${systemType}'=='Windows' Create List schannel
#OpenSSL SSL_connect: Connection was reset in connection toX-TG-Construct-By: tfe
#Send failure: Connection was reset Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
@@ -365,10 +369,10 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00003
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt ${starttime}
Append To File ${path}/enforcement_ratio.txt ${logsize}
Append To File ${path}/enforcement_ratio.txt ${s}
Append To File ${path}/enforcement_ratio.txt ${endtime}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.3访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00004
[Tags] selfserver SIP+DIP+URL
${caseName} set variable ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00004
@@ -414,13 +418,14 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00004
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
#${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":1,"cert_transparency":1,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1}
#${protocol_version} set variable "protocol_version":{"min":"","max":"","mirror_client":1,"allow_http2":1}
#${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
#${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
#${data} Create List ${requestbody}
#${response} CreatePolicyFileNoFile ${url} ${data}
#${mirror_profile} Get From Dictionary ${response} profileId
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":0,"cert_pinning":0,"protocol_errors":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileDesc":"autotest_decryption_add","isValid":1,"decryption":{${dynamic_bypass},${certificate_checks},${protocol_version}}}]}
#{"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"profileDesc":"autotest"}]}}
${data} set variable ${requestbody}
${response} CreatePolicyFileNoFile ${url} ${data}
${decryption_profile} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary
... policyName=${caseName}
@@ -428,8 +433,8 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00004
... policyDesc=${caseName}
... action=intercept
... effectiveRange=${Default_EffectiveRange}
... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":0,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
#... userRegion={"protocol":"SSL","keyring":123,"decryption",1,"decrypt_mirror":{"enable":1,"mirror_profile":${mirror_profile}}
#... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_FQDN_Id}|TSG_FIELD_SSL_SNI
... isValid=1
... appObjectIdArray=${3}
@@ -448,7 +453,7 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00004
... policyDesc=${Default_PolicyDesc}
... action=manipulation
... effectiveRange=${Default_EffectiveRange}
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_res_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":0.9999,"protocol":"HTTP"}
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_res_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":0.4,"protocol":"HTTP"}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_URL_Id}|TSG_FIELD_HTTP_URL
... isValid=1
... appObjectIdArray=${2}
@@ -466,7 +471,7 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00004
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/zjj/ZJJ_ProxyPolicy-Replace-00001.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=find&setCookie=set-cookie&contentType=text/html;charset=UTF-8&resBody=Response Body" https://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
${stringlist} run keyword if '${systemType}'=='Windows' Create List schannel
#OpenSSL SSL_connect: Connection was reset in connection toX-TG-Construct-By: tfe
#Send failure: Connection was reset Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
@@ -481,9 +486,14 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00004
${endtime} Get Time
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.4访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00005
[Tags] selfserver SIP+DIP+URL
${caseName} set variable ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00005
${caseName} set variable ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00006
Comment 创建目标IP
${objectDict} Create Dictionary
... objectType=ip
@@ -526,13 +536,14 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00005
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
#${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":1,"cert_transparency":1,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1}
#${protocol_version} set variable "protocol_version":{"min":"","max":"","mirror_client":1,"allow_http2":1}
#${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
#${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
#${data} Create List ${requestbody}
#${response} CreatePolicyFileNoFile ${url} ${data}
#${mirror_profile} Get From Dictionary ${response} profileId
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":0,"cert_pinning":0,"protocol_errors":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileDesc":"autotest_decryption_add","isValid":1,"decryption":{${dynamic_bypass},${certificate_checks},${protocol_version}}}]}
#{"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"profileDesc":"autotest"}]}}
${data} set variable ${requestbody}
${response} CreatePolicyFileNoFile ${url} ${data}
${decryption_profile} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary
... policyName=${caseName}
@@ -540,8 +551,126 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00005
... policyDesc=${caseName}
... action=intercept
... effectiveRange=${Default_EffectiveRange}
... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":0.5,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
#... userRegion={"protocol":"SSL","keyring":123,"decryption",1,"decrypt_mirror":{"enable":1,"mirror_profile":${mirror_profile}}
#... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_FQDN_Id}|TSG_FIELD_SSL_SNI
... isValid=1
... appObjectIdArray=${3}
... userTags=${Default_UserTags}
... doLog=${Default_DoLog}
... scheduleId=${Default_ScheduleId}
${rescode} ${securitypolicyId} AddPolicy2 ${1} ${policyDict}
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]}
Comment 创建带有比例的替换策略
${policyDict} Create Dictionary
... policyName=${caseName}
... policyType=pxy_manipulation
... policyDesc=${Default_PolicyDesc}
... action=manipulation
... effectiveRange=${Default_EffectiveRange}
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_res_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":0.5,"protocol":"HTTP"}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_URL_Id}|TSG_FIELD_HTTP_URL
... isValid=1
... appObjectIdArray=${2}
... userTags=${Default_UserTags}
... doLog=${Default_DoLog}
... scheduleId=${Default_ScheduleId}
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
${s} Convert to String ${policyId}
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]} {"policyType":"pxy_manipulation","policyIds":[${policyId}]}
#{"objectId":5668,"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":7732,"protocolFields":["TSG_FIELD_HTTP_URL"]}]}
#
#${disablePolciy} set variable {"opAction":"enable","policyList":[{"policyType":"pxy_manipulation","policyId":[${policyId}]}]}
#EditPolicy ${disablePolciy}
Comment 功能端验证SSL验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/zjj/ZJJ_ProxyPolicy-Replace-00001.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=find&setCookie=set-cookie&contentType=text/html;charset=UTF-8&resBody=Response Body" https://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List schannel
#OpenSSL SSL_connect: Connection was reset in connection toX-TG-Construct-By: tfe
#Send failure: Connection was reset Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
log endfor
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.5访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00006
[Tags] selfserver SIP+DIP+URL
${caseName} set variable ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00006
Comment 创建目标IP
${objectDict} Create Dictionary
... objectType=ip
... isValid=1
... objectSubType=${Default_ObjectSubType}
... isInitialize=${Default_IsInitialize}
... isExclusion=${Default_IsExclusion}
... objectName=${caseName}_IPobject
... objectDesc=${Default_ObjectDesc}
... subObjectIds=${Default_SubObjectIds}
... addItemList=CIDR|192.168.100.5|32|0/0&${Default_AddItem_ServerIpFormat}|${Default_AddItem_ServerIp1}|${Default_AddItem_ServerIp2}|${Default_AddItem_ServerPort}|${Default_AddItem_IsInitialize}|${Default_AddItem_ItemName}|${Default_AddItem_ItemDesc}
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
#创建url
${objectDict} Create Dictionary
... objectType=url
... isValid=${1}
... objectSubType=${Default_ObjectSubType}
... isInitialize=${Default_IsInitialize}
... isExclusion=${Default_IsExclusion}
... objectName=${caseName}_URLobject
... objectDesc=${Default_ObjectDesc}
... subObjectIds=${Default_SubObjectIds}
... addItemList=open.node.com/action
${rescode} ${object_URL_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_URL_Id}
#创建url
${objectDict} Create Dictionary
... objectType=fqdn
... isValid=${1}
... objectSubType=${Default_ObjectSubType}
... isInitialize=${Default_IsInitialize}
... isExclusion=${Default_IsExclusion}
... objectName=${caseName}_fqdnobject
... objectDesc=${Default_ObjectDesc}
... subObjectIds=${Default_SubObjectIds}
... addItemList=$open.node.com
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":0,"cert_pinning":0,"protocol_errors":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileDesc":"autotest_decryption_add","isValid":1,"decryption":{${dynamic_bypass},${certificate_checks},${protocol_version}}}]}
#{"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"profileDesc":"autotest"}]}}
${data} set variable ${requestbody}
${response} CreatePolicyFileNoFile ${url} ${data}
${decryption_profile} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary
... policyName=${caseName}
... policyType=tsg_security
... policyDesc=${caseName}
... action=intercept
... effectiveRange=${Default_EffectiveRange}
#... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_FQDN_Id}|TSG_FIELD_SSL_SNI
... isValid=1
... appObjectIdArray=${3}
@@ -578,7 +707,7 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00005
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/zjj/ZJJ_ProxyPolicy-Replace-00001.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=find&setCookie=set-cookie&contentType=text/html;charset=UTF-8&resBody=Response Body" https://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
${stringlist} run keyword if '${systemType}'=='Windows' Create List schannel
#OpenSSL SSL_connect: Connection was reset in connection toX-TG-Construct-By: tfe
#Send failure: Connection was reset Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
@@ -594,21 +723,254 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00005
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt ${starttime}
Append To File ${path}/enforcement_ratio.txt ${logsize}
Append To File ${path}/enforcement_ratio.txt ${s}
Append To File ${path}/enforcement_ratio.txt ${endtime}
#TestLogSize
#日志验证security_event_log
#GetLogListSize proxy_event_log 2020-04-28 09:40:00 2020-04-28 10:00:00 192.168.50.6 4837 ssl_sni httpdns.n.netease.co
#${logsize} GetLogListSize security_event_log 2020-04-28 09:40:00 2020-04-28 10:00:00 192.168.50.6 4837 ssl_sni httpdns.n.netease.co
#log 11${logsize}
#${logsize} GetLogCount security_event_log 2020-04-28 09:40:00 2020-04-28 10:00:00 192.168.50.6 4837 ssl_sni httpdns.n.netease.co
#log 22${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.9访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-000010
[Tags] selfserver SIP+DIP+URL
${caseName} set variable ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-000010
Comment 创建目标IP
${objectDict} Create Dictionary
... objectType=ip
... isValid=1
... objectSubType=${Default_ObjectSubType}
... isInitialize=${Default_IsInitialize}
... isExclusion=${Default_IsExclusion}
... objectName=${caseName}_IPobject
... objectDesc=${Default_ObjectDesc}
... subObjectIds=${Default_SubObjectIds}
... addItemList=CIDR|192.168.100.5|32|0/0&${Default_AddItem_ServerIpFormat}|${Default_AddItem_ServerIp1}|${Default_AddItem_ServerIp2}|${Default_AddItem_ServerPort}|${Default_AddItem_IsInitialize}|${Default_AddItem_ItemName}|${Default_AddItem_ItemDesc}
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
#创建url
${objectDict} Create Dictionary
... objectType=url
... isValid=${1}
... objectSubType=${Default_ObjectSubType}
... isInitialize=${Default_IsInitialize}
... isExclusion=${Default_IsExclusion}
... objectName=${caseName}_URLobject
... objectDesc=${Default_ObjectDesc}
... subObjectIds=${Default_SubObjectIds}
... addItemList=open.node.com/action
${rescode} ${object_URL_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_URL_Id}
#创建url
${objectDict} Create Dictionary
... objectType=fqdn
... isValid=${1}
... objectSubType=${Default_ObjectSubType}
... isInitialize=${Default_IsInitialize}
... isExclusion=${Default_IsExclusion}
... objectName=${caseName}_fqdnobject
... objectDesc=${Default_ObjectDesc}
... subObjectIds=${Default_SubObjectIds}
... addItemList=$open.node.com
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":0,"cert_pinning":0,"protocol_errors":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileDesc":"autotest_decryption_add","isValid":1,"decryption":{${dynamic_bypass},${certificate_checks},${protocol_version}}}]}
#{"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"profileDesc":"autotest"}]}}
${data} set variable ${requestbody}
${response} CreatePolicyFileNoFile ${url} ${data}
${decryption_profile} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary
... policyName=${caseName}
... policyType=tsg_security
... policyDesc=${caseName}
... action=intercept
... effectiveRange=${Default_EffectiveRange}
#... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":0,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_FQDN_Id}|TSG_FIELD_SSL_SNI
... isValid=1
... appObjectIdArray=${3}
... userTags=${Default_UserTags}
... doLog=${Default_DoLog}
... scheduleId=${Default_ScheduleId}
${rescode} ${securitypolicyId} AddPolicy2 ${1} ${policyDict}
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]}
Comment 创建带有比例的替换策略
${policyDict} Create Dictionary
... policyName=${caseName}
... policyType=pxy_manipulation
... policyDesc=${Default_PolicyDesc}
... action=manipulation
... effectiveRange=${Default_EffectiveRange}
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_res_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":0.9999,"protocol":"HTTP"}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_URL_Id}|TSG_FIELD_HTTP_URL
... isValid=1
... appObjectIdArray=${2}
... userTags=${Default_UserTags}
... doLog=${Default_DoLog}
... scheduleId=${Default_ScheduleId}
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
${s} Convert to String ${policyId}
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]} {"policyType":"pxy_manipulation","policyIds":[${policyId}]}
#{"objectId":5668,"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":7732,"protocolFields":["TSG_FIELD_HTTP_URL"]}]}
#
#${disablePolciy} set variable {"opAction":"enable","policyList":[{"policyType":"pxy_manipulation","policyId":[${policyId}]}]}
#EditPolicy ${disablePolciy}
Comment 功能端验证SSL验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/zjj/ZJJ_ProxyPolicy-Replace-00001.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=find&setCookie=set-cookie&contentType=text/html;charset=UTF-8&resBody=Response Body" https://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List schannel
#OpenSSL SSL_connect: Connection was reset in connection toX-TG-Construct-By: tfe
#Send failure: Connection was reset Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
log endfor
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.9999访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-000011
[Tags] selfserver SIP+DIP+URL
${caseName} set variable ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-000011
Comment 创建目标IP
${objectDict} Create Dictionary
... objectType=ip
... isValid=1
... objectSubType=${Default_ObjectSubType}
... isInitialize=${Default_IsInitialize}
... isExclusion=${Default_IsExclusion}
... objectName=${caseName}_IPobject
... objectDesc=${Default_ObjectDesc}
... subObjectIds=${Default_SubObjectIds}
... addItemList=CIDR|192.168.100.5|32|0/0&${Default_AddItem_ServerIpFormat}|${Default_AddItem_ServerIp1}|${Default_AddItem_ServerIp2}|${Default_AddItem_ServerPort}|${Default_AddItem_IsInitialize}|${Default_AddItem_ItemName}|${Default_AddItem_ItemDesc}
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
#创建url
${objectDict} Create Dictionary
... objectType=url
... isValid=${1}
... objectSubType=${Default_ObjectSubType}
... isInitialize=${Default_IsInitialize}
... isExclusion=${Default_IsExclusion}
... objectName=${caseName}_URLobject
... objectDesc=${Default_ObjectDesc}
... subObjectIds=${Default_SubObjectIds}
... addItemList=open.node.com/action
${rescode} ${object_URL_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_URL_Id}
#创建url
${objectDict} Create Dictionary
... objectType=fqdn
... isValid=${1}
... objectSubType=${Default_ObjectSubType}
... isInitialize=${Default_IsInitialize}
... isExclusion=${Default_IsExclusion}
... objectName=${caseName}_fqdnobject
... objectDesc=${Default_ObjectDesc}
... subObjectIds=${Default_SubObjectIds}
... addItemList=$open.node.com
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":0,"cert_pinning":0,"protocol_errors":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileDesc":"autotest_decryption_add","isValid":1,"decryption":{${dynamic_bypass},${certificate_checks},${protocol_version}}}]}
#{"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"profileDesc":"autotest"}]}}
${data} set variable ${requestbody}
${response} CreatePolicyFileNoFile ${url} ${data}
${decryption_profile} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary
... policyName=${caseName}
... policyType=tsg_security
... policyDesc=${caseName}
... action=intercept
... effectiveRange=${Default_EffectiveRange}
#... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":0.5,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_FQDN_Id}|TSG_FIELD_SSL_SNI
... isValid=1
... appObjectIdArray=${3}
... userTags=${Default_UserTags}
... doLog=${Default_DoLog}
... scheduleId=${Default_ScheduleId}
${rescode} ${securitypolicyId} AddPolicy2 ${1} ${policyDict}
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]}
Comment 创建带有比例的替换策略
${policyDict} Create Dictionary
... policyName=${caseName}
... policyType=pxy_manipulation
... policyDesc=${Default_PolicyDesc}
... action=manipulation
... effectiveRange=${Default_EffectiveRange}
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_res_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":1,"protocol":"HTTP"}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_URL_Id}|TSG_FIELD_HTTP_URL
... isValid=1
... appObjectIdArray=${2}
... userTags=${Default_UserTags}
... doLog=${Default_DoLog}
... scheduleId=${Default_ScheduleId}
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
${s} Convert to String ${policyId}
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]} {"policyType":"pxy_manipulation","policyIds":[${policyId}]}
#{"objectId":5668,"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":7732,"protocolFields":["TSG_FIELD_HTTP_URL"]}]}
#
#${disablePolciy} set variable {"opAction":"enable","policyList":[{"policyType":"pxy_manipulation","policyId":[${policyId}]}]}
#EditPolicy ${disablePolciy}
Comment 功能端验证SSL验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/zjj/ZJJ_ProxyPolicy-Replace-00001.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=find&setCookie=set-cookie&contentType=text/html;charset=UTF-8&resBody=Response Body" https://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List schannel
#OpenSSL SSL_connect: Connection was reset in connection toX-TG-Construct-By: tfe
#Send failure: Connection was reset Tango Secure Gateway CA
... ELSE Create List Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
:FOR ${n} IN RANGE 1000
SystemCommands ${commandstr} ${stringlist}
END
log endfor
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni open.node.com
log 22${logsize}
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 1访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-000012
[Tags] selfserver SIP+DIP+URL+ResHeader+ReqHeader
${caseName} set variable ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-00002
${caseName} set variable ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-000012
Comment 创建目标IP
${objectDict} Create Dictionary
... objectType=ip
@@ -665,6 +1027,14 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-000012
${rescode} ${object_ReqH_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_ReqH_Id}
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileDesc":"autotest_decryption_add","isValid":1,"decryption":{${dynamic_bypass},${certificate_checks},${protocol_version}}}]}
#{"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"profileDesc":"autotest"}]}}
${data} set variable ${requestbody}
${response} CreatePolicyFileNoFile ${url} ${data}
${decryption_profile} Get From Dictionary ${response} profileId
Comment 创建拦截策略
${policyDict} Create Dictionary
... policyName=${caseName}
@@ -672,7 +1042,8 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-000012
... policyDesc=${caseName}
... action=intercept
... effectiveRange=${Default_EffectiveRange}
... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
#... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR
... isValid=1
... appObjectIdArray=${2},${3}
@@ -690,7 +1061,7 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-000012
... policyDesc=${caseName}
... action=manipulation
... effectiveRange=${Default_EffectiveRange}
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find汉字 результатом манипуляций","replace_with":"replace"},{"search_in":"http_res_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":0.1,"protocol":"HTTP"}
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find汉字 результатом манипуляций","replace_with":"replace"},{"search_in":"http_res_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":0.111111,"protocol":"HTTP"}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_URL_Id}|TSG_FIELD_HTTP_URL,${object_ReqH_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_ResH_Id}|TSG_FIELD_HTTP_RES_HDR
... isValid=1
... appObjectIdArray=${2}
@@ -710,10 +1081,10 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-000012
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${path}/zjj/ZJJ_ProxyPolicy-Replace-00002.bat
... ELSE set variable curl -kv --cookie "JSESSIONID=976F28F6C1A5B803B0CDF5FF3E1D2725" -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=find汉字 результатом манипуляций&setCookie=JSESSIONID=976F28F6C1A5B803B0CDF5FF3E1D2725&contentType=text/html;charset=UTF-8&resBody=Response Body" https://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA replacetest
${stringlist} run keyword if '${systemType}'=='Windows' Create List schannel
#OpenSSL SSL_connect: Connection was reset in connection to
#Send failure: Connection was reset
... ELSE Create List Tango Secure Gateway CA replacetest
... ELSE Create List Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
@@ -722,9 +1093,10 @@ ZJJ_ProxyPolicy-Replace-ResbodyReqbocy-000012
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni open.node.com
${logsize} Convert to String ${logsize}
Append To File ${path}/enforcement_ratio.txt ${starttime}
Append To File ${path}/enforcement_ratio.txt ${logsize}
Append To File ${path}/enforcement_ratio.txt ${s}
Append To File ${path}/enforcement_ratio.txt ${endtime}
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
Append To File ${path}/enforcement_ratio.txt 0.111111访问1000次logsize:|${logsize}
Append To File ${path}/enforcement_ratio.txt s:|${s}
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}

View File

@@ -37,3 +37,27 @@ SystemCommand
${rescode} Set Variable 200
log ${rescode}
[Return] ${rescode}
SystemCommandReturnCompare
#执行命令并比对命令返回结果 需要执行的系统命令 命令返回结果要包含的字符串列表 命令返回结果不能包含的字符串列表
[Arguments] ${commandstr} ${stringlist} ${stringlistnotin}
log toSystemCommand_SystemCommandTest
${commandreturn} OperatingSystem.Run ${commandstr}
Append To File ${path}/write_file.txt ${commandstr}
Append To File ${path}/write_file.txt %%%%%%%%%%%%%%newbat
Append To File ${path}/write_file.txt ${commandreturn}
#${commandreturn} Set Variable abcdeConnection was reset
${listlenth}= Get Length ${stringlist}
FOR ${var} IN RANGE ${listlenth}
log ${var}
Should Contain ${commandreturn} ${stringlist}[${var}]
END
${listnotin}= Get Length ${stringlistnotin}
FOR ${varn} IN RANGE ${listnotin}
log ${varn}
Should Not Contain ${commandreturn} ${stringlistnotin}[${varn}]
END
${rescode} Set Variable 200
log ${rescode}
[Return] ${rescode}

View File

@@ -6,7 +6,8 @@ Library Collections
*** Keywords ***
GetApi
[Arguments] ${apiName} ${url} ${startTime}=${None} ${endTime}=${None} ${limit}=50000 ${statisticTime}=${None} ${statisticsUnit}=${None} ${timeGranularity}=${None} ${policy_id}=${None} ${ip}=${None}
[Arguments] ${apiName} ${url} ${startTime}=${None} ${endTime}=${None} ${limit}=50000 ${statisticTime}=${None} ${statisticsUnit}=${None} ${timeGranularity}=${None} ${policy_id}=${None} ${ip}=${None} ${device_ids}=${None} ${policy_ids}=${None} ${orderBy}=${None}
log policy_ids:${policy_ids}
#拼接查询条件
${strstrartTime}= run keyword if '${startTime}'!='${None}' Set Variable startTime=${startTime}&
... ELSE Set Variable ${EMPTY}
@@ -20,11 +21,21 @@ GetApi
... ELSE Set Variable ${EMPTY}
${strtimeGranularity}= run keyword if '${timeGranularity}'!='${None}' Set Variable timeGranularity=${timeGranularity}&
... ELSE Set Variable ${EMPTY}
${strpolicy_id} run keyword if '${policy_id}'!='${None}' Set Variable policy_id=${policy_id}&
${strpolicy_id}= run keyword if '${policy_id}'!='${None}' Set Variable policy_id=${policy_id}&
... ELSE Set Variable ${EMPTY}
${strip} run keyword if '${ip}'!='${None}' Set Variable ip=${ip}&
${strip}= run keyword if '${ip}'!='${None}' Set Variable ip=${ip}&
... ELSE Set Variable ${EMPTY}
${condition} catenate SEPARATOR= ${strstrartTime} ${strendTime} ${strstatisticTime} ${strlimit} ${strstatisticsUnit} ${strtimeGranularity} ${strpolicy_id} ${strip}
${strdevice_ids}= run keyword if '${device_ids}'!='${None}' Set Variable device_ids=${device_ids}&
... ELSE Set Variable ${EMPTY}
${strpolicy_ids}= run keyword if '${policy_ids}'!='${None}' Set Variable policy_ids=${policy_ids}&
... ELSE Set Variable ${EMPTY}
${strorderBy}= run keyword if '${orderBy}'!='${None}' Set Variable orderBy=${orderBy}&
... ELSE Set Variable ${EMPTY}
#替换policy_id为policyId
${strpolicy_id}= run keyword if '${apiName}'=='domain_resource' replace string ${strpolicy_id} policy_id policyId
... ELSE Set Variable ${strpolicy_id}
#bifang请求信息
${condition} catenate SEPARATOR= ${strstrartTime} ${strendTime} ${strstatisticTime} ${strlimit} ${strstatisticsUnit} ${strtimeGranularity} ${strpolicy_id} ${strip} ${strdevice_ids} ${strpolicy_ids} ${strorderBy}
#创建请求信息
${header} Create Dictionary Content-Type=application/x-www-form-urlencoded Authorization=${token}
Create Session api http://${host}:${port}/${version}
@@ -45,15 +56,25 @@ GetApi
... ELSE Set Variable ${EMPTY}
${strtimeGranularity}= run keyword if '${timeGranularity}'!='${None}' Set Variable timeGranularity=${timeGranularity} and
... ELSE Set Variable ${EMPTY}
${strpolicy_id} run keyword if '${policy_id}'!='${None}' Set Variable policy_id=${policy_id} and
${strpolicy_id}= run keyword if '${policy_id}'!='${None}' Set Variable policy_id=${policy_id} and
... ELSE Set Variable ${EMPTY}
${strip} run keyword if '${ip}'!='${None}' Set Variable ip=${ip} and
${strip}= run keyword if '${ip}'!='${None}' Set Variable ip=${ip} and
... ELSE Set Variable ${EMPTY}
${strdevice_ids}= run keyword if '${device_ids}'!='${None}' Set Variable device_ids=${device_ids} and
... ELSE Set Variable ${EMPTY}
#sql拼接 ${where}
${sqlwhere} catenate ${strstrartTime} ${strendTime} ${strstatisticTime} ${strstatisticsUnit} ${strtimeGranularity} ${strpolicy_id} ${strip}
${sqlwhere} catenate ${strstrartTime} ${strendTime} ${strstatisticTime} ${strstatisticsUnit} ${strtimeGranularity} ${strpolicy_id} ${strip} ${strdevice_ids}
${strippedwhere}= Strip String ${sqlwhere} mode=right
#截取最后一个and
${where}= Get Substring ${strippedwhere} \ -4
#injectionstatics 时间粒度默认为30
${timeGranularity}= run keyword if '${timeGranularity}'=="${None}" and '${apiName}'=="injectionstatics" set variable 30
... ELSE set variable ${timeGranularity}
log ${apiName}
#topn排序依据 \ sessions、totalbytes、totalpackets
${TotalOrderBy}= run keyword if '${orderBy}'=="bytes" and '${apiName}'=="topn" set variable totalBytes
... ELSE IF '${orderBy}'=="packets" and '${apiName}'=="topn" set variable totalPackets
... ELSE IF '${orderBy}'=="sessions" and '${apiName}'=="topn" set variable sessions
#BigData
${sql}= run keyword if '${apiName}'=="country" Set Variable SELECT country, APPROX_COUNT_DISTINCT_DS_HLL(ip_object) as num FROM source_country_ip_num_log where ${where} group by country order by num desc limit ${limit}
... ELSE IF '${apiName}'=="domain" Set Variable SELECT domain, protocol_type, ip_num, session_num \ FROM top_domain_recommend_daily_log where __time = '${statisticTime}'
@@ -64,7 +85,12 @@ GetApi
... ELSE IF '${apiName}'=="traffic" and '${statisticsUnit}'=='${None}' Set Variable select sum(total_in_bytes) as trafficInBytes, sum(total_out_bytes) as trafficOutBytes, \ sum(total_in_bytes+total_out_bytes) as trafficTotalBytes, sum(total_in_packets) as trafficInPackets,sum(total_out_packets) as trafficOutPackets,sum(total_in_packets+total_out_packets) as trafficTotalPackets, sum(new_conn_num) as sessions from traffic_metrics_log where __time >= '${startTime}' and __time < '${endTime}'
... ELSE IF '${apiName}'=="ip_correlation_domain" and '${ip}'!='${None}' Set Variable SELECT \ ip, FROM_UNIXTIME(max(stat_time)) as last_time, FROM_UNIXTIME(min(stat_time)) as first_time, groupUniqArrayMerge(domain_list) as domain_list, groupUniqArrayMerge(port_list) as port_list \ FROM security_ip_info where \ stat_time >= '${startTime}' and stat_time < '${endTime}' and ip='${ip}' group by ip
... ELSE IF '${apiName}'=="ip_correlation_domain" and ${ip}==${None} Set Variable SELECT ip,FROM_UNIXTIME(max(stat_time)) as last_time, FROM_UNIXTIME(min(stat_time)) as first_time, groupUniqArrayMerge(domain_list) as domain_list, groupUniqArrayMerge(port_list) as port_list \ FROM security_ip_info where \ stat_time >= '${startTime}' and stat_time < '${endTime}' \ group by ip
... ELSE IF '${apiName}'=="hijack_srcip_num" Set Variable SELECT policy_id,country,location, APPROX_COUNT_DISTINCT_DS_HLL(ip_object) as num \ FROM proxy_event_hits_log where \ __time >='${startTime}' and __time <'${endTime}' and policy_id in \ ( ${policy_ids} ) group by policy_id , country,location order by num desc
... ELSE IF '${apiName}'=="hijack_srcip_location" Set Variable select ip, IP_TO_CITY(ip) as location, IP_TO_GEO(ip) as geo from (SELECT policy_id, arrayJoin(groupUniqArrayMerge(ip_list)) as ip FROM proxy_ip_info where \ stat_time >= '${startTime}' and stat_time < '${endTime}' and policy_id = ${policy_id} group by policy_id )
... ELSE IF '${apiName}'=="domain_resource" Set Variable SELECT \ domain, groupUniqArrayMerge(ip_list) as ip_list, groupUniqArrayMerge(cdn_list) as cdn_list, groupUniqArrayMerge(protocol_type_list) as protocol_type_list, groupUniqArrayMerge(port_list) as port_list \ FROM security_website_domain_info where \ stat_time >= '${startTime}' and stat_time < '${endTime}' and policy_id=${policy_id} group by domain
... ELSE IF '${apiName}'=="injectionstatistics" Set Variable select DATE_FORMAT(FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(__time)/${timeGranularity})*${timeGranularity}),'%Y-%m-%d %H:%i:%s') as stat_time, \ sum(bytes) as bytes from injection_metrics_log \ where __time >= '${startTime}' and __time < '${endTime}' group by DATE_FORMAT(FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(__time)/${timeGranularity})*${timeGranularity}),'%Y-%m-%d %H:%i:%s') limit ${limit}
... ELSE IF '${apiName}'=="topn" Set Variable select domain,sum(session_num) as sessions,sum(c2s_byte_num) as sentBytes,sum(s2c_byte_num) as receivedBytes,sum(c2s_byte_num+s2c_byte_num) as totalBytes,sum(c2s_pkt_num) as sentPackets,sum(s2c_pkt_num) as receivedPackets,sum(c2s_pkt_num+s2c_pkt_num) as totalPackets from top_website_domain_log where __time >= '${startTime}' \ and __time < '${endTime}' \ and order_by='${orderBy}' \ group by domain order by ${TotalOrderBy} desc limit ${limit}
log ${sql}
log sql------------${sql}
#traffic二次请求sql
${sql2}= run keyword if '${apiName}'=='traffic' SplicingTrafficSql ${apiName} ${startTime} ${endTime} statisticsUnit=${statisticsUnit} timeGranularity=${timeGranularity} limit=${limit}
@@ -82,7 +108,7 @@ GetApi
... AND Should Be Equal As Strings ${bigdata2}[status] 200
#traffic二次请求json拼接与毕方一致
${bigdataTraffic}= run keyword if '${apiName}'=="traffic" SplicingTrafficJson ${bigdata} ${bigdata2}
${bifanglist} run keyword if '${apiName}'=="ip_correlation_domain" set variable ${bifang['data']['list']['list']}
${bifanglist} run keyword if '${apiName}'=="ip_correlation_domain" \ or '${apiName}'=='domain_resource' set variable ${bifang['data']['list']['list']}
... ELSE IF '${apiName}'=="traffic" set variable ${bifang['data']}
... ELSE set variable ${bifang['data']['list']}
${bigdatalist} run keyword if '${apiName}'=="traffic" set variable ${bigdataTraffic}
@@ -96,7 +122,7 @@ GetApi
BigData
[Arguments] ${sql}
#创建请求信息
Create Session api http://192.168.40.224:9999
Create Session api http://192.168.40.186:9999
#发送请求
${remoteResponse}= Get Request api ?query=${sql}
[Return] ${remoteResponse}
@@ -206,3 +232,35 @@ SplicingTrafficSql
${where}= Get Substring ${strippedwhere} \ -1
${sql2} catenate select DATE_FORMAT(FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(__time)/${timeGranularity})*${timeGranularity}),'%Y-%m-%d %H:%i:%s') as statisticsTime, ${where} from traffic_metrics_log where __time >= '${startTime}' and __time < '${endTime}' group by DATE_FORMAT(FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(__time)/${timeGranularity})*${timeGranularity}),'%Y-%m-%d %H:%i:%s') limit ${limit}
[Return] ${sql2}
Recommend
[Arguments] ${url} ${statisticTime}
${header} Create Dictionary Content-Type=application/x-www-form-urlencoded Authorization=${token}
Create Session api http://${host}:${port}/${version} headers=${header}
${remoteResponse} Get Request api ${url}?statisticTime=${statisticTime} headers=${header}
${response} to json ${remoteResponse.content}
Should Be Equal As Strings ${remoteResponse.status_code} 200
Trend
[Arguments] ${url} ${startTime} ${endTime} ${logType} ${policyId}
${header} Create Dictionary Content-Type=application/x-www-form-urlencoded Authorization=${token}
Create Session api http://${host}:${port}/${version} headers=${header}
${remoteResponse} Get Request api ${url}?policyId=${policyId}&logType=${logType}&startTime=${startTime}&endTime=${endTime} headers=${header}
${response} to json ${remoteResponse.content}
Should Be Equal As Strings ${remoteResponse.status_code} 200
Should Be Equal As Strings ${remoteResponse.json()}[msg] Success
Timeandcount
[Arguments] ${url} ${logType} ${policyIds}
${header} Create Dictionary Content-Type=application/x-www-form-urlencoded Authorization=${token}
Create Session api http://${host}:${port}/${version} headers=${header}
${remoteResponse} Get Request api ${url}?policyIds=${policyIds}&logType=${logType} headers=${header}
${response} to json ${remoteResponse.content}
Should Be Equal As Strings ${remoteResponse.status_code} 200
Should Be Equal As Strings ${remoteResponse.json()}[msg] Success
${data} set variable ${response}[data][list]
FOR ${kk} ${vv} IN ENUMERATE @{data}
log ${vv}[policyId]
${true} Evaluate "${vv}[policyId]" in "${policyIds}"
Should Be Equal As Strings ${true} True
END

View File

@@ -4,8 +4,8 @@ Library REST http://${host}:${port}/${version}
Library Collections
Library SSHLibrary
Resource PolicyObject.robot
Resource ../tsg_ui/Logout/Logout.robot
Resource ../tsg_ui/Login/Login.robot
Resource ../tsg_ui/logout/Logout.robot
Resource ../tsg_ui/login/Login.robot
Resource Tag.robot
*** Keywords ***

View File

@@ -204,3 +204,39 @@ TeardownDelete
Log teardown operation:${msg}
Log teardown condition:${data}
CreatePolicyFile4
[Arguments] ${url} ${filePath} ${fileName} ${objectDict}
[Timeout]
${binFile} Evaluate open(r"${path}/${filePath}${fileName}",'rb')
${fileDict} Create Dictionary file=${binFile}
${requestData} Create Dictionary name="file" filename="${fileName}" Content-Type=application/octet-stream
${suffix} Generate Random String
${profileName} Catenate SEPARATOR=_ test ${suffix}
log ${objectDict}
${string} Convert To String ${objectDict}
${fileDesc} Create Dictionary File-Desc=${string}
log ${fileDesc}[File-Desc]
${content} UpFilePostRequest ${url} ${requestData} ${fileDict} ${fileDesc}
${msg} Set Variable ${content['msg']}
${list} Set Variable ${content['data']['list']}
${profileId} Set Variable ${list[0]['profileId']}
${profileName} Set Variable ${list[0]['profileName']}
${response} Create Dictionary msg=${msg} profileId=${profileId} profileName=${profileName}
Log add operation:${msg}
Log profileId:${profileId}
[Return] ${response}
CreateRequest
[Arguments] ${url} ${data}
[Documentation] 必传参数url
... 可选参数data不传时使用默认值
${content} Post-Request ${url} ${data}
${msg} Set Variable ${content['msg']}
${list} Set Variable ${content['data']['list']}
${profileId} Set Variable ${list[0]['profileId']}
${profileName} Set Variable ${list[0]['profileName']}
${response} Create Dictionary msg=${msg} profileId=${profileId} profileName=${profileName}
Log add operation:${msg}
Log profileId:${profileId}
[Return] ${response}

View File

@@ -434,10 +434,15 @@ Run5
Write ${command}
${r} Read delay=10s
Should Not Be Empty ${r}
#${str} Replace String ${r} ${\n} -
${index} Evaluate '${r}'.rindex('tsgcli >')
#用换行符作为命令结束
${str} Replace String ${r} ${\n} -
${index} Evaluate '${str}'.rindex('-')
${len} Convert To Integer ${index}
${json} Evaluate '${r}'[0:${len}]
${json} Evaluate '${str}'[0:${len}]
#cli命令结果返回结束为换行使用下面截取
#${index} Evaluate '${r}'.rindex('tsgcli >')
#${len} Convert To Integer ${index}
#${json} Evaluate '${r}'[0:${len}]
${dict} json.Loads ${json}
${list} Convert To List ${dict}
[Return] ${list}

View File

@@ -4,8 +4,8 @@ Library REST http://${host}:${port}/${version}
Library Collections
Library ExtensionLibrary
Resource ../tsg_bfapi/LoginLogout.robot
Resource ../tsg_ui/Logout/Logout.robot
Resource ../tsg_ui/Login/Login.robot
Resource ../tsg_ui/logout/Logout.robot
Resource ../tsg_ui/login/Login.robot
*** Keywords ***
LoginAndAddLocalIP
@@ -16,10 +16,10 @@ LoginAndAddLocalIP
Run Keyword If '${loginType}' == 'api' ApiLoginAndAddLocalIP
... ELSE IF '${loginType}' == 'cli' CliLogin
... ELSE IF '${loginType}' != '${None}' UiLoginAndAaddLocalIP
... ELSE IF '${loginType}' != '${None}' UiLoginAndAddLocalIP
LogoutAndDelLocalIP
[Tags] tsg_adc tsg_bf_api tsg_cli
Run Keyword If '${loginType}' == 'api' ApiLogoutAndDelLocalIP
... ELSE IF '${loginType}' == 'cli' CliLogout
... ELSE IF '${loginType}' != '${None}' UiLoginAndAaddLocalIP
... ELSE IF '${loginType}' != '${None}' UiLogoutAndDelLocalIP

View File

@@ -1,94 +1,94 @@
*** Settings ***
Library FtpLibrary
*** Keywords ***
checkFTPRecvReport
[Arguments] ${fURL} ${fport} ${fuser} ${fpwd} ${fpath} ${filename}
[Documentation] [fURL写法例如:192.168.1.1]
... [fport写法例如21]
... [fuser写法例如wxs]
... [fpwd要写ftp服务器的密码写法例如111111]
... [fpath要写ftp服务器的绝对路径写法例如/a/b/20200110/]
... [filename,是指系统下发report时对report起的名字在这里判断方法是ftp文件名称是否包含report名称所以在TSG系统上下发report时应尽量不要用重名以免判断失误写法例如长安街]
... [注意:该关键字无返回值,他是等同于一个用例,若字符串不包含则表示用例执行失败,会有相关信息打印]
[Tags] function FTP reportResult
Ftp Connect ${fURL} ${fuser} ${fpwd} ${fport}
sleep 1
cwd ${fpath}
sleep 1
@{dirname} Dir Names
sleep 1
${Strdirname} Evaluate ''.join(@{dirname})
Should Contain ${Strdirname} ${filename}
ftp close
FTPDownloadFile
[Arguments] ${fURL} ${fport} ${fuser} ${fpwd} ${SrcPath} ${SrcName} ${dstPathName}
[Documentation] [fUrl是FTP服务器地址例如:192.168.1.1]
... [fport是ftp服务器的端口号例如21]
... [fuser是用户名例如wxs]
... [fpwd是密码例如wqqq]
... [SrcPath是ftp服务器上的要下载的文件的路径文件包名称必须写例如/a/b/]
... [SrcName是ftp服务器上的要下载的文件名称文件名称不要太复杂(不要包含符号)否则无法识别例如teacher王.txt]
... [dstPathName是下载到本地时的本地路径名+名称名称可不写建议不写下载到本地的名称就会与FTP上文件一样写法1. D:/rfftppy/tmp/ 2.D:/rfftppy/tmp/b.txt \]
[Tags] function FTP downloadFile
Ftp Connect ${fURL} ${fuser} ${fpwd} ${fport}
cwd ${SrcPath}
sleep 1
download file ${SrcName} ${dstPathName}
ftp close
FTPUploadFileToTest
[Arguments] ${fURL} ${fport} ${fuser} ${fpwd} ${SrcPathName}
[Documentation] [fURL写法例如:192.168.1.1]
... [fport写法例如21]
... [fuser写法例如wxs]
... [fpwd要写ftp服务器的密码写法例如111111]
... [SrcPathName,本地待上传的文件的路径名例如E:/qqq.txt]
... [注意该关键字默认上传到ftp服务器的/test目录下若test目录不存在会自己创建]
[Tags] function FTP uploadFileToTest
${intest} Set Variable test
Run Keyword If '${fport}'!='21' Run Keyword Log 请注意FTP服务器端口号不是21默认端口号请继续登入
... AND Log 登入中...
Ftp Connect ${fURL} ${fuser} ${fpwd} ${fport}
@{dirnames} Dir Names
${result} checkListContainStirng ${intest} @{dirnames}
log ${SrcPathName}
Run Keyword If '${result}'=='${intest}' log /test目录存在
... ELSE Run Keyword log /test目录不存在已创建并上传文件
... AND Mkd ${intest}
Cwd ${intest}
Comment @{aa} Dir Names
Upload File ${SrcPathName}
checkListContainStirng
[Arguments] ${str} @{strlist}
FOR ${value} IN @{strlist}
Log ${value}
Return From Keyword If '${value}'=='${str}' ${value}
END
Return From Keyword ${value}
FTPUploadFile
[Arguments] ${fURL} ${fport} ${fuser} ${fpwd} ${SrcPathName}
[Documentation] [fURL写法例如:192.168.1.1]
... [fport写法例如21]
... [fuser写法例如wxs]
... [fpwd要写ftp服务器的密码写法例如111111]
... [SrcPathName,本地待上传的文件的路径名例如E:/qqq.txt]
... [注意该关键字默认上传到ftp服务器的root目录下]
[Tags] function FTP uploadFile
Run Keyword If '${fport}'!='21' Run Keyword Log 请注意FTP服务器端口号不是21默认端口号请继续登入
... AND Log 登入中...
Ftp Connect ${fURL} ${fuser} ${fpwd} ${fport}
Upload File ${SrcPathName}
FTPLogin
[Arguments] ${fURL} ${fport} ${fuser} ${fpwd}
[Documentation] [fURL写法例如:192.168.1.1]
... [fport写法例如21]
... [fuser写法例如wxs]
... [fpwd要写ftp服务器的密码写法例如111111]
[Tags] function FTP login
Ftp Connect ${fURL} ${fuser} ${fpwd} ${fport}
Get Welcome
*** Settings ***
Library FtpLibrary
*** Keywords ***
checkFTPRecvReport
[Arguments] ${fURL} ${fport} ${fuser} ${fpwd} ${fpath} ${filename}
[Documentation] [fURL写法例如:192.168.1.1]
... [fport写法例如21]
... [fuser写法例如wxs]
... [fpwd要写ftp服务器的密码写法例如111111]
... [fpath要写ftp服务器的绝对路径写法例如/a/b/20200110/]
... [filename,是指系统下发report时对report起的名字在这里判断方法是ftp文件名称是否包含report名称所以在TSG系统上下发report时应尽量不要用重名以免判断失误写法例如长安街]
... [注意:该关键字无返回值,他是等同于一个用例,若字符串不包含则表示用例执行失败,会有相关信息打印]
[Tags] function FTP reportResult
Ftp Connect ${fURL} ${fuser} ${fpwd} ${fport}
sleep 1
cwd ${fpath}
sleep 1
@{dirname} Dir Names
sleep 1
${Strdirname} Evaluate ''.join(@{dirname})
Should Contain ${Strdirname} ${filename}
ftp close
FTPDownloadFile
[Arguments] ${fURL} ${fport} ${fuser} ${fpwd} ${SrcPath} ${SrcName} ${dstPathName}
[Documentation] [fUrl是FTP服务器地址例如:192.168.1.1]
... [fport是ftp服务器的端口号例如21]
... [fuser是用户名例如wxs]
... [fpwd是密码例如wqqq]
... [SrcPath是ftp服务器上的要下载的文件的路径文件包名称必须写例如/a/b/]
... [SrcName是ftp服务器上的要下载的文件名称文件名称不要太复杂(不要包含符号)否则无法识别例如teacher王.txt]
... [dstPathName是下载到本地时的本地路径名+名称名称可不写建议不写下载到本地的名称就会与FTP上文件一样写法1. D:/rfftppy/tmp/ 2.D:/rfftppy/tmp/b.txt \]
[Tags] function FTP downloadFile
Ftp Connect ${fURL} ${fuser} ${fpwd} ${fport}
cwd ${SrcPath}
sleep 1
download file ${SrcName} ${dstPathName}
ftp close
FTPUploadFileToTest
[Arguments] ${fURL} ${fport} ${fuser} ${fpwd} ${SrcPathName}
[Documentation] [fURL写法例如:192.168.1.1]
... [fport写法例如21]
... [fuser写法例如wxs]
... [fpwd要写ftp服务器的密码写法例如111111]
... [SrcPathName,本地待上传的文件的路径名例如E:/qqq.txt]
... [注意该关键字默认上传到ftp服务器的/test目录下若test目录不存在会自己创建]
[Tags] function FTP uploadFileToTest
${intest} Set Variable test
Run Keyword If '${fport}'!='21' Run Keyword Log 请注意FTP服务器端口号不是21默认端口号请继续登入
... AND Log 登入中...
Ftp Connect ${fURL} ${fuser} ${fpwd} ${fport}
@{dirnames} Dir Names
${result} checkListContainStirng ${intest} @{dirnames}
log ${SrcPathName}
Run Keyword If '${result}'=='${intest}' log /test目录存在
... ELSE Run Keyword log /test目录不存在已创建并上传文件
... AND Mkd ${intest}
Cwd ${intest}
Comment @{aa} Dir Names
Upload File ${SrcPathName}
checkListContainStirng
[Arguments] ${str} @{strlist}
FOR ${value} IN @{strlist}
Log ${value}
Return From Keyword If '${value}'=='${str}' ${value}
END
Return From Keyword ${value}
FTPUploadFile
[Arguments] ${fURL} ${fport} ${fuser} ${fpwd} ${SrcPathName}
[Documentation] [fURL写法例如:192.168.1.1]
... [fport写法例如21]
... [fuser写法例如wxs]
... [fpwd要写ftp服务器的密码写法例如111111]
... [SrcPathName,本地待上传的文件的路径名例如E:/qqq.txt]
... [注意该关键字默认上传到ftp服务器的root目录下]
[Tags] function FTP uploadFile
Run Keyword If '${fport}'!='21' Run Keyword Log 请注意FTP服务器端口号不是21默认端口号请继续登入
... AND Log 登入中...
Ftp Connect ${fURL} ${fuser} ${fpwd} ${fport}
Upload File ${SrcPathName}
FTPLogin
[Arguments] ${fURL} ${fport} ${fuser} ${fpwd}
[Documentation] [fURL写法例如:192.168.1.1]
... [fport写法例如21]
... [fuser写法例如wxs]
... [fpwd要写ftp服务器的密码写法例如111111]
[Tags] function FTP login
Ftp Connect ${fURL} ${fuser} ${fpwd} ${fport}
Get Welcome

View File

@@ -1,23 +1,23 @@
*** Settings ***
Library Selenium2Library
*** Keywords ***
Menu
[Arguments] ${menuOne} ${menuTwo}
Wait Until Element Is Enabled id=routerEvent0
# 一级菜单
${dict} create dictionary dashboard=routerEvent0 policy&objects=children1 log=children2 report=children3 device=children4 settings=children5 administartion=children6
# 二级菜单
${policy&objects} create dictionary Security Policy=sidebarObjects_ProxyInterception Proxy Policy=sidebarObjects_ProxyManipulation Objects=sidebarObjects_Objects Schedules=sidebarObjects_Schedule Tags=sidebarObjects_Tags
${log} create dictionary Security Event Logs=sidebarLog_SecurityEventLogs Proxy Event Logs=sidebarLog_ProxyEventLogs Session Records=sidebarLog_SesssionRecords Radius Logs=sidebarLog_RadiusLogs
# 遍历一级菜单
FOR ${list} ${num} IN ENUMERATE @{dict}
run keyword if "${num}"=="${menuOne}" run keywords sleep 5
... AND click element id=${dict}[${num}]
END
# 遍历二级菜单
FOR ${list} ${num} IN ENUMERATE @{${menuOne}}
run keyword if "${num}"=="dashboard" Exit For Loop
... ELSE IF "${num}"=="${menuTwo}" run keywords sleep 3
... AND click element id=${${menuOne}}[${num}]
END
*** Settings ***
Library Selenium2Library
*** Keywords ***
Menu
[Arguments] ${menuOne} ${menuTwo}
Wait Until Element Is Enabled id=routerEvent0
# 一级菜单
${dict} create dictionary dashboard=routerEvent0 policy&objects=children1 log=children2 report=children3 device=children4 settings=children5 administartion=children6
# 二级菜单
${policy&objects} create dictionary Security Policy=sidebarObjects_ProxyInterception Proxy Policy=sidebarObjects_ProxyManipulation Objects=sidebarObjects_Objects Schedules=sidebarObjects_Schedule Tags=sidebarObjects_Tags
${log} create dictionary Security Event Logs=sidebarLog_SecurityEventLogs Proxy Event Logs=sidebarLog_ProxyEventLogs Session Records=sidebarLog_SesssionRecords Radius Logs=sidebarLog_RadiusLogs
# 遍历一级菜单
FOR ${list} ${num} IN ENUMERATE @{dict}
run keyword if "${num}"=="${menuOne}" run keywords sleep 5
... AND click element id=${dict}[${num}]
END
# 遍历二级菜单
FOR ${list} ${num} IN ENUMERATE @{${menuOne}}
run keyword if "${num}"=="dashboard" Exit For Loop
... ELSE IF "${num}"=="${menuTwo}" run keywords sleep 3
... AND click element id=${${menuOne}}[${num}]
END

View File

@@ -1,541 +0,0 @@
*** Settings ***
Library Selenium2Library
Library E:/Program Files (x86)/Python37-32/Lib/site-packages/robot/libraries/String.py
*** Keywords ***
click
[Arguments] ${element}
Click Element ${element}
input
[Arguments] ${element} ${text}
Input Text ${element} ${text}
ui-logout
Close Browser
ui-login
Open Browser http://192.168.40.120 Chrome
input xpath=//*[@id="app"]/div/div[2]/div/div[2]/div/input lyf
input xpath=//*[@id="app"]/div/div[2]/div/div[3]/div/input 111111
click xpath=//*[@id="app"]/div/div[2]/div/div[4]/button
Create-Hijack Files
[Arguments] ${name} ${file} ${type}
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
Sleep 2
click id=profilesTabs_Profile_HijackFiles #点击Hijack Files按钮
Sleep 1
click id=hijackAdd #点击Create
Sleep 2
input id=hijack_profileName ${name} #输入name
Sleep 2
Choose File xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[1]/div[2]/form/div[2]/div/div/div[1]/input ${file} #上传文件
Sleep 2
click id=hijackAddContentType #点击+ 打开侧滑窗口
Sleep 1
click ${type} #选择文件类型
sleep 2
click id=hijackAddOk #点击OK
Sleep 2
input id=one-input ${name} #搜索输入框输入name
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name} #断言
Create-Insert Scripts
[Arguments] ${name} ${file} ${type}
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
Sleep 2
click id=profilesTabs_Profile_Insert #点击Insert Scripts按钮
Sleep 1
click id=insertAdd #点击Create
Sleep 2
input id=insert_profileName ${name} #输入name
Sleep 2
Choose File xpath=//*[@id="insertAddUpload"]/div[1]/input ${file} #上传文件
Sleep 2
click id=insert_select_format #点击下拉框按钮
Sleep 1
click ${type} #选择css
sleep 1
click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[5]/div/div/button[1] #点击OK
Sleep 1
input xpath=//*[@id="one-input"] ${name} #搜索输入框输入name
Sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[1]/div[2]/div[2]/i #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[2]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name} #断言
ui-logout
Create-Traffic Mirror Profiles
[Arguments] ${name} ${type} ${shuru}
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
Sleep 2
click id=profilesTabs_Profile_TrafficMirrorProfiles #点击Traffic Mirror Profiles按钮
Sleep 1
click id=trafficMirrorAdd #点击Create
Sleep 2
input id=trafficmirror_profileName ${name} #输入name
Sleep 2
click xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div/div[2]/form/div[2]/div/div/div[1]/span/span/i #点击下拉框
Sleep 2
click ${type} #选择vlan或者mac
Sleep 1
input id=trafficmirror_addrArray0 ${shuru}
sleep 2
click xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div/div[2]/form/div[5]/div/div/button[1] #点击OK
Sleep 2
input id=one-input ${name} #搜索输入框输入name
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[2]/div/div[3]/table/tbody/tr/td[2]/div/div/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name} #断言
ui-logout
Edit-Insert Scripts
[Arguments] ${id-name} ${name} ${name1} ${file} ${type}
[Documentation] 引用关键字,填入必填参数
... 必填参数:
... ${id-name}:为选择要查询的类型是ID或者Name的元素
... ${name}:为查询输入框输入内容
... ${name1}:为修改页面的name输入框里输入的内容
... ${file}:为修改页面要上传文件的路径
... ${type}:选择文件类型的元素
Sleep 1
click xpath=//*[@id="app"]/div/div[2]/ul/li[6]/div #点击一级目录Settings
Sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
Sleep 2
click id=profilesTabs_Profile_Insert #点击Insert files按钮
sleep 1
click id=one-input #搜索点击输入框
sleep 1
click ${id-name} #选择ID或者name
sleep 1
input id=sreach_input ${name} #输入搜索内容
sleep 1
click xpath=//*[@id="select_new_search_btn"] #点击搜索按钮
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[2]/div/div[3]/table/tbody/tr[1] #点击搜素到的列表
sleep 1
click id=insertEdit #点击Edit
sleep 1
Clear Element Text id=insert_profileName #清空输入框
sleep 1
input id=insert_profileName ${name1} #输入框输入
sleep 1
Choose File xpath=//*[@id="insertAddUpload"]/div[1]/input ${file} #上传文件
sleep 1
click id=insert_select_format #点击下拉框
sleep 1
click ${type} #选择文件类型
sleep 1
click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[8]/div/div/button[1] #点击ok提交
Create-Response Pages
[Arguments] ${name} ${file}
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${name}:新建页面name输入框里的内容
... ${file}:上传文件所在本地的路径
#打开浏览器
#ui-login lyf 111111
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
Sleep 2
click id=respinseAdd #Response Pages点击Create
Sleep 2
input id=responsepages_profileName ${name} #输入name
Sleep 2
Choose File xpath=//*[@id="policy_Manipulation_create6"]/div[2]/form/div[2]/div/div/div/input ${file} #上传文件
Sleep 2
click xpath=//*[@id="policy_Manipulation_create6"]/div[2]/form/div[4]/div/div/button[1] #点击OK缇交
Sleep 1
input xpath=//*[@id="one-input"] ${name} #搜索框输入
Sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[1]/div[1]/div[2]/i #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name} #断言
#ui-logout
Edit-Response Pages
[Arguments] ${id-name} ${name} ${name1} ${file}
[Documentation] 引用关键字,填入必填参数
... 必填参数:
... ${id-name}:为选择要查询的类型是ID或者Name的元素
... ${name}:为查询输入框输入内容
... ${name1}:为修改页面的name输入框里输入的内容
... ${file}:为修改页面要上传文件的路径
Sleep 1
click xpath=//*[@id="app"]/div/div[2]/ul/li[6]/div #点击一级目录Settings
Sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
Sleep 2
click id=one-input #搜索点击输入框
sleep 1
click ${id-name} #选择ID或者name
sleep 1
input id=sreach_input ${name}
sleep 1
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1] #点击搜素到的列表
sleep 1
click id=resinseEdit #点击Edit
sleep 1
Clear Element Text id=responsepages_profileName #清空name输入框
sleep 1
input id=responsepages_profileName ${name1}
sleep 1
Choose File xpath=//*[@id="policy_Manipulation_create6"]/div[2]/form/div[5]/div/div/div/input ${file}
sleep 1
click xpath=//*[@id="policy_Manipulation_create6"]/div[2]/form/div[7]/div/div/button[1]
Edit-Hijack Files
[Arguments] ${id-name} ${name} ${name1} ${file} ${type}
[Documentation] 引用关键字,填入必填参数
... 必填参数:
... ${id-name}:为选择要查询的类型是ID或者Name的元素
... ${name}:为查询输入框输入内容
... ${name1}:为修改页面的name输入框里输入的内容
... ${file}:为修改页面要上传文件的路径
... ${type}:为文件类型的元素
Sleep 1
click xpath=//*[@id="app"]/div/div[2]/ul/li[6]/div #点击一级目录Settings
Sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
Sleep 2
click id=profilesTabs_Profile_HijackFiles #点击Hijack files按钮
sleep 1
click id=one-input #搜索点击输入框
sleep 1
click ${id-name} #选择ID或者name
sleep 1
input id=sreach_input ${name} #输入搜索内容
sleep 1
click xpath=//*[@id="select_new_search_btn"] #点击搜索按钮
sleep 1
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1] #点击搜素到的列表
sleep 1
click id=hijackEdit #点击Edit
sleep 1
Clear Element Text id=hijack_profileName #清空输入框
sleep 1
input id=hijack_profileName ${name1} #输入框输入
sleep 1
Choose File xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[1]/div[2]/form/div[5]/div/div/div[1]/input ${file} #上传文件
sleep 1
click id=hijackAddContentType #点击+号打开侧滑框
sleep 3
click ${type} #选择类型
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[2]/div/div[2]/button #关闭侧滑框
sleep 1
click id=hijackAddOk #点击ok提交
Edit-Traffic Mirror Profiles
[Arguments] ${id-name} ${name} ${name1} ${type} ${shuju}
[Documentation] 引用关键字,填入必填参数
... 必填参数:
... ${id-name}:为选择要查询的类型是ID或者Name的元素
... ${name}:为查询输入框输入内容
... ${name1}:为修改页面的name输入框里输入的内容
... ${type}:为选择点击vlan或mac的元素
... ${shuju}:为输入框输入内容
Sleep 1
click xpath=//*[@id="app"]/div/div[2]/ul/li[6]/div #点击一级目录Settings
Sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
Sleep 2
click id=profilesTabs_Profile_TrafficMirrorProfiles #点击Traffic Mirror Profiles按钮
sleep 1
click id=one-input #搜索点击输入框
sleep 1
click ${id-name} #选择ID或者name
sleep 1
input id=sreach_input ${name} #输入搜索内容
sleep 1
click xpath=//*[@id="select_new_search_btn"] #点击搜索按钮
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[2]/div/div[3]/table/tbody/tr[1] #点击搜素到的列表
sleep 1
click id=trafficMirrorEdit #点击Edit
sleep 1
Clear Element Text id=trafficmirror_profileName #清空输入框
sleep 1
input id=trafficmirror_profileName ${name1} #输入框输入
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div/div[2]/form/div[5]/div/div/div[1]/input #点击下拉框
sleep 1
click ${type} #选择vlan或者mac
sleep 1
Clear Element Text id=trafficmirror_addrArray0 #清空输入框
sleep 1
input id=trafficmirror_addrArray0 ${shuju} #输入内容
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div/div[2]/form/div[8]/div/div/button[1] #点击ok
import-Trusted Certificate Authorities
[Arguments] ${name} ${file}
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${name}:新建页面name输入框里的内容
... ${file}:上传文件所在本地的路径
#打开浏览器
#ui-login lyf 111111
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_CertificateManagement #点击二级目录Trusted Certificate Authorities
Sleep 2
click id=Authorities_create #点击Import
Sleep 2
input id=authoritiesAdd_name ${name} #输入name
Sleep 2
Choose File xpath=//*[@id="upload_dome"]/div/input ${file} #上传文件
Sleep 2
click id=authoritiesAdd_sub #点击OK缇交
Sleep 1
input xpath=//*[@id="one-input"] ${name} #搜索框输入
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/div/p/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name} #断言
#ui-logout
Create-Decryption Keyrings
[Arguments] ${name} ${file} ${file1} ${1or2} ${type} ${type1}
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${name}:新建页面name输入框里的内容
... ${file}:上传文件所在本地的路径
... ${file1}:上传文件所在本地的路径
... ${1or2}:填入1 或者其他
... ${type}:上传证书类型的元素
... ${type1}:上传证书加密解密算法的元素
#打开浏览器
#ui-login lyf 111111
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_CertificateManagement #点击二级目录Trusted Certificate Authorities
Sleep 2
click xpath=//*[@id="proxyTabs"]/div/ul/li[2] #点击Decryption Keyrings
sleep 1
click id=Keyrings_create #点击Create
Sleep 2
input id=keyringsadd_name ${name} #输入name
Sleep 2
Choose File xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div/div[2]/form/div[2]/div/div/div/input ${file} #上传文件
Sleep 2
Choose File xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div/div[2]/form/div[4]/div/div/div/input ${file1} #上传文件
${select} Set Variable ${1or2}
Run Keyword If '${select}'=='1' click id=keyringsadd_customized
Run Keyword If '${select}'=='1' input id=reissueExpiryDate 10
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div/div[2]/form/div[7]/div/div/div[1] #点击下拉框
sleep 1
click ${type} #选择证书类型
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div/div[2]/form/div[8]/div/div/div[1] #点击下拉框
sleep 1
click ${type1} #选择加密解密类型
sleep 1
click id=keyringsadd_sub #点击OK缇交
Sleep 1
input xpath=//*[@id="one-input"] ${name} #搜索框输入
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/div/p/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name} #断言
#ui-logout
Create-SSL Decryption Exclusion
[Arguments] ${name} ${value} ${name1}
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${name}:新建页面name输入框里的内容
... ${value}:输入内容
... ${naem1}:搜索框填入内容
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_CertificateManagement #点击二级目录Trusted Certificate Authorities
Sleep 2
click xpath=//*[@id="proxyTabs"]/div/ul/li[3] #点击SSL Decryption Exclusion按钮
sleep 1
click id=ssl_create #点击Create
Sleep 2
input id=sslAdd_name ${name} #输入name
Sleep 2
input id=sslAdd_itemDesc ${value} #输入内容
Sleep 2
click id=ssl_ok #点击OK缇交
Sleep 1
input xpath=//*[@id="one-input"] ${name1} #搜索框输入
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/div/p/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name} #断言
Search-Cached Intermediate Certificates
[Arguments] ${type} ${id-sni} ${enabled}
[Documentation] 引用关键字,填入必填参数
... ${type}:为搜索类型的元素id或sni
... ${enabled}为enabled开启或关闭按钮的元素
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_CertificateManagement #点击二级目录Trusted Certificate Authorities
Sleep 2
click xpath=//*[@id="proxyTabs"]/div/ul/li[4] #点击Cached Intermediate Certificates按钮
Sleep 1
click id=one-input #点击搜索框
Sleep 1
click ${type}
Sleep 1
input id=sreach_input ${id-sni}
click id=select_new_search_btn #点击搜索按钮
Sleep 1
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[8]/div/div/div/p/a/i #点击下载
Sleep 10
click ${enabled} #点击enabled按钮
sleep 1
Edit-Trusted Certificate Authorities
[Arguments] ${id-name} ${value} ${name} ${file}
[Documentation] 引用关键字,填入必填参数
... 必填参数:
... ${id-name}:为选择要查询的类型是ID或者Name的元素
... ${value}:为查询输入框输入内容
... ${name}:为修改页面的name输入框里输入的内容
... ${file}:为修改页面要上传文件的路径
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_CertificateManagement #点击二级目录Trusted Certificate Authorities
Sleep 2
click id=one-input #点击搜索框
sleep 1
click ${id-name} #选择搜索类型
sleep 1
input id=sreach_input ${value} #输入内容
sleep 1
click id=select_new_search_btn #点击搜索按钮
sleep 1
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr #点击搜索列表
sleep 1
click id=Authorities_edit #点击Edit按钮
sleep 1
Clear Element Text id=authoritiesAdd_name #清空name输入框
sleep 1
input id=authoritiesAdd_name ${name} #输入name
sleep 1
Choose File xpath=//*[@id="upload_dome"]/div/input ${file} #上传文件
sleep 1
click id=authoritiesAdd_sub #点击ok
Edit-Decryption Keyrings
[Arguments] ${id-name} ${value} ${name} ${file} ${file1} ${1or2}
... ${type} ${type1}
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${id-name}:为选择要查询的类型是ID或者Name的元素
... ${value}:为查询输入框输入内容
... ${name}:新建页面name输入框里的内容
... ${file}:上传文件所在本地的路径
... ${file1}:上传文件所在本地的路径
... ${1or2}:填入1 或者其他
... ${type}:上传证书类型的元素
... ${type1}:上传证书加密解密算法的元素
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_CertificateManagement #点击二级目录Trusted Certificate Authorities
Sleep 2
click xpath=//*[@id="proxyTabs"]/div/ul/li[2] #点击Decryption Keyrings
sleep 1
click id=one-input #点击搜索框
sleep 1
click ${id-name} #选择搜索类型
sleep 1
input id=sreach_input ${value} #输入内容
sleep 1
click id=select_new_search_btn #点击搜索按钮
sleep 1
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr #点击搜索列表
sleep 1
click id=Keyrings_edit #点击Edit按钮
sleep 1
Clear Element Text id=keyringsadd_name #清空name输入框
sleep 1
input id=keyringsadd_name ${name} #输入name
sleep 1
Choose File xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div/div[2]/form/div[5]/div/div/div/input ${file} #上传文件
Sleep 2
Choose File xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div/div[2]/form/div[7]/div/div/div/input ${file1} #上传文件
${select} Set Variable ${1or2}
Run Keyword If '${select}'=='1' click id=keyringsadd_customized
Run Keyword If '${select}'=='1' input id=reissueExpiryDate 10
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div/div[2]/form/div[10]/div/div/div[1] #点击下拉框
sleep 1
click ${type} #选择证书类型
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div/div[2]/form/div[11]/div/div/div[1] #点击下拉框
sleep 1
click ${type1} #选择加密解密类型
sleep 1
click id=keyringsadd_sub #点击OK缇交
Edit-SSL Decryption Exclusion
[Arguments] ${id-name} ${value} ${name} ${value1}
[Documentation] 引用关键字,填入必填参数
... ${id-name}:id或者name的元素
... ${value}:输入搜索的内容
... ${name}:输入name
... ${calue1}:输入内容
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_CertificateManagement #点击二级目录Trusted Certificate Authorities
Sleep 2
click xpath=//*[@id="proxyTabs"]/div/ul/li[3] #点击SSL Decryption Exclusion按钮
sleep 1
click id=one-input #点击搜索框
sleep 1
click ${id-name} #选择搜索类型
sleep 1
input id=sreach_input ${value} #输入内容
sleep 1
click id=select_new_search_btn #点击搜索按钮
sleep 1
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr #点击搜索列表
Sleep 1
click id=ssl_edit #点击Edit
Sleep 1
Clear Element Text id=sslAdd_name #清空name输入框
sleep 1
input id=sslAdd_name ${name} #输入name
sleep 1
input id=sslAdd_itemDesc ${value1} #输入内容
Sleep 2
click id=ssl_ok #点击OK缇交

View File

@@ -2,8 +2,8 @@
Library Selenium2Library
Resource ../../../03-Variable/BifangApiVariable.txt
Library Selenium2Library
Resource ../Objects/Objects.robot
Resource ../Objects/ObjectPages.robot
Resource ../objects/Objects.robot
Resource ../objects/ObjectPages.robot
*** Keywords ***
Login
@@ -18,8 +18,8 @@ AddLocalIp
CreatePage ${obj1}[type] ${obj1}[name] ipads=${obj1}[ipads] ipclient=${obj1}[ipclient] ipclienttext1=${obj1}[ipclienttext1] ipclienttext2=${obj1}[ipclienttext2]
set global variable ${LocahIPName} ${obj1}[name]
UiLoginAndAaddLocalIP
log UiLoginAndAaddLocalIP
UiLoginAndAddLocalIP
log UiLoginAndAddLocalIP
Login.Login
Run Keyword If ${addTestClentIPFlag}==1 AddLocalIp
log UiLoginAndAaddLocalIP:${LocahIPName}
log UiLoginAndAddLocalIP:${LocahIPName}

View File

@@ -1,6 +1,6 @@
*** Settings ***
Library Selenium2Library
Resource ../Objects/ObjectPages.robot
Resource ../objects/ObjectPages.robot
*** Keywords ***
Logout
@@ -10,8 +10,7 @@ Logout
sleep 2
Close All Browsers
UiLogoutAndDelLocalIP
[Arguments] ${tempParm}
log UiLogoutAndDelLocalIP${tempParm}
Objects.DeletePage ${LocahIPName}
UiLogoutAndDelLocalIP
log UiLogoutAndDelLocalIP
Run Keyword If ${addTestClentIPFlag}==1 DeletePage ${LocahIPName}
Logout.Logout

View File

@@ -7,7 +7,7 @@ Library Collections
*** Keywords ***
CreatePage
[Arguments] ${objtype} ${name} ${ipads}=null ${ipclient}=null ${ipclienttext1}=null ${ipclienttext2}=null
... ${keywordtext}=null ${hex}=close ${reqrestype}=null ${reqresheader}=null
... ${keywordtext}=null ${hex}=close ${reqrestype}=null ${reqresheader}=null ${post}=null
Menu policy&objects Objects
sleep 3
Objects.CreateButton ${objtype}
@@ -15,7 +15,7 @@ CreatePage
Objects.Create-item
run keyword if "${objtype}"=="Ip" run keywords Objects.Create-ip-AddressType ${ipads}
... AND Objects.Create-ip-ClientIP ${ipclient}
... AND Objects.Create-ip-ClientIP-text ${ipclient} ${ipclienttext1} ${ipclienttext2}
... AND Objects.Create-ip-ClientIP-text ${ipclient} ${ipclienttext1} ${ipclienttext2} ${post}
run keyword if "${objtype}"=="Fqdn" or "${objtype}"=="Sub" or "${objtype}"=="Url" or "${objtype}"=="Category" or "${objtype}"=="Account" run keywords Objects.Create-keyword-text ${objtype} ${keywordtext}
... AND sleep 1
run keyword if '${objtype}'=='Key' run keywords Objects.Create-Key-text ${keywordtext}
@@ -69,4 +69,3 @@ DeleteObjects
\ sleep 2
\ run keyword if "${key}"!="Ip" DeletePage ${obj}[${key}]
\ sleep 1
END

View File

@@ -76,23 +76,26 @@ Create-ip-ClientIP
click element id=object_ip_sourecip0
sleep 2
run keyword if "${clientIPType}"=="range" run keywords sleep 1
... AND click element id=range0Range
... AND click element id=range0Range0111111
... ELSE IF "${clientIPType}"=="cidr" run keywords sleep 1
... AND click element id=CIDR0CIDR
... AND click element id=CIDR0CIDR1
... ELSE IF "${clientIPType}"=="masks" run keywords sleep 1
... AND click element id=mask0Masks
... AND click element id=mask0Masks2
... ELSE IF log 选择错误
sleep 2
Create-ip-ClientIP-text
[Arguments] ${clientIPType} ${clientIPStart} ${clientIPEnd}
[Arguments] ${clientIPType} ${clientIPStart} ${clientIPEnd} ${port}=null
sleep 2
run keyword if "${clientIPType}"=="range" run keywords input text id=object_ip_clientip10 ${clientIPStart}
... AND input text id=object_ip_clientip20 ${clientIPEnd}
... AND input text id=object_ip_clientPort110 ${port}
run keyword if "${clientIPType}"=="cidr" run keywords input text id=object_ip_clientip30 ${clientIPStart}
... AND input text id=object_ip_clientip40 ${clientIPEnd}
... AND input text id=object_ip_clientPort110 ${port}
run keyword if "${clientIPType}"=="masks" run keywords input text id=object_ip_clientip50 ${clientIPStart}
... AND input text id=object_ip_clientip60 ${clientIPEnd}
... AND input text id=object_ip_clientPort110 ${port}
Create-ip-ClientPort
@@ -262,6 +265,7 @@ objects-delete
click element id=objectDel #点击删除按钮
sleep 1
click element xpath=/html/body/div/div/div[3]/button[2]
#Close Browser #关闭浏览器
object-edit-fqdn
[Arguments] ${name} ${keywordtext}
@@ -378,7 +382,7 @@ object-edit-HTTPSignature
Sleep 2
object-edit-ip
[Arguments] ${name} ${ipads} ${ipclient} ${ipclienttext1} ${ipclienttext2}
[Arguments] ${name} ${ipads} ${ipclient} ${ipclienttext1} ${ipclienttext2} ${post}=null
Sleep 2
click element id=objectEdit
Sleep 2
@@ -388,7 +392,7 @@ object-edit-ip
Sleep 1
Objects.Create-ip-AddressType ${ipads}
Objects.Create-ip-ClientIP ${ipclient}
Objects.Create-ip-ClientIP-text ${ipclient} ${ipclienttext1} ${ipclienttext2}
Objects.Create-ip-ClientIP-text ${ipclient} ${ipclienttext1} ${ipclienttext2} ${post}
Sleep 1
click element id=objectAddItemIpOk
Sleep 1

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More