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.
TCFG (pronounced "tee config") is test suite configuration for the real world. TCFG offers:
Support for easily controlling which environment your tests execute against
A tiered structure to configuration which allows for every kind of configuration scenario to be supported.
Support for easily integrating standalone test suites into common Continuous Integration platforms like Jenkins.
The Wiki contains more in depth information. Some good places to start:
Start by installing the gem:
$ gem install tcfg
In the project root, make a yaml file called tcfg.yml that contains all configuration you want to be able to control. For a selenium suite, it might look something like this:
---
#start with basic defaults
BROWSER: firefox
BASE_URL: http://localhost:8080
LOG_LEVEL: INFO
#This is a special section with overrides by 'environment'
t_environments:
QA:
BASE_URL: http://qa.mysite.com
Production:
BASE_URL: https://mysite.com
Then configure RSpec to use tcfg in your spec helper file (typically called spec/spec_helper.rb):
require 'tcfg'
RSpec.configure do |config|
config.include TCFG::Helper
end
Now you can access configuration in any before, after, or it block, like:
require 'selenium-webdriver'
RSpec.configure do |config|
config.before(:all) do
@browser = Selenium::WebDriver.for tcfg['BROWSER']
end
config.before(:each) do
@browser.get tcfg['BASE_URL']
end
end
If you need to access configuration outside of a before, after, or it block you can use the TCFG module directly:
Log.level = TCFG['LOG_LEVEL']
To control your test suite, you can use environment variables. To change the browser used:
#To execute with all default configuration
$ rspec
#To change the browser used
$ T_BROWSER=chrome rspec
#To change which environment the tests execute against:
$ T_ENVIRONMENT=QA rspec
TCFG is a general purpose configuration framework. It should be possible to use with most Ruby test frameworks or even for non testing uses. If you have a use and aren't sure how to handle it with tcfg, file an issue we'll see if we can help you out.
TCFG is used in several projects that demonstrate it's capabilities.
More coming soon...
FAQs
Unknown package
We found that tcfg 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.