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
The advancement of software development requires not only writing efficient code, but also automating tasks that can optimize the workflow. GitHub Actions is a powerful tool that allows you to set up automatic flows, such as code validation. In this context, I will guide you through the process of making a commit, observing its behavior on GitHub and troubleshooting possible errors.
git add
command to add all the changes made to the files in the repository.git commit -m "Add GitHub Actions Config"
.git push
.When integrating GitHub Actions, it is common to encounter errors in the executed workflows. Suppose you see an error message like "Unable to Resolve Action". Here are some steps to fix it:
Checkout @4
to Checkout v4
.An essential part of any development is to ensure that our code works as expected. For this, unit tests are fundamental. Below, I will explain how to set up a unit test using mocks.
main_test.go
, and create a new test method.created time
using time.Now()
to simulate the exact time of creation.Insert
. Be sure to define what arguments it will receive and what the expected behavior is.assert
to verify that there are no errors and that the expectations of the mock are met.func TestInsert(t *testing.T) { c := new(YourTestingFramework) webhook := &models.Webhook{ Repository: models.Repository{FullName: "example/repo"}, HeadCommit: models.HeadCommit{ ID: "commit123", Message: "This is a commit", Author: models.Author{ Username: "user1", Email: "[email protected]", }, }, }, }
body, err := json.Marshal(webhook) assert.NoError(t, err)
createdTime := time.Now()
mockRepo := new(YourMockRepo) mockRepo.On("Insert", mock.Anything, mock.Anything).Return(nil)
err = InsertGitHubWebhook(context.Background(), mockRepo, webhook, body, createdTime) assert.NoError(t, err) mockRepo.AssertExpectations(t)}
This snippet is just an example, be sure to adapt it to your particular needs.
Finally, to successfully integrate with GitHub Actions and have it run your tests on every commit:
With the proper use of GitHub Actions and automated unit tests, we will not only improve code quality but also optimize our development process by quickly identifying potential bugs or bottlenecks in the workflow. Stay ahead in your learning process!
Contributions 3
Questions 0
Want to see more contributions, questions and answers from the community?