A library of CDK aspects applying to security groups.
Project description
cdk-aspects-library-security-group
A CDK library containing EC2 security group related CDK Aspects and the ability to define custom aspects.
Features
-
Utilize built in aspects for common cases:
- Disallow public access to any port
- Disallow public access to AWS Restricted Common ports (per the AWS Config rule)
- Disallow public access to SSH or RDP per CIS Benchmark guidelines and general good practice
- Disallow public or ALL access to common management ports like SSH, RDP, WinRM, WinRM over HTTPS
- Disallow public or ALL access common relational DB ports like MSSQL, MySQL, PostgreSQL, and Oracle
- Disallow public or ALL common web ports like HTTP (80, 8080) and HTTPS (443, 8443)
-
Create any other aspect using the base security group aspect class.
-
By default aspects generate errors in the CDK metadata which the deployment or synth process will find, but this can be changed with the
annotationType
property -
All default provided aspects restrict based on the public access CIDRs (
0.0.0.0/0
and::/0
) but you can also defined aspects with any set of restricted CIDRs or security group IDs you like
API Doc
See API
Examples
Typescript
// Add an existing aspect to your stack
Aspects.of(stack).add(new NoPublicIngressAspect());
// Add a custom aspect to your stack
Aspects.of(stack).add(new SecurityGroupAspectBase({
annotationText: 'This is a custom message warning you how you should not do what you are doing.',
annotationType: AnnotationType.WARNING,
ports: [5985],
restrictedCidrs: ['10.1.0.0/16'],
}));
// Change an existing aspects message and type
Aspects.of(stack).add(new NoPublicIngressAspect(
annotationText: 'This is custom text.',
annotationType: AnnotationType.WARNING
));
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for renovosolutions.aws-cdk-aspects-security-group-2.0.167.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99a675abb8f81a8aafa4e0438505ba8d2852bfe6f4c6a8dee0e02b6cec75b529 |
|
MD5 | 1618bbb07853c183539a94fe86d0d624 |
|
BLAKE2b-256 | 64674d6bfe8b7cd3467066f6f6500b2967c470c5406e29c657525e2c5b32385d |
Close
Hashes for renovosolutions.aws_cdk_aspects_security_group-2.0.167-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 669f3eba9fb1838d5b36852bd3c7cbbded5cde22e3e5169938b8d1887289887c |
|
MD5 | c16b8c13b08f7b16e03e8a4cc4e54833 |
|
BLAKE2b-256 | 72a7981147c58ba440a937a0fdc3558c8ccb3e7c1e0d602206edbfaed39a71ba |