Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for .NET8 container-based web apps #792

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

philasmar
Copy link
Contributor

Issue #, if available:
DOTNET-7201

Description of changes:

  • Updat dockerfile template with the changes required for .NET8 as well as allow dockerfile templates to conditionally generate the template based on the project target framework.
  • Add new a option setting to ECS Fargate deployments that exposes the load balancer port.
  • Added a new warning for users that are deploying to port different than the one used in the container. I am using docker inspect to access the environment variables in the container after we build it.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

// ProjectDefinitionParser will have transformed projectDirectory to an absolute path,
// and DockerFileName is static so traversal should not be possible here.
// nosemgrep: csharp.lang.security.filesystem.unsafe-path-combine.unsafe-path-combine
File.WriteAllText(Path.Combine(projectDirectory, DockerFileName), dockerFile);
File.WriteAllText(Path.Combine(projectDirectory, Constants.Docker.DefaultDockerfileName), dockerFile);

Check warning

Code scanning / Semgrep

String argument projectDirectory is used to read or write data from a file via Path.Combine without direct sanitization via Path.GetFileName. If the path is user-supplied data this can lead to path traversal. Warning

String argument projectDirectory is used to read or write data from a file via Path.Combine without direct sanitization via Path.GetFileName. If the path is user-supplied data this can lead to path traversal.
@philasmar philasmar force-pushed the asmarp/net8-containers branch 3 times, most recently from d946e35 to c418ac6 Compare October 11, 2023 15:39
@philasmar philasmar requested a review from normj October 11, 2023 15:44
@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

All modified lines are covered by tests ✅

❗ No coverage uploaded for pull request base (feature/net8@da421b7). Click here to learn what that means.

Additional details and impacted files
@@               Coverage Diff               @@
##             feature/net8     #792   +/-   ##
===============================================
  Coverage                ?   61.46%           
===============================================
  Files                   ?      277           
  Lines                   ?    10659           
  Branches                ?     1484           
===============================================
  Hits                    ?     6552           
  Misses                  ?     3566           
  Partials                ?      541           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@philasmar philasmar force-pushed the asmarp/net8-containers branch 2 times, most recently from 61a32e6 to abbbae4 Compare October 12, 2023 15:59
@philasmar philasmar requested review from normj and ashovlin October 12, 2023 16:05
@philasmar philasmar force-pushed the asmarp/net8-containers branch from abbbae4 to 95618f9 Compare October 12, 2023 17:38
@philasmar philasmar force-pushed the asmarp/net8-containers branch from 95618f9 to 70d08b4 Compare October 16, 2023 00:40
@philasmar philasmar merged commit 8c4a700 into feature/net8 Oct 16, 2023
10 checks passed
@philasmar philasmar deleted the asmarp/net8-containers branch October 16, 2023 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants