Giter VIP home page Giter VIP logo

kickoff's Introduction

KickOff Build Status Current packagist

A continuous website monitoring tool.

Why Use KickOff?

While each project you launch may have a different feature set, they often share many of the same performance, SEO and security requirements. Let's look at a typical example set of requirements:

  • Provide an X-XSS-Protection header.
  • Deliver all HTML documents in less than 1 second.
  • All redirects should contain a 301 header.
  • Cookies should be accessible via HttpOnly.
  • Your title tag should be no longer than 70 characters long.
  • [...]

This tool aims to automate the process of checking your list of requirements shortly before launch or directly after a deployment. Deploy, sit back and leave the rest of the work to KickOff.

KickOff can be integrated into your standard delivery process (such as with Jenkins, Travis CI, etc.) to help maintain your list of requirements after each deployment, not just on launch day. That is why KickOff can be called a continuous website monitoring tool.

##Installation

###Composer

php composer.phar require frickelbruder/kickoff

###Phar If you would prefer a precompiled phar-archive, simply download the latest release at https://github.com/frickelbruder/kickoff/releases

##Simple Example To get started, edit one of the provided files in the example directory and change your host where appropriate. Now run the test:

./bin/kickoff.php run example/security.yml

Once your test is complete you will see the results:

Example console output for SEO or security tests

Integration into CD

./bin/kickoff.php run -j build/logs/kickoff.xml example/security.yml

This generates a JUnit compatible log file, which you can inject into your CD work flow (with PHPUnit for example).

The command itself will return the number of errors as a result, so any errors should result in a failing build target.

Issues and Bugs

Bug reports are gladly accepted in the GitHub issue tracker.

More Info

More detailed information can be found at frickelbruder.github.io/kickoff.

kickoff's People

Contributors

frickelbruder avatar hanzi avatar ingowalther avatar ins0 avatar joshmountain avatar micheleorselli avatar skybluesofa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kickoff's Issues

SEO site review using sitemap.xml file

As I was reviewing code for another issue, I began thinking about a sitewide SEO prelaunch check. I would imagine it being run in one of two ways:
php ./bin/kickoff.php seocheck mysite.com/sitemap.xml
or
php ./bin/kickoff.php sitemap mysite.com

Basically, it would read the URLs from sitemap.xml and then run the 'seocheck' on each page resulting in a single report that could be used to fix SEO issues throughout the site.

Perhaps there could be some sort of paging in the case of too many URLs:
php ./bin/kickoff.php sitemap mysite.com 0-19
or
php ./bin/kickoff.php sitemap mysite.com link:0-19
to run through the first 20 links.

Does this sound feasible or even something you want right now? Do you think it would require a great amount of rework?

New command to perform basic security check

There should be a new command, which can be called to perform basic security checks on a given website.
Example:

php ./bin/kickoff.php securitycheck http://www.google.de

New command to perform basic performance check

There should be a new command, which performs basic performance settings checks.
Example:

php ./bin/kickoff.php performancecheck --image https://www.google.de/images/nav_logo242.png --styles https://www.google.de/whatever.css http://www.google.com 

Allow target: path: to be an array

The

target:
    path:

element should be either a normal string (as it is right now), or an array of strings, which applies the section with all its rules and setings to all listed url paths.

Add CSP-Rule

Add a CSP-Rule.
There is no need for a meta-CSP-tag check. Those checks are far more done via HTTP Header (if at all).

There might be a 2 different rules:

  • Check for existence of CSP
  • Check if the current page meets the CSP requirements. This should be possible, since the body and the headers are fetched in the same request and thus, the body could be checked according to the CSP header.

Readme.md needs improvement

The readme.md file needs improvement by a native english speaker or at least somebody, who is more fluent in english than me :-)

Proposed changes to the config file format

Before I dive into the implementation, I wanted to run this by you guys first. What do you think?
(Sorry for the long text. Below is an example if you just want to see the result.)

The Problem

