2017 © Pedro Peláez
 

library iniscan

A scanner to evaluate php.ini security

image

psecio/iniscan

A scanner to evaluate php.ini security

  • Sunday, February 4, 2018
  • by enygma
  • Repository
  • 64 Watchers
  • 1310 Stars
  • 41,500 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 91 Forks
  • 24 Open issues
  • 24 Versions
  • 4 % Grown

The README.md

Scanner for PHP.ini

Build Status Total Downloads, (*1)

SensioLabsInsight, (*2)

The Iniscan is a tool designed to scan the given php.ini file for common security practices and report back results. Currently it is only for use on the command line and reports the results back to the display for both Pass and Fail on each test., (*3)

Installation

Using Composer

composer require psecio/iniscan

The only current dependency is the Symfony console., (*4)

Global Composer installation

Additionally, you can install it outside of a project with the global functionality Composer provides. From any directory you can use:, (*5)

$ ./composer.phar global require psecio/iniscan
$ ~/.composer/vendor/bin/iniscan

Using a single Phar file

First make sure you run composer.phar install, (*6)

curl -LSs https://box-project.github.io/box2/installer.php | php
php box.phar build

This should result in a iniscan.phar file being created in the root folder. Instead of using vendor/bin/iniscan in the examples use ./iniscan.phar instead., (*7)

Example

vendor/bin/iniscan scan --path=/path/to/php.ini
Results for /private/etc/php.ini:
============
Status | Severity | PHP Version | Key                      | Description
----------------------------------------------------------------------
PASS   | ERROR    |             | session.use_cookies      | Accepts cookies to manage sessions
PASS   | ERROR    | 4.3.0       | session.use_only_cookies | Must use cookies to manage sessions, don't accept session-ids in a link

1 passing
2 failure(s)



> *NOTE:* When the scan runs, if it cannot find a setting in the `php.ini` given, it will use [ini_get](http://php.net/ini_get) to pull the current setting (possibly the default). Command line usage ------------------ *Iniscan* offers a few commands for both checking and showing the contents of your php.ini. ### Scan The `scan` command will be the most used - it runs the rules checks against the given ini file and reports back the results. For example:
vendor/bin/iniscan scan --path=/path/to/php.ini

If the path is omitted, *iniscan* will try to find it based off the current configuration (a "php -i" call). By default, this reports back both the pass and fail results of the checks. If you'd like to only return the failures, you can use the `fail-only` argument:
vendor/bin/iniscan scan --path=/path/to/php.ini --fail-only

The `scan` command will return an exit code based on the results: - 0: No errors - 1: Failures found #### Scan Level Threshold You can request the only scan for rules that are on or above a threshold:
vendor/bin/iniscan scan --path=/path/to/php.ini --threshold=ERROR

There are 3 levels you can use: * WARNING * ERROR * FATAL (No rules uses that level at the moment) ### Show The `show` command lists out the contents of your `php.ini` file with a bit of extra formatting.
vendor/bin/iniscan show --path=/path/to/php.ini

### List The `list-tests` command shows a listing of the current rules being checked and their related php.ini key.
vendor/bin/iniscan list-tests

### Output formats By default *iniscan* will output information directly to the console in a human-readable result. You can also specify other output formats that may be easier to parse programatically (like JSON). Use the `--format` option to change the output:
vendor/bin/iniscan show --path=/path/to/php.ini --format=json

the `list-tests` command also supports JSON output:
vendor/bin/iniscan list-tests --path=/path/to/php.ini --format=json

**NOTE:** Currently, only the `scan` command supports alternate output formats - console, JSON, XML and HTML. The HTML output option requires an `--output` option of the directory to write the file:
vendor/bin/iniscan scan --format=html --output=/var/www/output

The result will be written to a file named something like `iniscan-output-20131212.html` Contexts -------- The scanner also supports the concept of "contexts" - environments you may be executing the scanner in. For example, in your development environment, it may be okay to have `display_errors` on. In production, however, this is a bad idea. The scanner's default assumes you're using it in prod, so it uses the strictest checks unless you tell it otherwise. To do so, use the `context` command line option:
vendor/bin/iniscan show --path=/path/to/php.ini --context=dev

In this case, we've told it we're running in dev, so anything that specifically mentions "prod" isn't executed. Deprecated reporting -------------------- As the scanner runs, it will compare the configuration key to a list of deprecated items. If the version is at or later than the version defined in the rules, an error will be shown in the output. For example, in the console, you'd see:
WARNING: deprecated configuration items found: -> register_globals It's recommended that these settings be removed as they will be removed from future PHP versions.

This is default behavior and does not need to be enabled., (*8)

@author Chris Cornutt ccornutt@phpdeveloper.org, (*9)

Bitdeli Badge, (*10)

The Versions

04/02 2018

dev-master

9999999-dev https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

The Development Requires

scanner php.ini

20/02 2017

3.6.5

3.6.5.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

The Development Requires

scanner php.ini

07/02 2016

3.6.4

3.6.4.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

The Development Requires

scanner php.ini

25/09 2015

3.6.3

3.6.3.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

The Development Requires

scanner php.ini

24/09 2015

3.6.2

3.6.2.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

The Development Requires

scanner php.ini

18/07 2015

3.6.1

3.6.1.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

The Development Requires

scanner php.ini

12/09 2014

3.6

3.6.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

The Development Requires

scanner php.ini

05/09 2014

3.5

3.5.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

The Development Requires

scanner php.ini

02/06 2014

3.4

3.4.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

scanner php.ini

29/12 2013

3.3

3.3.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

scanner php.ini

23/12 2013

3.2

3.2.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

scanner php.ini

18/12 2013

3.1

3.1.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

scanner php.ini

09/12 2013

3.0

3.0.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

scanner php.ini

26/11 2013

2.9

2.9.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

scanner php.ini

15/11 2013

2.8

2.8.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

scanner php.ini

10/11 2013

2.7

2.7.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

scanner php.ini

09/11 2013

2.6

2.6.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

scanner php.ini

09/11 2013

2.5

2.5.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

scanner php.ini

07/11 2013

2.4

2.4.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

scanner php.ini

05/11 2013

2.3

2.3.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

scanner php.ini

02/11 2013

2.2

2.2.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

scanner php.ini

31/10 2013

2.1

2.1.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

scanner php.ini

31/10 2013

2.0

2.0.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

scanner php.ini

29/10 2013

1.0

1.0.0.0 https://github.com/psecio/iniscan.git

A scanner to evaluate php.ini security

  Sources   Download

MIT

The Requires

 

scanner php.ini