HTTP Observatory:一组测试和工具,用于扫描您的网站以获取基本的网络卫生信息。

httpobs-alt的Python项目详细描述


Mozilla HTTP观测站-Build StatusRequirements Status

如果Mozilla有很多工具可以用来分析你的网站。在

它分为三个项目:

用HTTP观测站扫描站点

可以使用以下方法扫描站点:

贡献

先决条件

  • 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运行本地扫描仪

# 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版

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Javaservlet,使用Quartz发送邮件   用Java编写XYRectangle类   java Docker/AWS ECS容器支持的服务(端点)数量   音频Java读取WAV文件作为浮点数组   java为什么是日历。九月不起作用了?   java连接到HTTPS url并发布到它   java线程动画示例不起作用   java查找HashMap是否包含所选值和返回键   java与后端API的交互   JavaFX启动时在JavaFX中执行应用程序启动异常   每T秒从Java运行一次MATLAB   java@Array(长度=?)怎么样OpenHFT中的注释/使用的值   java无法从InputStream读取多个可外部化的对象   java My RestController不返回对象的所有属性   java使Android XML阅读器只读取XML文件的一部分   java注释会影响编译时吗?   从Java到C#的迭代器方法与接口的等效性,然后在类上实现?   swing为什么Java中的侦听器相互依赖?