介绍
Yearning SQL 审计平台 基于Vue.js与Django的整套mysql-sql审核平台解决方案。提供基于Inception的SQL检测及执行。
GitHub:https://github.com/cookieY/Yearning
文档:Yearning使用手册 - Yearning_guide
安装部署(centos6.8)
1、Nginx安装
2、MySQL Server安装
MySQL :: Download MySQL Yum Repository 下载yum库mysql57-community-release-el6-11.noarch.rpm
1 | rpm -ivh mysql57-community-release-el6-11.noarch.rpm |
1 | yum install mysql-community-server -y |
3、Python 3.6安装
1 | tar -xvf Python-3.6.4. tar .xz |
1 | mkdir -p /usr/local/python/3 .6.4 /lib |
1 2 3 4 | cd Python-3.6.4 . /configure -- enable -shared --prefix= /usr/local/python/3 .6.4 LDFLAGS= "-Wl,-rpath /usr/local/python/3.6.4/lib" make make install |
1 2 3 | cp /usr/bin/python /usr/bin/python2 .6.6 ln -fs /usr/local/python/3 .6.4 /bin/python3 .6 /usr/bin/python ln -fs /usr/local/python/3 .6.4 /bin/pip3 /usr/bin/pip |
1 2 | vi /usr/bin/yum 将头部 #!/usr/bin/python 修改为 #!/usr/bin/python2.6.6 |
4、Inception安装
参考:Inception介绍(MySQL自动化运维工具) - shhnwangjian - 博客园
5、Yearning安装
1 | git clone https: //github .com /cookieY/Yearning .git |
1 | create database Yearning DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; |
1 2 | cd Yearning /src pip install -r requirements.txt |
- 配置,编辑Yearning/src/deploy.conf文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | [mysql] db = 所创建的库名 address = 数据库地址 port = 数据库端口 password = 数据库密码 username = 数据库用户 [host] ipaddress = 服务器ip地址:端口 (涉及跨域十分重要!!设置不正确将无法登陆!!) 如 本机地址为192.168.137.13 nginx设置端口为80 则应填写为 192.168.137.13:80 之后通过该地址访问平台。 [Inception] ip = Inception地址 port = Inception端口 user = Inception用户名 password = Inception密码 backupdb = 备份数据库地址 backupport = 备份数据库端口 backupuser = 备份数据库用户名 backuppassword = 备份数据库密码 [LDAP] LDAP相关设置 LDAP_SERVER = LDAP服务地址 LDAP_SCBASE = LDAP dc 设置 如 dc =xxx, dc =com LDAP_DOMAIN = LDAP域名 如 xxx.com [email] 邮箱推送相关设置 username = 邮箱发件账号 如 xxxx@163.com password = 邮箱发件账号密码 smtp_server = 邮箱stmp地址, 具体地址请咨询对应邮箱提供者 |
1 2 | python manage.py makemigrations python manage.py migrate |
1 | echo "from core.models import Account;Account.objects.create_user(username='admin', password='admin123456', group='admin',is_staff=1)" | python manage.py shell |
1 2 3 | cd Yearning /webpage/dist cp -rf * /usr/share/nginx/html/ service nginx restart |
1 2 | cd Yearning /src python manage.py runserver 0.0.0.0:8000 |
- 访问首页http://192.168.137.13