HTTP Observatory:一组测试和工具,用于扫描您的网站以获取基本的网络卫生信息。
httpobs-alt的Python项目详细描述
Mozilla HTTP观测站-
如果Mozilla有很多工具可以用来分析你的网站。在
它分为三个项目:
- http-observatory-扫描仪/分级机
- observatory-cli-命令行界面
- http-observatory-website-网络界面
用HTTP观测站扫描站点
可以使用以下方法扫描站点:
- observatory.mozilla.org-在线界面
- observatory-cli-官员节点.js命令行界面
- java-http-observatory-api-第三方java库和命令行接口
贡献
先决条件
- Python3
- 吉特
- pip3
注释
这些说明假设您有一个正在工作的Python3开发环境,安装了pip3
,并且能够构建需求,这可能需要安装额外的python操作系统包(-dev
,-devel
)。在
如果这不适合您的环境,您可以使用操作系统包管理器(或其他方式)安装适当的需求,并跳过pip3 -r requirements
命令。在
从本地代码库运行扫描,无需数据库,以实现连续集成
# Install the HTTP Observatory $ git clone https://github.com/mozilla/http-observatory.git $ cd http-observatory $ pip3 install --upgrade . $ pip3 install --upgrade -r requirements.txt
使用local scanner函数调用
^{pr2}$相同,但使用本地CLI
$ httpobs-local-scan --http-port 8080 --https-port 8443 --path '/foo/bar'\ --cookies '{"foo": "bar"}' --headers '{"X-Foo": "bar"}' --no-verify mozilla.org
使用Docker运行本地扫描仪
- 安装Docker Toolbox和{a10}
# Install the HTTP Observatory client and requests library $ git clone https://github.com/mozilla/http-observatory.git $ cd http-observatory $ pip3 install . $ pip3 install --upgrade requests # Create docker machine $ docker-machine create --driver virtualbox --virtualbox-disk-size "40000" http-observatory # Save the URL to the API in your .profile, .bash_profile, or whatever $ echoexportHTTPOBS_API_URL=http://$(docker-machine ip http-observatory):57001/api/v1 >> ~/.profile $ . ~/.profile # Start up the docker instance and install all the pieces $ eval$(docker-machine env http-observatory) $ docker-compose up -d
创建本地安装(在Ubuntu15上测试)
# Install git, postgresql, and redis
# sudo -s
# apt-get install -y git libpq-dev postgresql redis-server
# Clone the repo
# cd /opt
# git clone https://github.com/mozilla/http-observatory.git
# cd http-observatory
# Install the observatory and scanner
# pip install .
# pip3 install -r requirements.txt
# Install the database
# su - postgres
$ createdb http_observatory
$ psql http_observatory < httpobs/database/schema.sql
$ psql http_observatory
http_observatory=# \password httpobsapi
http_observatory=# \password httpobsscanner
# vi /etc/postgresql/9.4/main/postgresql.conf (set max_connections = 512, shared_buffers = 256MB)
# service postgresql restart
# Create the httpobs user, and log/pid directories
# useradd -m httpobs
# install -m 750 -o httpobs -g httpobs -d /var/run/httpobs /var/log/httpobs
# Update the environmental variables
# su - httpobs
$ echo export HTTPOBS_API_URL="http://localhost:57001/api/v1" >> ~/.profile
# Start the scanner
$ cd /opt/http-observatory
$ HTTPOBS_DATABASE_USER="httpobsscanner" HTTPOBS_DATABASE_PASS="....." \
/opt/http-observatory/httpobs/scripts/httpobs-scan-worker
# Start the API (in another terminal)
# HTTPOBS_DATABASE_USER="httpobsapi" HTTPOBS_DATABASE_PASS="....." \
uwsgi --http :57001 --wsgi-file httpobs/website/main.py --processes 8 --callable app --master
作者
- 四月国王
许可证
- Mozilla公共许可证2.0版
- 项目
标签: