AlgoSec修改天融信取配置命令
来源:互联网 发布:linux重启网络 编辑:程序博客网 时间:2024/06/04 19:22
1. 问题原因
AlgoSec对于天融信支持不是太好,不能做防火墙规则分析不说,连仅有的查看变更历史的功能都有问题。原因是,AlgoSec在天融信上取配置的命令是show
,会把--More--
这样的提示符当成配置给取走。于是在变更分析时,会像下面这样:
EXM?就因为加了个对象导致某一行从--More--
上面移到下面,就多出一处变更?囧……而且天融信也没办法像Juniper那样进行全局设置,使得执行show
时默认显示所有策略。所以只能从AlgoSec上想办法了。
另外,AlgoSec取完配置之后,不能成功退出。如果取配置的时间间隔小于天融信的用户登录超时时间,就会导致其他用户无法登录。
2. 解决方案
AlgoSec里有个功能,叫自定义防火墙品牌,即对于AlgoSec不支持的防火墙,也可以通过写配置文件、添加自定义防火墙品牌的方式进行纳管。实际上,AlgoSec内置支持的防火墙品牌也是通过这种方式添加的。
首先要找到天融信的配置文件:
[root@SEC_AFA_1 ~]# find / -name topsec
/usr/share/fa/data/plugins/topsec
[root@SEC_AFA_1 ~]# ls /usr/share/fa/data/plugins/topsec
brand_config.xml brand_config.xml.md5 icon_topsec_big.gif icon_topsec.gif
[root@SEC_AFA_1 ~]# cd /usr/share/fa/data/plugins/topsec/
[root@SEC_AFA_1 topsec]# cat brand_config.xml.md5
9e7c227e03748d1e5b9ec45165ff1f5c 1.35
这里配置文件就是brand_config.xml
,注意到这里还有一个brand_config.xml.md5
计算了配置文件的md5,并且加了盐。所以直接改配置文件肯定是不可以的。继续查找,发现了这么一个文件:
[root@SEC_AFA_1 plugins]# pwd
/usr/share/fa/data/plugins
[root@SEC_AFA_1 plugins]# cat brand_configuration_template.xml
<!–
DEVICE - main tag for device
id - id of device brand (the name of directory of the file have to be equal to device id , don’t change it )
name - name of brand, optional
title - title of brand, appear on data collection page of gui, optional
–>
…
…
<!– General Notes
There are default parametrs %<attribute name>% : “password”, “user_name”, “host_name”
For install new device brand :
- create configuration file
- put small and big images for the brand to directory of configuration file with names
icon_<brand_id>.gif and icon_<brand_id>_big.gif
- run fa_install_plugin <configuration file path>
–>
看到这里就简单了。我们把原来天融信的配置复制为一个新品牌,修改后导入。方法为:
[root@SEC_AFA_1 plugins]# mkdir tianrongxin
[root@SEC_AFA_1 plugins]# cp topsec/* tianrongxin/
[root@SEC_AFA_1 plugins]# cd tianrongxin/
[root@SEC_AFA_1 tianrongxin]# ls
brand_config.xml brand_config.xml.md5 icon_topsec_big.gif icon_topsec.gif
[root@SEC_AFA_1 tianrongxin]# mv icon_topsec_big.gif icon_tianrongxin_big.gif
[root@SEC_AFA_1 tianrongxin]# mv icon_topsec.gif icon_tianrongxin.gif
[root@SEC_AFA_1 tianrongxin]# rm -f brand_config.xml.md5
[root@SEC_AFA_1 tianrongxin]# vim brand_config.xml
修改:
- 所有topsec字样都替换为tianrongxin
- 修改执行的命令:
<COMMANDS_SEQUENCE> <CMD id="1" command="network route show" save_output="yes" use_listener="yes" skip_on_def="yes" extra_timeout="3"/> <CMD id="2" command="show nostop" save_output="yes" use_listener="yes" skip_on_def="yes"/> <CMD id="3" command="system version" save_output="yes" use_listener="yes" skip_on_def="yes"/> <CMD id="4" command="exit" save_output="yes" use_listener="yes" skip_on_def="yes" prompt="Save system config\?\[Y/N\]:" /></COMMANDS_SEQUENCE><!-- Command to finish connection --><EXIT_COMMAND command="N"/>
这里主要的改动为:
1. 把CMD2的show
改为了show nostop
;
2. 增加了CMD4作为退出命令,因为天融信即使是审计账号,退出时也会问题是否要保存配置,所以要更改提示符;
3. 注意,这里的提示符需要输入正则表达式,Save system config?[Y/N]:
中的特殊字符要进行转义,否则无法匹配。
4. 退出命令由exit
改为N
,即不保存配置。
保存之后导入:
[root@SEC_AFA_1 plugins]# /usr/share/fa/bin/fa_install_plugin tianrongxin/brand_config.xml
Check correctness of tianrongxin/brand_config.xml
Installing plugin for tianrongxin
此后,所有的天融信设备都改为tianrongxin这一类型即可。
- AlgoSec修改天融信取配置命令
- AlgoSec破解license
- windows 和linux 命令修改网络配置
- nginx 修改配置重新加载命令
- 读取和修改GPIO配置参数的ADB命令
- mac 配置mysql命令,修改root密码,启动项等
- 配置IP隧道的内核修改,添加ip, iptables命令
- [GPIO] 读取和修改GPIO配置参数的ADB命令
- Android adb命令修改配置或属性 adb发送广播
- ubuntu下修改终端命令输入行颜色配置
- linux关闭防火墙或者修改防火墙配置的命令
- jdk配置,修改文件方式和update-alternatives命令方式
- Rhyme/ linux Bash基本功能—历史命令history配置详解、修改历史命令保存条数、历史命令的调用
- 在Linux操作系统下修改IP、DNS和路由配置的命令
- Linux操作系统下修改IP、DNS和路由配置的命令
- 在Linux操作系统下修改IP、DNS和路由配置的命令
- 《git-修改.gitignore后使其配置生效方法》---记录几个命令而已
- 引起我注意的mac命令 & 我对macOS配置的修改
- C++之begin()和end()分析(C艹11)
- VS2010 手动为控件添加事件处理函数
- STL源码剖析: 第5章 关联式容器
- Kotlin基础教程-内联函数
- Java应用线上问题排查的常用工具和方法
- AlgoSec修改天融信取配置命令
- 关于spring中bean的三种配置方式的比较
- 有return的情况下try catch finally的执行顺序
- C++11之default和delete
- jQuery实现位移滚轮
- Qt 编译错误(用vs2015编译)
- 3. Android
- 城市三级联动
- 大型网站架构的发展