Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Cost-efficient bastion host with a CLI tool for convenient access to your AWS resources
With Basti, you can securely connect to your RDS/Aurora/Elasticache/EC2 instances in private VPC subnets from a local machine or CI/CD pipeline almost for free!
🏰 Using Basti CDK, you set up a bastion instance in the connection target's VPC.
🧑💻 You use Basti CLI to conveniently connect to your target through the bastion instance.
💵 Basti takes care of keeping the bastion instance stopped when it's not used to make the solution cost as low as ≈ 0.01 USD per hour of connection plus ≈ 0.80 USD per month of maintaining the instance in a stopped state.
🔒 Security completely relies on AWS Session Manager and IAM policies. The bastion instance is not accessible from the Internet and no SSH keys are used.
The construct is available in multiple languages thanks to JSII.
npm install basti-cdk
pip install basti-cdk
See the full API reference on Construct Hub.
See the test CDK apps for working examples of each feature the library provides.
Basti constructs can be imported from the basti-cdk
package.
import { BastiAccessSecurityGroup, BastiInstance } from 'basti-cdk';
💡 RDS instance is used as an example target. You can use Basti to connect to any other AWS resource that supports security groups.
Use BastiInstance
construct to create Basti EC2 instance.
const bastiInstance = new BastiInstance(stack, 'BastiInstance', {
vpc,
// Optional. Randomly generated if omitted.
// Used to name the EC2 instance and other resources.
// The resulting name will be "basti-instance-my-bastion"
bastiId: 'my-bastion',
});
Use BastiAccessSecurityGroup
construct to create a security group for your target. This security group will allow the Basti instance to connect to the target.
// Create a security group for your target
const bastiAccessSecurityGroup = new BastiAccessSecurityGroup(
stack,
'BastiAccessSecurityGroup',
{
vpc,
// Optional. Randomly generated if omitted.
// Used to name the security group and other resources.
// The resulting name will be "basti-access-my-target"
bastiId: 'my-target',
}
);
// Create the target
const rdsInstance = new aws_rds.DatabaseInstance(stack, 'RdsInstance', {
// Unrelated properties are omitted for brevity
vpc,
port: 5432,
securityGroups: [bastiAccessSecurityGroup],
});
// Allow the Basti instance to connect to the target on the specified port
bastiAccessSecurityGroup.allowBastiInstanceConnection(
bastiInstance,
aws_ec2.Port.tcp(rdsInstance.instanceEndpoint.port)
);
When the stack is deployed, you can use Basti CLI to connect to your target.
basti connect
When sharing a Basti instance across stacks, you can just pass it as a property to the other stack. In case you need to import a Basti instance created in a separate CDK app or not managed by CDK at all, you can use the BastiInstance.fromBastiId
method. The method returns an IBastiInstance
object which is sufficient for granting access to a connection target.
// Most likely, the VPC was created separately as well
const vpc = aws_ec2.Vpc.fromLookup(stack, 'Vpc', {
vpcName: 'existing-vpc-id',
});
const bastiInstance = BastiInstance.fromBastiId(
this,
'BastiInstance',
// The BastiID of the Basti instance you want to import
'existing-basti-id',
vpc
);
// bastiInstance can now be used to allow access to a connection target
bastiAccessSecurityGroup.allowBastiInstanceConnection(
bastiInstance,
aws_ec2.Port.tcp(1717)
);
You can grant the ability to connect to a Basti instance to other resources (users, roles, etc.) using the grantBastiCliConnect
method of an existing Basti instance.
const bastiInstance = new BastiInstance(/*...*/);
const grantee = new aws_iam.Role(/*...*/);
bastiInstance.grantBastiCliConnect(grantee);
Usage is provided under the MIT License. See LICENSE for the full details.
FAQs
Cost-efficient bastion host with a CLI tool for convenient access to your AWS resources
The npm package basti-cdk receives a total of 1,229 weekly downloads. As such, basti-cdk popularity was classified as popular.
We found that basti-cdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.