alf149.crowdsec

Crowdsec

此 Ansible 角色安装 Crowdsec,包括中心、集合、场景、后溢出、解析器、弹性代理和 Prometheus 端点。

需求

Ansible 主控端运行版本 2.12

测试平台:

  platforms:
    - name: Ubuntu
      versions:
        - bionic  #18.04 LTS
        - focal   #20.04 LTS
        - impish  #21.10
        - jammy   #22.04 LTS 未测试
    - name: Debian
      versions:
        - bookworm # 12
        - bullseye # 11
    - name: EL
      versions:
        - '8'   #Rocky & Alma Linux 和 Oracle Linux
        - '7'   #Oracle Linux

如何安装

我使用 ansible-galaxy 创建 requirements.yml 文件

roles:
  - geerlingguy.security
  - alf149.crowdsec

然后运行 ansible-galaxy install -r requirements.yml 这将把这个角色导入到你的 Ansible 项目中。

角色变量

可用变量及其默认值(见 defaults/main.yml) 变量可以在 group_vars/host.yml 中为主机特定。

示例剧本

- hosts: all

  vars:
    cs_ban_duration: "duration: 4h" # 生产环境例如 10m,用于测试

  roles:
    - alf149.crowdsec 

手动任务可能会很有用

ansible HOST -m shell -a "sudo cscli parsers install crowdsecurity/whitelists --force" ansible 'group' -m shell -a "sudo cscli parsers remove crowdsecurity/whitelists --force" ansible 'group' -m shell -a "sudo systemctl reload crowdsec"

待办事项

  • 在 Windows 服务器上测试
  • 可能自动检测 nftables/iptables,并加载正确的弹性代理。

错误报告

使用 GitHub 问题或创建 PR。

作者信息


Alf149

关于项目

This Ansibel roles installs Crowdsec incl. hub, collections, scenarios, postoverflows, parsers, bouncers and prometheus endpoint.

安装
ansible-galaxy install alf149.crowdsec
许可证
mit
下载
4k
拥有者