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.
@brave/cf2tf
Advanced tools
A Terraform importer for Cloudflare resources inspired by terraforming
A Terraform importer for Cloudflare resources inspired by terraforming.
git clone https://github.com/brave/cf2tf
npm install -g
You must export your Cloudflare credentials:
export CLOUDFLARE_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export CLOUDFLARE_EMAIL=xxx@xxx.xxx
$ cf2tf --help
Commands:
dns import dns records
Options:
--help Show help [boolean]
--tfstate output tfstate [default: false]
$ cf2tf dns --help
cf2tf dns
Options:
--help Show help [boolean]
--tfstate output tfstate [default: false]
--zone limit to a particular zone by name [default: ""]
The following example shows simulated output for a domain mysite.com
which has a single record, an apex CNAME to mysite.org
$ cf2tf dns --zone mysite.com > main.tf
$ cat main.tf
{
"resource": {
"cloudflare_record": {
"mysite_com_CNAME_mysite_org": {
"domain": "mysite.com",
"name": "mysite.com",
"value": "mysite.org",
"type": "CNAME",
"proxied": false
}
}
}
}
$ cf2tf dns --zone mysite.com --tfstate > terraform.tfstate
$ cat terraform.tfstate
{
"version": 1,
"serial": 1,
"modules": [
{
"path": [
"root"
],
"outputs": {},
"resources": {
"cloudflare_record.mysite_com_CNAME_mysite_org": {
"type": "cloudflare_record",
"depends_on": [],
"primary": {
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"attributes": {
"domain": "mysite.com",
"hostname": "mysite.com",
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"name": "mysite.com",
"priority": "0",
"proxied": "false",
"ttl": "1",
"type": "CNAME",
"value": "mysite.org",
"zone_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
},
"meta": {
"schema_version": "1"
},
"tainted": false
},
"deposed": [],
"provider": ""
}
},
"depends_on": []
}
]
}
Unlike terraforming, cf2tf outputs in the Terraform JSON configuration format. This can easily converted to hcl format via a tool like json2hcl.
FAQs
A Terraform importer for Cloudflare resources inspired by terraforming
The npm package @brave/cf2tf receives a total of 1 weekly downloads. As such, @brave/cf2tf popularity was classified as not popular.
We found that @brave/cf2tf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 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.
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.