Skip to content

Add C# and ASP.NET Core - #16

Merged
oritromax merged 1 commit into
mainfrom
add-csharp-aspnet
Aug 22, 2026
Merged

oritromax merged 1 commit into
mainfrom
add-csharp-aspnet

Conversation

@oritromax

Copy link
Copy Markdown
Owner

Tier 1, item 4. universal → csharp → web → csharp.aspnet-core, 19 composed.

C# (4)

Release build rather than debug, package versions that cannot move between
restores, framework and SDK pinned, vulnerable packages reviewed including
transitive.

ASP.NET Core (7)

Three critical, and all three are about what the framework does when nobody
told it otherwise:

  • environment-is-production — the environment name decides which config
    wins and whether the developer exception page is served. Unset or left as
    Development means stack traces and source lines returned to anyone who can
    make it throw.
  • developer-exception-page-guarded — commonly called unconditionally
    instead of inside an environment check, which produces that outcome
    deliberately.
  • no-secrets-in-appsettings — a connection string with a password is
    committed, published in build output, and copied into every image layer. The
    most common way a database credential leaves a dotnet repo.

Then data protection keys persisted (default keys live in the container
filesystem, so a restart signs out every user and two instances cannot read each
other's cookies), the generated API browser kept private, detailed errors off,
forwarded headers handled behind a proxy.

Verification

All eleven commands run against a throwaway project carrying every mistake — a
Version="4.*", ASPNETCORE_ENVIRONMENT=Development, an unguarded
UseDeveloperExceptionPage(), a Password= in appsettings.json,
"DetailedErrors": true, UseSwagger() with no guard, and no data protection
or forwarded headers config at all. Each surfaced its target, including the two
that had to correctly report nothing configured.

The -B3 context on the exception-page and Swagger checks is deliberate: it
shows the agent whether an environment guard sits above the call, which is the
entire question.

learn.microsoft.com added to the allowlist; --check-links passes.

C# carries four checks that hold for any dotnet deployment: a release build
rather than a debug one, package versions that cannot move between restores,
a pinned framework and SDK, and vulnerable packages reviewed including
transitive ones.

ASP.NET Core carries seven, three of them critical, and all three are about
what the framework does when nobody told it otherwise. The environment name
decides whether the developer exception page is served, so an unset or
Development value means full stack traces and source lines are returned to
anyone who can make the application throw. The exception page itself is often
called unconditionally rather than inside an environment check, which produces
the same result on purpose. And a connection string with a password in a
settings file is committed, published in the build output and copied into every
image layer, which is the most common way a database credential leaves a dotnet
repository.

The rest: data protection keys persisted so a restart does not sign out every
user, the generated API browser kept off the public internet, detailed errors
off, and forwarded headers handled behind a proxy.

All eleven commands were run against a throwaway project carrying each mistake
and each surfaced it. learn.microsoft.com added to the reference allowlist;
every reference resolves.
@oritromax
oritromax merged commit 2daca39 into main Aug 22, 2026
1 check passed
@oritromax
oritromax deleted the add-csharp-aspnet branch August 22, 2026 14:29
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.

1 participant