Conceptos generales de seguridad
Por qu茅 Ciberseguridad para Desarrollo Web
No estamos seguros
Autorizaci贸n Autenticaci贸n y Accountability : AAA
Funciona en mi local
Empecemos por la l贸gica
SQL Injection
De local a producci贸n
Introducci贸n a DevSecOps
DevSecOps como cultura
Creando pipelines
Corriendo nuestras pruebas
Listas de control de privilegios
Seguridad en la arquitectura
Dise帽ando la arquitectura
Infraestructura como c贸digo
Creando la infraestructura
Creando roles y policies
Desplegando funciones lambda
El mundo de la Base de Datos
Conectando lambdas a una VPC
Single point of failure
Evitando vulnerabilidades en el c贸digo
Configurando Auth0
Creando un lambda Authorizer
Secretos y API Keys
Creando Endpoints
Evitando Cross Site Scripting o XSS
Validando la integridad de los datos con tokens
Controles de seguridad sobre datos
Conociendo la naturaleza de los datos
Protege tus datos con Key Management Services
Monitoring y alertas
Sistema de logs
Observabilidad
Alertas y Postmortems
CORS y cierre
Errores de CORS
You don't have access to this class
Keep learning! Join and start boosting your career
Setting up a database on AWS is not just a matter of following a mechanical procedure. It requires an understanding of how cloud resources are organized and protected, particularly when employing VPCs (Virtual Private Clouds) to maintain the security and isolation of your data. In this guide, you will learn how to connect your database within an AWS VPC, configuring a custom security group to control access, and finally, creating and managing the PostgreSQL database in AWS using RDS.
A VPC, or Virtual Private Cloud, is an isolated network that lives within the AWS infrastructure. Resources within a VPC are protected from public access unless otherwise configured. To get started:
Log in to the AWS console: search for the VPC service and select the default VPC offered by AWS. Examine its settings, especially the access control lists, subnets, and routing tables.
Configure a secure VPC: Make sure that all resources that should communicate within the system, for example, a database and Lambda functions, are configured within the same VPC, creating an isolated and secure environment.
A Security Group is crucial for managing who and what can access your resources within the VPC. To set up a Security Group for your database, follow these steps:
Head to the EC2 dashboard: Here you will find the Security Groups section.
Create a new security group: Assign a name and description. Example:
Database Sec Group
Hello Traffic into the Database
Define the inbound rules: Allow only traffic from your local machine. For example, for PostgreSQL, enable port 5432 for your IP address only.
Incoming Traffic:- Type: PostgreSQL- Port: 5432- Source: Your IP address with mask /32
Generate the security group: After configuring the inbound rules, save the configuration.
AWS RDS is a service that facilitates the creation and management of databases. To create a PostgreSQL database:
Access the RDS console: Choose DB Instances
and click Create Database
.
Choose the Standard Create
: option for further customization. Select PostgreSQL
as the database engine.
Define the basic settings: Set a database name and primary user. For security, enable credential management through Secrets Manager
.
Configure connectivity and networking: Use the default VPC and specify that it is publicly accessible, ensuring that traffic only comes from your IP using the previously configured Security Group.
Encrypt traffic with SSL certificates: Activate and review additional configurations such as performance insights
or backups
, as needed.
Create the database: Your PostgreSQL database will be ready in a few minutes.
Once your database is ready, you can manage it with tools like pgAdmin:
Connect using pgAdmin: Go to Register
, select Server
, and fill in the connection details with the hostname, port, and credentials saved in Secrets
.
Create a table in your database: Use the Query Tool
to write and execute SQL commands, for example, to create a Commits
table.
CREATE TABLE Commits ( id SERIAL PRIMARY KEY, repo_name VARCHAR(100), commit_id VARCHAR(40), commit_message TEXT);
Setting up a database within a VPC on AWS ensures security and control over your resources. By using Security Groups and database management tools, you can customize access and manage your data efficiently. Don't forget to explore more about AWS RDS to further optimize your data infrastructures!
Contributions 3
Questions 0
Want to see more contributions, questions and answers from the community?