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.
rsg
is an opinionated Rails application generator that scaffolds apps with the bare minimum needed to run
nicely in development and production.
# Install the executable
gem install rsg
# Generate an API application called "the-next-twitter" under `~/projects`
rsg --api ~/projects/the-next-twitter
# Generate a "traditional" web application called "the-next-tiktok" under `~/projects`
rsg ~/projects/the-next-tiktok
# Use a custom application template to generate an application
rsg -m "my-org-template.rb" ~/projects/the-next-github
The main rsg
executable assumes you have everything necessary for bootstrapping the app, like for example
having DATABASE_URL
set for automatic execution of rails db:migrate
and nodejs / yarn available for
configuration of webpacker.
Alongside the rsg
executable, the gem also provides a set of Rails generators that can be executed on top
of existing apps. You can lookup the ones that are available with rails generate --help | grep rsg
.
Rails comes with lots of things by default these days and while it provides a nice experience for newbies, it is terrible for folks that would like to create micro services / apps with just the bare minimum. We also believe that some of the provided defaults are not that great for production use (like for example logging).
Sure, we can use the --minimal
flag and ignore most of the framework, or pass in --api
to cut down even
more but the meaning of --minimal
will change over time. Another option would be to run rails new --help
and go through all those 20+ --skip-*
flags (in Rails 6.1) and pass the appropriate ones to rails new
,
which is kinda boring and error prone.
Even if we provide all the --skip-*
flags, there are things that we can't customize from the CLI, like
for example, the generated README.md
or disabling Rail's encrypted secrets / credentials. The Rails Way :tm:
of doing those types of customizations are through application templates.
With those one can easily do things like add gems, create routes, etc. Application templates are simply Ruby
files that can be passed on to the -m
flag of rails new
. Those files can live anywhere, like on GitHub
repositories or Gists, or even inside other gems (like rsg
itself).
With all that in mind we've decided to create our own Rails application generator that's simplifies that
process. This project draws some inspiration from thoughtbot's suspenders
but it has a subtle difference, rsg
will do its best to hide the complexities of rails new
s by opting out
of all components it can (like active_record
or the asset pipeline) and hiding the vast majority of rails new
flags from its help just so users are not confused. Once that "barebones application" is created, the rsg
generators kick in and do their magic.
Different from suspenders, we chose to work off from application templates for "orchestration of generators"
instead of doing things from the app generator itself.
The reason for doing that is just so developers can easily customize how rsg
behaves by providing a simple ruby
file to it, instead of having to go through the process of adding extra flags, going through PRs, etc.
Finally, we want rsg
to be the basis of other application generators so we did the best we could to make
wrapping rsg
into your own internal / open source gem very simple (more on that below).
TODO: Write about it, with as many links as possible
TODO: Document how it'll look like
TODO: Document, explain what they do
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests.
You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update
the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for
the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
NOTE: The gem is currently owned by @fgrehm on RubyGems so you'll jave to ask him to publish a new release, we'll automate releases from GitHub actions or CircleCI later and will transfer the gem ownership to doximity.
rsg
from sourcegit clone https://github.com/doximity/rsg && cd rsg
./bin/setup
# Scaffold a sample app under ./tmp and configure the app to use RSG from sources
./exe/rsg --path="../../" tmp/sample-app
# Or if you want an API only project
./exe/rsg --path="../../" --api tmp/sample-api
TODO: Document
TODO: Document, provide as many links as possible
rsg
actionsTODO: Document, or link to file
rsg
into your own generatorTODO: Document
Bug reports and pull requests are welcome on GitHub at https://github.com/doximity/rsg.
rails new
flags that make sense or have a sane defaultgit commit
after each generatorrspec-rails
dotenv-rails
slim-rails
factory_bot
letter_opener_web
action_cable
action_mailbox
action_mailer
action_text
active_job
active_record
active_storage
test_unit
FAQs
Unknown package
We found that rsg 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.