compose-x / wordpress-demo

Deploy Wordpress with ECS ComposeX from original docker-compose by Bitnami
Apache License 2.0
0 stars 0 forks source link

Working E2E deployment #2

Open JohnPreston opened 7 months ago

gitguardian[bot] commented 7 months ago

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | | | -------------- | ------------------ | ------------------------------ | ---------------- | --------------- | -------------------- | | [9696068](https://dashboard.gitguardian.com/incidents/9696068?occurrence=125642388) | Triggered | Username Password | 3185b9364eb50162f3375f787ca5acf541757b22 | aws.yml | [View secret](https://github.com/compose-x/wordpress-demo/commit/3185b9364eb50162f3375f787ca5acf541757b22#diff-65be3cca90828b47ef55640c948b1f53b25aaf2fc372127b2e6a0b011eaaadf2R11) |
🛠 Guidelines to remediate hardcoded secrets
1. Understand the implications of revoking this secret by investigating where it is used in your code. 2. Replace and store your secret safely. [Learn here](https://blog.gitguardian.com/secrets-api-management?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) the best practices. 3. Revoke and [rotate this secret](https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/generics/username_password#revoke-the-secret?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). 4. If possible, [rewrite git history](https://blog.gitguardian.com/rewriting-git-history-cheatsheet?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data. To avoid such incidents in the future consider - following these [best practices](https://blog.gitguardian.com/secrets-api-management/?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) for managing and storing secrets including API keys and other credentials - install [secret detection on pre-commit](https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) to catch secret before it leaves your machine and ease remediation.

🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

aanno commented 7 months ago

Hm,

for me

ecs-compose-x up -f docker-compose.yml -f aws.yml -p wordpress-demo

on branch fix/2024-02+-update fails with

2024-03-01 07:55:23 [    INFO] Validating against input schema /stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/specs/compose-spec.json
2024-03-01 07:55:23 [    INFO] volumes.persistent - Mapped to wordpress
2024-03-01 07:55:23 [   ERROR] Failed to retrieve the image digest for public.ecr.aws/bitnami/wordpress:latest: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
2024-03-01 07:55:23 [ WARNING] services.wordpress: Failed to interpolate Docker image tag with digest
2024-03-01 07:55:23 [    INFO] services.wordpress - No Launch Type defined. Using default: FARGATE
2024-03-01 07:55:24 [    INFO] Service families to process ['wordpress']
Loaded x-acm acm acm /stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/acm
Loaded x-elbv2 elbv2 elbv2 /stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/elbv2
Loaded x-rds rds rds /stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/rds
Loaded x-route53 route53 route53 /stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/route53
Loaded x-s3 s3 s3 /stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/s3
Loaded x-sns sns sns /stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/sns
Loaded x-efs efs efs /stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/efs
2024-03-01 07:55:24 [    INFO] x-elbv2.wordpress-lb - Adding target wordpress:wordpress
2024-03-01 07:55:24 [    INFO] LB wordpress-lb only has a unique service. LB will be deployed with the service stack.
/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/compose/x_resources/services_resources.py:216: DeprecationWarning: Services list will be deprecated in the next version. Use Services objects instead.
  warn(
2024-03-01 07:55:24 [    INFO] Processing x-acm
2024-03-01 07:55:24 [    INFO] x-acm.wordpress-demo - Lookup via Tags
Traceback (most recent call last):
  File "/stratis/home/tpasch/dev/venv/composex/bin/ecs-compose-x", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/cli.py", line 206, in main
    root_stack = generate_full_template(settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/ecs_composex.py", line 256, in generate_full_template
    add_x_resources(settings)
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/ecs_composex.py", line 180, in add_x_resources
    x_stack = module.stack_class(
              ^^^^^^^^^^^^^^^^^^^
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/acm/acm_stack.py", line 166, in __init__
    resolve_lookup(module.lookup_resources, settings, module)
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/acm/acm_stack_helpers.py", line 62, in resolve_lookup
    resource.lookup_resource(
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/compose/x_resources/__init__.py", line 269, in lookup_resource
    self.arn = find_aws_resource_arn_from_tags_api(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/common/aws.py", line 233, in find_aws_resource_arn_from_tags_api
    return handle_search_results(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/common/aws.py", line 172, in handle_search_results
    raise LookupError(
LookupError: ('No resources were found with the provided tags and information', None, 'acm:certificate')
JohnPreston commented 7 months ago

@aanno yes, that's to be expected. But probably then should have shouted it out in the README.

This presumes that you have a route53 hosted zone and a certificate in your AWS account ready to go to use to have HTTPs working properly.

If you do, there is the environment variable DOMAIN_NAME that you can change to your domain. But equally line 34 you should make sure to adapt the Tags to use to find an existing ACM certificate.

Do you reckon for the demo I should just scrap TLS? Or have one file that does the demo no TLS and the other one with? :thinking:

EDIT: going one step farther, should I remove the DNS for the domain altogether and assume the user doesn't have a functional zone yet?

aanno commented 7 months ago

Ah, I see. Some words in the README would make things more clear. And perhaps is possible to serve on http/80 only if no DOMAIN_NAME is given?!?

JohnPreston commented 7 months ago

Ah, I see. Some words in the README would make things more clear. And perhaps is possible to serve on http/80 only if no DOMAIN_NAME is given?!?

Sounds like a plan. Will do that.