Skip to content

guide security quick S7 Basic Error Handling

Santos Jiménez edited this page Oct 25, 2019 · 2 revisions
Table of Contents

S7 Basic Error Handling

This package describes basic error handling controls.

S7-1

The application does not output error messages or stack traces containing sensitive data that could assist an attacker, including session id, software/framework versions and personal information.

Purpose: Developers usually like to see ad hoc why the system failed (when it failed). This usually leads to stack trace information being directly exposed in response body. This information can assist the attacker in multiple ways.

Solution: Secure by default. The devonfw platform introduces the class io.oasp.module.rest.service.impl.RestServiceExceptionFacade (preloaded by the JAX-RS @Provider annotation) that handles how exceptions are visible to the client application. The secure default is, that no stack traces are exposed to the client. It can be eventually overwritten for development purposes by setting a the flag exposeInternalErrorDetails on true, but must never be used this way on the production environment.

if (this.exposeInternalErrorDetails) {
      message = getExposedErrorDetails(error);
} else {
      message = error.getLocalizedMessage();
}

S7-2

Time sources should be synchronized to ensure logs have the correct time.

Purpose: This is crucial for every system integrity analysis, if we have to extract information from multiple logs on different machines (very true for micro service architectures).

Solution: The solution for this problem lies far below the devonfw platform, in the usage of the NTP protocol.

Note: You need to handle the time synchronization topic even if you use infrastructure of some cloud service providers (e.g. AWS).

Clone this wiki locally