Giter VIP home page Giter VIP logo

taxi-network-infrastructure's Introduction

Network infrastructure

À propos

Network infrastructure décrit par le code l'infrastructure à provisionner pour les éléments réseaux de Taxi Gestion.

Table des matières

Prérequis

Installation

La commande suivante permet d'utiliser la ligne de commande terraform via Docker :

docker run --rm -it --name terraform -v ~/:/root/ -v $(pwd):/workspace -w /workspace hashicorp/terraform:light

Pour une utilisation simplifiée, il est possible de créer un alias :

alias terraform='docker run --rm -it --name terraform -v ~/:/root/ -v $(pwd):/workspace -w /workspace hashicorp/terraform:light'

Avec cet alias, il n'y a plus de différence entre une commande terraform exécutée avec Docker ou avec Terraform CLI.

Utilisation

Vérifier et corriger la syntaxe des fichiers .tf

terraform fmt

Vérifier la cohérence de l'infrastructure

terraform validate

Récupérer un jeton d'authentification à Terraform Cloud en local

terraform login

Initialiser l'état et les plugins en local

terraform init

Planifier une exécution pour voir les différences avec l'état précédent de l'infrastructure

terraform plan

Contribution

Appliquer la mise à jour de l'infrastructure

Pour que les modifications de la description de l'infrastructure soient appliquées en production, il suffit de publier les changements sur la branche main.

Construit avec

Langages & Frameworks

  • Terraform est un outil de description d'infrastructure par le code qui permet de créer et de maintenir une infrastructure de manière sûre et prévisible

Outils

CI

  • Github Actions est l'outil d'intégration et de déploiement continu intégré à GitHub
  • Secrets du dépôt :
    • TF_API_TOKEN : Le token d'api Terraform Cloud qui permet à la CI d'opérer des actions sur Terraform Cloud

Déploiement

  • AWS est la plateforme de services Cloud proposée par Amazon.
    • Utilisateur : taxi-aymeric.network.infrastructure
    • Groupe : network.deployer
  • Terraform Cloud est la plateforme proposée par HashiCorp pour administrer les modifications d'infrastructure
    • Organisation : taxi-gestion
    • Workspaces : network-*
    • Variables
      • AWS_SECRET_ACCESS_KEY
        • Value : Sensitive - write only
        • Category : env
      • AWS_ACCESS_KEY_ID
        • Value : Sensitive - write only
        • Category : env

Licence

Voir le fichier LICENSE.md du dépôt.

taxi-network-infrastructure's People

Contributors

romain-cambonie avatar marc-gavanier avatar

Watchers

 avatar

taxi-network-infrastructure's Issues

Restrict Application Load Balancer to api gateway

Problem : the application load balancer endpoint is still accessible (and not protected) from the public internet.

Probable Solution : change alb to internal and target it directly with the api gateway

Probable Steps :

  • Change the Load Balancer type to 'internal'

  • Create a VPC Link

resource "aws_apigatewayv2_vpc_link" "example" {
  name               = "example"
  security_group_ids = [data.aws_security_group.example.id]
  subnet_ids         = data.aws_subnet_ids.example.ids

  tags = {
    Usage = "example"
  }
}
  • Target the VPC link with API gateway
resource "aws_api_gateway_route" "example" {
  api_id = aws_api_gateway_rest_api.example.id
  route_key = "GET /example"
  target = "internal.example.com"
  target_type = "ip"
  vpc_link_id = aws_api_gateway_vpc_link.example.id
}
  • Update the Security Group for the LB
resource "aws_security_group_rule" "example" {
  type = "ingress"
  from_port = 80
  to_port = 80
  protocol = "tcp"
  security_group_id = "sg-0123456789abcdef0"
  source_security_group_id = aws_api_gateway_vpc_link.example.security_group_ids[0]
}

Add missing Content Security Policy and Permission Policy on Cloudfront api origin

Image

On utilise actuellement "CORS-with-preflight-and-SecurityHeadersPolicy" :
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-response-headers-policies.html#managed-response-headers-policies-security

Il faudra crée une resource : https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_response_headers_policy

qui reprends l'existant et ajoute CSP et PP.

On a déja un exemple partiel avec la policy pour l'origins S3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.