Skip to content

Added support for roles and role management. - #1603

Merged
pagbabian-splunk merged 37 commits into
mainfrom
role_mgt_2
May 19, 2026
Merged

Added support for roles and role management.#1603
pagbabian-splunk merged 37 commits into
mainfrom
role_mgt_2

Conversation

@pagbabian-splunk

@pagbabian-splunk pagbabian-splunk commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Related Issue: #1600

Description of changes:

Added support for roles and role management.

Although we have been describing users as users or roles in many contexts, we don't have explicit support for roles (and there was no Role object). This PR adds IAM Role to existing IAM classes, group_management and authorize_session, adds a role_management class and user_management class which combines user_access_management and account_change. The latter two classes are deprecated. Activities are updated in the modified classes to support IAM Roles.

Where there were _result objects they were replaced by updated_ objects, and where Update activities were missing they were added.

IAM classes that had activities against a target, such as user or group such as attaching policies or privileges now consistently use arrays for the attached or assigned objects, so that more than one IAM Role, more than one Policy etc. can be assigned or removed in a single event.

An IAM Role object includes key attributes from the User object but none of the personal information that would not apply to a Role. As an example, a Role object can have a Session for temporary credentials that can expire with the session. A Policy object is available for attaching a policy to a role, as well as privileges as we have with User Management.

Because there are cross-account roles, the IAM Role object can have a different account (via an Account) object than the actor's account (e.g. via the User Management class).

Signed-off-by: Paul Agbabian <pagbabian@splunk.com>
Signed-off-by: Paul Agbabian <pagbabian@splunk.com>
…classes.

Signed-off-by: Paul Agbabian <pagbabian@splunk.com>
@github-actions

github-actions Bot commented Apr 10, 2026

Copy link
Copy Markdown

Schema Description Review

Automated suggestions for improving description clarity for LLM consumption. These are advisory — not required changes.

Based on my comparison with the previous review, here's my updated assessment:

Previous Issues Status

Description issue remains - The uid_alt description in the iam_role object still incorrectly mentions "user identifier" when this attribute is for a role.

CHANGELOG conflicts resolved - The git merge conflicts have been fixed.

Suggestions

  1. Object: iam_role
    Attribute: uid_alt
    Issue: Description mentions "user identifier" when this is for a role
    Current: "The alternate user identifier. For example, the Active Directory role GUID or the associated LDAP group DN."
    Suggested: "The alternate role identifier. For example, the Active Directory role GUID or the associated LDAP group DN."

Anti-Pattern Findings

All previously identified anti-patterns persist unchanged:

  1. Pattern: Cross-Attribute Inconsistency
    Object/Class: iam_role
    Attribute: name
    Issue: The name attribute uses string_t type in the iam_role object, while the same attribute name uses different types across the schema (file_name_t, process_name_t, username_t). This creates programmatic inconsistency.
    Recommendation: Consider using string_t consistently for role names, or create a distinct attribute name like role_name if the semantic difference warrants a specialized type.

  2. Pattern: Cross-Attribute Inconsistency
    Object/Class: iam_role
    Attribute: uid
    Issue: The uid attribute uses string_t type in the iam_role object, while the same attribute name uses resource_uid_t type in other objects. This inconsistency makes the schema harder to consume programmatically.
    Recommendation: Standardize on either string_t or resource_uid_t for all uid attributes, or use distinct attribute names to reflect semantic differences.

  3. Pattern: Cross-Attribute Inconsistency
    Object/Class: iam_role
    Attribute: uid_alt
    Issue: The uid_alt attribute uses string_t type in the iam_role object, while the same attribute name uses resource_uid_t type in other objects.
    Recommendation: Align the type choice with the broader schema pattern or use semantically distinct attribute names.

Summary

The PR has resolved the CHANGELOG formatting issues but the main description fix for uid_alt remains unaddressed. All structural anti-patterns identified in the previous review persist, creating ongoing type inconsistencies across the schema.

Signed-off-by: Paul Agbabian <pagbabian@splunk.com>
…ade all non-entity attributes of Role optional.

Signed-off-by: Paul Agbabian <pagbabian@splunk.com>
Signed-off-by: Paul Agbabian <pagbabian@splunk.com>
Signed-off-by: Paul Agbabian <pagbabian@splunk.com>
Signed-off-by: Paul Agbabian <pagbabian@splunk.com>
Comment thread objects/role.json Outdated
Comment thread objects/role.json Outdated
@floydtree

Copy link
Copy Markdown
Contributor

Also, do we not want to add this new object to the actor object?

@pagbabian-splunk

Copy link
Copy Markdown
Contributor Author

Good comments all - let me take a crack at an update with them included.

Signed-off-by: Paul Agbabian <pagbabian@splunk.com>
…descriptions.

