Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
express-security-txt
Advanced tools
Readme
Express middleware that implements a security.txt path and policy. Allows the repeating of a directive, as well as the insertion of comments.
References:
yarn add express-security-txt
Define an options object with the keys that make up a valid security.txt file. All the keys are in camelCase.
const securityTxt = require('express-security-txt')
const options = {
contact: 'https://example.com/security/',
preferredLanguages: 'en'
}
app.use(securityTxt.setup(options))
Some directives allow you to specify multiple values. This package allows you to do this by passing an array:
const options = {
contact: ['mailto:security@example.com', 'https://example.com/security/']
}
Comments can be included in the generated file. The #
at the beggining of each line of a comment is automatically inserted by the package.
Comments at the start and end of a file can be added by using the _prefixComment
and _postfixComment
keys, like so:
const options = {
_prefixComment: 'This comment will appear at the beggining of the security.txt file',
contact: 'mailto:security@example.com',
_postfixComment: 'This comment will appear at the end of the security.txt file'
}
NOTE: You may include the newline character (\n
), and the package will automatically insert the #
symbol at the beggining of each line.
Multiline comments can also be added by specifying an array, where each element is a line of the comment.
Comments just before a directive can be added by creating an object of the form { comment: '...', value: '...' }
, where the value associated with the value
key is the value of the field; and the comment
is the comment to appear directly before the field.
For example,
const options = {
contact: 'https://example.com/security/',
acknowledgments: {
comment: 'This comment will appear just above the Acknowledgments field',
value: 'https://example.com/hall_of_fame'
}
}
Would become
Contact: https://example.com/security/
# This comment will appear just above the Acknowledgments field
Acknowledgments: https://example.com/hall_of_fame
If a field allows multiple values, you can leave a comment on each one like so:
const options = {
contact: [
{ comment: 'You can rarely reach me by email', value: 'mailto:security@example.com' },
{ comment: 'Try this online form instead?', value: 'https://example.com/security/' }
]
}
Project tests:
yarn run test
Project linting:
yarn run lint
The project uses the commitizen tool for standardizing changelog style commit messages so you should follow it as so:
git add . # add files to staging
yarn run commit # use the wizard for the commit message
FAQs
Express middleware that implements a security.txt path and policy
The npm package express-security-txt receives a total of 1,097 weekly downloads. As such, express-security-txt popularity was classified as popular.
We found that express-security-txt 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.