Skip to content

Commit

Permalink
v0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjinhub committed Dec 26, 2021
1 parent 0400567 commit 49cf921
Show file tree
Hide file tree
Showing 51 changed files with 941 additions and 643 deletions.
40 changes: 12 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
![x](./images/x.png)

## 什么是 W5 SOAR?
![x](./images/pc.png)

**W5** 是一款基于 **Python** 开发的安全编排与自动化响应平台,为了企业安全做出了精心的打造,无需编写代码即可实现自动化响应流程,可节约企业 **80%** 的成本。
> 免责声明:
> - 禁止用于非法用途,一切违法行为与作者无关。
> - 所有插件的使用均符合国家相关法律法规,网络安全法等,我方遵守开源协议及 APP 厂商的相关要求。
> - 本项目采用 GPL v3 开源协议,企业二次开发需进行开源公布,发现违法开源协议者,将采用法律追究。
- **无代码** : 无需编写代码,即可让企业内部人员快速实现事件响应。
## W5 介绍

- **扩展强** : 提供插件模块,可以扩展让所有的应用平台集成 **W5** 自身插件
![x](./images/x.png)

- **自动化** : 提供 `Webhook``Mail``用户输入``API` 等入口,无需人工即可实现全部流程
**W5** 是一个面向企业安全与运维设计的 **低代码** 自动化平台,可以让团队降低 **人工成本**,提升 **工作效率**。可以把代码 **图形化****可视化****可编排**。让不同的系统,不同的组件通过 APP 进行封装形成平台能力,通过剧本画出你想要的逻辑过程,利用多种 **Trigger** 去实现自动化执行。W5 适应用于多个方向,例:Devops、安全运营、自动化渗透、工作流程等

![1](./images/1.png)

![2](./images/2.png)

## 为什么要使用它?

- 节约企业 80% 成本

- 节约企业成本
- 提升工作效率
- 增加团队协作能力
- 代码可视化配置编排
- 无需担心开发人员离职后的交接问题

- 不用怕看不懂代码的痛苦

- 不懂代码的小白一样也可以实现自动化

- ...

## 部分界面

1、两种主题,漂亮的 UI
Expand All @@ -50,20 +48,6 @@
![1](./images/gvp.png)

## 核心功能介绍

- [x] 工作流编辑
- [x] 链路执行
- [x] 链路多种判断
- [x] 全局变量
- [x] 局部变量
- [x] APP 变量
- [x] 用户输入、WebHook、定时器 多种入口
- [x] 日记状态追踪
- [x] 多款 APP

只列出了部分核心功能,更多功能请自行搭建测试 ~~

## 如何使用

- **官网**https://w5.io
Expand Down
5 changes: 3 additions & 2 deletions core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from core.view import Decorator
from flask import (Flask, send_from_directory)

version = "0.5.2"
version = "0.5.3"

db = Orator()
redis = FlaskRedis()
Expand Down Expand Up @@ -174,9 +174,10 @@ def init_web_sockets(app):


def init_w5(app):
from core.view.system.view import init_key, init_timer
from core.view.system.view import init_key, init_timer, init_async
init_key()
init_timer()
init_async()


def init_app():
Expand Down
Binary file modified core/auto/linux/core.so
Binary file not shown.
Binary file modified core/auto/windows/core.pyd
Binary file not shown.
5 changes: 5 additions & 0 deletions core/err/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,8 @@ class ErrUploadZipR(object):
class ErrUploadAppExist(object):
errcode = 9026
errmsg = 'APP 已经存在'


class ErrRoleExist(object):
errcode = 9027
errmsg = '角色已经存在!'
20 changes: 20 additions & 0 deletions core/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,23 @@ class LoginHistory(db.Model):
class Audit(db.Model):
__table__ = 'w5_audit'
__timestamps__ = False


class Nav(db.Model):
__table__ = 'w5_nav'
__timestamps__ = False


class Role(db.Model):
__table__ = 'w5_role'
__timestamps__ = False


class RoleNav(db.Model):
__table__ = 'w5_role_nav'
__timestamps__ = False


class UserRole(db.Model):
__table__ = 'w5_user_role'
__timestamps__ = False
4 changes: 2 additions & 2 deletions core/utils/times.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def get_month():
index = calendar.monthrange(int(str(curr_year_month).split("-")[0]), int(str(curr_year_month).split("-")[1]))[1]

for i in range(index)[::-1]:
curr_month = datetime.datetime(now.year, now.month + 1, 1) - timedelta(days=i + 1)
curr_month = datetime.datetime(now.year, now.month, index) - timedelta(days=i)
arr = str(curr_month).split(" ")[0].split("-")
v = arr[1] + "-" + arr[2]
result.append(v)
Expand Down Expand Up @@ -85,4 +85,4 @@ def get_year():
else:
result.append("0" + str(i + 1))

return result
return result
5 changes: 5 additions & 0 deletions core/view/api/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
from . import *


@r.route("/webhookx", methods=['GET', 'POST'])
def api_webhookx():
return Response.re()


@r.route("/webhook", methods=['GET', 'POST'])
def api_webhook():
if request.method == "POST":
Expand Down
2 changes: 1 addition & 1 deletion core/view/login/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ def login():
return Response.re(data={"token": token, "account": user.account, "nick_name": user.nick_name,
"user_id": user.id})
else:
return Response.re(err=ErrUserPassword)
return Response.re(err=ErrUserPassword)
24 changes: 18 additions & 6 deletions core/view/system/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,25 @@ def init_key():

def init_timer():
def setting():
result = redis.set("manage_timer_lock", 1, nx=True, ex=8)
if result:
manage_timer = ManageTimer()
manage_timer.start()
manage_timer = ManageTimer()
manage_timer.start()

s = ThreadedServer(service=manage_timer, port=53124, auto_register=False)
s.start()
s = ThreadedServer(service=manage_timer, port=53124, auto_register=False)
s.start()

result = redis.set("manage_timer_lock", 1, nx=True, ex=8)

if result:
t = threading.Thread(target=setting)
t.setDaemon(True)
t.start()


def init_async():
def setting():
new_loop = asyncio.new_event_loop()
asyncio.set_event_loop(new_loop)
new_loop.run_forever()

t = threading.Thread(target=setting)
t.setDaemon(True)
Expand Down
Loading

0 comments on commit 49cf921

Please sign in to comment.