Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/cadf: add attributes for name enrichment to type Resource #54

Merged
merged 1 commit into from
Feb 16, 2022

Commits on Feb 15, 2022

  1. pkg/cadf: add attributes for name enrichment to type Resource

    We want to have project/domain names on Initiator resources in a
    standard way. Since all other Go-based services rely on `package cadf`
    when generating structured events, `type Resource` needs to support
    the respective fields.
    
    While making this change, I realized that `AuditParameters.NewEvent()`
    in this package deviates from github.com/sapcc/go-bits/audittools in the
    meaning of Initiator.Domain: In this package, Initiator.Domain is set to
    the domain from the token scope (or empty for project-scoped tokens),
    whereas audittools sets Initiator.Domain to the name of the user's
    domain.
    
    The CADF standard describes the "domain" attribute for resources as "the
    optional name of the domain that qualifies the name of the resource".
    Since "the resource" is the initiating user in this case, this supports
    audittools' interpretation. I therefore changed NewEvent() in this
    package to use the same interpretation. Since there are no users of
    NewEvent() across sapcc projects right now (at least as far as GitHub
    Code Search can tell), this should be a low-impact change.
    majewsky committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    7388c1a View commit details
    Browse the repository at this point in the history