Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(aws-networkfirewall): L2 construct(s) #19209

Closed
2 tasks
Obirah opened this issue Mar 2, 2022 · 1 comment
Closed
2 tasks

(aws-networkfirewall): L2 construct(s) #19209

Obirah opened this issue Mar 2, 2022 · 1 comment
Labels
@aws-cdk/aws-networkfirewall Related to AWS Network Firewall closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/large Large work item – several weeks of effort feature/new-construct A request for a new L2 construct feature-request A feature should be added or improved. p2

Comments

@Obirah
Copy link

Obirah commented Mar 2, 2022

Description

Currently, there only are generated L1 constructs for the relatively new AWS Network Firewall service. The deployment of a network firewall with corresponding routing through several subnets is a bit cumbersome with those constructs and could heavily benefit from sophisticated L2 constructs.

Use Case

The approaches how one can/should deploy a network firewall are structured clear as can be seen in this AWS workshop.

However, with the L1 constructs one has to go "all the way" and implement all the bits and pieces of the architecture. This requires to write boilerplate code in several places. The most annoying one being the retrieval of the network firewall's VPC endpoint IDs.

I solved this problem with an AwsCustomResource looking somewhat like this:

    private createVpcEndpointProvider(): void {
        const describeFirewall: AwsSdkCall = {
            service: 'NetworkFirewall',
            action: 'describeFirewall',
            parameters: {
                'FirewallName': NetworkFirewall.FIREWALL_NAME
            },
            outputPaths: this.stack.vpc.availabilityZones.map(az => NetworkFirewall.vpcEndpointIdResponsePath(az)),
            physicalResourceId: PhysicalResourceId.of(`VpcEndpointIds`)
        };

        this.vpcEndpointIdProvider = new AwsCustomResource(this, `VpcEndpointIdProvider`, {
            onCreate: describeFirewall,
            onUpdate: describeFirewall,
            policy: AwsCustomResourcePolicy.fromSdkCalls({ resources: AwsCustomResourcePolicy.ANY_RESOURCE })
        });

        this.vpcEndpointIdProvider.node.addDependency(this.firewall);
    }

This seems like a recurring use-case that shouldn't require the user to write boilerplate.

Another use-case for L2 constructs would be the decoupling of the firewall policy and rule groups. Currently (to my knowledge) all rule groups must be specified inline in the properties of CfnFirewallPolicy. It would be nice to be able to add more rule groups to an existing firewall policy from other stacks.

Proposed Solution

Implement L2 constructs for the network firewall entities, that...

  • ...make the VPC endpoint IDs directly accessible
  • ...additionally provide the option to automatically deploy parts of the infrastructure that are required to implement the centralized or decentralized models of the network firewall
    • example: creating a NetworkFirewall L2 constructs allows the user to automatically deploy a firewall subnet for each AZ and to automatically create the Firewall policy
  • ...provide APIs to manage firewall policies in a decoupled way
    • example: make the firewall policy importable through something like FirewallPolicy.fromFirewallPolicyArn(...) so that one can add more rule groups to an existing firewall policy from another stack
  • ...provide abstraction for firewall rule groups
    • example: a stateful rule group for domain allow- or deny-lists always looks pretty similar. It would be cool to have something like a DomainAllowList and DomainDenyList class that wraps all the recurring code.

This is just a loose collection of ideas. I'm sure there's more that can be done, so feel free to add more ideas.

Other information

No response

Acknowledge

  • I may be able to implement this feature request
  • This feature might incur a breaking change
@Obirah Obirah added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Mar 2, 2022
@github-actions github-actions bot added the @aws-cdk/aws-networkfirewall Related to AWS Network Firewall label Mar 2, 2022
@skinny85 skinny85 added p2 effort/large Large work item – several weeks of effort feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs feature/new-construct A request for a new L2 construct and removed needs-triage This issue or PR still needs to be triaged. labels May 5, 2022
@skinny85 skinny85 removed their assignment May 5, 2022
@skinny85 skinny85 removed the feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs label May 5, 2022
@github-actions
Copy link

github-actions bot commented May 5, 2023

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-networkfirewall Related to AWS Network Firewall closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/large Large work item – several weeks of effort feature/new-construct A request for a new L2 construct feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

2 participants