SecAutoBan SDK
Project description
SecAutoBan Python SDK
安装
pip3 install SecAutoBan
样例
告警模块
from SecAutoBan import SecAutoBan
def alarm_analysis(ws_client):
ws_client.send_alarm("127.1.0.3", "NMAP 扫描 127.0.0.1")
sec_auto_ban = SecAutoBan(
server_ip="127.0.0.1",
server_port=8000,
sk="sk-*****",
client_type="alarm",
alarm_analysis = alarm_analysis
)
sec_auto_ban.run()
封禁模块
from SecAutoBan import SecAutoBan
def block_ip(ip):
if check_exist_ip(ip):
return
pass
def unblock_ip(ip):
pass
def get_all_block_ip() -> list:
ip_list = []
return ip_list
def check_exist_ip(ip) -> bool:
return ip in get_all_block_ip()
sec_auto_ban = SecAutoBan(
server_ip="127.0.0.1",
server_port=8000,
sk="sk-*****",
client_type="block",
block_ip = block_ip,
unblock_ip = unblock_ip,
get_all_block_ip= get_all_block_ip
)
sec_auto_ban.run()
参数说明
| 参数 | 描述 | 是否需要填写 |
|---|---|---|
| server_ip | 核心模块回连IP | 需要 |
| server_port | 核心模块回连端口 | 需要 |
| sk | 设备页面生成的密钥 | 需要 |
| client_type | 模块类型(alarm/block) |
需要 |
| alarm_analysis | 告警分析函数 | alarm模块必填 |
| block_ip | 封禁函数 | block模块必填 |
| unblock_ip | 解禁函数 | block模块必填 |
| get_all_block_ip | 获取设备中全部封禁IP函数 | block模块可选 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
secautoban-3.0.0.tar.gz
(3.8 kB
view details)
File details
Details for the file secautoban-3.0.0.tar.gz.
File metadata
- Download URL: secautoban-3.0.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d37c92dfad83b79c94e370dc67e7f25aa3682975ed53acd548c6a3de8307cf51
|
|
| MD5 |
cdbe6ea21d37c138b13c2b9312f94aa1
|
|
| BLAKE2b-256 |
82ce6df4883e4c034632789f7d07735de81445e4b6db0ce787f76d466ecaba5c
|
Provenance
The following attestation bundles were made for secautoban-3.0.0.tar.gz:
Publisher:
python_sdk.yml on sec-report/SecAutoBan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
secautoban-3.0.0.tar.gz -
Subject digest:
d37c92dfad83b79c94e370dc67e7f25aa3682975ed53acd548c6a3de8307cf51 - Sigstore transparency entry: 158746256
- Sigstore integration time:
-
Permalink:
sec-report/SecAutoBan@4b5ceb5753ac0f4ba84d9632eebcd82d19a6181c -
Branch / Tag:
refs/tags/v3.0.0 - Owner: https://github.com/sec-report
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python_sdk.yml@4b5ceb5753ac0f4ba84d9632eebcd82d19a6181c -
Trigger Event:
push
-
Statement type: