Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
BENCHMARKABLE by Aman King
http://bitbucket.org/amanking/benchmarkable/
A module that allows a class to mention which instance methods to benchmark, and then allows retrieving the benchmark report in csv format from the class's instances. The csv includes the method invocation timestamp, some context description (if provided), the method name along with arguments passed for the invocation, and the number of seconds the method took to execute.
Eg: class Gateway
def make_request(url) url = URI.parse(url) Net::HTTP.start(url.host, url.port) {|http| http.get('/index.html') } rescue => error puts "Unexpected error: #{error.message}" end
include Benchmarkable benchmark :make_request end
gateway = Gateway.new gateway.make_request('http://www.google.com/') gateway.make_request('http://www.yahoo.com/') gateway.make_request('http://www.wikyblog.com/AmanKing/') File.open('./gateway_performance_report.csv', 'a+') do |file| file.puts gateway.benchmark_report.to_csv(:starting_context => 'gateway') end
Output (in gateway_performance_report.csv): "2009-09-10T20:13:59+05:30","gateway","make_request http://www.google.com/","0.306514978408813" "2009-09-10T20:13:59+05:30","gateway","make_request http://www.yahoo.com/","1.08063411712646" "2009-09-10T20:14:00+05:30","gateway","make_request http://www.wikyblog.com/AmanKing/","2.1521680355072"
(see samples/ajaxy_blog_spec.rb for an example of how to use Benchmarkable to monitor ajax performance using selenium, and look at spec/benchmarkable_spec.rb for more details about the api)
License
Copyright 2009 Aman King
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
FAQs
Unknown package
We found that benchmarkable 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.