从syslog文件收集SSH度量
aeliant-ssh-metrics的Python项目详细描述
SSH指标
ssh-metrics
是一个python命令行脚本,允许用户读取SSH身份验证。记录文件并从中返回一些度量。在
要求
以下是脚本工作的要求(系统范围):
geoip-bin
安装
您可以从pypi安装它:
pip install aeliant-ssh-metrics
基本用途
^{pr2}$特点
所有这些示例输出都基于/var/log/auth.log
文件。
在运行它之前,请确保您有权限。在
失败的密码
有关失败密码的列表:
$ ssh-metrics -d 05/17/2020 --failed-passwords --format txt Time User Src ip Src geoip -------- --------------- --------------- ---------------------- 00:00:15 yash 80.211.7.53 IT, Italy 00:02:42 apache2 203.135.20.36 PK, Pakistan 00:03:32 deploy 181.40.76.162 PY, Paraguay 00:03:43 ramya 99.245.133.108 CA, Canada 00:04:30 shubham 37.139.20.6 NL, Netherlands 00:04:33 gzw 195.231.0.89 IT, Italy 00:04:53 postgres 88.157.229.59 PT, Portugal
对于同一份清单,但有国家统计数据:
$ ssh-metrics -d 05/17/2020 --failed-passwords --format txt GeoIP Count ---------------------- ------- IT, Italy 26 PK, Pakistan 1 PY, Paraguay 3 CA, Canada 22 NL, Netherlands 56 PT, Portugal 3
无效用户
有关无效用户指标的列表:
$ ssh-metrics -d 05/17/2020 --invalid-users --format txt Time User Src ip Src geoip -------- --------------- --------------- ---------------------- 00:00:14 yash 80.211.7.53 IT, Italy 00:01:04 imran 195.231.0.89 IT, Italy 00:02:05 tuanna69 104.236.33.155 US, United States 00:02:40 apache2 203.135.20.36 PK, Pakistan 00:03:30 deploy 181.40.76.162 PY, Paraguay 00:03:41 ramya 99.245.133.108 CA, Canada 00:04:31 gzw 195.231.0.89 IT, Italy 00:04:51 postgres 88.157.229.59 PT, Portugal 00:05:11 hcn 176.31.102.37 FR, France
对于同一份清单,但有国家统计数据:
$ ssh-metrics -d 05/17/2020 --failed-passwords --format txt GeoIP Count ---------------------- ------- IT, Italy 26 PK, Pakistan 1 PY, Paraguay 3 CA, Canada 22 NL, Netherlands 56 PT, Portugal 3
接受的连接
有关计算机上已接受连接的列表:
$ ssh-metrics -d 05/17/2020 --accepted-connections --format txt Time User Auth Src ip Src geoip -------- ------- --------- ------------- ----------- 10:53:19 yash publickey 181.40.76.162 PY, Paraguay 10:53:19 imran publickey 80.211.7.53 IT, Italy 10:53:19 apache2 publickey 203.135.20.36 PK, Pakistan 10:53:19 postgres publickey 176.31.102.37 FR, France
对于同一份清单,但有国家统计数据:
$ ssh-metrics -d 05/17/2020 --accepted-connections --format txt --country-stats
- 项目
标签: