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

Secure error page without authentication? #176

Open
msamwill opened this issue Aug 12, 2023 · 1 comment
Open

Secure error page without authentication? #176

msamwill opened this issue Aug 12, 2023 · 1 comment

Comments

@msamwill
Copy link

Is it possible to prevent remote access to the error list page without adding authentication to the application? Will write logs to database and view them there or access the error page locally instead.

@tiesont
Copy link

tiesont commented Nov 11, 2023

I assume you've figured this out already, but yes:

options.CheckPermissionAction = context => false;

will reject all attempts to access the error pages. As a more complete example, for the XmlFileErrorLog logger, omitting whatever else you normally configure:

services.AddElmah<XmlFileErrorLog>(options => {
    options.CheckPermissionAction = context => false;
});

Note that this rejects everything - if you still want to access the logs locally, you'd need to add some sort of "is local" or "is development" switch, but how that's done is more or less unique to your configuration.

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

No branches or pull requests

2 participants