maxlareo.portsentry

PortSentry

构建状态 Ansible Galaxy

在类 Debian 系统中安装和配置 PortSentry

角色变量

关于 /etc/portsentry/portsentry.conf 文件

  • portsentry_tcp_ports: [默认值: 1,11,15,79,111,119,143,540,635,1080,1524,2000,5742,6667,12345,12346,20034,27665,31337,32771,32772,32773,32774,40421,49724,54320]: 经典和基本隐身模式的 TCP 端口配置
  • portsentry_udp_ports: [默认值: 1,7,9,69,161,162,513,635,640,641,700,37444,34555,31335,32770,32771,32772,32773,32774,31337,54321]: 经典和基本隐身模式的 UDP 端口配置
  • portsentry_advanced_exclude_tcp: [默认值: 113,139]: 要忽略的 TCP 端口,PortSentry 将不会对这些请求做出响应,实际效果是 PortSentry 视它们为已绑定的守护进程
  • portsentry_advanced_exclude_udp: [默认值: 520,138,137,67]: 要忽略的 UDP 端口,PortSentry 将不会对这些请求做出响应,实际效果是 PortSentry 视它们为已绑定的守护进程
  • portsentry_ignore_file: [默认值: /etc/portsentry/portsentry.ignore]: 要忽略的主机
  • portsentry_history_file: [默认值: /var/lib/portsentry/portsentry.history]: 被拒绝的主机(运行历史记录)
  • portsentry_blocked_file: [默认值: /var/lib/portsentry/portsentry.blocked]: 本次会话中被拒绝的主机(在下次重启之前为临时状态)
  • portsentry_RESOLVE_HOST: [默认值: 0]: DNS 名称解析,1 将开启 DNS 查询,0(或其他任何值)将关闭
  • portsentry_block_udp: [默认值: 0]: 启用自动响应选项以处理 UDP/TCP(您可能想要屏蔽 UDP,但不想屏蔽 TCP),0 不屏蔽 UDP/TCP 扫描,1 屏蔽 UDP/TCP 扫描,2 仅运行外部命令
  • portsentry_block_tcp: [默认值: 0]: 启用自动响应选项以处理 UDP/TCP(您可能想要屏蔽 TCP,但不想屏蔽 UDP),0 不屏蔽 UDP/TCP 扫描,1 屏蔽 UDP/TCP 扫描,2 仅运行外部命令
  • portsentry_kill_route: [默认值: /sbin/iptables -I INPUT -s $TARGET$ -j DROP]: 此命令用于丢弃路由或将主机添加到本地过滤表中
  • portsentry_scan_trigger: [默认值: 0]: 输入您允许的端口连接数,在达到该数目时将触发警报,默认值为 0,表示立即反应

关于 /etc/portsentry/portsentry.ignore.static 文件

  • portsentry_ignore_static: [默认值: []]: 将您希望永远不被阻止的主机放在此处(格式: ip/netmask),如果不提供网络掩码,默认为 32 位

依赖

示例剧本

- hosts: servers
  roles:
    - portsentry

许可证

MIT

关于项目

Install and configure PortSenrty in Debian-like systems

安装
ansible-galaxy install maxlareo.portsentry
许可证
mit
下载
121
拥有者