Skip to content

Commit

Permalink
✨ Add more fields to microsoft.serviceprincipal, retrieve enterprise …
Browse files Browse the repository at this point in the history
…applications (#2189)

* ✨ Add more fields to microsoft.serviceprincipal, retrieve enterprise applications.

* 🧹 update serviceprinciple default

---------

Co-authored-by: Christoph Hartmann <chris@lollyrock.com>
  • Loading branch information
preslavgerchev and chris-rock authored Oct 12, 2023
1 parent 5dc7799 commit 4243deb
Show file tree
Hide file tree
Showing 5 changed files with 395 additions and 12 deletions.
6 changes: 1 addition & 5 deletions providers/ms365/resources/applications.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ func (a *mqlMicrosoft) applications() ([]interface{}, error) {
res := []interface{}{}
apps := resp.GetValue()
for _, app := range apps {
identifierUris := []interface{}{}
for _, uri := range app.GetIdentifierUris() {
identifierUris = append(identifierUris, uri)
}
mqlResource, err := CreateResource(a.MqlRuntime, "microsoft.application",
map[string]*llx.RawData{
"id": llx.StringData(convert.ToString(app.GetId())),
Expand All @@ -44,7 +40,7 @@ func (a *mqlMicrosoft) applications() ([]interface{}, error) {
"displayName": llx.StringData(convert.ToString(app.GetDisplayName())),
"publisherDomain": llx.StringData(convert.ToString(app.GetPublisherDomain())),
"signInAudience": llx.StringData(convert.ToString(app.GetSignInAudience())),
"identifierUris": llx.ArrayData(identifierUris, types.String),
"identifierUris": llx.ArrayData(convert.SliceAnyToInterface(app.GetIdentifierUris()), types.String),
})
if err != nil {
return nil, err
Expand Down
36 changes: 35 additions & 1 deletion providers/ms365/resources/ms365.lr
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ microsoft {
applications() []microsoft.application
// List of service principals
serviceprincipals() []microsoft.serviceprincipal
// List of enterprise applications
enterpriseApplications() []microsoft.serviceprincipal
// Microsoft 365 settings
settings() dict
}
Expand Down Expand Up @@ -164,9 +166,41 @@ private microsoft.application @defaults("id displayName") {
}

// Microsoft Service Principal
private microsoft.serviceprincipal @defaults("id") {
private microsoft.serviceprincipal @defaults("name") {
// Service principal ID
id string
// Service principal type
type string
// Service principal name
name string
// Service principal tags
tags []string
// Whether users can sign into the service principal (application)
enabled bool
// Service principal homepage URL
homepageUrl string
// Service principal terms of service URL
termsOfServiceUrl string
// Service principal reply URLs
replyUrls []string
// Whether users or other apps must be assigned to this service principal before using it
assignmentRequired bool
// Whether the service principal is visible to users
visibleToUsers bool
// Service principal notes
notes string
// The list of assignments (users and groups) this service principal has
assignments []microsoft.serviceprincipal.assignment
}

// Microsoft Service Principal Assignment
private microsoft.serviceprincipal.assignment @defaults("id") {
// Service Principal Assignment ID
id string
// Service Principal Assignment name
displayName string
// Service Principal Assignment type
type string
}

// Microsoft Security
Expand Down
244 changes: 244 additions & 0 deletions providers/ms365/resources/ms365.lr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4243deb

Please sign in to comment.