
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
@useoptic/hapi-middleware
Advanced tools
This module is an hapi plugin using @useoptic/optic-node-sdk to capture and format HTTP data to send to Optic. We have a list of middleware available for some frameworks, if we are missing the framework join our community and suggest the next framework or develop it with us.
The module requires @useoptic/cli
to be installed, instructions on installing it are available https://www.useoptic.com/docs/.
npm install @useoptic/hapi-middleware
The middleware takes a configuration object and captures traffic in the background as long as @useoptic/cli
is installed.
All options are optional for easier configuration in your application
enabled
: boolean
(defaults to false
) Programmatically control if capturing data and sending it to OpticuploadUrl
: string
(defaults to process.env.OPTIC_LOGGING_URL
) The URL to Optics capture URL, if left blank it will expect OPTIC_LOGGING_URL
environment variable set by the Optic CLIconsole
: boolean
(defaults to false
) Send to stdout/console for debuggingframework
: string
(defaults to '') Additional information to inform Optic of where it is capturing informationUsing a basic hapi server.
const Hapi = require('@hapi/hapi')
const { OpticPlugin } = require('@useoptic/hapi-middleware')
const init = async () => {
const server = Hapi.server({
port: 3001,
host: 'localhost'
})
await server.register({
plugin: OpticPlugin,
options: {
enabled: true
}
})
server.route({
method: ['GET', 'POST'],
path: '/',
handler: (request, h) => {
return 'Hello World! ' + Math.random()
}
})
await server.start()
console.log('Server running on %s', server.info.uri)
}
process.on('unhandledRejection', (err) => {
if (err) {
console.log('ERROR')
console.log(err)
process.exit(1)
}
})
init()
To start capturing data from the SDK, run your application with
api exec "node <your hapi server>"
This software is licensed under the MIT license.
FAQs
NodeJS middleware for using Optic within Hapi
We found that @useoptic/hapi-middleware demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.