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

Print authentication error stack-trace in INFO level #2070

Merged
merged 1 commit into from
Mar 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
[cyberark/conjur#2052](https://github.com/cyberark/conjur/issues/2052)
- When a user checks permissions of a non-existing role or a non-existing resource, Conjur now audits a failure message.
[cyberark/conjur#2059](https://github.com/cyberark/conjur/issues/2059)
- Print login and authentication error stack trace to the log in INFO level.
[cyberark/conjur#2080](https://github.com/cyberark/conjur/issues/2080)

### Changed
- The secrets batch retrieval endpoint now refers to the `Accept-Encoding` header rather than `Accept` to determine the response encoding
Expand Down
7 changes: 6 additions & 1 deletion app/controllers/authenticate_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ def handle_authentication_error(err)

def log_backtrace(err)
err.backtrace.each do |line|
logger.debug(line)
# We want to print a minimal stack trace in INFO level so that it is easier
# to understand the issue. To do this, we filter the trace output to only
# Conjur application code, and not code from the Gem dependencies.
# We still want to print the full stack trace (including the Gem dependencies
# code) so we print it in DEBUG level.
line.include?(ENV['GEM_HOME']) ? logger.debug(line) : logger.info(line)
end
end

Expand Down