AliyunDoorKeeper 白名单管理中间件
Find a file
Xyjerry 8fcbbc2d50
refactor(views): remove unused import
- Remove unused import of app.aliyundk module
2025-02-28 14:35:20 +08:00
.vscode fix(mq): improve message queue connection and error handling 2025-01-17 21:15:31 +08:00
app fix(mq): improve message queue connection and error handling 2025-01-17 21:15:31 +08:00
config refactor(config/run): improve configuration handling and server setup 2025-01-17 17:43:56 +08:00
middleware fix(middleware): improve RabbitMQ connection handling and error management 2025-01-18 18:27:03 +08:00
sdk feat: implement AliyunDoorKeeper application 2025-01-17 00:00:18 +08:00
static feat: implement AliyunDoorKeeper application 2025-01-17 00:00:18 +08:00
templates fix(mq): improve message queue connection and error handling 2025-01-17 21:15:31 +08:00
utils feat(config): add ignore IPs for proxy and improve IP handling 2025-01-18 19:36:03 +08:00
views refactor(views): remove unused import 2025-02-28 14:35:20 +08:00
.dockerignore feat(config): add bind and port configuration 2025-01-18 00:16:05 +08:00
.gitignore feat: implement AliyunDoorKeeper application 2025-01-17 00:00:18 +08:00
bluebird.py feat(mq): declare RabbitMQ queues as durable 2025-01-18 14:15:23 +08:00
config.yaml feat(config): add ignore IPs for proxy and improve IP handling 2025-01-18 19:36:03 +08:00
Dockerfile feat(config): add bind and port configuration 2025-01-18 00:16:05 +08:00
flowchart.svg fix: types/v3-directive not published 2025-01-19 12:44:34 +08:00
README.md docs(README): add flowchart to illustrate operation process 2025-01-18 23:41:54 +08:00
requirements.txt feat: implement RabbitMQ and Redis support for whitelist management 2025-01-17 16:59:40 +08:00
run.py feat(config): add bind and port configuration 2025-01-18 00:16:05 +08:00
webapp.py feat: implement RabbitMQ and Redis support for whitelist management 2025-01-17 16:59:40 +08:00

AliyunDoorKeeper

本项目基于阿里云API与阿里云ECS安全组功能实现了对云服务器的访问权限的简单自动化控制与维护。

环境依赖

  • Python 3.7 +
  • Redis
  • RabbitMQ
  • 互联网访问

配置详解

配置项名 解释
behind_proxy 应用是否被反向代理
如果未被,则直接通过remote_addr取用户IP
如果被,则通过X-Forwarded-For头取用户IP
该项非常重要若配置不当可能导致应用无法正常运行或IP被用户随意篡改.
server 被控制权限应用的简称
sg_id 进行权限授予的安全组ID
sg_region_id 进行权限授予的安全组地域ID
rule_priority ACCEPT权限的优先级
请将该值配置为小于全局REFUSE规则的优先级
api.endpoint 需要操作的阿里云API的端点
api.ak_id 你的阿里云AccessKey-ID
请确保该AK具有访问上面设置的安全组的权限
api.ak_secret API密钥
max_whitelist_size 由于阿里云对单个安全组所能创建的规则条数做了限制,当被授予权限的用户数达到该值后再有新的授权出现,最先被授予权限的用户将被提前撤销权限。
expiry_time 权限有效期,单位为秒
redis.* Redis配置
rabbitmq.* RabbitMQ配置
需要注意的是该RabbitMQ需要支持通过WebAPI进行管理。
bluebird.max_retry 阿里云API重试次数。

运行流程

FlowChart