Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Logasm.build(application_name, logger_config)
logger_config is a hash with logger types and their configuration.
loggers:
stdout:
level: 'debug'
Supported log levels:
For example level: 'warn' will log everything with warn and above.
Creating a new stdout logger
require 'logasm'
logasm = Logasm.build('myApp', stdout: nil)
When no loggers are specified, it creates a stdout logger by default.
Preprocessors allow modification of log messages, prior to sending of the message to the configured logger(s).
Excludes or masks defined fields of the passed hash object. You can specify the name of the field and which action to take on it. Nested hashes of any level are preprocessed as well.
Available actions:
prune
(default) - fully excludes the field and its value from the hash.mask
- replaces every character from the original value with *
.
In case of array
, hash
or boolean
value is replaced with one *
.preprocessors:
blacklist:
fields:
- key: password
- key: phone
action: mask
logger = Logasm.build(application_name, logger_config, preprocessors)
input = {password: 'password', info: {phone: '+12055555555'}}
logger.debug("Received request", input)
Logger output:
Received request {"info":{"phone":"************"}}
Prunes or masks all the fields except those whitelisted in the configuration using JSON Pointer.
Only simple values(string
, number
, boolean
) can be whitelisted.
Whitelisting array and hash elements can be done using wildcard symbol ~
.
Available actions:
mask
(default) - replaces every character from the original value with *
.
In case of array
, hash
or boolean
value is replaced with one *
.prune
- fully excludes the field and its value from the hash.preprocessors:
whitelist:
pointers: ['/info/phone', '/addresses/~/host']
action: prune
logger = Logasm.build(application_name, logger_config, preprocessors)
input = {password: 'password', info: {phone: '+12055555555'}, addresses: [{host: 'example.com', path: 'info'}]}
logger.debug("Received request", input)
Logger output:
Received request {password: "********", "info": {"phone": "+12055555555"}, "addresses": [{"host": "example.com","path": "****"}]}
FAQs
Unknown package
We found that logasm-jruby demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.