Signed-off-by: Paul Agbabian <pagbabian@splunk.com>
Signed-off-by: Paul Agbabian <pagbabian@splunk.com>
@pagbabian-splunk

Copy link
Copy Markdown
Contributor Author

Also, do we not want to add this new object to the actor object?

Added iam_role to actor as well.

Comment thread objects/actor.json
Comment thread events/iam/account_change.json Outdated
@mikeradka
mikeradka self-requested a review April 21, 2026 14:35
@github-actions

github-actions Bot commented Apr 21, 2026

Copy link
Copy Markdown

Schema Anti-Pattern Check

Automated structural analysis for common schema design anti-patterns. These are advisory — not required changes.

Warnings

  1. type-inconsistencyiam_role.name
    name has different types across objects: file_name_t (1 object), process_name_t (2 objects), string_t (90 objects), username_t (1 object). Inconsistent types for the same attribute name make the schema harder to consume programmatically.

    Suggestion: Use distinct attribute names for different types, or standardize on a single type across all objects.

  2. type-inconsistencyiam_role.uid
    uid has different types across objects: resource_uid_t (4 objects), string_t (87 objects). Inconsistent types for the same attribute name make the schema harder to consume programmatically.

    Suggestion: Use distinct attribute names for different types, or standardize on a single type across all objects.

  3. type-inconsistencyiam_role.uid_alt
    uid_alt has different types across objects: resource_uid_t (4 objects), string_t (11 objects). Inconsistent types for the same attribute name make the schema harder to consume programmatically.

    Suggestion: Use distinct attribute names for different types, or standardize on a single type across all objects.

  4. tautological-descriptiondictionary.updated_role
    updated_role description "The updated role. See specific usage." is essentially restating the attribute name. Descriptions should provide meaning beyond what the name already conveys.

    Suggestion: Add context about what this attribute represents, when it applies, or how it should be populated.

  5. tautological-descriptiondictionary.updated_group
    updated_group description "The updated group. See specific usage." is essentially restating the attribute name. Descriptions should provide meaning beyond what the name already conveys.

    Suggestion: Add context about what this attribute represents, when it applies, or how it should be populated.

  6. tautological-descriptiondictionary.updated_user
    updated_user description "The updated user. See specific usage." is essentially restating the attribute name. Descriptions should provide meaning beyond what the name already conveys.

    Suggestion: Add context about what this attribute represents, when it applies, or how it should be populated.

Summary: 6 warning(s), 0 informational finding(s)

Comment thread objects/iam_role.json
@pagbabian-splunk

Copy link
Copy Markdown
Contributor Author

I'm going to experiment with a separate Role Management class rather than adding to the Account Change class. Most of that class has to do with changes to a User although it is also where a User is created.

Since roles are first class citizens of most RBAC based products, the lifecycle of a role, and the changes to a role itself likely belong in a separate class. Assigning roles to users and groups given they already exist can still be done in Group Management and User Access Management.

Entity Management can be reserved for lifecycle and state changes of a Managed Entity (via entity_result) which can be devices, policies, orgs etc. Also user but none of them lists.

Signed-off-by: Paul Agbabian <pagbabian@splunk.com>
@pagbabian-splunk
pagbabian-splunk requested a review from Aniak5 May 7, 2026 16:20
mikeradka
mikeradka previously approved these changes May 7, 2026
Aniak5
Aniak5 previously approved these changes May 7, 2026

@Aniak5 Aniak5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! This is a huge improvement, and I love the prescriptive descriptions!

zschmerber
zschmerber previously approved these changes May 8, 2026
Signed-off-by: Paul Agbabian <pagbabian@splunk.com>
Signed-off-by: Paul Agbabian <pagbabian@splunk.com>
Signed-off-by: Paul Agbabian <pagbabian@splunk.com>
@pagbabian-splunk
pagbabian-splunk dismissed floydtree’s stale review May 13, 2026 17:03

I've addressed all the changes requested - I don't know why they haven't resolved.

@dfirence

Copy link
Copy Markdown

This is useful for many products. I want to understand if it will accommodate my use case for enterprise network devices like NXOS where the group management and privileges assigned are classically considered "permissive" - i.e., "permit/deny ..."

This model follows not just a right (read/write), but also follows commands the group can execute -- like sudo command assignments:

[config-role]$ rule 1 permit command {{ command_name_here }}

How would I take my Syslog telemetry and encode these types of group changes given this PR?

Comment thread events/iam/group_management.json
Comment thread CHANGELOG.md
@pagbabian-splunk
pagbabian-splunk merged commit 1971da2 into main May 19, 2026
5 checks passed
@pagbabian-splunk
pagbabian-splunk deleted the role_mgt_2 branch May 19, 2026 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants