{"id":13505122,"url":"https://github.com/psecio/iniscan","last_synced_at":"2025-05-14T16:14:20.594Z","repository":{"id":42203529,"uuid":"13842805","full_name":"psecio/iniscan","owner":"psecio","description":"A php.ini scanner for best security practices","archived":false,"fork":false,"pushed_at":"2023-05-31T19:52:36.000Z","size":310,"stargazers_count":1477,"open_issues_count":28,"forks_count":96,"subscribers_count":53,"default_branch":"master","last_synced_at":"2025-05-10T17:39:50.655Z","etag":null,"topics":["configuration","ini","php","scanner","security"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/psecio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-10-24T20:00:08.000Z","updated_at":"2025-05-08T13:35:37.000Z","dependencies_parsed_at":"2022-08-24T03:40:17.607Z","dependency_job_id":"d3f1dbcf-d5ca-45e8-9838-42afb1d45c61","html_url":"https://github.com/psecio/iniscan","commit_stats":{"total_commits":307,"total_committers":29,"mean_commits":"10.586206896551724","dds":0.4560260586319218,"last_synced_commit":"880dede38298adb5a23171e304fe03410260b7e3"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psecio%2Finiscan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psecio%2Finiscan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psecio%2Finiscan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psecio%2Finiscan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psecio","download_url":"https://codeload.github.com/psecio/iniscan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253568710,"owners_count":21928909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configuration","ini","php","scanner","security"],"created_at":"2024-08-01T00:00:58.898Z","updated_at":"2025-05-14T16:14:20.577Z","avatar_url":"https://github.com/psecio.png","language":"PHP","funding_links":[],"categories":["Table of Contents","Standalone","安全","PHP","安全 Security","目录","Security","安全( Security )","类库"],"sub_categories":["Security","Bugs finders","安全 Security","安全"],"readme":"Scanner for PHP.ini\n===========================\n\n[![Build Status](https://secure.travis-ci.org/psecio/iniscan.png?branch=master)](http://travis-ci.org/psecio/iniscan)\n[![Total Downloads](https://img.shields.io/packagist/dt/psecio/iniscan.svg?style=flat-square)](https://packagist.org/packages/psecio/iniscan)\n\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/262321f3-1522-4e82-abd6-7968e108ee87/small.png)](https://insight.sensiolabs.com/projects/262321f3-1522-4e82-abd6-7968e108ee87)\n\nThe Iniscan is a tool designed to scan the given php.ini file for common security practices\nand report back results. Currently it is only for use on the command line and reports the\nresults back to the display for both Pass and Fail on each test.\n\nInstallation\n------------\n\n### Using Composer\n\n```shell\ncomposer require psecio/iniscan\n```\n\n\nThe only current dependency is the Symfony console.\n\n### Global Composer installation\nAdditionally, you can install it outside of a project with the `global` functionality Composer provides. From\nany directory you can use:\n\n```\n$ ./composer.phar global require psecio/iniscan\n$ ~/.composer/vendor/bin/iniscan\n```\n\n### Using a single Phar file\n\nFirst make sure you run composer.phar install\n```\ncurl -LSs https://box-project.github.io/box2/installer.php | php\nphp box.phar build\n```\nThis should result in a iniscan.phar file being created in the root folder.\nInstead of using `vendor/bin/iniscan` in the examples use `./iniscan.phar` instead.\n\nExample\n-------\n```\nvendor/bin/iniscan scan --path=/path/to/php.ini\n```\n```\nResults for /private/etc/php.ini:\n============\nStatus | Severity | PHP Version | Key                      | Description\n----------------------------------------------------------------------\nPASS   | ERROR    |             | session.use_cookies      | Accepts cookies to manage sessions\nPASS   | ERROR    | 4.3.0       | session.use_only_cookies | Must use cookies to manage sessions, don't accept session-ids in a link\n\n1 passing\n2 failure(s)\n```\n\n\u003e *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).\n\nCommand line usage\n------------------\n\n*Iniscan* offers a few commands for both checking and showing the contents of your php.ini.\n\n### Scan\n\nThe `scan` command will be the most used - it runs the rules checks against the given ini file and reports back the results. For example:\n\n```\nvendor/bin/iniscan scan --path=/path/to/php.ini\n```\n\nIf 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:\n\n```\nvendor/bin/iniscan scan --path=/path/to/php.ini --fail-only\n```\n\nThe `scan` command will return an exit code based on the results:\n\n- 0: No errors\n- 1: Failures found\n\n\n#### Scan Level Threshold\nYou can request the only scan for rules that are on or above a threshold:\n\n```\nvendor/bin/iniscan scan --path=/path/to/php.ini --threshold=ERROR\n```\n\nThere are 3 levels you can use:\n* WARNING\n* ERROR\n* FATAL (No rules uses that level at the moment)\n\n\n### Show\n\nThe `show` command lists out the contents of your `php.ini` file with a bit of extra formatting.\n\n```\nvendor/bin/iniscan show --path=/path/to/php.ini\n```\n\n### List\n\nThe `list-tests` command shows a listing of the current rules being checked and their related php.ini key.\n\n```\nvendor/bin/iniscan list-tests\n```\n\n### Output formats\n\nBy 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:\n\n```\nvendor/bin/iniscan show --path=/path/to/php.ini --format=json\n```\n\nthe `list-tests` command also supports JSON output:\n\n```\nvendor/bin/iniscan list-tests --path=/path/to/php.ini --format=json\n```\n\n**NOTE:** Currently, only the `scan` command supports alternate output formats - console, JSON, XML and HTML.\n\nThe HTML output option requires an `--output` option of the directory to write the file:\n\n```\nvendor/bin/iniscan scan --format=html --output=/var/www/output\n```\n\nThe result will be written to a file named something like `iniscan-output-20131212.html`\n\n\nContexts\n--------\n\nThe 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:\n\n```\nvendor/bin/iniscan show --path=/path/to/php.ini --context=dev\n```\n\nIn this case, we've told it we're running in dev, so anything that specifically mentions \"prod\" isn't executed.\n\n\nDeprecated reporting\n--------------------\n\nAs 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:\n\n```\nWARNING: deprecated configuration items found:\n-\u003e register_globals\nIt's recommended that these settings be removed as they will be removed from future PHP versions.\n```\n\nThis is default behavior and does not need to be enabled.\n\n\n\n@author Chris Cornutt \u003cccornutt@phpdeveloper.org\u003e\n\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/psecio/iniscan/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsecio%2Finiscan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsecio%2Finiscan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsecio%2Finiscan/lists"}