Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
api-gateway-auth-policy
Advanced tools
This package aims to solve the problem of generating AWS auth policies for API gateways lambda authorizers. Authorizers an easy and combinient way to secure your aws lambda invokations, to find more about it consult aws docs.
Being written in typescript, this package aims to be 100% type safe, avoiding common mistakes and being self documented.
yarn add api-gateway-auth-policy
The public methods exposed by the api are all chainable.
const optionalConfig = {
region: 'eu-west-1',
stage: 'production',
apiId: 'xxxxxxxxxx',
};
const accountId = '12345';
new ApiGatewayAuthPolicy(accountId, optionalConfig)
.allowMethod(HttpVerb.GET, '/media', {
StringEquals: {'aws:username': 'johndoe'},
})
.allowMethod(HttpVerb.PATCH, '/media')
.allowMethod(HttpVerb.POST, '/media')
.denyMethod(HttpVerb.DELETE, '/media')
.denyMethod(HttpVerb.PUT, '/media', {
IpAddress: {
'aws:SourceIp': ['203.0.113.0/24', '2001:DB8:1234:5678::/64'],
},
})
.render('principalId');
{
"context": {
"isSecured": true,
"name": "diogo"
},
"policyDocument": {
"Statement": [
{
"Action": "execute-api:Invoke",
"Condition": {
"StringEquals": {
"aws:username": "johndoe"
}
},
"Effect": "Allow",
"Resource": ["arn:aws:execute-api:*:12345:*:*:GET:/media"]
},
{
"Action": "execute-api:Invoke",
"Effect": "Allow",
"Resource": ["arn:aws:execute-api:*:12345:*:*:PATCH:/media", "arn:aws:execute-api:*:12345:*:*:POST:/media"]
},
{
"Action": "execute-api:Invoke",
"Condition": {
"IpAddress": {
"aws:SourceIp": ["203.0.113.0/24", "2001:DB8:1234:5678::/64"]
}
},
"Effect": "Deny",
"Resource": ["arn:aws:execute-api:*:12345:*:*:PUT:/media"]
},
{
"Action": "execute-api:Invoke",
"Effect": "Deny",
"Resource": ["arn:aws:execute-api:*:12345:*:*:DELETE:/media"]
}
],
"Version": "2012-10-17"
},
"principalId": "*"
}
FAQs
A policy generator for an api gateway authorizer
The npm package api-gateway-auth-policy receives a total of 116 weekly downloads. As such, api-gateway-auth-policy popularity was classified as not popular.
We found that api-gateway-auth-policy 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.