While trying to assemble a config file for one of my projects, I ran into a few inconsistencies and things that feel unnecessarily complicated. Here are my thoughts, in no particular order.

  1. In a section, you cannot use a target node to overwrite the one in defaults. Instead, you have to call it config here even though you’re overriding target with it.
  2. The name of the uri node is misleading. It contains the path, not a URI.
    URI: https://www.example.com/foo/bar?baz=qux (more specifically a URL, but whatever)
    Path: /foo/bar
  3. Defining scheme, host and port separately seems rather useless. Not a big problem, but for any use case that I can imagine it should be enough to define a base (https://www.example.com) and a path (/foo/bar).
  4. Since we already have to manually define names for our rules, there is actually no reason for them to HaveAWeirdNotationLikeThis. Without any infrastructural changes whatsoever, YAML would already support more human-readable names.
  5. The syntax for setting rule options may be easy to parse, but is harder to write and to read. For example, HttpRequestTime: [["maxTransferTime", 1500]] looks a bit weird. Also, it mentions the same thing (download time) twice and uses different words (request time and transfer time.)

My Proposal

Issues 1 and 2 are easily solved: Rename config to target and uri to path. Each section is always deep-merged with the defaults section so everything behaves as you would expect.

Issue 3 is a matter of opinion. If we choose to do this, my vote goes towards having base and path that simply get concatenated. So if you define { base: http://www.example.com/foo, path: /bar }, the resulting URL would be http://www.example.com/foo/bar.
path defaults to /.
base would be a required setting for now, but later we could even add the option of setting it via command line (bin/kickoff.php check foo.yml http://www.example.com.)

So much for the easy part.

Rule Sets

This references #5, #6 and #7.

The idea is to define groups of rules that can be applied in bulk, and that contain some sensible defaults.

Now the issues are about creating dedicated commands for those rule sets, but I don’t see any reason why we shouldn’t offer them in the config as well. So next to the rules node I would introduce a rule sets node that contains an array of strings:

rule sets:
    - seo
    - security

rules:
    - 

This would require looking up the rule sets seo and security and simply merging them into the rules node internally.

Natural Language Rule Names

Instead of HttpRequestTime: [["maxTransferTime", 1500]] you could just say downloads faster than: 1500ms.

downloads faster than would be the name of the rule and 1500ms its option.

I was considering the following rules:

  1. Rule names are case insensitive.
  2. Punctuation is ignored, so contains an <h1> tag is interpreted as contains an h1 tag. Of course, this is limited by YAML itself. Can’t use colons or quotes too freely.
  3. A rule can optionally have a parameter, like shown above. It does not have to: exists would be a rule as well.
  4. An option can either be a scalar value or an array or a hash. It’s the rule’s job to properly parse that.
  5. Names and options should be chosen so that the resulting config is a reasonably readable list of English sentences without too much weird syntax. Again: limitations imposed by YAML.

See below for a full example of what I mean.

Allow For A Simpler Version?

Another idea is that if neither defaults nor sections nodes exist, we just treat the config as if it were part of a sections block.

But I’m not sure whether that is actually helpful or just adding more fragmentation.

Or, we could drop the sections node entirely and just treat defaults as a special kind of section.

Full Example

defaults:
    target:
        host: https://www.google.com
        path: /
        headers:
            X-Foo: bar

    rules:
        - exists
        - is gzipped


sections:
    main page:
        target: { path: / }

        rule sets:
            - seo
            - security
            - performance

        rules:
            - downloads faster than: 1000ms
            - contains: "I’m Feeling Lucky"
            # The rules “exists” and “is gzipped” are included as well because
            # they are defined in the "defaults" section.


    non-existant page:
        target: { path: /404 }

        rules:
            - is missing


    all rules:
        target:
            host: http://www.example.com
            path: /foo/bar
            headers:
                X-Test: yes
                # disables the X-Foo header that has been set in the defaults
                X-Foo: ~

        rules:
            - enables xss protection
            - does not expose server software:
                tolerate server without version: true
            - downloads faster than: 1500ms
            - has expires header in the far future
            - contains etag
            - exists
            - is gzipped
            - disables content sniffing
            - is missing
            - responds 304 to if modified since
            - prevents framing
            - restricts framing to origin
            - sets httponly flag for cookie: session_id
            - sets secure flag for cookie: session_id
            - enables hsts:
                includes subdomains: true
            - title tag length is good:
                min: 10
                max: 50
            - meta description length is good
            - open graph properties are present
            - twitter properties are present
            - canonical link is present
            - has hreflang tag
            - has apple touch icons
            - does not have generator meta tag
            - contains: "foo bar"
            - contains an h1 tag
            - contains exactly one h1 tag

Add rulesets

There should be a new main area:
Rulesets

Each rule set should consist of a name and one or more rule assigned rules. Example:

Rulesets:
    - security:
            - ValidSslCertificate
            - HttpHeaderXSSProtectionSecure
            - HttpHeaderExposeLanguage

Those rulesets can be referenced in each section ( additionally to normal rules ). Example:

Sections:
    website:
         rulesets:
             - security
             - seo
         rules:
            - HttpHeaderHasEtag
            - HttpHeaderResourceFound

Beautify console output

The console error messages need some cosmetics.
It should basically still look similar, but there need to be some empty lines where appropriate and the section:Rulename hint looks somehow weird

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.