class SecurityExceptionMapper implements ExceptionMapper<SecurityException> {

    @Override
    public Response toResponse(final SecurityException exception) {
        LOGGER.error("Security exception", exception);

        // Return 500 assume access attempt is malicious
        return Response.serverError().build();
    }

}