Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@everymundo/aws-instance-identity
Advanced tools
Returns information about the AWS Instance that calls it
Returns information about the AWS Instance that calls it
npm install @everymundo/aws-instance-identity
const { getIdentityDocument } = require('@everymundo/aws-instance-identity');
getIdentityDocument()
.then((result) => {
console.log(result);
})
.catch((err) => {
console.error(err);
});
const { getIdentityDocument } = require('@everymundo/aws-instance-identity');
const init = async() => {
try {
const result = getIdentityDocument();
console.log(result);
} catch (e) {
console.error(err);
}
}
When running locally it will fail the request since that request is done to an endpoint that only works inside the aws infrastructure.
If you really want to get a document you can do so by running a socks proxy with an AWS instance via ssh. The connection can be stablished by running the following command:
# You should replace your-instance-address by your instance address
ssh -ND 8157 your-instance-address &> /dev/null & PID=$! && echo $PID
After that you can just set the environment variable SOCKS_PROXY=socks://127.0.0.1:8157
and run your aplication.
You can try that out in a node console
SOCKS_PROXY=socks://127.0.0.1:8157 node -e "require('@everymundo/aws-instance-identity').getIdentityDocument().then(console.log)"
The output would be similar to this:
{
privateIp: '192.168.0.12',
devpayProductCodes: null,
availabilityZone: 'us-west-1a',
version: '2010-08-31',
instanceId: 'i-2093840273489',
billingProducts: null,
instanceType: 'm4.xlarge',
accountId: '98237498273984',
architecture: 'x86_64',
kernelId: null,
ramdiskId: null,
imageId: 'ami-34cb443',
pendingTime: '2017-10-20T20:41:03Z',
region: 'us-west-1'
}
This should bring you an error
node -e "require('@everymundo/aws-instance-identity').getIdentityDocument().catch(console.error)"
The error message would be something similar to this:
{ code: 599,
start: 2018-03-21T04:35:54.692Z,
end: 1521606957775,
err:
{ Error: connect EHOSTUNREACH 169.254.169.254:80
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1170:14)
errno: 'EHOSTUNREACH',
code: 'EHOSTUNREACH',
syscall: 'connect',
address: '169.254.169.254',
port: 80 },
attempt: 1,
endpoint: 'http://169.254.169.254/latest/dynamic/instance-identity/document' }
FAQs
Returns information about the AWS Instance that calls it
The npm package @everymundo/aws-instance-identity receives a total of 15 weekly downloads. As such, @everymundo/aws-instance-identity popularity was classified as not popular.
We found that @everymundo/aws-instance-identity demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 24 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.