Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Extract ec2 metadata information from the local http interface on an ec2 instance
Extract ec2 metadata information from the local http interface on an ec2 instance
This module can be consumed programmatically or as a command line tool
Click here for complete reference about ec2 metadata information or better yet, use this module's cli to get an index of properties.
Beware, though, when traversing the ec2 metadata information tree! There are some "traps" one is ought to know of in advance, if one is to save precious time... this is discussed here
npm i ec2-info
const ec2Info = require('ec2-info')
let properties = ['meta-data/instance-id', 'meta-data/instance-type']
// fetch these properties
ec2Info(properties, (err, info) => {
if (err) return console.error(err)
// prints: Map { 'meta-data/instance-id' => 'foofoofoo', 'meta-data/instance-type' => 'm4-large' }
console.log(info)
})
// custom data url
let options = { dataURL: 'http://localhost:8080/latest/' }
ec2Info(properties, options, (err, info) => {
if (err) return console.error(err)
// prints: Map { 'meta-data/instance-id' => 'foofoofoo', 'meta-data/instance-type' => 'm4-large' }
console.log(info)
})
ec2Info(properties, callback [, options])
Fetch the specified set of properties and return them in the callback inside an ES6 Map object.
If used on anything other than an ec2 instance as determined by is-ec2-machine the module will still work without an error but all the property values will be not an ec2 machine
.
You can disable that check by specifying the option { testIsEc2Machine: false }
You can also change the default url http://169.254.169.254/latest/
to something else by specifying the option { dataURL: 'http://localhost:8080/latest' }
. This is helpful in testing or if you're using the package on your machine but want to port foward to an ec2 instance, e.g: ssh -f ec2-user@<ec2 host address> -L 8080:169.254.169.254:80 -N
'
npm i -g ec2-info
ec2-info --help
ec2-info fetch --help
ec2-info fetch meta-data/public-ipv4 meta-data/instance-id --format=json
ec2-info index
uses debug with namespace ec2-info
MIT © ironSource ltd
FAQs
Extract ec2 metadata information from the local http interface on an ec2 instance
The npm package ec2-info receives a total of 3 weekly downloads. As such, ec2-info popularity was classified as not popular.
We found that ec2-info demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.