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.
Sync your DNS host with your DNS zone file, making it easy to version your zone file and sync changes.
Configuration management is important, and switched-on technical types now agree that "configuration is code". This means that your DNS configuration should be treated with the same degree of respect you would give to any other code you would write.
In order to live up to this standard, there needs to be an easy way to manage your DNS host file in a SCM tool like Git, allowing you to feed it into a continuous integration pipeline. This library enables this very ideal, making DNS management no different to source code management.
Add zonesync
to your Gemfile:
source 'https://rubygems.org'
gem 'zonesync'
or run:
gem install zonesync
The following is an example DNS zone file for example.com
:
$ORIGIN example.com.
$TTL 1h
example.com. IN SOA ns.example.com. username.example.com. (2007120710; 1d; 2h; 4w; 1h)
example.com. NS ns
example.com. NS ns.somewhere.example.
example.com. MX 10 mail.example.com.
@ MX 20 mail2.example.com.
@ MX 50 mail3
example.com. A 192.0.2.1
AAAA 2001:db8:10::1
ns A 192.0.2.2
AAAA 2001:db8:10::2
www CNAME example.com.
wwwtest CNAME www
mail A 192.0.2.3
mail2 A 192.0.2.4
mail3 A 192.0.2.5
ignore A 192.0.2.6 ; zonesync: ignore
Note that records with a comment containing "zonesync: ignore" will not be touched during the sync. I'm considering inverting this from a blacklist to a whitelist in a future version, to avoid stomping on collaborators' records.
We need to tell zonesync
about our DNS host by building a small YAML file. The structure of this file will depend on your DNS host, so here are some examples:
Cloudflare
provider: Cloudflare
zone_id: <CLOUDFLARE_DOMAIN_ZONE_ID>
token: <CLOUDFLARE_API_TOKEN>
# or instead of token you can auth with:
email: <CLOUDFLARE_EMAIL>
key: <CLOUDFLARE_API_KEY>
``
**Route 53**
provider: AWS aws_access_key_id: <AWS_ACCESS_KEY_ID> aws_secret_access_key: <AWS_SECRET_ACCESS_KEY>
### Usage
#### CLI
$ bundle exec zonesync
$ bundle exec zonesync --dry-run # log to STDOUT but don't actually perform the sync
$ bundle exec zonesync generate # generate a Zonefile from the configured provider
#### Ruby
Assuming your zone file lives in `hostfile.txt` and your DNS provider credentials are configured in `provider.yml`:
```ruby
require 'zonesync'
Zonesync.call(zonefile: 'hostfile.txt', credentials: YAML.load('provider.yml'))
FAQs
Unknown package
We found that zonesync demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.