From 048d9adabe0e43f911f7998c1d013671b650b0ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20B=C3=BClow=20Knudsen?= <12843299+JonasBK@users.noreply.github.com> Date: Mon, 26 Aug 2024 17:20:36 +0200 Subject: [PATCH] feat: LoginURL Az property (#791) --- packages/cue/bh/azure/azure.cue | 7 +++++++ packages/go/ein/azure.go | 1 + packages/go/graphschema/ad/ad.go | 1 - packages/go/graphschema/azure/azure.go | 10 ++++++++-- packages/go/graphschema/common/common.go | 1 - packages/javascript/bh-shared-ui/src/graphSchema.ts | 3 +++ 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/packages/cue/bh/azure/azure.cue b/packages/cue/bh/azure/azure.cue index edf511bd1d..e7201cd879 100644 --- a/packages/cue/bh/azure/azure.cue +++ b/packages/cue/bh/azure/azure.cue @@ -50,6 +50,13 @@ AppDisplayName: types.#StringEnum & { representation: "appdisplayname" } +LoginURL: types.#StringEnum & { + symbol: "LoginURL" + schema: "azure" + name: "Login URL" + representation: "loginurl" +} + ServicePrincipalType: types.#StringEnum & { symbol: "ServicePrincipalType" schema: "azure" diff --git a/packages/go/ein/azure.go b/packages/go/ein/azure.go index dd1ad8e07d..05d5247fdc 100644 --- a/packages/go/ein/azure.go +++ b/packages/go/ein/azure.go @@ -911,6 +911,7 @@ func ConvertAzureServicePrincipal(data models.ServicePrincipal) ([]IngestibleNod azure.AppOwnerOrganizationID.String(): data.AppOwnerOrganizationId, azure.AppDescription.String(): data.AppDescription, azure.AppDisplayName.String(): data.AppDisplayName, + azure.LoginURL.String(): data.LoginUrl, azure.ServicePrincipalType.String(): data.ServicePrincipalType, azure.TenantID.String(): strings.ToUpper(data.TenantId), }, diff --git a/packages/go/graphschema/ad/ad.go b/packages/go/graphschema/ad/ad.go index 14a1134a91..0c5a2ba963 100644 --- a/packages/go/graphschema/ad/ad.go +++ b/packages/go/graphschema/ad/ad.go @@ -21,7 +21,6 @@ package ad import ( "errors" - graph "github.com/specterops/bloodhound/dawgs/graph" ) diff --git a/packages/go/graphschema/azure/azure.go b/packages/go/graphschema/azure/azure.go index 3b35354d37..385746a18c 100644 --- a/packages/go/graphschema/azure/azure.go +++ b/packages/go/graphschema/azure/azure.go @@ -21,7 +21,6 @@ package azure import ( "errors" - graph "github.com/specterops/bloodhound/dawgs/graph" ) @@ -101,6 +100,7 @@ const ( AppOwnerOrganizationID Property = "appownerorganizationid" AppDescription Property = "appdescription" AppDisplayName Property = "appdisplayname" + LoginURL Property = "loginurl" ServicePrincipalType Property = "serviceprincipaltype" UserType Property = "usertype" TenantID Property = "tenantid" @@ -132,7 +132,7 @@ const ( ) func AllProperties() []Property { - return []Property{AppOwnerOrganizationID, AppDescription, AppDisplayName, ServicePrincipalType, UserType, TenantID, ServicePrincipalID, ServicePrincipalNames, OperatingSystemVersion, TrustType, IsBuiltIn, AppID, AppRoleID, DeviceID, NodeResourceGroupID, OnPremID, OnPremSyncEnabled, SecurityEnabled, SecurityIdentifier, EnableRBACAuthorization, Scope, Offer, MFAEnabled, License, Licenses, MFAEnforced, UserPrincipalName, IsAssignableToRole, PublisherDomain, SignInAudience, RoleTemplateID} + return []Property{AppOwnerOrganizationID, AppDescription, AppDisplayName, LoginURL, ServicePrincipalType, UserType, TenantID, ServicePrincipalID, ServicePrincipalNames, OperatingSystemVersion, TrustType, IsBuiltIn, AppID, AppRoleID, DeviceID, NodeResourceGroupID, OnPremID, OnPremSyncEnabled, SecurityEnabled, SecurityIdentifier, EnableRBACAuthorization, Scope, Offer, MFAEnabled, License, Licenses, MFAEnforced, UserPrincipalName, IsAssignableToRole, PublisherDomain, SignInAudience, RoleTemplateID} } func ParseProperty(source string) (Property, error) { switch source { @@ -142,6 +142,8 @@ func ParseProperty(source string) (Property, error) { return AppDescription, nil case "appdisplayname": return AppDisplayName, nil + case "loginurl": + return LoginURL, nil case "serviceprincipaltype": return ServicePrincipalType, nil case "usertype": @@ -210,6 +212,8 @@ func (s Property) String() string { return string(AppDescription) case AppDisplayName: return string(AppDisplayName) + case LoginURL: + return string(LoginURL) case ServicePrincipalType: return string(ServicePrincipalType) case UserType: @@ -278,6 +282,8 @@ func (s Property) Name() string { return "App Description" case AppDisplayName: return "App Display Name" + case LoginURL: + return "Login URL" case ServicePrincipalType: return "Service Principal Type" case UserType: diff --git a/packages/go/graphschema/common/common.go b/packages/go/graphschema/common/common.go index 9320bb8d29..6fd161585e 100644 --- a/packages/go/graphschema/common/common.go +++ b/packages/go/graphschema/common/common.go @@ -21,7 +21,6 @@ package common import ( "errors" - graph "github.com/specterops/bloodhound/dawgs/graph" ) diff --git a/packages/javascript/bh-shared-ui/src/graphSchema.ts b/packages/javascript/bh-shared-ui/src/graphSchema.ts index f6770e95db..93b613481e 100644 --- a/packages/javascript/bh-shared-ui/src/graphSchema.ts +++ b/packages/javascript/bh-shared-ui/src/graphSchema.ts @@ -882,6 +882,7 @@ export enum AzureKindProperties { AppOwnerOrganizationID = 'appownerorganizationid', AppDescription = 'appdescription', AppDisplayName = 'appdisplayname', + LoginURL = 'loginurl', ServicePrincipalType = 'serviceprincipaltype', UserType = 'usertype', TenantID = 'tenantid', @@ -919,6 +920,8 @@ export function AzureKindPropertiesToDisplay(value: AzureKindProperties): string return 'App Description'; case AzureKindProperties.AppDisplayName: return 'App Display Name'; + case AzureKindProperties.LoginURL: + return 'Login URL'; case AzureKindProperties.ServicePrincipalType: return 'Service Principal Type'; case AzureKindProperties.UserType: