定制 sockam/csp-logger-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sockam/csp-logger-bundle

Composer 安装命令:

composer require sockam/csp-logger-bundle

包简介

A Symfony Bundle that can collect reports from CSP

README 文档

README

SensioLabsInsight StyleCI Scrutinizer Code Quality

The SockamCSPLoggerBundle provides a basic service for logging content security policy violations.

#Features

  • Saving CSP violations
  • Viewing the saves CSP violations

Installation

Get the bundle

Add sockam/csp-logger-bundle to your dependencies:

{
    "require": {
        ...
        "sockam/csp-logger-bundle": "^0.2.0"
    }
    ...
}

To install, run php composer.phar [update|install].

Add CSPLoggerBundle to your application kernel

<?php

    // app/AppKernel.php
    public function registerBundles()
    {
        return array(
            // ...
            new Sockam\CSPLoggerBundle\SockamCSPLoggerBundle(),
            // ...
        );
    }

Import the routing configuration

Add to your routing.yml:

# app/config/routing.yml
sockam_csp_logger:
    resource: "@SockamCSPLoggerBundle/Resources/config/routing.yml"
    prefix:   /csp

You can customize the prefix as you wish.

Update your database schema:

$ php bin/console doctrine:schema:update --force

You can now use /csp/log endpoint in your CSP headers: You can now access the dashboard at this url: /csp/logs

To secure the CSP violations viewer, you can add the following to your security.yml - provided your administrator role is ROLE_ADMIN

    access_control:
        - { path: ^/csp/logs, roles: ROLE_ADMIN }

Now only users with the role ROLE_ADMIN will be able to access the CSP violations viewer at this url: /csp/logs

Screenshots

Violations viewer

CSP Violations Log Viewer

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固