Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/voorhoede/lighthouse-security
Runs the default Google Lighthouse tests with additional security tests
https://github.com/voorhoede/lighthouse-security
audit cli developer-tools lighthouse reporting security web-security
Last synced: 3 months ago
JSON representation
Runs the default Google Lighthouse tests with additional security tests
- Host: GitHub
- URL: https://github.com/voorhoede/lighthouse-security
- Owner: voorhoede
- License: apache-2.0
- Archived: true
- Created: 2017-08-11T10:49:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-09T23:27:24.000Z (about 6 years ago)
- Last Synced: 2024-10-25T06:35:57.270Z (3 months ago)
- Topics: audit, cli, developer-tools, lighthouse, reporting, security, web-security
- Language: JavaScript
- Homepage: https://github.com/voorhoede/lighthouse-security#readme
- Size: 206 KB
- Stars: 198
- Watchers: 3
- Forks: 13
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Audit: audits/cookie-httponly.js
Awesome Lists containing this project
README
# [Lighthouse](https://github.com/GoogleChrome/lighthouse) Security [![Linux Build Status](https://travis-ci.org/voorhoede/lighthouse-security.svg?branch=master)](https://travis-ci.org/voorhoede/lighthouse-security) [![Coverage Status](https://coveralls.io/repos/github/voorhoede/lighthouse-security/badge.svg?branch=master)](https://coveralls.io/github/voorhoede/lighthouse-security?branch=master) [![npm lighthouse-security package](https://img.shields.io/npm/v/lighthouse-security.svg)](https://npmjs.org/package/lighthouse-security)
**Runs the default Google Lighthouse tests with additional security tests.**
## Installation
```sh
npm install -g lighthouse-security
```## Run from CLI
Run the command from CLI like displayed below. The options are the same as for
the [default Lighthouse CLI options](https://github.com/GoogleChrome/lighthouse#cli-options).```sh
lighthouse-security [options]
```To run security audits only, use the `--security` flag:
```sh
lighthouse-security --security [options]
```## Use in code
The extension can also be used within your code. A short example is given below.
To render reports etc. it is recommended to import functionality from Lighthouse.```javascript
const runLighthouse = require('lighthouse-security')runLighthouse(url, flags)
.then(results => console.log(results))
```Alternatively you can import just the `lighthouse-security` configuration and use it in your own runner:
```javascript
const lighthouse = require('lighthouse')
const chromeLauncher = require('lighthouse/chrome-launcher')// import one or more lighthouse configs:
const securityConfig = require('lighthouse-security/config')// combine configs into one:
const config = Object.assign({},
pageSecurityConfig,
{ extends: 'lighthouse:default' }
)// run lighthouse as usual:
async function run(url, flags = {}) {
const chrome = await chromeLauncher.launch()
flags.port = chrome.port
const results = await lighthouse(url, flags, config)
const stopped = await chrome.kill()
return results
}
```## Contributing
Contributions are always welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for [guidelines](CONTRIBUTING.md#guidelines) and [development scripts](CONTRIBUTING.md#scripts).
## License
[Apache 2.0 Licensed](LICENSE) by [De Voorhoede](https://www.voorhoede.nl/)
[↑ back to top](#readme)