Failed to load custom SAML attribute map
search cancel

Failed to load custom SAML attribute map

book

Article ID: 287391

calendar_today

Updated On:

Products

Carbon Black EDR (formerly Cb Response)

Issue/Introduction

Error seen in /var/log/cb/coreservices/debug.log:

2021-05-06 17:57:55 [51778] <err>  cb.flask.blueprints.api_routes_saml - Failed to load custom SAML attribute map.  Reverting to default mapping.
Traceback (most recent call last):
  File "/usr/share/cb/virtualenv/lib/python3.8/site-packages/cb/flask/blueprints/api_routes_saml.py", line 378, in get_attr_mapper
  File "/usr/lib64/python3.8/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 779, in exec_module
  File "<frozen importlib._bootstrap_external>", line 916, in get_code
  File "<frozen importlib._bootstrap_external>", line 846, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/etc/cb/sso/attr_map.py", line 61
    logger.debug("{} {}".format(str(key), str(value)))
                                                     ^
TabError: inconsistent use of tabs and spaces in indentation

Environment

  • EDR Server: All Supported Versions
  • SAML Integration with IDP

Cause

A combination of extra tabs and spaces located in the /etc/cb/sso/attr_map.py file

Resolution

  1. Ensure the consistency with tabs or spaces in Python files, depending on which is preferred.  The default examples of the attr_map.py file use spaces, so the recommendation is to continue using spaces when using templates.
  2. View all characters using a text editor and validate the tabs and spaces
    1. Below is an example snippet of the output from Notepad++.  Notice the '.' (spaces) and arrows (tab indentions).