Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit 321b15b

Browse files
committed
feat: release v1.1.0 - add support for lambda
1 parent c01f716 commit 321b15b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+4179
-8149
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Dynamic Object and Rule Extensions for AWS Network Firewall Solution Release Changelog
22

3+
## [1.1.0] - 2022-05-12
4+
### Added
5+
- Support for lambda reference
6+
37
## [1.0.0] - 2022-01-20
48
### Added
59
- All files, initial version

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The solution provides a RESTful interface with CRUD APIs for managing rule bundl
1919
*Request Orchestration*
2020

2121

22-
1. The API gateway provides the primary interface for the customer to interact with this solution, including endpoints to manage the domain entities include Rule/Object/RuleBundle, as well as list Audit info. Please refer to [implementation guide](https://docs.aws.amazon.com/solutions/latest/dynamic-object-and-rule-extensions-for-aws-network-firewall/welcome.html) for information on updating the Data.
22+
1. The API gateway provides the primary interface for the customer to interact with this solution, including endpoints to manage the domain entities include Rule/Object/RuleBundle, as well as list Audit info. Please refer to implementation guide Appendix C: API schema and sample requests for information on updating the Metadata.
2323
2. Request is forwarded to the Lambda function which coordinates the handling of the request.
2424
3. *Optional* - based on configuration value enableOpa. When enableOpa=ture, Lambda triggers ECS-hosted OPA cluster to exercise validation on the request based on context, e.g, is the requester allowed to perform the Create Object action?
2525
4. Lambda issues request data from DynamoDB to read from or write to domain entity tables
@@ -91,6 +91,21 @@ Upon successfully cloning the repository into your local development environment
9191
* cli tools zip tar gzip
9292

9393

94+
## Configuration
95+
| Configuration | Description | Default value| Value type|
96+
| ----------- | ----------- | ----------- | ----------- |
97+
| networkFirewallRuleGroupNamePattern | Allowed Network Firewall rule group pattern |default-anfwconfig-rule-*| string |
98+
| defaultAggregatorName | AWS Config aggregator name used by this solution, when creating a new rule group. If no aggregator is provided, defaultAggregator will be assigned to the rule group | org-replicator | string |
99+
|ruleResolutionInterval| The interval rules are resolved and applied into Network Firewall |10 mins | integer, min value 5, max value 60|
100+
| failureNotificationTargetEmails| The email addresses for sending notifications. Once rule resolution failure happens, customer can add their email to the SNS topic manually later on | [] | list of strings
101+
| apiGatewayType | The type of API gateway |private | edge \| private
102+
| enableOpa* | (OPA specific configuration) Enable OPA cluster to validate rule and object mutation requests | false | true \| false
103+
|certificateArn*| (OPA specific configuration) ACM certification for the ALB used when enableOpa is set to true |
104+
|crossAccountConfigReadOnlyRole**| AWS IAM read-only role in the account in which the AWS config is activated |NULL, target at solution installation account| string
105+
|crossAccountNetworkFirewallReadWriteRole**| AWS IAM read/write role account in which the AWS network firewall instance is setup| NULL, target at solution installation account | string|
106+
|objectExtensionSecOpsAdminRole**| Customer specified AWS IAM role in solution account which to be used to access solution API| arn:aws:iam::<solution-account>:role/ObjectExtensionSecOpsAdminRole-<solution-region> | ARN|
107+
108+
94109
## Running Unit Tests
95110

96111
The `/source/run-all-tests.sh` script is the centralized script for running all unit, integration, and snapshot tests for both the CDK project as well as any associated Lambda functions or other source code packages.
@@ -103,6 +118,15 @@ chmod +x ./run-unit-tests.sh
103118

104119
***
105120

121+
## API schema and examples
122+
### API schema document
123+
1. generate api doc `cd source; npm run doc:firewall-config-api`
124+
2. the api document is located in [source/lambda/firewall-config-api/doc/index.html](source/lambda/firewall-config-api/doc/index.html)
125+
126+
### API usage example
127+
see more in [API-Usage-example.md](source/doc/API-Usage-example.md)
128+
129+
106130
## Building and Deploy the solution
107131
1. Clone the solution source code from its GitHub repository.
108132
2. Open the terminal and navigate to the folder created in step 1.
@@ -137,7 +161,7 @@ Notice for data retention and audit purpose the following 2 types of resource wi
137161

138162

139163
## Collection of operational metrics
140-
This solution collects anonymous operational metrics to help AWS improve the quality and features of the solution. For more information, including how to disable this capability, please see the [implementation guide](https://docs.aws.amazon.com/solutions/latest/dynamic-object-and-rule-extensions-for-aws-network-firewall/collection-of-operational-metrics.html).
164+
This solution collects anonymous operational metrics to help AWS improve the quality and features of the solution. For more information, including how to disable this capability, please see the [implementation guide](deep link into the documentation with specific information about the metrics and how to opt-out).
141165

142166
***
143167

source/.versionrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@
3939
{
4040
"filename": "lambda/shared-types/package-lock.json",
4141
"type": "json"
42+
},
43+
{
44+
"filename": "lambda/operational-metrics-collector/package.json",
45+
"type": "json"
46+
},
47+
{
48+
"filename": "lambda/operational-metrics-collector/package-lock.json",
49+
"type": "json"
4250
}
4351
],
4452
"types": [

source/bin/cdk-solution.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,38 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
*/
17-
import "source-map-support/register";
18-
import * as cdk from "@aws-cdk/core";
19-
import { FirewallObjectExtensionSolutionStack } from "../lib/cdk-solution-stack";
17+
import 'source-map-support/register';
18+
import * as cdk from '@aws-cdk/core';
19+
import { FirewallObjectExtensionSolutionStack } from '../lib/cdk-solution-stack';
2020

2121
const app = new cdk.App();
22-
const SOLUTION_ID = process.env["SOLUTION_ID"]
23-
? process.env["SOLUTION_ID"]
24-
: "SO0196";
25-
const VERSION = process.env["VERSION"] ? process.env["VERSION"] : "v1.0.0";
22+
const SOLUTION_ID = process.env['SOLUTION_ID']
23+
? process.env['SOLUTION_ID']
24+
: 'SO0196';
25+
const VERSION = process.env['VERSION'] ? process.env['VERSION'] : 'v1.1.0';
2626

2727
const solutionProperty = {
28-
description: `(${SOLUTION_ID}) - The AWS CDK template for deployment of the Dynamic Object and Rule Extensions for AWS Network Firewall solution, version: (Version ${VERSION})`,
29-
solutionId: SOLUTION_ID,
30-
version: VERSION,
28+
description: `(${SOLUTION_ID}) - The AWS CDK template for deployment of the Dynamic Object and Rule Extensions for AWS Network Firewall solution, version: (Version ${VERSION})`,
29+
solutionId: SOLUTION_ID,
30+
version: VERSION,
3131
};
3232

33-
if (app.node.tryGetContext("account") && app.node.tryGetContext("region")) {
34-
new FirewallObjectExtensionSolutionStack(
35-
app,
36-
"FirewallObjectExtensionSolutionStack",
37-
{
38-
...solutionProperty,
39-
env: {
40-
account: app.node.tryGetContext("account"),
41-
region: app.node.tryGetContext("region"),
42-
},
43-
}
44-
);
33+
if (app.node.tryGetContext('account') && app.node.tryGetContext('region')) {
34+
new FirewallObjectExtensionSolutionStack(
35+
app,
36+
'FirewallObjectExtensionSolutionStack',
37+
{
38+
...solutionProperty,
39+
env: {
40+
account: app.node.tryGetContext('account'),
41+
region: app.node.tryGetContext('region'),
42+
},
43+
}
44+
);
4545
} else {
46-
new FirewallObjectExtensionSolutionStack(
47-
app,
48-
"FirewallObjectExtensionSolutionStack",
49-
{ ...solutionProperty }
50-
);
46+
new FirewallObjectExtensionSolutionStack(
47+
app,
48+
'FirewallObjectExtensionSolutionStack',
49+
{ ...solutionProperty }
50+
);
5151
}

source/doc/API-Usage-example.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Before you begin
2+
ensure that:
3+
4+
You are using Postman version 9.xx.x or higher, and
5+
You can access the API gateway endpoint from your host (running Postman)
6+
7+
8+
# Load collection to postman
9+
1. Using Postman, navigate to Import -> Select file and select `NetworkFirewallObjectExtension-API.postman_collection.json` from /source/doc.
10+
2. Setup environment variables
11+
To set up the environment variables, from the left hand panel, navigate to Environments -> Create Environment, and add the following variables:
12+
13+
| Variable name| Description |
14+
| ----------- | ----------- |
15+
| ff-rest-api | API gateway ID for this solution |
16+
| access_key | AccessKeyId |
17+
| secret_key | SecretAccessKey |
18+
| session_token | SessionToken |
19+
20+
For example, the default role to access this solution's API gate, assuming it is in ap-southeast-2, is arn:aws:iam::<region>:role/ObjectExtensionSecOpsAdminRole-ap-southeast-2.
21+
22+
To return the new credential values, run the following command (assuming your current credentials have the assume-role access).
23+
```
24+
aws sts assume-role --role-arn arn:aws:iam::<region>:role/ObjectExtensionSecOpsAdminRole-ap-southeast-2 --role-session-name IntegrationTestAdminSession --duration-second 3600
25+
```
26+
(assume your current credential have the assume role access) will return the new credential values.
27+
28+
For more information about API schema please refer to [API schema and example](source/README.md)

0 commit comments

Comments
 (0)