Skip to main content

Projeto módulo de criação de regras do WAF usando CDK e Python!

Sobre • Funcionalidades • Como usar o módulo nos projetos • Gerando uma nova versão do módulo • Tecnologias •

💻 Sobre o projeto

Projeto módulo de criação de regras do WAF usando CDK e Python


⚙️ Funcionalidades

Esse é o módulo que cria os seguintes itens na AWS:

  • IPSet
  • WebACL

E as seguintes regras:

  • GlobalIpRateLimit
  • BlockApiOutsideAccess

🚀 Como usar o módulo nos projetos

Baixe a dependencia (módulo):

$ poetry shell
$ poetry add asaas-waf-module

Instale ou atualize as dependencias:

$ poetry install && poetry update

📦 Criando um novo IP Set com uma lista de IP's

No arquivo app.py inclua as informações conforme o exemplo abaixo:

from asaas_waf_module.asaas_waf_module_stack import WafConstructStack

waf_stack = WafConstructStack(
    app,
    '<Nome_Recurso>WafConstructStack',
    aws_profile="sandbox",
    rate_limit=1000,
    is_allowed_asaas_ips=False,
    addresses=[
        "IP/32",
        "IP-01/32",
        "IP-NN/32",
    ],
    search_string_block_outside_access=["/api", "/srv"],
    env=cdk.Environment(
            account='276456543520',
            region='us-east-1'
        ),
)

📦 Usando o IP Set já existente

No arquivo app.py inclua as informações conforme o exemplo abaixo:

from asaas_waf_module.asaas_waf_module_stack import WafConstructStack

waf_stack = WafConstructStack(
    app,
    '<Nome_Recurso>WafConstructStack',
    aws_profile="sandbox",
    rate_limit=1000,
    is_allowed_asaas_ips=True,
    search_string_block_outside_access=["/api", "/srv"],
    ip_set_id="<ID_IPSET>",
    env=cdk.Environment(
            account='276456543520',
            region='us-east-1'
        ),
)

🎲 Gerando uma nova versão do módulo ou criando um novo

Adicione o CloudRepo para poder exportar o módulo e atualizar:

$ poetry source add --priority=supplemental asaas-cdk-modules https://asaas.mycloudrepo.io/repositories/asaas-cdk-modules
$ poetry config http-basic.asaas-cdk-modules devops@asaas.com.br <senha>
$ poetry add --source asaas-cdk-modules private-package

Realize as devidas alterações ou correções e depois para atualizar o módulo faça:

No arquivo setup.py altere a versão do módulo na linha:

version='0.1.0',

Depois execute os comandos para atualizar o módulo:

$ poetry publish --build --repository asaas-cdk-modules

🛠 Tecnologias

As seguintes ferramentas foram usadas na construção do projeto:

Metadata

Release files for asaas-cdk-constructs 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asaas-cdk-constructs 0.1.0
File Size Uploaded Provenance
asaas_cdk_constructs-0.1.0.tar.gz 3.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for asaas-cdk-constructs 0.1.0
File Interpreter ABI Platform
asaas_cdk_constructs-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / asaas_cdk_constructs-0.1.0.tar.gz

Download URL asaas_cdk_constructs-0.1.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ffffacd1ef9ad0a1477078438d76d40acdafa0d182b738b13bd762c0b3a8d127
BLAKE2b-256 checksum
How to use checksums
e8b840a301e1085a54ac4a97c95fda892492cef1ea3dcb7533e44c11cc904cc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.12 Linux/6.2.0-37-generic

Release files / asaas_cdk_constructs-0.1.0-py3-none-any.whl

Download URL asaas_cdk_constructs-0.1.0-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a7aa0098f340f32e9d3f66562f4caeb73b3ab6d0b49748f0d573eb6079fc406
BLAKE2b-256 checksum
How to use checksums
5151f5b78147820ed809da8ec2b70387b24b276b3ab30ca7bf4f9fb8059f9549
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.12 Linux/6.2.0-37-generic

Security for asaas-cdk-constructs 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page