Giter Site home page Giter Site logo

abcdatos / wp-sec Goto Github PK

View Code? Open in Web Editor NEW

This project forked from markri/wp-sec

0.0 1.0 0.0 100 KB

Wp-sec is an exentsion for wp-cli which checks for Wordpress CVE security issues at wpvulndb.com

License: MIT License

Shell 1.16% PHP 94.80% Gherkin 1.90% Dockerfile 2.14%

wp-sec's Introduction

markri/wp-sec

Build Status

Quick links: Using | Installing | Contributing

What is wp-sec?

Wp-sec is an extension for wp-cli which checks for Wordpress CVE security issues at wpvulndb.com. All installed versions of core, plugins and themes can be checked and monitored, so you know when to update your Wordpress installation.

Using

Following synopsis should be enough to get you started

NAME

  wp wp-sec

DESCRIPTION

  Check for CVE security issues at wpvulndb.com

SYNOPSIS

  wp wp-sec <command>

SUBCOMMANDS

  check      Checks for core, plugins and themes
  version    Returns current version


CHECK PARAMETERS

  --type=[core|plugins|themes|all]
      Check for a specific part, or use all to check all parts
      Default: all

  --output=[user|nagios|json]
      Controls the output
      Default: user

  --cached
      Lets you cache the resuls of wpvulndb, to prevent hammering at their servers. Be nice to them, it's a free service

  --ttl=[integer]
      Cache control of above --cached setting. If omitted a default of 8 hours is used. This setting will give
      you fine grained control. Value is entered in seconds

  --api=[v2|v3]
      The WPvulnDB API version to be used. Currently there is no functional difference between these API's. Except for logging in with a token on API v3

  --token=[<your token>] 
      Your user token to be used @ wpvulndb.com. Only needed for API v3

  --lowercase
      Converts themes and plugin names to lowercase to submit to wpvulndb. This is due to an issue at wpvulndb. https://github.com/markri/wp-sec/issues/14 As of october 2018 (tested) it doesn't seem to be needed anymore

GLOBAL PARAMETERS

  All global wp cli parameters are inherited

Installing

Installing this package requires WP-CLI v0.23.0 or greater. Install fresh wp-cli as instructed here Or update to the latest stable release with wp cli update.

Once you've done so, you can install this package with wp package install markri/wp-sec.

Contributing

We appreciate you taking the initiative to contribute to this project.

Contributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.

Development

To setup a development environment for code contributions, follow instructions below. Execution of the extension is done within a dockerized environment (only tested under Linux). Editing can still be done outside of docker as the current directory is mounted into the docker environment.

Place wp-cli binary in the bin folder. According to current documentation from WP-CLI you would want to do something like:

   cd bin 
   curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
   chmod +x wp-cli.phar
   mv wp-cli.phar wp

Create a docker environment and bring it up like this:

   docker-compose up -d

Enter your dev environment and create a fresh wordpress installation to test against

   docker exec -ti wpsec-phpcli /bin/bash
   mkdir testsite && cd testsite
   wp core download
   wp core config --dbname=wpsec --dbuser=wpsec --dbpass=wpsec --dbhost=wpsec-mariadb
   wp core install --url=http://localhost --title=testsite --admin_user=admin --admin_password=admin [email protected] --skip-email

Running (from /home/wp/testsite)

   wp wp-sec check

Preparing testsuite (from /home/wp)

   composer install
   mysql -h wpsec-mariadb -e 'CREATE DATABASE IF NOT EXISTS wp_cli_test;' -uroot -pwpsec

Running testsuite

   vendor/bin/behat --strict

Reporting a bug

Think you’ve found a bug? We’d love for you to help us get it fixed.

Before you create a new issue, you should search existing issues to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.

Once you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please create a new issue with the following:

  1. What you were doing (e.g. "When I run wp post list").
  2. What you saw (e.g. "I see a fatal about a class being undefined.").
  3. What you expected to see (e.g. "I expected to see the list of posts.")

Include as much detail as you can, and clear steps to reproduce if possible.

Creating a pull request

Want to contribute a new feature? Please first open a new issue to discuss whether the feature is a good fit for the project.

Once you've decided to commit the time to seeing your pull request through, please follow our guidelines for creating a pull request to make sure it's a pleasant experience:

  1. Create a feature branch for each contribution.
  2. Submit your pull request early for feedback.
  3. Include functional tests with your changes. Read the WP-CLI documentation for an introduction.
  4. Follow the PSR-2 Coding Standards.

wp-sec's People

Contributors

markri avatar cericoda avatar anemirovsky avatar abcdatos avatar danielbachhuber avatar

Watchers

James Cloos avatar

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.