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.
whenever-eb-shipoffers
Advanced tools
Whenever-elasticbeanstalk is an extension gem to Whenever that automatically ensures that one instance in an AWS Elastic Beanstalk environment is set as leader. This allows you to run cron jobs on all instances, or just on the leader. This is required since Elastic Beanstalk may start or stop any instance as it scales up or down.
Add this line to your application's Gemfile:
gem 'whenever-elasticbeanstalk'
And then execute:
$ bundle
Or install it yourself as:
$ gem install whenever-elasticbeanstalk
$ cd /apps/my-great-project
$ wheneverize-eb .
This will create an initial config/schedule.rb
file for you with the ensure_leader
job set to run every minute. It will also create a .ebextensions/cron.config
file that will automatically choose a leader on environment initialization, and start up Whenever with the correct leader
role. Lastly, it creates the config/whenever-elasticbeanstalk.yml
file that will contain your AWS credentials for retrieving your environment information.
If you are already using Whenever, running wheneverize-eb .
won't overwrite your config/schedule.rb
file. You'll need to add the following lines in order for your environment to always have one leader.
every 1.minute do
command "cd /var/app/current && bundle exec ensure_one_cron_leader"
end
In order for the scripts to work, you need to ensure that the EC2 Instance Role has access to EC2 instances and tags (further reading at AWS Documentation ). Ensure that your EC2 instance has at a minimum the following permissions:
Example policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ec2:DescribeInstanceAttribute",
"ec2:DescribeInstanceStatus",
"ec2:DescribeInstances",
"ec2:DescribeTags",
"ec2:CreateTags"
],
"Resource": [
"*"
],
"Effect": "Allow"
}
]
}
Make sure to add the RACK_ENV
environment variable to your environment if you haven't already done so. This variable is not created automatically by AWS. You can add the following line to your .elasticbeanstalk/optionsettings.appname-env
file:
RACK_ENV=staging
For config/schedule.rb
usage, please see the documentation for the Whenever gem.
To run a task only on one instance, assign the task to the leader
role.
every :day, :at => "12:30am", :roles => [:leader] do
runner "MyModel.task_to_run_nightly_only_on_one_instance"
end
To run a task on all instance, omit the roles
option.
every 1.minute do
command "touch $EB_CONFIG_APP_SUPPORT/.cron_check"
end
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that whenever-eb-shipoffers 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.