-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support egress and inspection rule types (#4)
**Issue #, if available:** ## Description of changes: `Egress` and `Inspection` traffic can be routed differently. For this reason, the ability to define the type of traffic has been added. **Checklist** <!--- Leave unchecked if your change doesn't seem to apply --> * [x] Update tests * [x] Update docs * [x] PR title follows [conventional commit semantics](https://www.conventionalcommits.org/en/v1.0.0-beta.2/#commit-message-for-a-fix-using-an-optional-issue-number) By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
- Loading branch information
Showing
11 changed files
with
190 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import click | ||
import jsonschema2md | ||
|
||
from aws_network_firewall.schemas import EnvironmentSchema | ||
|
||
|
||
@click.command() | ||
def cli() -> None: | ||
parser = jsonschema2md.Parser( | ||
examples_as_yaml=True, | ||
show_examples="all", | ||
) | ||
md_lines = parser.parse_schema(EnvironmentSchema) | ||
|
||
with open("./docs/content/schema.md", "w") as fh: | ||
fh.writelines(md_lines) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# JSON Schema | ||
|
||
*Schema for defining an environment* | ||
|
||
## Properties | ||
|
||
- **`AccountId`** *(string)* | ||
- **`Name`** *(string)* | ||
- **`CidrRanges`** *(object)*: Cannot contain additional properties. | ||
- **`ap-northeast-1`** *(string)* | ||
- **`ap-southeast-1`** *(string)* | ||
- **`eu-central-1`** *(string)* | ||
- **`eu-west-1`** *(string)* | ||
- **`sa-east-1`** *(string)* | ||
- **`ca-central-1`** *(string)* | ||
- **`us-east-1`** *(string)* | ||
- **`us-east-2`** *(string)* | ||
- **`Rules`** *(array)* | ||
- **Items**: Refer to *[#/definitions/Rule](#definitions/Rule)*. | ||
|
||
Examples: | ||
```yaml | ||
Description: Allow traffic to reach the outbound destinations | ||
Destinations: | ||
- $ref: '#/definitions/Destination' | ||
Name: Outbound Connectivity | ||
Sources: | ||
- $ref: '#/definitions/Source' | ||
Type: Egress | ||
``` | ||
## Definitions | ||
- <a id="definitions/Rule"></a>**`Rule`** *(object)*: Cannot contain additional properties. | ||
- **`Name`** *(string, required)* | ||
- **`Type`**: Must be one of: `["Egress", "Inspection"]`. | ||
- **`Description`** *(string, required)* | ||
- **`Sources`** *(array, required)* | ||
- **Items**: Refer to *[#/definitions/Source](#definitions/Source)*. | ||
- **`Destinations`** *(array, required)* | ||
- **Items**: Refer to *[#/definitions/Destination](#definitions/Destination)*. | ||
- <a id="definitions/Source"></a>**`Source`** *(object)*: Cannot contain additional properties. | ||
- **`Description`** *(string, required)* | ||
- **`Cidr`** *(string)* | ||
- **`Region`** *(string)* | ||
|
||
Examples: | ||
```yaml | ||
Cidr: 10.0.0.0/8 | ||
Description: Allow access from `10.0.0.0/8` to the defined destinations. | ||
``` | ||
|
||
```yaml | ||
Description: Allow access from `eu-central-1` to the defined destinations. | ||
Region: eu-central-1 | ||
``` | ||
- <a id="definitions/Destination"></a>**`Destination`** *(object)*: Cannot contain additional properties. | ||
- **Any of** | ||
- | ||
- | ||
- | ||
- **`Description`** *(string, required)* | ||
- **`Endpoint`** *(string)* | ||
- **`Cidr`** *(string)* | ||
- **`Region`** *(string)* | ||
- **`Protocol`**: Must be one of: `["TCP", "TLS", "ICMP"]`. | ||
- **`Port`** *(integer)* | ||
|
||
Examples: | ||
```yaml | ||
Description: Website of Xebia | ||
Endpoint: xebia.com | ||
Port: 443 | ||
Protocol: TLS | ||
Region: eu-central-1 | ||
``` | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters