diff --git a/auditree/templates/reports/cf/user-roles.md.tmpl b/auditree/templates/reports/cf/user-roles.md.tmpl index e9d9119..32a6a5c 100644 --- a/auditree/templates/reports/cf/user-roles.md.tmpl +++ b/auditree/templates/reports/cf/user-roles.md.tmpl @@ -6,9 +6,10 @@ The following users have access to our cloud.gov infrastructure. {% for section_heading, user_guids in all_successes.items() -%} ## {{ section_heading }} -{% for guid in user_guids: %} +| User Name | Roles | +| --------- | ----- | +{% for guid in user_guids: -%} {% set user = test.users[guid] -%} -* **User**: {{ user["user_name"] }}
- **Roles**: {{ user["roles"] | join(', ') }} +| {{ user["user_name"] }} | {{ user["roles"] | join('
') | safe }} | {% endfor %} {% endfor %} diff --git a/auditree/utils/cf_roles.py b/auditree/utils/cf_roles.py index 7e6908f..a724d20 100644 --- a/auditree/utils/cf_roles.py +++ b/auditree/utils/cf_roles.py @@ -48,9 +48,10 @@ def __init__(self, entity): @property def username(self): if self._is_service_account: - return client.v3.service_credential_bindings.get( + service_name = client.v3.service_credential_bindings.get( self._username, include="service_instance" ).service_instance()["name"] + return f"{service_name} ({self._username})" else: return self._username