![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Cookie Filter uses a developer defined safelist of allowed cookies and their values to filter cookies that are not allowed by the safelist configuration. This gem filters both incoming cookies from the browser and what cookies can be set from rails. I want to thank MittMedia DMU for allowing me to open source this piece of code. We are always looking for new developers ;).
Measurment has shown that this filter adds less than 1ms per request.
This library has been in production on sites with 5 million weekly pageviews for 2 years before being packaged as a gem and open sourced.
This gem package has not been tested in production.
Install the cookiefilter gem; or add it to your Gemfile with bundler:
Add this line to your application's Gemfile
:
gem 'cookiefilter'
And then execute:
$ bundle install
Tell your app to use the Cookiefilter middleware. For Rails 4+ apps:
# In config/application.rb
config.middleware.use Cookiefilter
Add a cookiefilter.rb
file to config/initializers/
:
# In config/initializers/cookiefilter.rb
class Cookiefilter
def self.safelist
# This is an array of hashes. It serves as a living documentation of our
# allowed cookies and their format. Need help with regex? Visit this site:
# http://rubular.com/
# Each hash in the array is per cookie with the following format:
# description: Human readable string of what/who this cookie pertains.
# key: A regex that matches the name of the cookie or cookies matching
# the above description.
# value: A regex that validates the content of the cookie, if the regex
# is nil, no validation is done.
# sacred: This is a boolean indicating that this cookie are not to be
# removed to decrease the overall size of cookies per domain.
# It will however be removed in second run if no other options
# are left.
[
{
description: 'Rails Session Cookie',
key: /\Aproject_name_session\z/,
value: nil,
sacred: true
}
]
end
end
Then restart your rails server.
Happy filtering!
The gem is available as open source under the terms of the MIT License.
All contributions are welcome, issues and PR's. Make sure tests pass by running them like so:
rake test
FAQs
Unknown package
We found that cookiefilter 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.