Documentation
¶
Overview ¶
Package services provides typed, high-level wrappers around the BloodHound API endpoints exposed by the SDK client groups.
Index ¶
- Constants
- Variables
- func JobStatusName(status EnumJobStatus) string
- func ToDOT(graph *UnifiedGraphGraphWithKeys) string
- func ToMermaid(graph *UnifiedGraphGraphWithKeys) string
- type ADBaseEntitiesGroup
- type ADBaseEntitiesQuery
- func (q *ADBaseEntitiesQuery) All(ctx context.Context) ([]RelatedEntity, error)
- func (q *ADBaseEntitiesQuery) Limit(n int) *ADBaseEntitiesQuery
- func (q *ADBaseEntitiesQuery) Results(ctx context.Context) (RelatedEntityList, error)
- func (q *ADBaseEntitiesQuery) Skip(n int) *ADBaseEntitiesQuery
- func (q *ADBaseEntitiesQuery) SortBy(field string) *ADBaseEntitiesQuery
- type ADUsersGroup
- func (g *ADUsersGroup) AdminRights(objectID string) *ADUsersQuery
- func (g *ADUsersGroup) ConstrainedDelegationRights(objectID string) *ADUsersQuery
- func (g *ADUsersGroup) Controllables(objectID string) *ADUsersQuery
- func (g *ADUsersGroup) Controllers(objectID string) *ADUsersQuery
- func (g *ADUsersGroup) DcomRights(objectID string) *ADUsersQuery
- func (g *ADUsersGroup) Membership(objectID string) *ADUsersQuery
- func (g *ADUsersGroup) PsRemoteRights(objectID string) *ADUsersQuery
- func (g *ADUsersGroup) RdpRights(objectID string) *ADUsersQuery
- func (g *ADUsersGroup) Sessions(objectID string) *ADUsersQuery
- func (g *ADUsersGroup) SqlAdminRights(objectID string) *ADUsersQuery
- func (g *ADUsersGroup) UserEntity(ctx context.Context, objectID string) (*Entity, error)
- type ADUsersQuery
- func (q *ADUsersQuery) All(ctx context.Context) ([]RelatedEntity, error)
- func (q *ADUsersQuery) Limit(n int) *ADUsersQuery
- func (q *ADUsersQuery) Results(ctx context.Context) (RelatedEntityList, error)
- func (q *ADUsersQuery) Skip(n int) *ADUsersQuery
- func (q *ADUsersQuery) SortBy(field string) *ADUsersQuery
- type AIACAsGroup
- type AIACAsQuery
- func (q *AIACAsQuery) All(ctx context.Context) ([]RelatedEntity, error)
- func (q *AIACAsQuery) Limit(n int) *AIACAsQuery
- func (q *AIACAsQuery) Results(ctx context.Context) (RelatedEntityList, error)
- func (q *AIACAsQuery) Skip(n int) *AIACAsQuery
- func (q *AIACAsQuery) SortBy(field string) *AIACAsQuery
- type APIError
- type APIErrorDetail
- type APIInfoGroup
- type APITokensGroup
- func (g *APITokensGroup) AuthTokens(ctx context.Context, opts *ListOptions) ([]AuthToken, error)
- func (g *APITokensGroup) CreateAuthToken(ctx context.Context, body generated.CreateAuthTokenJSONRequestBody) (*AuthToken, error)
- func (g *APITokensGroup) DeleteAuthToken(ctx context.Context, tokenID openapi_types.UUID) (*ActionResult, error)
- type APIVersionInfo
- type ActionResult
- type AdDataQualityStat
- type AffectedUsersResult
- type Alert
- type AlertAttempt
- type AlertEvent
- type AlertEventType
- type AlertWebhook
- type AlertWebhookCreateResult
- type AlertWebhookSecret
- type AlertsGroup
- func (g *AlertsGroup) Alert(ctx context.Context, alertId string) (*Alert, error)
- func (g *AlertsGroup) AlertAttempts(ctx context.Context, opts *ListOptions) ([]AlertAttempt, error)
- func (g *AlertsGroup) AlertEvent(ctx context.Context, alertEventId string) (*AlertEvent, error)
- func (g *AlertsGroup) AlertEventTypes(ctx context.Context) ([]AlertEventType, error)
- func (g *AlertsGroup) AlertEvents(ctx context.Context, opts *ListOptions) ([]AlertEvent, error)
- func (g *AlertsGroup) AlertWebhook(ctx context.Context, alertWebhookId string) (*AlertWebhook, error)
- func (g *AlertsGroup) AlertWebhooks(ctx context.Context, opts *ListOptions) ([]AlertWebhook, error)
- func (g *AlertsGroup) Alerts(ctx context.Context, opts *ListOptions) ([]Alert, error)
- func (g *AlertsGroup) CreateAlert(ctx context.Context, body generated.CreateAlertJSONRequestBody) (*Alert, error)
- func (g *AlertsGroup) CreateAlertWebhook(ctx context.Context, body generated.CreateAlertWebhookJSONRequestBody) (*AlertWebhookCreateResult, error)
- func (g *AlertsGroup) DeleteAlert(ctx context.Context, alertId string) (*ActionResult, error)
- func (g *AlertsGroup) DeleteAlertWebhook(ctx context.Context, alertWebhookId string) (*ActionResult, error)
- func (g *AlertsGroup) RotateAlertWebhookSecret(ctx context.Context, alertWebhookId string) (*AlertWebhookSecret, error)
- func (g *AlertsGroup) UpdateAlert(ctx context.Context, alertId string, body generated.UpdateAlertJSONRequestBody) (*Alert, error)
- func (g *AlertsGroup) UpdateAlertWebhook(ctx context.Context, alertWebhookId string, ...) (*AlertWebhook, error)
- type AllFindings
- type AnalysisGroup
- func (g *AnalysisGroup) AssetGroupComboNode(ctx context.Context, assetGroupID int32) (*BHGraphGraph, error)deprecated
- func (g *AnalysisGroup) ComboTreeGraph(ctx context.Context, domainID string) (*BHGraphGraph, error)
- func (g *AnalysisGroup) LatestTierZeroComboNode(ctx context.Context, domainID string) (map[string]BHGraphNode, error)
- type AnalysisRequestDetails
- type AppConfigParam
- type AppConfigUpdateResult
- type AssetGroup
- type AssetGroupCollection
- type AssetGroupMember
- type AssetGroupMemberSelectors
- type AssetGroupSelector
- type AssetGroupSelectorsUpdateResult
- type AssetGroupTag
- type AssetGroupTagSearchResult
- type AssetGroupTagsCertification
- type AssetGroupTagsHistory
- type AssetGroupTagsMember
- type AssetGroupTagsSelector
- type AssetIsolationGroup
- func (g *AssetIsolationGroup) AssetGroup(ctx context.Context, assetGroupID int32) (*AssetGroup, error)
- func (g *AssetIsolationGroup) AssetGroupCollections(ctx context.Context, assetGroupID int32, opts *ListOptions) ([]AssetGroupCollection, error)
- func (g *AssetIsolationGroup) AssetGroupCustomMemberCount(ctx context.Context, assetGroupID int32) (*int, error)
- func (g *AssetIsolationGroup) AssetGroupMemberCountByKind(ctx context.Context, assetGroupID int32) (*CountByKind, error)
- func (g *AssetIsolationGroup) AssetGroupMembers(ctx context.Context, assetGroupID int32, opts *ListOptions) ([]AssetGroupMember, error)deprecated
- func (g *AssetIsolationGroup) AssetGroupSelectorMemberCountsByKind(ctx context.Context, assetGroupTagID int32, assetGroupTagSelectorId int32) (*CountByKind, error)
- func (g *AssetIsolationGroup) AssetGroupSelectorsByMemberId(ctx context.Context, assetGroupTagID int32, assetGroupMemberId int32) (*AssetGroupMemberSelectors, error)
- func (g *AssetIsolationGroup) AssetGroupTag(ctx context.Context, assetGroupTagID int32) (*AssetGroupTag, error)
- func (g *AssetIsolationGroup) AssetGroupTagHistory(ctx context.Context, opts *ListOptions) (*AssetGroupTagsHistory, error)
- func (g *AssetIsolationGroup) AssetGroupTagMemberCountByKind(ctx context.Context, assetGroupTagID int32) (*CountByKind, error)
- func (g *AssetIsolationGroup) AssetGroupTagMembersById(ctx context.Context, assetGroupTagID int32, opts *ListOptions) ([]AssetGroupTagsMember, error)
- func (g *AssetIsolationGroup) AssetGroupTagMembersBySelector(ctx context.Context, assetGroupTagID int32, assetGroupTagSelectorId int32, ...) ([]AssetGroupTagsMember, error)
- func (g *AssetIsolationGroup) AssetGroupTagSearch(ctx context.Context, body generated.AssetGroupTagSearchJSONRequestBody) (*AssetGroupTagSearchResult, error)
- func (g *AssetIsolationGroup) AssetGroupTagSelector(ctx context.Context, assetGroupTagID int32, assetGroupTagSelectorId int32) (*AssetGroupTagsSelector, error)
- func (g *AssetIsolationGroup) AssetGroupTagSelectors(ctx context.Context, assetGroupTagID int32) ([]AssetGroupTagsSelector, error)
- func (g *AssetIsolationGroup) AssetGroupTags(ctx context.Context) ([]AssetGroupTag, error)
- func (g *AssetIsolationGroup) AssetGroups(ctx context.Context, opts *ListOptions) ([]AssetGroup, error)
- func (g *AssetIsolationGroup) CreateAssetGroup(ctx context.Context, body generated.CreateAssetGroupJSONRequestBody) (*AssetGroup, error)
- func (g *AssetIsolationGroup) CreateAssetGroupTagSelector(ctx context.Context, assetGroupTagID int32, ...) (*AssetGroupTagsSelector, error)
- func (g *AssetIsolationGroup) DeleteAssetGroup(ctx context.Context, assetGroupID int32) (*ActionResult, error)
- func (g *AssetIsolationGroup) DeleteAssetGroupSelector(ctx context.Context, assetGroupID int32, assetGroupSelectorId int32) (*ActionResult, error)
- func (g *AssetIsolationGroup) DeleteAssetGroupTagSelector(ctx context.Context, assetGroupTagID int32, assetGroupTagSelectorId int32) (*ActionResult, error)
- func (g *AssetIsolationGroup) IsOwned(ctx context.Context, objectID string) (bool, error)
- func (g *AssetIsolationGroup) MarkAsOwned(ctx context.Context, objectID string) (*AssetGroupTagsSelector, error)
- func (g *AssetIsolationGroup) OwnedTag(ctx context.Context) (*AssetGroupTag, error)
- func (g *AssetIsolationGroup) PreviewSelectors(ctx context.Context, body generated.PreviewSelectorsJSONRequestBody) (*AssetGroupTagsMember, error)
- func (g *AssetIsolationGroup) SearchAssetGroupTagHistory(ctx context.Context, body generated.SearchAssetGroupTagHistoryJSONRequestBody, ...) (*AssetGroupTagsHistory, error)
- func (g *AssetIsolationGroup) UnmarkAsOwned(ctx context.Context, objectID string) error
- func (g *AssetIsolationGroup) UpdateAssetGroup(ctx context.Context, assetGroupID int32, ...) (*AssetGroup, error)
- func (g *AssetIsolationGroup) UpdateAssetGroupSelectors(ctx context.Context, assetGroupID int32, ...) (*AssetGroupSelectorsUpdateResult, error)
- func (g *AssetIsolationGroup) UpdateAssetGroupSelectorsDeprecated(ctx context.Context, assetGroupID int32, ...) (*AssetGroupSelectorsUpdateResult, error)deprecated
- func (g *AssetIsolationGroup) UpdateAssetGroupTag(ctx context.Context, assetGroupTagID int32, ...) (*AssetGroupTag, error)
- func (g *AssetIsolationGroup) UpdateAssetGroupTagSelector(ctx context.Context, assetGroupTagID int32, assetGroupTagSelectorId int32, ...) (*AssetGroupTagsSelector, error)
- type AttackPathFinding
- type AttackPathFindingTypeInfo
- type AttackPathFindingsOptions
- type AttackPathSparkline
- type AttackPathsGroup
- func (g *AttackPathsGroup) AllAttackPathFindings(ctx context.Context) (*AllFindings, error)
- func (g *AttackPathsGroup) AttackPathFindingTypes(ctx context.Context) ([]AttackPathFindingTypeInfo, error)
- func (g *AttackPathsGroup) AttackPathFindings(ctx context.Context, opts *AttackPathFindingsOptions) ([]AttackPathFinding, error)
- func (g *AttackPathsGroup) AttackPathSparklineValues(ctx context.Context, domainID string, opts *ListOptions) (*AttackPathSparkline, error)
- func (g *AttackPathsGroup) AttackPathTypes(ctx context.Context, opts *ListOptions) ([]string, error)
- func (g *AttackPathsGroup) AvailableAttackPathTypesForDomain(ctx context.Context, domainID string, opts *ListOptions) ([]string, error)
- func (g *AttackPathsGroup) DomainAttackPathsDetails(ctx context.Context, domainID string, opts *ListOptions) (map[string]interface{}, error)
- func (g *AttackPathsGroup) ExportAttackPathFindings(ctx context.Context, domainID string, opts *ListOptions) (string, error)deprecated
- func (g *AttackPathsGroup) FindingTrendsForEnvironment(ctx context.Context) (map[string]interface{}, error)
- func (g *AttackPathsGroup) StartAnalysisAndWait(ctx context.Context, options *WaitOptions) (*DatapipeStatusDetails, error)
- func (g *AttackPathsGroup) StartAnalysisBhe(ctx context.Context) (*ActionResult, error)
- func (g *AttackPathsGroup) UpdateAttackPathRisk(ctx context.Context, attackPathId int64, ...) (*Finding, error)
- type AuditGroup
- type AuditLog
- type AuthGroup
- func (g *AuthGroup) AuthProviders(ctx context.Context) ([]AuthProvider, error)
- func (g *AuthGroup) CreateOIDCProvider(ctx context.Context, body generated.CreateOIDCProviderJSONRequestBody) (*OidcProvider, error)
- func (g *AuthGroup) CreateSAMLProvider(ctx context.Context, name string, metadataXML []byte) (*SamlProvider, error)deprecated
- func (g *AuthGroup) CreateSSOSAMLProvider(ctx context.Context, opts SSOSAMLProviderOptions) (*SamlProvider, error)
- func (g *AuthGroup) DeleteSSOProvider(ctx context.Context, ssoProviderID int32) (*AffectedUsersResult, error)
- func (g *AuthGroup) DeleteSamlProvider(ctx context.Context, samlProviderID int32) (*AffectedUsersResult, error)deprecated
- func (g *AuthGroup) Login(ctx context.Context, body generated.LoginJSONRequestBody) (*LoginResult, error)
- func (g *AuthGroup) Logout(ctx context.Context) (*ActionResult, error)
- func (g *AuthGroup) PatchSSOProvider(ctx context.Context, ssoProviderID int32, ...) (*SSOProviderPatchResult, error)
- func (g *AuthGroup) SSOProviderSAMLSigningCertificate(ctx context.Context, ssoProviderID int32) (string, error)
- func (g *AuthGroup) SamlProvider(ctx context.Context, samlProviderID int32) (*SamlProvider, error)deprecated
- func (g *AuthGroup) SamlProviders(ctx context.Context) ([]SamlProvider, error)deprecated
- func (g *AuthGroup) SamlSignOnEndpoints(ctx context.Context) ([]SamlSignOnEndpoint, error)deprecated
- func (g *AuthGroup) SamlSignSignOnEndpoints(ctx context.Context) ([]SamlSignOnEndpoint, error)deprecated
- func (g *AuthGroup) Self(ctx context.Context) (*AuthenticatedRequester, error)
- type AuthProvider
- type AuthToken
- type AuthenticatedRequester
- type AvailableDomainsQuery
- func (q *AvailableDomainsQuery) Collected(v string) *AvailableDomainsQuery
- func (q *AvailableDomainsQuery) Name(v string) *AvailableDomainsQuery
- func (q *AvailableDomainsQuery) ObjectID(v string) *AvailableDomainsQuery
- func (q *AvailableDomainsQuery) Results(ctx context.Context) ([]DomainSelector, error)
- func (q *AvailableDomainsQuery) SortBy(v string) *AvailableDomainsQuery
- type AzureDataQualityStat
- type AzureEntitiesGroup
- type AzureEntityData
- type BHGraphGraph
- type BHGraphNode
- type BloodHoundUsersGroup
- func (g *BloodHoundUsersGroup) ActivateUserMfa(ctx context.Context, userID openapi_types.UUID, ...) (MfaActivationStatus, error)
- func (g *BloodHoundUsersGroup) AddUserMfa(ctx context.Context, userID openapi_types.UUID, ...) (*UserMfaSetup, error)
- func (g *BloodHoundUsersGroup) CreateOrSetUserSecret(ctx context.Context, userID openapi_types.UUID, ...) (*ActionResult, error)
- func (g *BloodHoundUsersGroup) CreateUser(ctx context.Context, body generated.CreateUserJSONRequestBody) (*User, error)
- func (g *BloodHoundUsersGroup) DeleteUser(ctx context.Context, userID openapi_types.UUID) (*ActionResult, error)
- func (g *BloodHoundUsersGroup) DeleteUserSecret(ctx context.Context, userID openapi_types.UUID) (*ActionResult, error)
- func (g *BloodHoundUsersGroup) MfaActivationStatus(ctx context.Context, userID openapi_types.UUID) (MfaActivationStatus, error)
- func (g *BloodHoundUsersGroup) RemoveUserMfa(ctx context.Context, userID openapi_types.UUID, ...) (MfaActivationStatus, error)
- func (g *BloodHoundUsersGroup) UpdateUser(ctx context.Context, userID openapi_types.UUID, ...) (*ActionResult, error)
- func (g *BloodHoundUsersGroup) User(ctx context.Context, userID openapi_types.UUID) (*User, error)
- func (g *BloodHoundUsersGroup) Users(ctx context.Context, opts *ListOptions) ([]User, error)
- func (g *BloodHoundUsersGroup) UsersMinimal(ctx context.Context, opts *ListOptions) ([]UsersMinimal, error)
- type CertTemplatesGroup
- type CertTemplatesQuery
- func (q *CertTemplatesQuery) All(ctx context.Context) ([]RelatedEntity, error)
- func (q *CertTemplatesQuery) Limit(n int) *CertTemplatesQuery
- func (q *CertTemplatesQuery) Results(ctx context.Context) (RelatedEntityList, error)
- func (q *CertTemplatesQuery) Skip(n int) *CertTemplatesQuery
- func (q *CertTemplatesQuery) SortBy(field string) *CertTemplatesQuery
- type ClientCollectionOptions
- type ClientDisplay
- type ClientIngestGroup
- type ClientModel
- type ClientScheduleDisplay
- type ClientScheduledJob
- type ClientScheduledJobDisplay
- type ClientsGroup
- func (g *ClientsGroup) Client(ctx context.Context, clientID openapi_types.UUID) (*ClientDisplay, error)
- func (g *ClientsGroup) ClientCompletedJobs(ctx context.Context, clientID openapi_types.UUID, opts *ListOptions) ([]ClientScheduledJobDisplay, error)
- func (g *ClientsGroup) ClientCompletedTasks(ctx context.Context, clientID openapi_types.UUID, opts *ListOptions) ([]ClientScheduledJobDisplay, error)deprecated
- func (g *ClientsGroup) Clients(ctx context.Context, opts *ListOptions) ([]ClientDisplay, error)
- func (g *ClientsGroup) CreateAndStartSimpleClientJob(ctx context.Context, clientID openapi_types.UUID, ...) (*ClientScheduledJob, error)
- func (g *ClientsGroup) CreateAndStartSimpleClientTask(ctx context.Context, clientID openapi_types.UUID, ...) (*ClientScheduledJob, error)deprecated
- func (g *ClientsGroup) CreateClient(ctx context.Context, body generated.CreateClientJSONRequestBody) (*ClientModel, error)
- func (g *ClientsGroup) CreateClientScheduledJob(ctx context.Context, clientID openapi_types.UUID, ...) (*ClientScheduledJob, error)
- func (g *ClientsGroup) CreateClientScheduledTask(ctx context.Context, clientID openapi_types.UUID, ...) (*ClientScheduledJob, error)deprecated
- func (g *ClientsGroup) CreateSimpleClientScheduledJob(ctx context.Context, clientID openapi_types.UUID, ...) (*ClientScheduledJob, error)
- func (g *ClientsGroup) CreateSimpleClientScheduledTask(ctx context.Context, clientID openapi_types.UUID, ...) (*ClientScheduledJob, error)deprecated
- func (g *ClientsGroup) DeleteClient(ctx context.Context, clientID openapi_types.UUID) (*ActionResult, error)
- func (g *ClientsGroup) LogClientError(ctx context.Context, body generated.LogClientErrorJSONRequestBody) (*ActionResult, error)
- func (g *ClientsGroup) ReplaceClientToken(ctx context.Context, clientID openapi_types.UUID) (*AuthToken, error)
- func (g *ClientsGroup) RunSimpleClientJob(ctx context.Context, clientID openapi_types.UUID, ...) (*ClientScheduledJobDisplay, error)
- func (g *ClientsGroup) RunSimpleClientTask(ctx context.Context, clientID openapi_types.UUID, ...) (*ClientScheduledJobDisplay, error)deprecated
- func (g *ClientsGroup) UpdateClient(ctx context.Context, clientID openapi_types.UUID, ...) (*ClientModel, error)
- func (g *ClientsGroup) UpdateClientInfo(ctx context.Context, body generated.UpdateClientInfoJSONRequestBody) (*ClientModel, error)
- type CollectionUploadsGroup
- func (g *CollectionUploadsGroup) AcceptedFileUploadTypes(ctx context.Context) ([]string, error)
- func (g *CollectionUploadsGroup) CompletedTasks(ctx context.Context, fileUploadJobID int64) ([]FileUploadJobCompletedTasks, error)
- func (g *CollectionUploadsGroup) CreateFileUploadJob(ctx context.Context) (*FileUploadJob, error)
- func (g *CollectionUploadsGroup) EndFileUploadJob(ctx context.Context, fileUploadJobID int64) (*ActionResult, error)
- func (g *CollectionUploadsGroup) FileUploadJob(ctx context.Context, fileUploadJobID int64) (*FileUploadJob, error)
- func (g *CollectionUploadsGroup) FileUploadJobs(ctx context.Context, opts *ListOptions) ([]FileUploadJob, error)
- func (g *CollectionUploadsGroup) LatestFileUploadJob(ctx context.Context) (*FileUploadJob, error)
- func (g *CollectionUploadsGroup) UploadFilePaths(ctx context.Context, paths ...string) (*FileUploadJob, error)
- func (g *CollectionUploadsGroup) UploadFileToJob(ctx context.Context, fileUploadJobID int64, ...) (*ActionResult, error)
- func (g *CollectionUploadsGroup) UploadFileToJobData(ctx context.Context, fileUploadJobID int64, file UploadFile) (*ActionResult, error)
- func (g *CollectionUploadsGroup) UploadFiles(ctx context.Context, files []UploadFile) (*FileUploadJob, error)
- type CollectorManifest
- type CollectorsGroup
- func (g *CollectorsGroup) CollectorChecksum(ctx context.Context, collectorType EnumClientType, releaseTag string) (string, error)
- func (g *CollectorsGroup) CollectorManifest(ctx context.Context, collectorType EnumClientType) (*CollectorManifest, error)
- func (g *CollectorsGroup) DownloadCollector(ctx context.Context, collectorType EnumClientType, releaseTag string) (io.ReadSeeker, error)
- type CommunityQueriesProvider
- func (CommunityQueriesProvider) ASREPRoastableAccounts() string
- func (CommunityQueriesProvider) DCSyncPrincipals() string
- func (CommunityQueriesProvider) DomainAdmins() string
- func (CommunityQueriesProvider) DomainControllers() string
- func (CommunityQueriesProvider) HighValueTargets() string
- func (CommunityQueriesProvider) KerberoastableAccounts() string
- func (CommunityQueriesProvider) LAPSViewers() string
- func (CommunityQueriesProvider) OwnedPrincipals() string
- func (CommunityQueriesProvider) PasswordNeverExpires() string
- func (CommunityQueriesProvider) SensitiveAccountsNotDelegated() string
- func (CommunityQueriesProvider) ShortestPathsToDomainAdmins() string
- func (CommunityQueriesProvider) ShortestPathsToTierZero() string
- func (CommunityQueriesProvider) UnconstrainedDelegation() string
- func (CommunityQueriesProvider) UsersWithSPNAndAdminRights() string
- type ComputersGroup
- func (g *ComputersGroup) AdminRights(objectID string) *ComputersQuery
- func (g *ComputersGroup) Admins(objectID string) *ComputersQuery
- func (g *ComputersGroup) ComputerEntity(ctx context.Context, objectID string) (*Entity, error)
- func (g *ComputersGroup) ConstrainedDelegationRights(objectID string) *ComputersQuery
- func (g *ComputersGroup) ConstrainedUsers(objectID string) *ComputersQuery
- func (g *ComputersGroup) Controllables(objectID string) *ComputersQuery
- func (g *ComputersGroup) Controllers(objectID string) *ComputersQuery
- func (g *ComputersGroup) DcomRights(objectID string) *ComputersQuery
- func (g *ComputersGroup) DcomUsers(objectID string) *ComputersQuery
- func (g *ComputersGroup) GroupMembership(objectID string) *ComputersQuery
- func (g *ComputersGroup) PsRemoteRights(objectID string) *ComputersQuery
- func (g *ComputersGroup) PsRemoteUsers(objectID string) *ComputersQuery
- func (g *ComputersGroup) RdpRights(objectID string) *ComputersQuery
- func (g *ComputersGroup) RdpUsers(objectID string) *ComputersQuery
- func (g *ComputersGroup) Sessions(objectID string) *ComputersQuery
- func (g *ComputersGroup) SqlAdmins(objectID string) *ComputersQuery
- type ComputersQuery
- func (q *ComputersQuery) All(ctx context.Context) ([]RelatedEntity, error)
- func (q *ComputersQuery) Limit(n int) *ComputersQuery
- func (q *ComputersQuery) Results(ctx context.Context) (RelatedEntityList, error)
- func (q *ComputersQuery) Skip(n int) *ComputersQuery
- func (q *ComputersQuery) SortBy(field string) *ComputersQuery
- type ConfigGroup
- func (g *ConfigGroup) AppConfigParams(ctx context.Context) ([]AppConfigParam, error)
- func (g *ConfigGroup) FeatureFlags(ctx context.Context) ([]FeatureFlag, error)
- func (g *ConfigGroup) SetAppConfigParam(ctx context.Context, body generated.SetAppConfigParamJSONRequestBody) (*AppConfigUpdateResult, error)
- func (g *ConfigGroup) ToggleFeatureFlag(ctx context.Context, featureId int32) (*ToggleFeatureFlagResult, error)
- type ContainersGroup
- type ContainersQuery
- func (q *ContainersQuery) All(ctx context.Context) ([]RelatedEntity, error)
- func (q *ContainersQuery) Limit(n int) *ContainersQuery
- func (q *ContainersQuery) Results(ctx context.Context) (RelatedEntityList, error)
- func (q *ContainersQuery) Skip(n int) *ContainersQuery
- func (q *ContainersQuery) SortBy(field string) *ContainersQuery
- type CountByKind
- type CustomNode
- type CustomNodeManagementGroup
- func (g *CustomNodeManagementGroup) CreateCustomNodes(ctx context.Context, body generated.CreateCustomNodesJSONRequestBody) ([]CustomNode, error)
- func (g *CustomNodeManagementGroup) CustomNode(ctx context.Context, kindName string) (*CustomNode, error)
- func (g *CustomNodeManagementGroup) CustomNodes(ctx context.Context) ([]CustomNode, error)
- func (g *CustomNodeManagementGroup) DeleteCustomNode(ctx context.Context, kindName string) (*ActionResult, error)deprecated
- func (g *CustomNodeManagementGroup) UpdateCustomNode(ctx context.Context, kindName string, ...) (*CustomNode, error)
- type CypherGroup
- func (g *CypherGroup) CreateSavedQuery(ctx context.Context, body generated.CreateSavedQueryJSONRequestBody) (*SavedQuery, error)
- func (g *CypherGroup) DeleteSavedQuery(ctx context.Context, savedQueryID int64) (*ActionResult, error)
- func (g *CypherGroup) DeleteSavedQueryPermissions(ctx context.Context, savedQueryID int64, ...) (*ActionResult, error)
- func (g *CypherGroup) ExportSavedQueries(ctx context.Context) (string, error)
- func (g *CypherGroup) ExportSavedQuery(ctx context.Context, savedQueryID int32) (string, error)
- func (g *CypherGroup) FindSavedQueryByName(ctx context.Context, name string) (*SavedQuery, error)
- func (g *CypherGroup) ImportSavedQueries(ctx context.Context, body generated.ImportSavedQueriesJSONRequestBody) (int, error)
- func (g *CypherGroup) LoadSavedQueryPack(ctx context.Context, data []byte) error
- func (g *CypherGroup) LoadSavedQueryPackFile(ctx context.Context, filePath string) error
- func (g *CypherGroup) LoadSavedQueryPackFromURL(ctx context.Context, rawURL string) error
- func (g *CypherGroup) LoadSpecterOpsQueryLibrary(ctx context.Context) error
- func (g *CypherGroup) RunCypher(ctx context.Context, query string) (*UnifiedGraphGraphWithKeys, error)
- func (g *CypherGroup) RunCypherQuery(ctx context.Context, body generated.RunCypherQueryJSONRequestBody) (*UnifiedGraphGraphWithKeys, error)
- func (g *CypherGroup) RunSavedQuery(ctx context.Context, savedQueryID int32) (*UnifiedGraphGraphWithKeys, error)
- func (g *CypherGroup) RunSavedQueryByName(ctx context.Context, name string) (*UnifiedGraphGraphWithKeys, error)
- func (g *CypherGroup) SavedQueries(ctx context.Context, opts *ListOptions) ([]SavedQuery, error)
- func (g *CypherGroup) SavedQuery(ctx context.Context, savedQueryID int32) (*SavedQuery, error)
- func (g *CypherGroup) SavedQueryPermissions(ctx context.Context, savedQueryID int64) (*SavedQueriesPermissionsResult, error)
- func (g *CypherGroup) ShareSavedQuery(ctx context.Context, savedQueryID int64, ...) ([]SavedQueriesPermissions, error)
- func (g *CypherGroup) UpdateSavedQuery(ctx context.Context, savedQueryID int64, ...) (*SavedQuery, error)
- type DataQualityAggregation
- type DataQualityAggregationsOptions
- type DataQualityGroup
- func (g *DataQualityGroup) AdDomainDataQualityStats(ctx context.Context, domainID string, opts *ListOptions) ([]AdDataQualityStat, error)
- func (g *DataQualityGroup) AzureTenantDataQualityStats(ctx context.Context, tenantId string, opts *ListOptions) ([]AzureDataQualityStat, error)
- func (g *DataQualityGroup) CompletenessStats(ctx context.Context) (map[string]float64, error)
- func (g *DataQualityGroup) DataQualityAggregations(ctx context.Context, schemaEnvironmentKindId int32, ...) ([]DataQualityAggregation, error)
- func (g *DataQualityGroup) GlobalDataQualityStats(ctx context.Context, environmentId string, opts *DataQualityStatsOptions) ([]DataQualityStat, error)
- func (g *DataQualityGroup) PlatformDataQualityAggregate(ctx context.Context, platformId string, opts *ListOptions) (*DataQualityPlatformAggregate, error)
- type DataQualityPlatformAggregate
- type DataQualityStat
- type DataQualityStatsOptions
- type DatabaseGroup
- type DatapipeGroup
- func (g *DatapipeGroup) AnalysisRequest(ctx context.Context) (*AnalysisRequestDetails, error)
- func (g *DatapipeGroup) CancelAnalysisRequest(ctx context.Context) (*ActionResult, error)
- func (g *DatapipeGroup) CurrentDatapipeStatus(ctx context.Context) (*DatapipeStatusDetails, error)
- func (g *DatapipeGroup) DatapipeStatus(ctx context.Context) (*DatapipeStatusDetails, error)
- func (g *DatapipeGroup) StartAnalysis(ctx context.Context) (*ActionResult, error)
- func (g *DatapipeGroup) StartAnalysisAndWait(ctx context.Context, options *WaitOptions) (*DatapipeStatusDetails, error)
- func (g *DatapipeGroup) WaitForAnalysisIdle(ctx context.Context, options *WaitOptions) (*DatapipeStatusDetails, error)
- type DatapipeStatus
- type DatapipeStatusDetails
- type DomainRelatedQuery
- func (q *DomainRelatedQuery) All(ctx context.Context) ([]RelatedEntity, error)
- func (q *DomainRelatedQuery) Limit(n int) *DomainRelatedQuery
- func (q *DomainRelatedQuery) Results(ctx context.Context) (RelatedEntityList, error)
- func (q *DomainRelatedQuery) Skip(n int) *DomainRelatedQuery
- func (q *DomainRelatedQuery) SortBy(field string) *DomainRelatedQuery
- type DomainSelector
- type DomainUpdateResult
- type DomainsGroup
- func (g *DomainsGroup) ADCSEscalations(objectID string) *DomainRelatedQuery
- func (g *DomainsGroup) Computers(objectID string) *DomainRelatedQuery
- func (g *DomainsGroup) Controllers(objectID string) *DomainRelatedQuery
- func (g *DomainsGroup) DCSyncers(objectID string) *DomainRelatedQuery
- func (g *DomainsGroup) ForeignAdmins(objectID string) *DomainRelatedQuery
- func (g *DomainsGroup) ForeignGPOControllers(objectID string) *DomainRelatedQuery
- func (g *DomainsGroup) ForeignGroups(objectID string) *DomainRelatedQuery
- func (g *DomainsGroup) ForeignUsers(objectID string) *DomainRelatedQuery
- func (g *DomainsGroup) GPOs(objectID string) *DomainRelatedQuery
- func (g *DomainsGroup) Get(ctx context.Context, objectID string) (*Entity, error)
- func (g *DomainsGroup) Groups(objectID string) *DomainRelatedQuery
- func (g *DomainsGroup) InboundTrusts(objectID string) *DomainRelatedQuery
- func (g *DomainsGroup) LinkedGPOs(objectID string) *DomainRelatedQuery
- func (g *DomainsGroup) OUs(objectID string) *DomainRelatedQuery
- func (g *DomainsGroup) OutboundTrusts(objectID string) *DomainRelatedQuery
- func (g *DomainsGroup) Update(ctx context.Context, objectID string, collected bool) (*DomainUpdateResult, error)
- func (g *DomainsGroup) Users(objectID string) *DomainRelatedQuery
- type EULAGroup
- type EdgeKind
- type EnterpriseAssetIsolationGroup
- func (g *EnterpriseAssetIsolationGroup) AssetGroupTagsCertifications(ctx context.Context, opts *ListOptions) (*AssetGroupTagsCertification, error)
- func (g *EnterpriseAssetIsolationGroup) CertifyOrRevokeObjects(ctx context.Context, body generated.CertifyOrRevokeObjectsJSONRequestBody) (*ActionResult, error)
- func (g *EnterpriseAssetIsolationGroup) CreateAssetGroupTag(ctx context.Context, body generated.CreateAssetGroupTagJSONRequestBody) (*AssetGroupTag, error)
- func (g *EnterpriseAssetIsolationGroup) DeleteAssetGroupTag(ctx context.Context, assetGroupTagID int32) (*ActionResult, error)
- type EnterpriseCAsGroup
- func (g *EnterpriseCAsGroup) Controllers(objectID string) *EnterpriseCAsQuery
- func (g *EnterpriseCAsGroup) EnterpriseCaEntity(ctx context.Context, objectID string) (*Entity, error)
- func (g *EnterpriseCAsGroup) PkiHierarchy(objectID string) *EnterpriseCAsQuery
- func (g *EnterpriseCAsGroup) PublishedTemplates(objectID string) *EnterpriseCAsQuery
- type EnterpriseCAsQuery
- func (q *EnterpriseCAsQuery) All(ctx context.Context) ([]RelatedEntity, error)
- func (q *EnterpriseCAsQuery) Limit(n int) *EnterpriseCAsQuery
- func (q *EnterpriseCAsQuery) Results(ctx context.Context) (RelatedEntityList, error)
- func (q *EnterpriseCAsQuery) Skip(n int) *EnterpriseCAsQuery
- func (q *EnterpriseCAsQuery) SortBy(field string) *EnterpriseCAsQuery
- type EnterpriseCollectorsGroup
- func (g *EnterpriseCollectorsGroup) KennelAsset(ctx context.Context, assetName string) (io.ReadSeeker, error)
- func (g *EnterpriseCollectorsGroup) KennelEnterpriseManifest(ctx context.Context) (*KennelEnterpriseManifest, error)
- func (g *EnterpriseCollectorsGroup) KennelManifest(ctx context.Context) (*KennelManifest, error)
- type Entity
- type EnumClientType
- type EnumJobStatus
- type EnumPostureHistoryType
- type EventsGroup
- func (g *EventsGroup) ClientSchedule(ctx context.Context, eventID int32) (*ClientScheduleDisplay, error)
- func (g *EventsGroup) ClientSchedules(ctx context.Context, opts *ListOptions) ([]ClientScheduleDisplay, error)
- func (g *EventsGroup) CreateClientSchedule(ctx context.Context, body generated.CreateClientScheduleJSONRequestBody) (*ClientScheduleDisplay, error)
- func (g *EventsGroup) DeleteClientEvent(ctx context.Context, eventID int32) (*ActionResult, error)
- func (g *EventsGroup) UpdateClientEvent(ctx context.Context, eventID int32, ...) (*ClientScheduleDisplay, error)
- type FeatureFlag
- type FileUploadJob
- type FileUploadJobCompletedTasks
- type Finding
- type GPOsGroup
- func (g *GPOsGroup) Computers(objectID string) *GPOsQuery
- func (g *GPOsGroup) Controllers(objectID string) *GPOsQuery
- func (g *GPOsGroup) GpoEntity(ctx context.Context, objectID string) (*Entity, error)
- func (g *GPOsGroup) Ous(objectID string) *GPOsQuery
- func (g *GPOsGroup) TierZero(objectID string) *GPOsQuery
- func (g *GPOsGroup) Users(objectID string) *GPOsQuery
- type GPOsQuery
- type GraphExtensionPayload
- type GraphGroup
- func (g *GraphGroup) ACLInheritancePath(ctx context.Context, sourceNode int32, targetNode int32, edgeType string) (*UnifiedGraphGraph, error)
- func (g *GraphGroup) Kinds(ctx context.Context) ([]string, error)
- func (g *GraphGroup) PathComposition(ctx context.Context, sourceNode int32, targetNode int32, edgeType string) (*UnifiedGraphGraph, error)
- func (g *GraphGroup) Pathfinding(ctx context.Context, startNode string, endNode string) (*BHGraphGraph, error)deprecated
- func (g *GraphGroup) RelayTargets(ctx context.Context, sourceNode int32, targetNode int32, edgeType string) (*UnifiedGraphGraph, error)
- func (g *GraphGroup) SearchResult(ctx context.Context, query string) (map[string]BHGraphNode, error)
- func (g *GraphGroup) ShortestPath(ctx context.Context, startNode string, endNode string, ...) (*UnifiedGraphGraph, error)
- type GraphStats
- type GroupsGroup
- func (g *GroupsGroup) AdminRights(objectID string) *GroupsQuery
- func (g *GroupsGroup) Controllables(objectID string) *GroupsQuery
- func (g *GroupsGroup) Controllers(objectID string) *GroupsQuery
- func (g *GroupsGroup) DcomRights(objectID string) *GroupsQuery
- func (g *GroupsGroup) GroupEntity(ctx context.Context, objectID string) (*Entity, error)
- func (g *GroupsGroup) Members(objectID string) *GroupsQuery
- func (g *GroupsGroup) Memberships(objectID string) *GroupsQuery
- func (g *GroupsGroup) PsRemoteRights(objectID string) *GroupsQuery
- func (g *GroupsGroup) RdpRights(objectID string) *GroupsQuery
- func (g *GroupsGroup) Sessions(objectID string) *GroupsQuery
- type GroupsQuery
- func (q *GroupsQuery) All(ctx context.Context) ([]RelatedEntity, error)
- func (q *GroupsQuery) Limit(n int) *GroupsQuery
- func (q *GroupsQuery) Results(ctx context.Context) (RelatedEntityList, error)
- func (q *GroupsQuery) Skip(n int) *GroupsQuery
- func (q *GroupsQuery) SortBy(field string) *GroupsQuery
- type JobsGroup
- func (g *JobsGroup) AvailableClientJobs(ctx context.Context, opts *ListOptions) ([]ClientScheduledJobDisplay, error)
- func (g *JobsGroup) CancelClientJob(ctx context.Context, jobID int64) (*ClientScheduledJobDisplay, error)
- func (g *JobsGroup) ClientCurrentJob(ctx context.Context) (*ClientScheduledJobDisplay, error)
- func (g *JobsGroup) ClientFinishedJobs(ctx context.Context, opts *ListOptions) ([]ClientScheduledJobDisplay, error)
- func (g *JobsGroup) ClientJob(ctx context.Context, jobID int64) (*ClientScheduledJobDisplay, error)
- func (g *JobsGroup) ClientJobLog(ctx context.Context, jobID int64) (string, error)
- func (g *JobsGroup) ClientJobs(ctx context.Context) ([]ClientScheduledJobDisplay, error)
- func (g *JobsGroup) EndClientJob(ctx context.Context) (*ClientScheduledJob, error)
- func (g *JobsGroup) StartAndWaitClientJob(ctx context.Context, jobID int64, options *WaitOptions) (*ClientScheduledJobDisplay, error)
- func (g *JobsGroup) StartClientJob(ctx context.Context, body generated.StartClientJobJSONRequestBody) (*ClientScheduledJob, error)
- func (g *JobsGroup) StartClientJobByID(ctx context.Context, jobID int64) (*ClientScheduledJob, error)
- func (g *JobsGroup) WaitForClientJob(ctx context.Context, jobID int64, options *WaitOptions) (*ClientScheduledJobDisplay, error)
- type KennelEnterpriseManifest
- type KennelManifest
- type ListOptions
- type LoginResult
- type MetaEntitiesGroup
- type MfaActivationStatus
- type NTAuthStoresGroup
- type NTAuthStoresQuery
- func (q *NTAuthStoresQuery) All(ctx context.Context) ([]RelatedEntity, error)
- func (q *NTAuthStoresQuery) Limit(n int) *NTAuthStoresQuery
- func (q *NTAuthStoresQuery) Results(ctx context.Context) (RelatedEntityList, error)
- func (q *NTAuthStoresQuery) Skip(n int) *NTAuthStoresQuery
- func (q *NTAuthStoresQuery) SortBy(field string) *NTAuthStoresQuery
- type NodeKind
- type NodeKindResult
- type OUsGroup
- type OUsQuery
- type OidcProvider
- type OpenGraphGroup
- func (g *OpenGraphGroup) DeleteExtension(ctx context.Context, extensionId int32) (*ActionResult, error)
- func (g *OpenGraphGroup) EdgeKinds(ctx context.Context) ([]EdgeKind, error)
- func (g *OpenGraphGroup) Extensions(ctx context.Context) (json.RawMessage, error)
- func (g *OpenGraphGroup) Node(ctx context.Context, nodeId int64, includeInfo bool) (json.RawMessage, error)
- func (g *OpenGraphGroup) NodeKind(ctx context.Context, nodeKindId int32) (*NodeKindResult, error)
- func (g *OpenGraphGroup) Relationship(ctx context.Context, relationshipId int64, includeInfo bool) (json.RawMessage, error)
- func (g *OpenGraphGroup) RelationshipKind(ctx context.Context, relationshipKindId int32) (*RelationshipKindResult, error)
- func (g *OpenGraphGroup) UpsertExtension(ctx context.Context, payload GraphExtensionPayload) (json.RawMessage, error)
- type Permission
- type PermissionsGroup
- type PostureHistory
- type PostureHistoryPoint
- type QueryLibraryItem
- type RelatedEntity
- type RelatedEntityList
- type RelationshipKind
- type RelationshipKindResult
- type RiskCounts
- type RiskPostureGroup
- type RiskPostureStat
- type Role
- type RolesGroup
- type RootCAsGroup
- type RootCAsQuery
- func (q *RootCAsQuery) All(ctx context.Context) ([]RelatedEntity, error)
- func (q *RootCAsQuery) Limit(n int) *RootCAsQuery
- func (q *RootCAsQuery) Results(ctx context.Context) (RelatedEntityList, error)
- func (q *RootCAsQuery) Skip(n int) *RootCAsQuery
- func (q *RootCAsQuery) SortBy(field string) *RootCAsQuery
- type SSOProviderPatchResult
- type SSOSAMLProviderOptions
- type SamlProvider
- type SamlSignOnEndpoint
- type SavedQueriesPermissions
- type SavedQueriesPermissionsResult
- type SavedQuery
- type SearchGroup
- type SearchQuery
- type SearchResult
- type TasksGroup
- func (g *TasksGroup) AvailableClientTasks(ctx context.Context, opts *ListOptions) ([]ClientScheduledJobDisplay, error)deprecated
- func (g *TasksGroup) CancelClientTask(ctx context.Context, taskID int64) (*ClientScheduledJobDisplay, error)deprecated
- func (g *TasksGroup) ClientCurrentTask(ctx context.Context) (*ClientScheduledJobDisplay, error)deprecated
- func (g *TasksGroup) ClientFinishedTasks(ctx context.Context, opts *ListOptions) ([]ClientScheduledJobDisplay, error)deprecated
- func (g *TasksGroup) ClientTask(ctx context.Context, taskID int64) (*ClientScheduledJobDisplay, error)deprecated
- func (g *TasksGroup) ClientTaskLog(ctx context.Context, taskID int64) (string, error)deprecated
- func (g *TasksGroup) ClientTasks(ctx context.Context) ([]ClientScheduledJobDisplay, error)deprecated
- func (g *TasksGroup) EndClientTask(ctx context.Context) (*ClientScheduledJob, error)deprecated
- func (g *TasksGroup) StartAndWaitClientTask(ctx context.Context, taskID int64, options *WaitOptions) (*ClientScheduledJobDisplay, error)deprecated
- func (g *TasksGroup) StartClientTask(ctx context.Context, body generated.StartClientTaskJSONRequestBody) (*ClientScheduledJob, error)deprecated
- func (g *TasksGroup) StartClientTaskByID(ctx context.Context, taskID int64) (*ClientScheduledJob, error)deprecated
- func (g *TasksGroup) WaitForClientTask(ctx context.Context, taskID int64, options *WaitOptions) (*ClientScheduledJobDisplay, error)deprecated
- type ToggleFeatureFlagResult
- type UnifiedGraphEdge
- type UnifiedGraphGraph
- type UnifiedGraphGraphWithKeys
- type UnifiedGraphNode
- func FindNodeByLabel(graph *UnifiedGraphGraphWithKeys, label string) *UnifiedGraphNode
- func GetNode(graph *UnifiedGraphGraphWithKeys, nodeID string) *UnifiedGraphNode
- func NodesByKind(graph *UnifiedGraphGraphWithKeys, kind string) []UnifiedGraphNode
- func OwnedNodes(graph *UnifiedGraphGraphWithKeys) []UnifiedGraphNode
- func TierZeroNodes(graph *UnifiedGraphGraphWithKeys) []UnifiedGraphNode
- type UploadFile
- type User
- type UserMfaSetup
- type UsersMinimal
- type WaitOptions
Constants ¶
const ( SharpHound = generated.Sharphound AzureHound = generated.Azurehound )
Collector client types accepted by Collectors methods.
const SpecterOpsQueryLibraryURL = "https://github.com/SpecterOps/BloodHoundQueryLibrary/releases/latest/download/Queries.json"
SpecterOpsQueryLibraryURL points to the latest release Queries.json of the official SpecterOps BloodHound Query Library.
Variables ¶
var JobStatusNames = map[EnumJobStatus]string{ EnumJobStatus(-1): "Invalid", EnumJobStatus(0): "Ready", EnumJobStatus(1): "Running", EnumJobStatus(2): "Complete", EnumJobStatus(3): "Canceled", EnumJobStatus(4): "Timed Out", EnumJobStatus(5): "Failed", EnumJobStatus(6): "Ingesting", EnumJobStatus(7): "Analyzing", EnumJobStatus(8): "Partially Complete", }
JobStatusNames maps BloodHound job status enum values to human-friendly names.
Functions ¶
func JobStatusName ¶
func JobStatusName(status EnumJobStatus) string
JobStatusName returns a human-friendly name for a job status.
name := JobStatusName(status) fmt.Println(name) // e.g. "Running"
func ToDOT ¶
func ToDOT(graph *UnifiedGraphGraphWithKeys) string
ToDOT exports a Cypher query result graph in GraphViz DOT format.
func ToMermaid ¶
func ToMermaid(graph *UnifiedGraphGraphWithKeys) string
ToMermaid exports a Cypher query result graph as a Mermaid flowchart string.
Types ¶
type ADBaseEntitiesGroup ¶
type ADBaseEntitiesGroup struct {
API *generated.ClientWithResponses
}
ADBaseEntitiesGroup provides methods for querying Active Directory base entity information from the BloodHound API. Base entities are the fundamental graph nodes (users, computers, groups, etc.) that make up the AD attack path model.
Access this group via [CommunityClient.ADBaseEntities] or [EnterpriseClient.ADBaseEntities]:
entities := client.Community().ADBaseEntities()
func (*ADBaseEntitiesGroup) Controllables ¶
func (g *ADBaseEntitiesGroup) Controllables(objectID string) *ADBaseEntitiesQuery
Controllables returns a query builder that lists the AD objects an entity can control. In BloodHound's attack path model, controllables are nodes reachable via outbound control relationships (ForceChangePassword, GenericAll, etc.).
results, err := client.Community().ADBaseEntities().
Controllables("ABCD1234-...").
Limit(50).
Results(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Controls %d objects\n", results.Count)
func (*ADBaseEntitiesGroup) Controllers ¶
func (g *ADBaseEntitiesGroup) Controllers(objectID string) *ADBaseEntitiesQuery
Controllers returns a query builder that lists the AD objects that have control over the given entity. Controllers are nodes with inbound control relationships targeting this object (e.g., principals that can reset its password or modify its ACL).
results, err := client.Community().ADBaseEntities().
Controllers("ABCD1234-...").
SortBy("name").
Results(ctx)
if err != nil {
log.Fatal(err)
}
for _, c := range results.Data {
fmt.Printf(" %s (%s)\n", c.Name, c.Label)
}
func (*ADBaseEntitiesGroup) Entity ¶
Entity retrieves a single AD entity by its BloodHound object ID. The returned Entity includes the node's name, label, kind tags, and all collected properties.
The objectID is the BloodHound-assigned identifier for the node (not the AD objectSid or objectGUID).
entity, err := client.Community().ADBaseEntities().Entity(ctx, "ABCD1234-...")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Name: %s Label: %s\n", entity.Name, entity.Label)
type ADBaseEntitiesQuery ¶
type ADBaseEntitiesQuery struct {
API *generated.ClientWithResponses
// contains filtered or unexported fields
}
ADBaseEntitiesQuery is a fluent query builder for paginated entity relationship lookups (controllables and controllers).
func (*ADBaseEntitiesQuery) All ¶
func (q *ADBaseEntitiesQuery) All(ctx context.Context) ([]RelatedEntity, error)
All executes paginated queries in a loop until all matching entities are collected and returned as a flat slice.
entities, err := client.Community().ADBaseEntities().Controllers(objectID).All(ctx)
func (*ADBaseEntitiesQuery) Limit ¶
func (q *ADBaseEntitiesQuery) Limit(n int) *ADBaseEntitiesQuery
Limit sets the maximum number of items to return. It returns the query for method chaining.
func (*ADBaseEntitiesQuery) Results ¶
func (q *ADBaseEntitiesQuery) Results(ctx context.Context) (RelatedEntityList, error)
Results executes the query and returns a paginated RelatedEntityList. The list includes the matched entities along with Count, Skip, and Limit metadata for cursor-based pagination.
func (*ADBaseEntitiesQuery) Skip ¶
func (q *ADBaseEntitiesQuery) Skip(n int) *ADBaseEntitiesQuery
Skip sets the number of items to skip for pagination. It returns the query for method chaining.
func (*ADBaseEntitiesQuery) SortBy ¶
func (q *ADBaseEntitiesQuery) SortBy(field string) *ADBaseEntitiesQuery
SortBy sets the field name used to order results. It returns the query for method chaining.
type ADUsersGroup ¶
type ADUsersGroup struct {
API *generated.ClientWithResponses
}
ADUsersGroup provides methods for querying Active Directory user entities and their relationships from the BloodHound API.
Access this group via [CommunityClient.ADUsers] or [EnterpriseClient.ADUsers]:
users := client.Community().ADUsers()
func (*ADUsersGroup) AdminRights ¶
func (g *ADUsersGroup) AdminRights(objectID string) *ADUsersQuery
AdminRights returns a query builder that lists computers where this user has local administrator privileges.
results, err := client.Community().ADUsers().
AdminRights("ABCD1234-...").Limit(50).Results(ctx)
func (*ADUsersGroup) ConstrainedDelegationRights ¶
func (g *ADUsersGroup) ConstrainedDelegationRights(objectID string) *ADUsersQuery
ConstrainedDelegationRights returns a query builder that lists services this user is allowed to delegate credentials to via Kerberos constrained delegation.
func (*ADUsersGroup) Controllables ¶
func (g *ADUsersGroup) Controllables(objectID string) *ADUsersQuery
Controllables returns a query builder that lists AD objects this user can control via outbound ACL-based relationships (GenericAll, WriteDacl, etc.).
func (*ADUsersGroup) Controllers ¶
func (g *ADUsersGroup) Controllers(objectID string) *ADUsersQuery
Controllers returns a query builder that lists AD objects with control over this user via inbound ACL-based relationships.
func (*ADUsersGroup) DcomRights ¶
func (g *ADUsersGroup) DcomRights(objectID string) *ADUsersQuery
DcomRights returns a query builder that lists computers where this user has DCOM (Distributed COM) execution rights.
func (*ADUsersGroup) Membership ¶
func (g *ADUsersGroup) Membership(objectID string) *ADUsersQuery
Membership returns a query builder that lists the AD groups this user belongs to.
groups, err := client.Community().ADUsers().
Membership("ABCD1234-...").SortBy("name").Results(ctx)
if err != nil {
log.Fatal(err)
}
for _, g := range groups.Data {
fmt.Println(g.Name)
}
func (*ADUsersGroup) PsRemoteRights ¶
func (g *ADUsersGroup) PsRemoteRights(objectID string) *ADUsersQuery
PsRemoteRights returns a query builder that lists computers where this user has PowerShell Remoting (WinRM) access.
func (*ADUsersGroup) RdpRights ¶
func (g *ADUsersGroup) RdpRights(objectID string) *ADUsersQuery
RdpRights returns a query builder that lists computers where this user has Remote Desktop Protocol access.
func (*ADUsersGroup) Sessions ¶
func (g *ADUsersGroup) Sessions(objectID string) *ADUsersQuery
Sessions returns a query builder that lists computers where this user has active logon sessions.
func (*ADUsersGroup) SqlAdminRights ¶
func (g *ADUsersGroup) SqlAdminRights(objectID string) *ADUsersQuery
SqlAdminRights returns a query builder that lists SQL Server instances where this user has sysadmin privileges.
func (*ADUsersGroup) UserEntity ¶
UserEntity retrieves a single AD user entity by its BloodHound object ID. The returned Entity includes the user's name, label, kind tags, and all collected properties (e.g., enabled status, last logon, SPN configuration).
user, err := client.Community().ADUsers().UserEntity(ctx, "ABCD1234-...")
if err != nil {
log.Fatal(err)
}
fmt.Printf("User: %s (%s)\n", user.Name, user.Label)
type ADUsersQuery ¶
type ADUsersQuery struct {
API *generated.ClientWithResponses
// contains filtered or unexported fields
}
ADUsersQuery is a fluent query builder for paginated AD user relationship lookups.
func (*ADUsersQuery) All ¶
func (q *ADUsersQuery) All(ctx context.Context) ([]RelatedEntity, error)
All executes paginated queries in a loop until all matching entities are collected and returned as a flat slice.
entities, err := client.Community().ADUsers().AdminRights(objectID).All(ctx)
func (*ADUsersQuery) Limit ¶
func (q *ADUsersQuery) Limit(n int) *ADUsersQuery
Limit sets the maximum number of items to return. It returns the query for method chaining.
func (*ADUsersQuery) Results ¶
func (q *ADUsersQuery) Results(ctx context.Context) (RelatedEntityList, error)
Results executes the query and returns a paginated RelatedEntityList. The list includes the matched entities along with Count, Skip, and Limit metadata for cursor-based pagination.
func (*ADUsersQuery) Skip ¶
func (q *ADUsersQuery) Skip(n int) *ADUsersQuery
Skip sets the number of items to skip for pagination. It returns the query for method chaining.
func (*ADUsersQuery) SortBy ¶
func (q *ADUsersQuery) SortBy(field string) *ADUsersQuery
SortBy sets the field name used to order results. It returns the query for method chaining.
type AIACAsGroup ¶
type AIACAsGroup struct {
API *generated.ClientWithResponses
}
AIACAsGroup provides methods for querying AD Certificate Services Authority Information Access (AIA) CA entities and their relationships.
Access this group via [CommunityClient.AIACAs]:
aias := client.Community().AIACAs()
func (*AIACAsGroup) AiaCaEntity ¶
AiaCaEntity retrieves a single AIA CA entity by its BloodHound object ID. The returned Entity includes the CA's name, label, kind tags, and all collected properties from the AD Certificate Services PKI infrastructure.
ca, err := client.Community().AIACAs().AiaCaEntity(ctx, "ABCD1234-...")
if err != nil {
log.Fatal(err)
}
fmt.Printf("AIA CA: %s (%s)\n", ca.Name, ca.Label)
func (*AIACAsGroup) Controllers ¶
func (g *AIACAsGroup) Controllers(objectID string) *AIACAsQuery
Controllers returns a query builder that lists objects with control over this AIA CA. Controllers are principals that hold permissions (GenericAll, WriteDacl, etc.) allowing them to modify or manage the AIA CA object in Active Directory.
results, err := client.Community().AIACAs().
Controllers("ABCD1234-...").Limit(50).Results(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Controlled by %d objects\n", results.Count)
func (*AIACAsGroup) PkiHierarchy ¶
func (g *AIACAsGroup) PkiHierarchy(objectID string) *AIACAsQuery
PkiHierarchy returns a query builder that lists entities in the PKI trust chain related to this AIA CA. The hierarchy includes parent and child certificate authorities that form the AD Certificate Services chain of trust.
type AIACAsQuery ¶
type AIACAsQuery struct {
API *generated.ClientWithResponses
// contains filtered or unexported fields
}
AIACAsQuery is a fluent query builder for paginated AIA CA relationship lookups.
func (*AIACAsQuery) All ¶
func (q *AIACAsQuery) All(ctx context.Context) ([]RelatedEntity, error)
All executes paginated queries in a loop until all matching entities are collected and returned as a flat slice.
entities, err := client.Community().AIACAs().Controllers(objectID).All(ctx)
func (*AIACAsQuery) Limit ¶
func (q *AIACAsQuery) Limit(n int) *AIACAsQuery
Limit sets the maximum number of items to return. It returns the query for method chaining.
func (*AIACAsQuery) Results ¶
func (q *AIACAsQuery) Results(ctx context.Context) (RelatedEntityList, error)
Results executes the query and returns a paginated RelatedEntityList. The list includes the matched entities along with Count, Skip, and Limit metadata for cursor-based pagination.
func (*AIACAsQuery) Skip ¶
func (q *AIACAsQuery) Skip(n int) *AIACAsQuery
Skip sets the number of items to skip for pagination. It returns the query for method chaining.
func (*AIACAsQuery) SortBy ¶
func (q *AIACAsQuery) SortBy(field string) *AIACAsQuery
SortBy sets the field name used to order results. It returns the query for method chaining.
type APIError ¶
type APIError struct {
HTTPStatus int `json:"http_status"`
Timestamp string `json:"timestamp"`
RequestID string `json:"request_id"`
Errors []APIErrorDetail `json:"errors"`
}
APIError represents a structured error response from the BloodHound API. All API failures returned by this package have *APIError as their dynamic type; use errors.As to extract it.
func ParseAPIErrorBytes ¶
ParseAPIErrorBytes parses a BloodHound API error envelope from a response body. For non-JSON bodies it falls back to a single truncated detail entry.
type APIErrorDetail ¶
APIErrorDetail contains a single error entry within an API error response.
type APIInfoGroup ¶
type APIInfoGroup struct {
API *generated.ClientWithResponses
}
APIInfoGroup provides methods for retrieving BloodHound server version and API specification metadata.
Access this group via [CommunityClient.APIInfo]:
info := client.Community().APIInfo()
func (*APIInfoGroup) ApiSpec ¶
func (g *APIInfoGroup) ApiSpec(ctx context.Context) (string, error)
ApiSpec retrieves the raw OpenAPI specification document from the server as a string.
spec, err := client.Community().APIInfo().ApiSpec(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Spec length: %d bytes\n", len(spec))
func (*APIInfoGroup) ApiVersion ¶
func (g *APIInfoGroup) ApiVersion(ctx context.Context) (*APIVersionInfo, error)
ApiVersion retrieves the BloodHound server version, product edition (Community or Enterprise), and API version details. The returned APIVersionInfo includes the current and deprecated API version strings.
ver, err := client.Community().APIInfo().ApiVersion(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Server: %s Edition: %s\n", *ver.ServerVersion, *ver.ProductEdition)
type APITokensGroup ¶
type APITokensGroup struct {
API *generated.ClientWithResponses
}
APITokensGroup provides methods for managing BloodHound API authentication tokens used for HMAC-signed requests.
Access this group via [CommunityClient.APITokens]:
tokens := client.Community().APITokens()
func (*APITokensGroup) AuthTokens ¶
func (g *APITokensGroup) AuthTokens(ctx context.Context, opts *ListOptions) ([]AuthToken, error)
AuthTokens lists all API authentication tokens for the current user. Each returned AuthToken includes the token ID, name, and last-used timestamp. Pass a *ListOptions to set SortBy, or nil for server defaults.
tokens, err := client.Community().APITokens().AuthTokens(ctx, nil)
if err != nil {
log.Fatal(err)
}
for _, t := range tokens {
fmt.Printf("Token: %v (ID: %s)\n", t.Name, t.Id)
}
func (*APITokensGroup) CreateAuthToken ¶
func (g *APITokensGroup) CreateAuthToken(ctx context.Context, body generated.CreateAuthTokenJSONRequestBody) (*AuthToken, error)
CreateAuthToken creates a new API authentication token. The returned AuthToken contains the generated token key needed for HMAC request signing.
tokenName := "my-token"
token, err := client.Community().APITokens().CreateAuthToken(ctx, generated.CreateAuthTokenJSONRequestBody{
TokenName: &tokenName,
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Token ID: %s\n", token.Id)
func (*APITokensGroup) DeleteAuthToken ¶
func (g *APITokensGroup) DeleteAuthToken(ctx context.Context, tokenID openapi_types.UUID) (*ActionResult, error)
DeleteAuthToken revokes and deletes an API authentication token by its ID.
_, err := client.Community().APITokens().DeleteAuthToken(ctx, tokenID)
if err != nil {
log.Fatal(err)
}
type APIVersionInfo ¶
type APIVersionInfo struct {
ServerVersion *string
ProductEdition *string
CurrentAPIVersion *string
DeprecatedVersion *string
}
APIVersionInfo contains version metadata returned by APIInfo.ApiVersion.
type ActionResult ¶
ActionResult is the standardized result for mutation/action endpoints that do not return a typed resource payload.
type AdDataQualityStat ¶
type AdDataQualityStat = generated.ModelAdDataQualityStat
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AffectedUsersResult ¶
type AffectedUsersResult struct {
ActionResult
Users []User
}
AffectedUsersResult is returned by actions that impact a set of users.
type Alert ¶
type Alert = generated.ModelAlert
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AlertAttempt ¶
type AlertAttempt = generated.ModelAlertAttempt
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AlertEvent ¶
type AlertEvent = generated.ModelAlertEvent
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AlertEventType ¶
type AlertEventType = generated.ModelAlertEventType
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AlertWebhook ¶
type AlertWebhook = generated.ModelAlertWebhook
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AlertWebhookCreateResult ¶
type AlertWebhookCreateResult struct {
Webhook *AlertWebhook
HmacSecret *string
}
AlertWebhookCreateResult carries the created webhook together with its one-time HMAC secret.
type AlertWebhookSecret ¶
AlertWebhookSecret is the rotation response for a webhook's HMAC secret.
type AlertsGroup ¶
type AlertsGroup struct {
API *generated.ClientWithResponses
}
AlertsGroup provides methods for managing BloodHound alerts: alert rules, read-only alert events and delivery attempts, and webhook channels.
Access this group via [CommunityClient.Alerts]:
alerts := client.Community().Alerts()
func (*AlertsGroup) Alert ¶
Alert retrieves a single alert rule by ID (UUID).
alert, err := client.Community().Alerts().Alert(ctx, "0b1e2c3d-...")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Alert %s disabled at %v\n", *alert.Name, alert.DisabledAt)
func (*AlertsGroup) AlertAttempts ¶
func (g *AlertsGroup) AlertAttempts(ctx context.Context, opts *ListOptions) ([]AlertAttempt, error)
AlertAttempts lists webhook delivery attempts for alert events. Use opts to paginate; nil accepts server defaults.
func (*AlertsGroup) AlertEvent ¶
func (g *AlertsGroup) AlertEvent(ctx context.Context, alertEventId string) (*AlertEvent, error)
AlertEvent retrieves a single alert event by ID (UUID).
func (*AlertsGroup) AlertEventTypes ¶
func (g *AlertsGroup) AlertEventTypes(ctx context.Context) ([]AlertEventType, error)
AlertEventTypes lists registered alert event types and their supported payload versions.
func (*AlertsGroup) AlertEvents ¶
func (g *AlertsGroup) AlertEvents(ctx context.Context, opts *ListOptions) ([]AlertEvent, error)
AlertEvents lists read-only alert events. Use opts to paginate; nil accepts server defaults.
func (*AlertsGroup) AlertWebhook ¶
func (g *AlertsGroup) AlertWebhook(ctx context.Context, alertWebhookId string) (*AlertWebhook, error)
AlertWebhook retrieves a single webhook channel by ID (UUID). The HMAC secret is not included; it is only returned by AlertsGroup.CreateAlertWebhook and AlertsGroup.RotateAlertWebhookSecret.
func (*AlertsGroup) AlertWebhooks ¶
func (g *AlertsGroup) AlertWebhooks(ctx context.Context, opts *ListOptions) ([]AlertWebhook, error)
AlertWebhooks lists configured webhook channels. Use opts to paginate; nil accepts server defaults.
func (*AlertsGroup) Alerts ¶
func (g *AlertsGroup) Alerts(ctx context.Context, opts *ListOptions) ([]Alert, error)
Alerts lists alert rules. Use opts to paginate; nil accepts server defaults.
alerts, err := client.Community().Alerts().Alerts(ctx, &services.ListOptions{Limit: &limit})
if err != nil {
log.Fatal(err)
}
for _, a := range alerts {
fmt.Printf("Alert: %s\n", *a.Name)
}
func (*AlertsGroup) CreateAlert ¶
func (g *AlertsGroup) CreateAlert(ctx context.Context, body generated.CreateAlertJSONRequestBody) (*Alert, error)
CreateAlert creates an alert rule with event subscriptions.
alert, err := client.Community().Alerts().CreateAlert(ctx, generated.CreateAlertJSONBody{
Name: "stale-secret",
Subscriptions: subs,
})
func (*AlertsGroup) CreateAlertWebhook ¶
func (g *AlertsGroup) CreateAlertWebhook(ctx context.Context, body generated.CreateAlertWebhookJSONRequestBody) (*AlertWebhookCreateResult, error)
CreateAlertWebhook registers a webhook channel. The returned HMAC secret is shown only once; store it securely.
res, err := client.Community().Alerts().CreateAlertWebhook(ctx, generated.CreateAlertWebhookJSONBody{
Name: "soc-hook",
Type: generated.CreateAlertWebhookJSONBodyTypeGeneric,
Url: "https://soc.example.com/hooks/bh",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Secret (save now): %s\n", *res.HmacSecret)
func (*AlertsGroup) DeleteAlert ¶
func (g *AlertsGroup) DeleteAlert(ctx context.Context, alertId string) (*ActionResult, error)
DeleteAlert removes an alert rule by ID.
func (*AlertsGroup) DeleteAlertWebhook ¶
func (g *AlertsGroup) DeleteAlertWebhook(ctx context.Context, alertWebhookId string) (*ActionResult, error)
DeleteAlertWebhook removes a webhook channel by ID.
func (*AlertsGroup) RotateAlertWebhookSecret ¶
func (g *AlertsGroup) RotateAlertWebhookSecret(ctx context.Context, alertWebhookId string) (*AlertWebhookSecret, error)
RotateAlertWebhookSecret rotates a webhook channel's HMAC signing secret. The new secret value is returned only here.
func (*AlertsGroup) UpdateAlert ¶
func (g *AlertsGroup) UpdateAlert(ctx context.Context, alertId string, body generated.UpdateAlertJSONRequestBody) (*Alert, error)
UpdateAlert patches an alert rule's name, description, enabled state, or subscriptions.
func (*AlertsGroup) UpdateAlertWebhook ¶
func (g *AlertsGroup) UpdateAlertWebhook(ctx context.Context, alertWebhookId string, body generated.UpdateAlertWebhookJSONRequestBody) (*AlertWebhook, error)
UpdateAlertWebhook patches a webhook channel's name, description, URL, type, or enabled state.
type AllFindings ¶
type AllFindings = generated.ApiResponseAllFindings
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AnalysisGroup ¶
type AnalysisGroup struct {
API *generated.ClientWithResponses
}
AnalysisGroup provides methods for enterprise Tier Zero analysis and combo-node graph visualization.
Access this group via [EnterpriseClient.Analysis]:
analysis := client.Enterprise().Analysis()
func (*AnalysisGroup) AssetGroupComboNode
deprecated
func (g *AnalysisGroup) AssetGroupComboNode(ctx context.Context, assetGroupID int32) (*BHGraphGraph, error)
AssetGroupComboNode retrieves the combo node graph for a specific asset group. The returned BHGraphGraph contains the nodes and edges that make up the asset group's attack path visualization.
graph, err := client.Enterprise().Analysis().AssetGroupComboNode(ctx, assetGroupID)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Graph: %v\n", graph)
Deprecated: This endpoint is deprecated by BloodHound and will no longer be supported in a future release.
func (*AnalysisGroup) ComboTreeGraph ¶
func (g *AnalysisGroup) ComboTreeGraph(ctx context.Context, domainID string) (*BHGraphGraph, error)
ComboTreeGraph retrieves the combo tree graph structure for a domain. The returned BHGraphGraph contains nodes and edges representing the hierarchical Tier Zero visualization.
graph, err := client.Enterprise().Analysis().ComboTreeGraph(ctx, domainID)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Graph: %v\n", graph)
func (*AnalysisGroup) LatestTierZeroComboNode ¶
func (g *AnalysisGroup) LatestTierZeroComboNode(ctx context.Context, domainID string) (map[string]BHGraphNode, error)
LatestTierZeroComboNode retrieves the latest Tier Zero combo node map for a domain. The returned map is keyed by node ID, with each value being a BHGraphNode containing the node's label, properties, and relationships.
nodes, err := client.Enterprise().Analysis().LatestTierZeroComboNode(ctx, domainID)
if err != nil {
log.Fatal(err)
}
for id, node := range nodes {
fmt.Printf("Node %s: %v\n", id, node)
}
type AnalysisRequestDetails ¶
type AnalysisRequestDetails struct {
DeleteAllGraph *bool
DeleteSourceKinds []string
DeleteSourcelessGraph *bool
RequestType *string
RequestedAt *time.Time
RequestedBy *string
}
AnalysisRequestDetails contains the current analysis request metadata.
type AppConfigParam ¶
type AppConfigParam = generated.ModelAppConfigParam
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AppConfigUpdateResult ¶
AppConfigUpdateResult contains updated config key/value returned by SetAppConfigParam.
type AssetGroup ¶
type AssetGroup = generated.ModelAssetGroup
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AssetGroupCollection ¶
type AssetGroupCollection = generated.ModelAssetGroupCollection
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AssetGroupMember ¶
type AssetGroupMember = generated.ModelAssetGroupMember
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AssetGroupMemberSelectors ¶
type AssetGroupMemberSelectors struct {
Member *AssetGroupTagsMember
Selectors []AssetGroupTagsSelector
}
AssetGroupMemberSelectors contains one member and the selectors attached to it.
type AssetGroupSelector ¶
type AssetGroupSelector = generated.ModelAssetGroupSelector
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AssetGroupSelectorsUpdateResult ¶
type AssetGroupSelectorsUpdateResult struct {
AddedSelectors []AssetGroupSelector
RemovedSelectors []AssetGroupSelector
}
AssetGroupSelectorsUpdateResult contains selector diff results from selector update endpoints.
type AssetGroupTag ¶
type AssetGroupTag = generated.ModelAssetGroupTag
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AssetGroupTagSearchResult ¶
type AssetGroupTagSearchResult struct {
Members []AssetGroupTagsMember
Selectors []AssetGroupTagsSelector
Tags []AssetGroupTag
}
AssetGroupTagSearchResult contains grouped search results for asset group tag search.
type AssetGroupTagsCertification ¶
type AssetGroupTagsCertification = generated.ModelAssetGroupTagsCertificationResponse
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AssetGroupTagsHistory ¶
type AssetGroupTagsHistory = generated.ModelAssetGroupTagsHistory
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AssetGroupTagsMember ¶
type AssetGroupTagsMember = generated.ModelAssetGroupTagsMember
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AssetGroupTagsSelector ¶
type AssetGroupTagsSelector = generated.ModelAssetGroupTagsSelectorResponse
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AssetIsolationGroup ¶
type AssetIsolationGroup struct {
API *generated.ClientWithResponses
}
AssetIsolationGroup provides methods for managing asset groups, tags, selectors, and member queries used in BloodHound's asset isolation and Tier Zero management.
Access this group via [CommunityClient.AssetIsolation] or [EnterpriseClient.AssetIsolation]:
isolation := client.Community().AssetIsolation()
func (*AssetIsolationGroup) AssetGroup ¶
func (g *AssetIsolationGroup) AssetGroup(ctx context.Context, assetGroupID int32) (*AssetGroup, error)
AssetGroup retrieves a single asset group by ID.
func (*AssetIsolationGroup) AssetGroupCollections ¶
func (g *AssetIsolationGroup) AssetGroupCollections(ctx context.Context, assetGroupID int32, opts *ListOptions) ([]AssetGroupCollection, error)
AssetGroupCollections lists collection entries for an asset group. Pass a *ListOptions to set SortBy, or nil for server defaults.
func (*AssetIsolationGroup) AssetGroupCustomMemberCount ¶
func (g *AssetIsolationGroup) AssetGroupCustomMemberCount(ctx context.Context, assetGroupID int32) (*int, error)
AssetGroupCustomMemberCount returns the count of custom (non-selector-matched) members in an asset group.
func (*AssetIsolationGroup) AssetGroupMemberCountByKind ¶
func (g *AssetIsolationGroup) AssetGroupMemberCountByKind(ctx context.Context, assetGroupID int32) (*CountByKind, error)
AssetGroupMemberCountByKind returns member counts grouped by node kind (User, Computer, Group, etc.) for an asset group.
func (*AssetIsolationGroup) AssetGroupMembers
deprecated
func (g *AssetIsolationGroup) AssetGroupMembers(ctx context.Context, assetGroupID int32, opts *ListOptions) ([]AssetGroupMember, error)
AssetGroupMembers lists all members of an asset group. Each returned AssetGroupMember identifies a graph node included in the group. Pass a *ListOptions to paginate or sort results, or nil for server defaults.
members, err := client.Community().AssetIsolation().AssetGroupMembers(ctx, groupID, nil)
if err != nil {
log.Fatal(err)
}
for _, m := range members {
fmt.Printf("%s (%s)\n", m.Name, m.ObjectId)
}
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use AssetIsolationGroup.AssetGroupTagMembersById or AssetIsolationGroup.AssetGroupTagMembersBySelector instead.
When no explicit Limit is set, results are fetched across all pages.
func (*AssetIsolationGroup) AssetGroupSelectorMemberCountsByKind ¶
func (g *AssetIsolationGroup) AssetGroupSelectorMemberCountsByKind(ctx context.Context, assetGroupTagID int32, assetGroupTagSelectorId int32) (*CountByKind, error)
AssetGroupSelectorMemberCountsByKind returns selector-specific member counts grouped by node kind.
func (*AssetIsolationGroup) AssetGroupSelectorsByMemberId ¶
func (g *AssetIsolationGroup) AssetGroupSelectorsByMemberId(ctx context.Context, assetGroupTagID int32, assetGroupMemberId int32) (*AssetGroupMemberSelectors, error)
AssetGroupSelectorsByMemberId retrieves the selectors that caused a specific member to be included in an asset group tag. The returned AssetGroupMemberSelectors contains the member details and matching selectors.
func (*AssetIsolationGroup) AssetGroupTag ¶
func (g *AssetIsolationGroup) AssetGroupTag(ctx context.Context, assetGroupTagID int32) (*AssetGroupTag, error)
AssetGroupTag retrieves a single asset group tag by ID.
func (*AssetIsolationGroup) AssetGroupTagHistory ¶
func (g *AssetIsolationGroup) AssetGroupTagHistory(ctx context.Context, opts *ListOptions) (*AssetGroupTagsHistory, error)
AssetGroupTagHistory retrieves the change history for asset group tags. Pass a *ListOptions to paginate or sort results, or nil for server defaults.
func (*AssetIsolationGroup) AssetGroupTagMemberCountByKind ¶
func (g *AssetIsolationGroup) AssetGroupTagMemberCountByKind(ctx context.Context, assetGroupTagID int32) (*CountByKind, error)
AssetGroupTagMemberCountByKind returns tag member counts grouped by node kind (User, Computer, Group, etc.).
func (*AssetIsolationGroup) AssetGroupTagMembersById ¶
func (g *AssetIsolationGroup) AssetGroupTagMembersById(ctx context.Context, assetGroupTagID int32, opts *ListOptions) ([]AssetGroupTagsMember, error)
AssetGroupTagMembersById lists members associated with an asset group tag. Pass a *ListOptions to paginate or sort results, or nil for server defaults. When no explicit Limit is set, ALL members are returned (CE supports limit=-1 as unlimited for this endpoint).
func (*AssetIsolationGroup) AssetGroupTagMembersBySelector ¶
func (g *AssetIsolationGroup) AssetGroupTagMembersBySelector(ctx context.Context, assetGroupTagID int32, assetGroupTagSelectorId int32, opts *ListOptions) ([]AssetGroupTagsMember, error)
AssetGroupTagMembersBySelector lists members matched by a specific selector within an asset group tag. Pass a *ListOptions to paginate or sort results, or nil for server defaults. When no explicit Limit is set, ALL members are returned (CE supports limit=-1 as unlimited for this endpoint).
func (*AssetIsolationGroup) AssetGroupTagSearch ¶
func (g *AssetIsolationGroup) AssetGroupTagSearch(ctx context.Context, body generated.AssetGroupTagSearchJSONRequestBody) (*AssetGroupTagSearchResult, error)
AssetGroupTagSearch searches across tags, members, and selectors. The returned AssetGroupTagSearchResult contains matching items from all three categories.
func (*AssetIsolationGroup) AssetGroupTagSelector ¶
func (g *AssetIsolationGroup) AssetGroupTagSelector(ctx context.Context, assetGroupTagID int32, assetGroupTagSelectorId int32) (*AssetGroupTagsSelector, error)
AssetGroupTagSelector retrieves a single selector by tag and selector ID.
func (*AssetIsolationGroup) AssetGroupTagSelectors ¶
func (g *AssetIsolationGroup) AssetGroupTagSelectors(ctx context.Context, assetGroupTagID int32) ([]AssetGroupTagsSelector, error)
AssetGroupTagSelectors lists ALL selectors configured for an asset group tag. The CE endpoint defaults to a limit of 50 when no limit is supplied, so this method requests limit=-1 (unlimited, supported by CE on this endpoint) to avoid silent truncation.
func (*AssetIsolationGroup) AssetGroupTags ¶
func (g *AssetIsolationGroup) AssetGroupTags(ctx context.Context) ([]AssetGroupTag, error)
AssetGroupTags lists all asset group tags.
func (*AssetIsolationGroup) AssetGroups ¶
func (g *AssetIsolationGroup) AssetGroups(ctx context.Context, opts *ListOptions) ([]AssetGroup, error)
AssetGroups lists all asset groups configured in the BloodHound instance. Pass a *ListOptions to set SortBy, or nil for server defaults.
func (*AssetIsolationGroup) CreateAssetGroup ¶
func (g *AssetIsolationGroup) CreateAssetGroup(ctx context.Context, body generated.CreateAssetGroupJSONRequestBody) (*AssetGroup, error)
CreateAssetGroup creates a new asset group.
func (*AssetIsolationGroup) CreateAssetGroupTagSelector ¶
func (g *AssetIsolationGroup) CreateAssetGroupTagSelector(ctx context.Context, assetGroupTagID int32, body generated.CreateAssetGroupTagSelectorJSONRequestBody) (*AssetGroupTagsSelector, error)
CreateAssetGroupTagSelector creates a new selector for an asset group tag.
func (*AssetIsolationGroup) DeleteAssetGroup ¶
func (g *AssetIsolationGroup) DeleteAssetGroup(ctx context.Context, assetGroupID int32) (*ActionResult, error)
DeleteAssetGroup removes an asset group.
func (*AssetIsolationGroup) DeleteAssetGroupSelector ¶
func (g *AssetIsolationGroup) DeleteAssetGroupSelector(ctx context.Context, assetGroupID int32, assetGroupSelectorId int32) (*ActionResult, error)
DeleteAssetGroupSelector removes a single selector from an asset group.
func (*AssetIsolationGroup) DeleteAssetGroupTagSelector ¶
func (g *AssetIsolationGroup) DeleteAssetGroupTagSelector(ctx context.Context, assetGroupTagID int32, assetGroupTagSelectorId int32) (*ActionResult, error)
DeleteAssetGroupTagSelector removes a selector from an asset group tag.
func (*AssetIsolationGroup) IsOwned ¶ added in v0.8.10
IsOwned reports whether the object with the given object ID is currently a member of the "Owned" tag in the BloodHound graph.
func (*AssetIsolationGroup) MarkAsOwned ¶ added in v0.8.10
func (g *AssetIsolationGroup) MarkAsOwned(ctx context.Context, objectID string) (*AssetGroupTagsSelector, error)
MarkAsOwned marks the object with the given object ID as owned. Owned membership is expressed as an object-ID selector on the built-in "Owned" tag. If an existing selector already covers the object, the call is a no-op and returns (nil, nil).
func (*AssetIsolationGroup) OwnedTag ¶ added in v0.8.10
func (g *AssetIsolationGroup) OwnedTag(ctx context.Context) (*AssetGroupTag, error)
OwnedTag returns the built-in "Owned" asset group tag (type 3). Marking an object as owned is expressed as a selector on this tag.
func (*AssetIsolationGroup) PreviewSelectors ¶
func (g *AssetIsolationGroup) PreviewSelectors(ctx context.Context, body generated.PreviewSelectorsJSONRequestBody) (*AssetGroupTagsMember, error)
PreviewSelectors previews the member impact of a selector configuration without persisting any changes.
func (*AssetIsolationGroup) SearchAssetGroupTagHistory ¶
func (g *AssetIsolationGroup) SearchAssetGroupTagHistory(ctx context.Context, body generated.SearchAssetGroupTagHistoryJSONRequestBody, opts *ListOptions) (*AssetGroupTagsHistory, error)
SearchAssetGroupTagHistory searches tag history with filter criteria. Pass a *ListOptions to paginate or sort results, or nil for server defaults.
func (*AssetIsolationGroup) UnmarkAsOwned ¶ added in v0.8.10
func (g *AssetIsolationGroup) UnmarkAsOwned(ctx context.Context, objectID string) error
UnmarkAsOwned removes the object with the given object ID from the "Owned" tag. Selectors whose only seed is the object are deleted; selectors that also own other objects are patched to drop just this seed. If the object is not owned, the call is a no-op.
func (*AssetIsolationGroup) UpdateAssetGroup ¶
func (g *AssetIsolationGroup) UpdateAssetGroup(ctx context.Context, assetGroupID int32, body generated.UpdateAssetGroupJSONRequestBody) (*AssetGroup, error)
UpdateAssetGroup modifies an existing asset group's name or description.
func (*AssetIsolationGroup) UpdateAssetGroupSelectors ¶
func (g *AssetIsolationGroup) UpdateAssetGroupSelectors(ctx context.Context, assetGroupID int32, body generated.UpdateAssetGroupSelectorsJSONRequestBody) (*AssetGroupSelectorsUpdateResult, error)
UpdateAssetGroupSelectors replaces the selector set for an asset group. The returned AssetGroupSelectorsUpdateResult contains the added and removed selector diff.
func (*AssetIsolationGroup) UpdateAssetGroupSelectorsDeprecated
deprecated
func (g *AssetIsolationGroup) UpdateAssetGroupSelectorsDeprecated(ctx context.Context, assetGroupID int32, body generated.UpdateAssetGroupSelectorsDeprecatedJSONRequestBody) (*AssetGroupSelectorsUpdateResult, error)
UpdateAssetGroupSelectorsDeprecated replaces the selector set for an asset group using the legacy endpoint.
Deprecated: Use AssetIsolationGroup.UpdateAssetGroupSelectors instead.
func (*AssetIsolationGroup) UpdateAssetGroupTag ¶
func (g *AssetIsolationGroup) UpdateAssetGroupTag(ctx context.Context, assetGroupTagID int32, body generated.UpdateAssetGroupTagJSONRequestBody) (*AssetGroupTag, error)
UpdateAssetGroupTag modifies an existing asset group tag.
func (*AssetIsolationGroup) UpdateAssetGroupTagSelector ¶
func (g *AssetIsolationGroup) UpdateAssetGroupTagSelector(ctx context.Context, assetGroupTagID int32, assetGroupTagSelectorId int32, body generated.UpdateAssetGroupTagSelectorJSONRequestBody) (*AssetGroupTagsSelector, error)
UpdateAssetGroupTagSelector modifies an existing selector for an asset group tag.
type AttackPathFinding ¶
type AttackPathFinding struct {
AssetGroupTagId *int `json:"asset_group_tag_id,omitempty"`
EnvironmentId *string `json:"environment_id,omitempty"`
EnvironmentName *string `json:"environment_name,omitempty"`
Finding *string `json:"finding,omitempty"`
FindingType *string `json:"finding_type,omitempty"`
FirstSeen *time.Time `json:"first_seen,omitempty"`
LastSeen *time.Time `json:"last_seen,omitempty"`
Platform *string `json:"platform,omitempty"`
Severity *string `json:"severity,omitempty"`
SourcePrincipalId *string `json:"source_principal_id,omitempty"`
SourcePrincipalKind *string `json:"source_principal_kind,omitempty"`
SourcePrincipalName *string `json:"source_principal_name,omitempty"`
Status *string `json:"status,omitempty"`
TargetPrincipalId *string `json:"target_principal_id,omitempty"`
TargetPrincipalKind *string `json:"target_principal_kind,omitempty"`
TargetPrincipalName *string `json:"target_principal_name,omitempty"`
Title *string `json:"title,omitempty"`
ZoneName *string `json:"zone_name,omitempty"`
}
AttackPathFinding is one finding from the cross-environment attack path findings listing.
type AttackPathFindingTypeInfo ¶
type AttackPathFindingTypeInfo struct {
Finding string `json:"finding"`
Title string `json:"title"`
}
AttackPathFindingTypeInfo describes one registered attack path finding type.
type AttackPathFindingsOptions ¶
type AttackPathFindingsOptions struct {
// Severity filters by severity level (e.g. "critical").
Severity string
// FindingType filters by finding type.
FindingType string
// Finding filters by finding name.
Finding string
// Title filters by finding title.
Title string
// Platform filters by platform (e.g. "active-directory").
Platform string
// EnvironmentIDs filters by one or more environment identifiers.
EnvironmentIDs []string
// EnvironmentName filters by environment display name.
EnvironmentName string
// AssetGroupTagID filters by asset group tag identifier.
AssetGroupTagID string
// ZoneName filters by zone name.
ZoneName string
// SourcePrincipalID filters by source principal identifier.
SourcePrincipalID string
// SourcePrincipalKind filters by source principal kind.
SourcePrincipalKind string
// SourcePrincipalName filters by source principal display name.
SourcePrincipalName string
// TargetPrincipalID filters by target principal identifier.
TargetPrincipalID string
// TargetPrincipalKind filters by target principal kind.
TargetPrincipalKind string
// TargetPrincipalName filters by target principal display name.
TargetPrincipalName string
// Status filters by finding status (e.g. "hidden").
Status string
// FirstSeen filters by first-seen timestamp predicate.
FirstSeen string
// LastSeen filters by last-seen timestamp predicate.
LastSeen string
// SortBy orders results, e.g. "-last_seen".
SortBy string
// Skip skips the first N results.
Skip *int
// Limit caps the number of results.
Limit *int
}
AttackPathFindingsOptions tunes AttackPathsGroup.AttackPathFindings. Filter fields mirror the API's predicate filters; empty values are not sent.
type AttackPathSparkline ¶
type AttackPathSparkline struct {
Start *time.Time
End *time.Time
Data []RiskCounts
}
AttackPathSparkline contains sparkline point-in-time risk counts.
type AttackPathsGroup ¶
type AttackPathsGroup struct {
API *generated.ClientWithResponses
}
AttackPathsGroup provides methods for enterprise attack path analysis, findings export, and risk management.
Access this group via [EnterpriseClient.AttackPaths]:
paths := client.Enterprise().AttackPaths()
func (*AttackPathsGroup) AllAttackPathFindings ¶
func (g *AttackPathsGroup) AllAttackPathFindings(ctx context.Context) (*AllFindings, error)
AllAttackPathFindings retrieves all attack path findings across domains.
func (*AttackPathsGroup) AttackPathFindingTypes ¶
func (g *AttackPathsGroup) AttackPathFindingTypes(ctx context.Context) ([]AttackPathFindingTypeInfo, error)
AttackPathFindingTypes lists registered attack path finding types.
func (*AttackPathsGroup) AttackPathFindings ¶
func (g *AttackPathsGroup) AttackPathFindings(ctx context.Context, opts *AttackPathFindingsOptions) ([]AttackPathFinding, error)
AttackPathFindings lists attack path findings across environments. Use opts to filter and paginate; nil accepts server defaults.
findings, err := client.Enterprise().AttackPaths().AttackPathFindings(ctx,
&services.AttackPathFindingsOptions{Severity: "critical"})
func (*AttackPathsGroup) AttackPathSparklineValues ¶
func (g *AttackPathsGroup) AttackPathSparklineValues(ctx context.Context, domainID string, opts *ListOptions) (*AttackPathSparkline, error)
AttackPathSparklineValues retrieves sparkline time-series risk data for a domain. Pass a *ListOptions to set SortBy, or nil for server defaults.
func (*AttackPathsGroup) AttackPathTypes ¶
func (g *AttackPathsGroup) AttackPathTypes(ctx context.Context, opts *ListOptions) ([]string, error)
AttackPathTypes lists all known attack path type identifiers. Pass a *ListOptions to set SortBy, or nil for server defaults.
func (*AttackPathsGroup) AvailableAttackPathTypesForDomain ¶
func (g *AttackPathsGroup) AvailableAttackPathTypesForDomain(ctx context.Context, domainID string, opts *ListOptions) ([]string, error)
AvailableAttackPathTypesForDomain lists attack path types that have findings for a specific domain. Pass a *ListOptions to set SortBy, or nil for server defaults.
func (*AttackPathsGroup) DomainAttackPathsDetails ¶
func (g *AttackPathsGroup) DomainAttackPathsDetails(ctx context.Context, domainID string, opts *ListOptions) (map[string]interface{}, error)
DomainAttackPathsDetails retrieves detailed attack path metadata for a domain. Pass a *ListOptions to paginate or sort results, or nil for server defaults.
func (*AttackPathsGroup) ExportAttackPathFindings
deprecated
func (g *AttackPathsGroup) ExportAttackPathFindings(ctx context.Context, domainID string, opts *ListOptions) (string, error)
ExportAttackPathFindings exports attack path findings for a domain as a raw string (typically CSV). Pass a *ListOptions to set SortBy, or nil for server defaults.
csv, err := client.Enterprise().AttackPaths().ExportAttackPathFindings(ctx, domainID, nil)
if err != nil {
log.Fatal(err)
}
os.WriteFile("findings.csv", []byte(csv), 0o644)
Deprecated: This endpoint is deprecated by BloodHound and will no longer be supported in a future release. Use AttackPathsGroup.AllAttackPathFindings or AttackPathsGroup.AttackPathFindings instead.
func (*AttackPathsGroup) FindingTrendsForEnvironment ¶
func (g *AttackPathsGroup) FindingTrendsForEnvironment(ctx context.Context) (map[string]interface{}, error)
FindingTrendsForEnvironment retrieves trend data for attack path findings across environments.
func (*AttackPathsGroup) StartAnalysisAndWait ¶
func (g *AttackPathsGroup) StartAnalysisAndWait(ctx context.Context, options *WaitOptions) (*DatapipeStatusDetails, error)
StartAnalysisAndWait triggers an enterprise attack path analysis run and blocks until the datapipe returns to idle. Use WaitOptions to control polling interval and timeout behavior.
func (*AttackPathsGroup) StartAnalysisBhe ¶
func (g *AttackPathsGroup) StartAnalysisBhe(ctx context.Context) (*ActionResult, error)
StartAnalysisBhe triggers an enterprise attack path analysis run.
func (*AttackPathsGroup) UpdateAttackPathRisk ¶
func (g *AttackPathsGroup) UpdateAttackPathRisk(ctx context.Context, attackPathId int64, body generated.UpdateAttackPathRiskJSONRequestBody) (*Finding, error)
UpdateAttackPathRisk updates the accepted risk level for an attack path finding.
type AuditGroup ¶
type AuditGroup struct {
API *generated.ClientWithResponses
}
AuditGroup provides methods for retrieving BloodHound audit logs that track user and system actions.
Access this group via [CommunityClient.Audit]:
audit := client.Community().Audit()
func (*AuditGroup) AuditLogs ¶
func (g *AuditGroup) AuditLogs(ctx context.Context, opts *ListOptions) ([]AuditLog, error)
AuditLogs retrieves the list of audit log entries. Each AuditLog records an action performed by a user or the system, including the actor, action type, and timestamp. Pass a *ListOptions to paginate or sort results, or nil for server defaults.
logs, err := client.Community().Audit().AuditLogs(ctx, nil)
if err != nil {
log.Fatal(err)
}
for _, entry := range logs {
fmt.Printf("%s: %s\n", *entry.Action, *entry.ActorName)
}
func (*AuditGroup) AuditLogsAll ¶
func (g *AuditGroup) AuditLogsAll(ctx context.Context) ([]AuditLog, error)
AuditLogsAll retrieves all audit log entries across all pages.
logs, err := client.Community().Audit().AuditLogsAll(ctx)
type AuditLog ¶
type AuditLog = generated.ModelAuditLog
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AuthGroup ¶
type AuthGroup struct {
API *generated.ClientWithResponses
}
AuthGroup provides methods for authentication operations including login/logout, SSO provider management (SAML and OIDC), and session introspection.
Access this group via [CommunityClient.Auth]:
auth := client.Community().Auth()
func (*AuthGroup) AuthProviders ¶
func (g *AuthGroup) AuthProviders(ctx context.Context) ([]AuthProvider, error)
AuthProviders lists all configured authentication providers (local, SAML, and OIDC). Each returned AuthProvider includes the provider type and configuration.
providers, err := client.Community().Auth().AuthProviders(ctx)
if err != nil {
log.Fatal(err)
}
for _, p := range providers {
fmt.Printf("Provider: %s (type: %s)\n", *p.Name, *p.Type)
}
func (*AuthGroup) CreateOIDCProvider ¶
func (g *AuthGroup) CreateOIDCProvider(ctx context.Context, body generated.CreateOIDCProviderJSONRequestBody) (*OidcProvider, error)
CreateOIDCProvider registers a new OIDC identity provider. The returned OidcProvider contains the created provider's ID and configuration.
provider, err := client.Community().Auth().CreateOIDCProvider(ctx, generated.CreateOIDCProviderJSONRequestBody{
Name: "my-oidc-provider",
Issuer: "https://idp.example.com",
ClientId: "client-id",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Created provider: %s\n", *provider.Name)
func (*AuthGroup) CreateSAMLProvider
deprecated
func (g *AuthGroup) CreateSAMLProvider(ctx context.Context, name string, metadataXML []byte) (*SamlProvider, error)
CreateSAMLProvider registers a SAML identity provider from IdP metadata XML.
metadata, err := os.ReadFile("okta-metadata.xml")
...
provider, err := client.Community().Auth().CreateSAMLProvider(ctx, "okta", metadata)
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use AuthGroup.CreateSSOSAMLProvider instead.
func (*AuthGroup) CreateSSOSAMLProvider ¶
func (g *AuthGroup) CreateSSOSAMLProvider(ctx context.Context, opts SSOSAMLProviderOptions) (*SamlProvider, error)
CreateSSOSAMLProvider registers an enterprise SSO SAML identity provider from IdP metadata XML, configuring automatic user provisioning.
metadata, err := os.ReadFile("okta-metadata.xml")
...
provider, err := client.Community().Auth().CreateSSOSAMLProvider(ctx, SSOSAMLProviderOptions{
Name: "okta",
MetadataXML: metadata,
AutoProvisionEnabled: true,
AutoProvisionRoleID: "421684921243456780",
RoleProvision: true,
})
func (*AuthGroup) DeleteSSOProvider ¶
func (g *AuthGroup) DeleteSSOProvider(ctx context.Context, ssoProviderID int32) (*AffectedUsersResult, error)
DeleteSSOProvider removes an SSO provider (OIDC or SAML) by its ID. The returned AffectedUsersResult lists any users whose authentication was tied to the deleted provider.
_, err := client.Community().Auth().DeleteSSOProvider(ctx, ssoProviderID)
if err != nil {
log.Fatal(err)
}
func (*AuthGroup) DeleteSamlProvider
deprecated
func (g *AuthGroup) DeleteSamlProvider(ctx context.Context, samlProviderID int32) (*AffectedUsersResult, error)
DeleteSamlProvider removes a SAML identity provider by its ID. The returned AffectedUsersResult lists any users whose authentication was tied to the deleted provider.
_, err := client.Community().Auth().DeleteSamlProvider(ctx, samlProviderID)
if err != nil {
log.Fatal(err)
}
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use AuthGroup.DeleteSSOProvider instead.
func (*AuthGroup) Login ¶
func (g *AuthGroup) Login(ctx context.Context, body generated.LoginJSONRequestBody) (*LoginResult, error)
Login authenticates with username/password credentials. The returned LoginResult includes a session token, user ID, and whether the credentials have expired.
secret := "password"
result, err := client.Community().Auth().Login(ctx, generated.LoginJSONRequestBody{
Username: "admin",
LoginMethod: generated.LoginJSONBodyLoginMethod("secret"),
Secret: &secret,
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Session: %s\n", *result.SessionToken)
func (*AuthGroup) Logout ¶
func (g *AuthGroup) Logout(ctx context.Context) (*ActionResult, error)
Logout terminates the current authenticated session.
_, err := client.Community().Auth().Logout(ctx)
if err != nil {
log.Fatal(err)
}
func (*AuthGroup) PatchSSOProvider ¶
func (g *AuthGroup) PatchSSOProvider(ctx context.Context, ssoProviderID int32, body generated.PatchSSOProviderJSONRequestBody) (*SSOProviderPatchResult, error)
PatchSSOProvider updates an existing SSO provider (OIDC or SAML). The returned SSOProviderPatchResult contains the patched provider, which may be either an OIDC or SAML provider depending on the target.
name := "updated-name"
result, err := client.Community().Auth().PatchSSOProvider(ctx, ssoProviderID, generated.PatchSSOProviderJSONRequestBody{
Name: &name,
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Patched: %v\n", result)
func (*AuthGroup) SSOProviderSAMLSigningCertificate ¶
func (g *AuthGroup) SSOProviderSAMLSigningCertificate(ctx context.Context, ssoProviderID int32) (string, error)
SSOProviderSAMLSigningCertificate retrieves the SAML signing certificate for an SSO provider. The certificate is returned as a PEM-encoded string.
cert, err := client.Community().Auth().SSOProviderSAMLSigningCertificate(ctx, ssoProviderID)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Certificate:\n%s\n", cert)
func (*AuthGroup) SamlProvider
deprecated
SamlProvider retrieves a single SAML identity provider by its numeric ID. The returned SamlProvider includes the provider's configuration details.
provider, err := client.Community().Auth().SamlProvider(ctx, samlProviderID)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Provider: %s\n", *provider.Name)
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use AuthGroup.AuthProviders to list SAML providers via SSO instead.
func (*AuthGroup) SamlProviders
deprecated
func (g *AuthGroup) SamlProviders(ctx context.Context) ([]SamlProvider, error)
SamlProviders lists all configured SAML identity providers. Each returned SamlProvider includes the provider's name, IdP metadata URL, and SSO endpoint.
providers, err := client.Community().Auth().SamlProviders(ctx)
if err != nil {
log.Fatal(err)
}
for _, p := range providers {
fmt.Printf("Provider: %s\n", *p.Name)
}
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use AuthGroup.AuthProviders to list SSO providers instead.
func (*AuthGroup) SamlSignOnEndpoints
deprecated
func (g *AuthGroup) SamlSignOnEndpoints(ctx context.Context) ([]SamlSignOnEndpoint, error)
SamlSignOnEndpoints lists the available SAML sign-on URLs. Each returned SamlSignOnEndpoint includes the provider name and the URL users visit to initiate SAML-based SSO login.
endpoints, err := client.Community().Auth().SamlSignOnEndpoints(ctx)
if err != nil {
log.Fatal(err)
}
for _, ep := range endpoints {
fmt.Printf("Endpoint: %s\n", *ep.Name)
}
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use AuthGroup.AuthProviders to list SSO providers and their endpoints instead.
func (*AuthGroup) SamlSignSignOnEndpoints
deprecated
func (g *AuthGroup) SamlSignSignOnEndpoints(ctx context.Context) ([]SamlSignOnEndpoint, error)
SamlSignSignOnEndpoints is a backwards-compatible alias for AuthGroup.SamlSignOnEndpoints. Prefer the shorter name.
Deprecated: Use SamlSignOnEndpoints instead.
func (*AuthGroup) Self ¶
func (g *AuthGroup) Self(ctx context.Context) (*AuthenticatedRequester, error)
Self retrieves the currently authenticated user's identity and permissions. The returned AuthenticatedRequester includes the user's ID, name, roles, and authentication metadata.
me, err := client.Community().Auth().Self(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("User: %s\n", *me.Name)
type AuthProvider ¶
type AuthProvider = generated.ModelAuthProvider
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AuthToken ¶
type AuthToken = generated.ModelAuthToken
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AuthenticatedRequester ¶
type AuthenticatedRequester = generated.ApiResponseAuthenticatedRequester
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AvailableDomainsQuery ¶
type AvailableDomainsQuery struct {
API *generated.ClientWithResponses
// contains filtered or unexported fields
}
AvailableDomainsQuery is a fluent query builder for listing collected AD domains.
func (*AvailableDomainsQuery) Collected ¶
func (q *AvailableDomainsQuery) Collected(v string) *AvailableDomainsQuery
Collected filters results by collection status. It returns the query for method chaining.
query := client.Community().Search().Domains().Collected("true")
func (*AvailableDomainsQuery) Name ¶
func (q *AvailableDomainsQuery) Name(v string) *AvailableDomainsQuery
Name filters results by domain name. It returns the query for method chaining.
query := client.Community().Search().Domains().Name("corp.local")
func (*AvailableDomainsQuery) ObjectID ¶
func (q *AvailableDomainsQuery) ObjectID(v string) *AvailableDomainsQuery
ObjectID filters results to a specific domain by object ID. It returns the query for method chaining.
query := client.Community().Search().Domains().ObjectID("ABCD1234-...")
func (*AvailableDomainsQuery) Results ¶
func (q *AvailableDomainsQuery) Results(ctx context.Context) ([]DomainSelector, error)
Results executes the domain query and returns matching DomainSelector entries.
domains, err := client.Community().Search().Domains().
Name("corp.local").
Results(ctx)
if err != nil {
log.Fatal(err)
}
for _, d := range domains {
fmt.Printf("%+v\n", d)
}
func (*AvailableDomainsQuery) SortBy ¶
func (q *AvailableDomainsQuery) SortBy(v string) *AvailableDomainsQuery
SortBy sets the field name used to order results. It returns the query for method chaining.
query := client.Community().Search().Domains().SortBy("name")
type AzureDataQualityStat ¶
type AzureDataQualityStat = generated.ModelAzureDataQualityStat
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type AzureEntitiesGroup ¶
type AzureEntitiesGroup struct {
API *generated.ClientWithResponses
}
AzureEntitiesGroup provides methods for querying Azure (Entra ID) entity information from the BloodHound API.
Access this group via [CommunityClient.AzureEntities]:
azure := client.Community().AzureEntities()
func (*AzureEntitiesGroup) AzureEntity ¶
func (g *AzureEntitiesGroup) AzureEntity(ctx context.Context, entityType string, opts *ListOptions) (*AzureEntityData, error)
AzureEntity retrieves an Azure (Entra ID) entity by its type identifier. The returned AzureEntityData includes the entity's kind and a property map containing all collected attributes. Pass a *ListOptions to paginate results, or nil for server defaults.
entity, err := client.Community().AzureEntities().AzureEntity(ctx, "users/abc-123", nil)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Kind: %s\n", *entity.Kind)
type AzureEntityData ¶
AzureEntityData contains selected fields from Azure entity responses.
type BHGraphGraph ¶
type BHGraphGraph = generated.ModelBhGraphGraph
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type BHGraphNode ¶
type BHGraphNode = generated.ModelBhGraphNode
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type BloodHoundUsersGroup ¶
type BloodHoundUsersGroup struct {
API *generated.ClientWithResponses
}
BloodHoundUsersGroup provides methods for managing BloodHound platform user accounts, credentials, and multi-factor authentication.
Access this group via [CommunityClient.BloodHoundUsers] or [EnterpriseClient.BloodHoundUsers]:
users := client.Community().BloodHoundUsers()
func (*BloodHoundUsersGroup) ActivateUserMfa ¶
func (g *BloodHoundUsersGroup) ActivateUserMfa(ctx context.Context, userID openapi_types.UUID, body generated.ActivateUserMfaJSONRequestBody) (MfaActivationStatus, error)
ActivateUserMfa confirms MFA enrollment by validating a TOTP code. Call this after BloodHoundUsersGroup.AddUserMfa to complete setup. The returned MfaActivationStatus reflects the new activation state.
status, err := client.Community().BloodHoundUsers().ActivateUserMfa(ctx, userID, generated.ActivateUserMfaJSONRequestBody{
Otp: ptr("123456"),
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("MFA now: %s\n", status) // "activated"
func (*BloodHoundUsersGroup) AddUserMfa ¶
func (g *BloodHoundUsersGroup) AddUserMfa(ctx context.Context, userID openapi_types.UUID, body generated.AddUserMfaJSONRequestBody) (*UserMfaSetup, error)
AddUserMfa begins MFA enrollment for a user. The returned UserMfaSetup contains a QR code and TOTP secret for authenticator app setup. Complete enrollment by calling BloodHoundUsersGroup.ActivateUserMfa with a valid TOTP code.
setup, err := client.Community().BloodHoundUsers().AddUserMfa(ctx, userID, generated.AddUserMfaJSONRequestBody{
Secret: ptr("currentP@ssw0rd"),
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Scan QR: %s\n", *setup.QrCode)
fmt.Printf("Or enter manually: %s\n", *setup.TotpSecret)
func (*BloodHoundUsersGroup) CreateOrSetUserSecret ¶
func (g *BloodHoundUsersGroup) CreateOrSetUserSecret(ctx context.Context, userID openapi_types.UUID, body generated.CreateOrSetUserSecretJSONRequestBody) (*ActionResult, error)
CreateOrSetUserSecret sets or resets a user's password credential. Use this to assign an initial password or force a password reset.
_, err := client.Community().BloodHoundUsers().CreateOrSetUserSecret(ctx, userID, generated.CreateOrSetUserSecretJSONRequestBody{
Secret: ptr("newP@ssw0rd!"),
NeedsPasswordReset: ptr(true),
})
if err != nil {
log.Fatal(err)
}
func (*BloodHoundUsersGroup) CreateUser ¶
func (g *BloodHoundUsersGroup) CreateUser(ctx context.Context, body generated.CreateUserJSONRequestBody) (*User, error)
CreateUser creates a new BloodHound platform user account. The returned User contains the newly created user's details.
user, err := client.Community().BloodHoundUsers().CreateUser(ctx, generated.CreateUserJSONRequestBody{
Principal: ptr("analyst@example.com"),
EmailAddress: ptr("analyst@example.com"),
Roles: &[]int32{1},
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Created user: %s\n", *user.PrincipalName)
func (*BloodHoundUsersGroup) DeleteUser ¶
func (g *BloodHoundUsersGroup) DeleteUser(ctx context.Context, userID openapi_types.UUID) (*ActionResult, error)
DeleteUser removes a BloodHound platform user account.
result, err := client.Community().BloodHoundUsers().DeleteUser(ctx, userID)
if err != nil {
log.Fatal(err)
}
func (*BloodHoundUsersGroup) DeleteUserSecret ¶
func (g *BloodHoundUsersGroup) DeleteUserSecret(ctx context.Context, userID openapi_types.UUID) (*ActionResult, error)
DeleteUserSecret removes a user's password credential. After deletion the user can only authenticate via SSO until a new secret is set.
_, err := client.Community().BloodHoundUsers().DeleteUserSecret(ctx, userID)
if err != nil {
log.Fatal(err)
}
func (*BloodHoundUsersGroup) MfaActivationStatus ¶
func (g *BloodHoundUsersGroup) MfaActivationStatus(ctx context.Context, userID openapi_types.UUID) (MfaActivationStatus, error)
MfaActivationStatus retrieves whether MFA is pending, active, or deactivated for a user. The returned MfaActivationStatus is a string enum.
status, err := client.Community().BloodHoundUsers().MfaActivationStatus(ctx, userID)
if err != nil {
log.Fatal(err)
}
fmt.Printf("MFA: %s\n", status) // e.g. "activated", "pending", "deactivated"
func (*BloodHoundUsersGroup) RemoveUserMfa ¶
func (g *BloodHoundUsersGroup) RemoveUserMfa(ctx context.Context, userID openapi_types.UUID, body generated.RemoveUserMfaJSONRequestBody) (MfaActivationStatus, error)
RemoveUserMfa disables MFA for a user and returns the resulting MfaActivationStatus.
status, err := client.Community().BloodHoundUsers().RemoveUserMfa(ctx, userID, generated.RemoveUserMfaJSONRequestBody{
Secret: ptr("currentP@ssw0rd"),
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("MFA status: %s\n", status)
func (*BloodHoundUsersGroup) UpdateUser ¶
func (g *BloodHoundUsersGroup) UpdateUser(ctx context.Context, userID openapi_types.UUID, body generated.UpdateUserJSONRequestBody) (*ActionResult, error)
UpdateUser modifies an existing BloodHound platform user's profile or role.
result, err := client.Community().BloodHoundUsers().UpdateUser(ctx, userID, generated.UpdateUserJSONRequestBody{
Principal: ptr("newname@example.com"),
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Status: %d\n", result.StatusCode)
func (*BloodHoundUsersGroup) User ¶
func (g *BloodHoundUsersGroup) User(ctx context.Context, userID openapi_types.UUID) (*User, error)
User retrieves a single BloodHound platform user by UUID. The returned User includes the user's profile, role, and authentication status.
user, err := client.Community().BloodHoundUsers().User(ctx, userID)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Principal: %s Role: %v\n", *user.PrincipalName, user.Roles)
func (*BloodHoundUsersGroup) Users ¶
func (g *BloodHoundUsersGroup) Users(ctx context.Context, opts *ListOptions) ([]User, error)
Users lists all BloodHound platform user accounts. Each returned User includes the user's profile, role, and authentication configuration. Pass a *ListOptions to set SortBy, or nil for server defaults.
users, err := client.Community().BloodHoundUsers().Users(ctx, nil)
if err != nil {
log.Fatal(err)
}
for _, u := range users {
fmt.Printf("%s (role: %s)\n", u.PrincipalName, u.Roles)
}
func (*BloodHoundUsersGroup) UsersMinimal ¶
func (g *BloodHoundUsersGroup) UsersMinimal(ctx context.Context, opts *ListOptions) ([]UsersMinimal, error)
UsersMinimal lists BloodHound platform users with minimal fields (ID and name), suitable for populating dropdowns or autocomplete widgets. Pass a *ListOptions to set SortBy, or nil for server defaults.
users, err := client.Community().BloodHoundUsers().UsersMinimal(ctx, nil)
if err != nil {
log.Fatal(err)
}
for _, u := range users {
fmt.Println(*u.Name)
}
type CertTemplatesGroup ¶
type CertTemplatesGroup struct {
API *generated.ClientWithResponses
}
CertTemplatesGroup provides methods for querying AD Certificate Services certificate template entities and their relationships.
Access this group via [CommunityClient.CertTemplates]:
templates := client.Community().CertTemplates()
func (*CertTemplatesGroup) CertTemplateEntity ¶
func (g *CertTemplatesGroup) CertTemplateEntity(ctx context.Context, objectID string) (*Entity, error)
CertTemplateEntity retrieves a single AD CS certificate template entity by its BloodHound object ID. The returned Entity includes the template's name, label, kind tags, and all collected properties.
tmpl, err := client.Community().CertTemplates().CertTemplateEntity(ctx, "ABCD1234-...")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Template: %s (%s)\n", tmpl.Name, tmpl.Label)
func (*CertTemplatesGroup) Controllers ¶
func (g *CertTemplatesGroup) Controllers(objectID string) *CertTemplatesQuery
Controllers returns a query builder that lists objects with control over this certificate template via inbound ACL-based relationships.
ctrls, err := client.Community().CertTemplates().
Controllers("ABCD1234-...").Limit(50).Results(ctx)
func (*CertTemplatesGroup) PublishedToCAs ¶
func (g *CertTemplatesGroup) PublishedToCAs(objectID string) *CertTemplatesQuery
PublishedToCAs returns a query builder that lists certificate authorities this template is published to.
cas, err := client.Community().CertTemplates().
PublishedToCAs("ABCD1234-...").Limit(50).Results(ctx)
type CertTemplatesQuery ¶
type CertTemplatesQuery struct {
API *generated.ClientWithResponses
// contains filtered or unexported fields
}
CertTemplatesQuery is a fluent query builder for paginated certificate template relationship lookups.
func (*CertTemplatesQuery) All ¶
func (q *CertTemplatesQuery) All(ctx context.Context) ([]RelatedEntity, error)
All executes paginated queries in a loop until all matching entities are collected and returned as a flat slice.
entities, err := client.Community().CertTemplates().Controllers(objectID).All(ctx)
func (*CertTemplatesQuery) Limit ¶
func (q *CertTemplatesQuery) Limit(n int) *CertTemplatesQuery
Limit sets the maximum number of items to return. It returns the query for method chaining.
func (*CertTemplatesQuery) Results ¶
func (q *CertTemplatesQuery) Results(ctx context.Context) (RelatedEntityList, error)
Results executes the query and returns a paginated RelatedEntityList. The list includes the matched entities along with Count, Skip, and Limit metadata for cursor-based pagination.
func (*CertTemplatesQuery) Skip ¶
func (q *CertTemplatesQuery) Skip(n int) *CertTemplatesQuery
Skip sets the number of items to skip for pagination. It returns the query for method chaining.
func (*CertTemplatesQuery) SortBy ¶
func (q *CertTemplatesQuery) SortBy(field string) *CertTemplatesQuery
SortBy sets the field name used to order results. It returns the query for method chaining.
type ClientCollectionOptions ¶
type ClientCollectionOptions struct {
Domains []string
OUs []string
DomainController string
AllTrustedDomains bool
AdStructureCollection bool
SessionCollection bool
LocalGroupCollection bool
CertServicesCollection bool
CaRegistryCollection bool
DcRegistryCollection bool
}
ClientCollectionOptions provides a simplified input shape for scheduling client collection tasks/jobs.
type ClientDisplay ¶
type ClientDisplay = generated.ModelClientDisplay
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type ClientIngestGroup ¶
type ClientIngestGroup struct {
API *generated.ClientWithResponses
}
ClientIngestGroup provides methods for data ingestion operations including collection upload management.
Access this group via [EnterpriseClient.ClientIngest]:
ingest := client.Enterprise().ClientIngest()
func (*ClientIngestGroup) IngestData ¶
func (g *ClientIngestGroup) IngestData(ctx context.Context) (*ActionResult, error)
IngestData triggers a data ingestion operation.
result, err := client.Enterprise().ClientIngest().IngestData(ctx)
if err != nil {
log.Fatal(err)
}
type ClientModel ¶
type ClientModel = generated.ModelClient
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type ClientScheduleDisplay ¶
type ClientScheduleDisplay = generated.ModelClientScheduleDisplay
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type ClientScheduledJob ¶
type ClientScheduledJob = generated.ModelClientScheduledJob
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type ClientScheduledJobDisplay ¶
type ClientScheduledJobDisplay = generated.ModelClientScheduledJobDisplay
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type ClientsGroup ¶
type ClientsGroup struct {
API *generated.ClientWithResponses
}
ClientsGroup provides methods for managing BloodHound collector clients, including registration, scheduling, and task/job lifecycle.
Access this group via [EnterpriseClient.Clients]:
clients := client.Enterprise().Clients()
func (*ClientsGroup) Client ¶
func (g *ClientsGroup) Client(ctx context.Context, clientID openapi_types.UUID) (*ClientDisplay, error)
Client retrieves a single collector client by its UUID.
func (*ClientsGroup) ClientCompletedJobs ¶
func (g *ClientsGroup) ClientCompletedJobs(ctx context.Context, clientID openapi_types.UUID, opts *ListOptions) ([]ClientScheduledJobDisplay, error)
ClientCompletedJobs lists completed jobs for a collector client. Pass a *ListOptions to paginate or sort results, or nil for server defaults.
func (*ClientsGroup) ClientCompletedTasks
deprecated
func (g *ClientsGroup) ClientCompletedTasks(ctx context.Context, clientID openapi_types.UUID, opts *ListOptions) ([]ClientScheduledJobDisplay, error)
ClientCompletedTasks lists completed tasks for a collector client. Pass a *ListOptions to paginate or sort results, or nil for server defaults.
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use ClientsGroup.ClientCompletedJobs instead.
func (*ClientsGroup) Clients ¶
func (g *ClientsGroup) Clients(ctx context.Context, opts *ListOptions) ([]ClientDisplay, error)
Clients lists all registered collector clients. Pass a *ListOptions to paginate or sort results, or nil for server defaults.
clients, err := client.Enterprise().Clients().Clients(ctx, nil)
if err != nil {
log.Fatal(err)
}
for _, c := range clients {
fmt.Printf("Client: %s\n", c.Name)
}
func (*ClientsGroup) CreateAndStartSimpleClientJob ¶
func (g *ClientsGroup) CreateAndStartSimpleClientJob(ctx context.Context, clientID openapi_types.UUID, options ClientCollectionOptions) (*ClientScheduledJob, error)
CreateAndStartSimpleClientJob creates a collection job using simplified ClientCollectionOptions and starts it immediately.
func (*ClientsGroup) CreateAndStartSimpleClientTask
deprecated
func (g *ClientsGroup) CreateAndStartSimpleClientTask(ctx context.Context, clientID openapi_types.UUID, options ClientCollectionOptions) (*ClientScheduledJob, error)
CreateAndStartSimpleClientTask creates a collection task using simplified ClientCollectionOptions and starts it immediately.
Deprecated: This helper targets a deprecated BloodHound endpoint that will be removed in a future release. Use ClientsGroup.CreateAndStartSimpleClientJob instead.
func (*ClientsGroup) CreateClient ¶
func (g *ClientsGroup) CreateClient(ctx context.Context, body generated.CreateClientJSONRequestBody) (*ClientModel, error)
CreateClient registers a new collector client.
func (*ClientsGroup) CreateClientScheduledJob ¶
func (g *ClientsGroup) CreateClientScheduledJob(ctx context.Context, clientID openapi_types.UUID, body generated.CreateClientScheduledJobJSONRequestBody) (*ClientScheduledJob, error)
CreateClientScheduledJob creates a new collection job for a collector client.
func (*ClientsGroup) CreateClientScheduledTask
deprecated
func (g *ClientsGroup) CreateClientScheduledTask(ctx context.Context, clientID openapi_types.UUID, body generated.CreateClientScheduledTaskJSONRequestBody) (*ClientScheduledJob, error)
CreateClientScheduledTask creates a new collection task for a collector client.
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use ClientsGroup.CreateClientScheduledJob or ClientsGroup.CreateSimpleClientScheduledJob instead.
func (*ClientsGroup) CreateSimpleClientScheduledJob ¶
func (g *ClientsGroup) CreateSimpleClientScheduledJob(ctx context.Context, clientID openapi_types.UUID, options ClientCollectionOptions) (*ClientScheduledJob, error)
CreateSimpleClientScheduledJob creates a collection job using simplified ClientCollectionOptions.
func (*ClientsGroup) CreateSimpleClientScheduledTask
deprecated
func (g *ClientsGroup) CreateSimpleClientScheduledTask(ctx context.Context, clientID openapi_types.UUID, options ClientCollectionOptions) (*ClientScheduledJob, error)
CreateSimpleClientScheduledTask creates a collection task using simplified ClientCollectionOptions.
Deprecated: This helper targets a deprecated BloodHound endpoint that will be removed in a future release. Use ClientsGroup.CreateSimpleClientScheduledJob instead.
func (*ClientsGroup) DeleteClient ¶
func (g *ClientsGroup) DeleteClient(ctx context.Context, clientID openapi_types.UUID) (*ActionResult, error)
DeleteClient removes a collector client.
func (*ClientsGroup) LogClientError ¶
func (g *ClientsGroup) LogClientError(ctx context.Context, body generated.LogClientErrorJSONRequestBody) (*ActionResult, error)
LogClientError submits an error log entry for a collector client.
func (*ClientsGroup) ReplaceClientToken ¶
func (g *ClientsGroup) ReplaceClientToken(ctx context.Context, clientID openapi_types.UUID) (*AuthToken, error)
ReplaceClientToken rotates the authentication token for a collector client.
func (*ClientsGroup) RunSimpleClientJob ¶
func (g *ClientsGroup) RunSimpleClientJob(ctx context.Context, clientID openapi_types.UUID, options ClientCollectionOptions, waitOptions *WaitOptions) (*ClientScheduledJobDisplay, error)
RunSimpleClientJob creates a collection job, starts it immediately, and blocks until it reaches a terminal state. Use WaitOptions to control polling interval and timeout behavior.
func (*ClientsGroup) RunSimpleClientTask
deprecated
func (g *ClientsGroup) RunSimpleClientTask(ctx context.Context, clientID openapi_types.UUID, options ClientCollectionOptions, waitOptions *WaitOptions) (*ClientScheduledJobDisplay, error)
RunSimpleClientTask creates a collection task, starts it immediately, and blocks until it reaches a terminal state. Use WaitOptions to control polling interval and timeout behavior.
Deprecated: This helper targets deprecated BloodHound endpoints that will be removed in a future release. Use ClientsGroup.RunSimpleClientJob instead.
func (*ClientsGroup) UpdateClient ¶
func (g *ClientsGroup) UpdateClient(ctx context.Context, clientID openapi_types.UUID, body generated.UpdateClientJSONRequestBody) (*ClientModel, error)
UpdateClient modifies a collector client's configuration.
func (*ClientsGroup) UpdateClientInfo ¶
func (g *ClientsGroup) UpdateClientInfo(ctx context.Context, body generated.UpdateClientInfoJSONRequestBody) (*ClientModel, error)
UpdateClientInfo updates a client's informational metadata.
type CollectionUploadsGroup ¶
type CollectionUploadsGroup struct {
API *generated.ClientWithResponses
}
CollectionUploadsGroup provides methods for uploading BloodHound collection data files (SharpHound/AzureHound output).
Access this group via [CommunityClient.CollectionUploads]:
uploads := client.Community().CollectionUploads()
func (*CollectionUploadsGroup) AcceptedFileUploadTypes ¶
func (g *CollectionUploadsGroup) AcceptedFileUploadTypes(ctx context.Context) ([]string, error)
AcceptedFileUploadTypes lists accepted file upload MIME types.
func (*CollectionUploadsGroup) CompletedTasks ¶
func (g *CollectionUploadsGroup) CompletedTasks(ctx context.Context, fileUploadJobID int64) ([]FileUploadJobCompletedTasks, error)
CompletedTasks lists completed processing tasks for a file upload job.
func (*CollectionUploadsGroup) CreateFileUploadJob ¶
func (g *CollectionUploadsGroup) CreateFileUploadJob(ctx context.Context) (*FileUploadJob, error)
CreateFileUploadJob creates a new file upload job.
func (*CollectionUploadsGroup) EndFileUploadJob ¶
func (g *CollectionUploadsGroup) EndFileUploadJob(ctx context.Context, fileUploadJobID int64) (*ActionResult, error)
EndFileUploadJob signals that all files have been uploaded for a job.
func (*CollectionUploadsGroup) FileUploadJob ¶
func (g *CollectionUploadsGroup) FileUploadJob(ctx context.Context, fileUploadJobID int64) (*FileUploadJob, error)
FileUploadJob returns one upload job by ID. It pages through the job list until the job is found or the list is exhausted.
func (*CollectionUploadsGroup) FileUploadJobs ¶
func (g *CollectionUploadsGroup) FileUploadJobs(ctx context.Context, opts *ListOptions) ([]FileUploadJob, error)
FileUploadJobs lists all file upload jobs. Pass a *ListOptions to paginate or sort results, or nil for server defaults.
func (*CollectionUploadsGroup) LatestFileUploadJob ¶
func (g *CollectionUploadsGroup) LatestFileUploadJob(ctx context.Context) (*FileUploadJob, error)
LatestFileUploadJob returns the most recently created upload job, or nil if none exist.
func (*CollectionUploadsGroup) UploadFilePaths ¶
func (g *CollectionUploadsGroup) UploadFilePaths(ctx context.Context, paths ...string) (*FileUploadJob, error)
UploadFilePaths opens and reads local files from disk, detects their MIME content types, and uploads them to a new BloodHound collection file upload job.
job, err := client.Community().CollectionUploads().UploadFilePaths(ctx, "sharphound.zip", "azurehound.json")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Upload job %d complete\n", *job.Id)
func (*CollectionUploadsGroup) UploadFileToJob ¶
func (g *CollectionUploadsGroup) UploadFileToJob(ctx context.Context, fileUploadJobID int64, body generated.UploadFileToJobJSONRequestBody) (*ActionResult, error)
UploadFileToJob uploads a JSON request body to an existing upload job.
func (*CollectionUploadsGroup) UploadFileToJobData ¶
func (g *CollectionUploadsGroup) UploadFileToJobData(ctx context.Context, fileUploadJobID int64, file UploadFile) (*ActionResult, error)
UploadFileToJobData uploads a single file payload to an existing upload job.
func (*CollectionUploadsGroup) UploadFiles ¶
func (g *CollectionUploadsGroup) UploadFiles(ctx context.Context, files []UploadFile) (*FileUploadJob, error)
UploadFiles uploads one or more collection data files (e.g., SharpHound or AzureHound output). It creates a new upload job, uploads each file, ends the job, and returns the final FileUploadJob record.
After ending the job the record is refreshed from the server (a paged scan of the job list) so the returned status reflects post-processing state; this costs extra requests by design. Concurrent uploads may require scanning multiple pages before the job is located.
data, _ := os.ReadFile("sharphound_output.zip")
job, err := client.Community().CollectionUploads().UploadFiles(ctx, []services.UploadFile{
{Path: "sharphound_output.zip", ContentType: "application/zip", Data: data},
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Upload job %d complete\n", *job.Id)
type CollectorManifest ¶
type CollectorManifest = generated.ModelCollectorManifest
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type CollectorsGroup ¶
type CollectorsGroup struct {
API *generated.ClientWithResponses
}
CollectorsGroup provides methods for retrieving BloodHound collector (SharpHound/AzureHound) version information and download manifests.
Access this group via [CommunityClient.Collectors] or [EnterpriseClient.Collectors]:
collectors := client.Community().Collectors()
func (*CollectorsGroup) CollectorChecksum ¶
func (g *CollectorsGroup) CollectorChecksum(ctx context.Context, collectorType EnumClientType, releaseTag string) (string, error)
CollectorChecksum retrieves the SHA-256 checksum for a specific collector release, which can be used to verify the integrity of a downloaded binary.
checksum, err := client.Community().Collectors().CollectorChecksum(ctx, services.SharpHound, "v2.0.0")
if err != nil {
log.Fatal(err)
}
fmt.Printf("SHA-256: %s\n", checksum)
func (*CollectorsGroup) CollectorManifest ¶
func (g *CollectorsGroup) CollectorManifest(ctx context.Context, collectorType EnumClientType) (*CollectorManifest, error)
CollectorManifest retrieves the download manifest for a given collector type (SharpHound or AzureHound). The returned CollectorManifest contains version information and available release assets.
manifest, err := client.Community().Collectors().CollectorManifest(ctx, services.SharpHound)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Latest: %s\n", manifest.Latest)
func (*CollectorsGroup) DownloadCollector ¶
func (g *CollectorsGroup) DownloadCollector(ctx context.Context, collectorType EnumClientType, releaseTag string) (io.ReadSeeker, error)
DownloadCollector downloads a collector binary for the given type and release tag. The returned io.ReadSeeker contains the raw binary content.
reader, err := client.Community().Collectors().DownloadCollector(ctx, services.SharpHound, "v2.0.0")
if err != nil {
log.Fatal(err)
}
io.Copy(outFile, reader)
type CommunityQueriesProvider ¶
type CommunityQueriesProvider struct{}
CommunityQueriesProvider provides pre-built Cypher queries from the standard BloodHound community query pack for Active Directory and Azure environments.
var CommunityQueries CommunityQueriesProvider
CommunityQueries is the singleton provider of standard BloodHound community queries.
func (CommunityQueriesProvider) ASREPRoastableAccounts ¶
func (CommunityQueriesProvider) ASREPRoastableAccounts() string
ASREPRoastableAccounts returns Cypher to find all user accounts that do not require Kerberos pre-authentication (vulnerable to AS-REP Roasting).
func (CommunityQueriesProvider) DCSyncPrincipals ¶
func (CommunityQueriesProvider) DCSyncPrincipals() string
DCSyncPrincipals returns Cypher to find all principals with DCSync rights (GetChanges and GetChangesAll) on any domain.
func (CommunityQueriesProvider) DomainAdmins ¶
func (CommunityQueriesProvider) DomainAdmins() string
DomainAdmins returns Cypher to find all members of Domain Admins groups.
func (CommunityQueriesProvider) DomainControllers ¶
func (CommunityQueriesProvider) DomainControllers() string
DomainControllers returns Cypher to find all Domain Controller computers.
func (CommunityQueriesProvider) HighValueTargets ¶
func (CommunityQueriesProvider) HighValueTargets() string
HighValueTargets returns Cypher to find all Tier Zero / High Value Target nodes.
func (CommunityQueriesProvider) KerberoastableAccounts ¶
func (CommunityQueriesProvider) KerberoastableAccounts() string
KerberoastableAccounts returns Cypher to find all enabled user accounts with Service Principal Names (SPNs) vulnerable to Kerberoasting.
func (CommunityQueriesProvider) LAPSViewers ¶
func (CommunityQueriesProvider) LAPSViewers() string
LAPSViewers returns Cypher to find all principals with rights to read LAPS passwords.
func (CommunityQueriesProvider) OwnedPrincipals ¶
func (CommunityQueriesProvider) OwnedPrincipals() string
OwnedPrincipals returns Cypher to find all compromised / owned objects in the database.
func (CommunityQueriesProvider) PasswordNeverExpires ¶
func (CommunityQueriesProvider) PasswordNeverExpires() string
PasswordNeverExpires returns Cypher to find all enabled users whose passwords never expire.
func (CommunityQueriesProvider) SensitiveAccountsNotDelegated ¶
func (CommunityQueriesProvider) SensitiveAccountsNotDelegated() string
SensitiveAccountsNotDelegated returns Cypher to find sensitive accounts not marked as protected from delegation.
func (CommunityQueriesProvider) ShortestPathsToDomainAdmins ¶
func (CommunityQueriesProvider) ShortestPathsToDomainAdmins() string
ShortestPathsToDomainAdmins returns Cypher to find the shortest attack paths from all enabled users to Domain Admins groups.
func (CommunityQueriesProvider) ShortestPathsToTierZero ¶
func (CommunityQueriesProvider) ShortestPathsToTierZero() string
ShortestPathsToTierZero returns Cypher to find the shortest attack paths to any Tier Zero / High Value Target assets.
func (CommunityQueriesProvider) UnconstrainedDelegation ¶
func (CommunityQueriesProvider) UnconstrainedDelegation() string
UnconstrainedDelegation returns Cypher to find all computers configured with unconstrained Kerberos delegation.
func (CommunityQueriesProvider) UsersWithSPNAndAdminRights ¶
func (CommunityQueriesProvider) UsersWithSPNAndAdminRights() string
UsersWithSPNAndAdminRights returns Cypher to find Kerberoastable accounts that also have local admin rights.
type ComputersGroup ¶
type ComputersGroup struct {
API *generated.ClientWithResponses
}
ComputersGroup provides methods for querying Active Directory computer entities and their relationships from the BloodHound API.
Access this group via [CommunityClient.Computers] or [EnterpriseClient.Computers]:
computers := client.Community().Computers()
func (*ComputersGroup) AdminRights ¶
func (g *ComputersGroup) AdminRights(objectID string) *ComputersQuery
AdminRights returns a query builder that lists computers where this computer has local administrator privileges via delegation or trust relationships.
results, err := client.Community().Computers().
AdminRights("ABCD1234-...").Limit(50).Results(ctx)
func (*ComputersGroup) Admins ¶
func (g *ComputersGroup) Admins(objectID string) *ComputersQuery
Admins returns a query builder that lists all principals with local administrator privileges on this computer.
func (*ComputersGroup) ComputerEntity ¶
ComputerEntity retrieves a single AD computer entity by its BloodHound object ID. The returned Entity includes the computer's name, label, kind tags, and all collected properties (e.g., OS version, enabled status, service principal names).
computer, err := client.Community().Computers().ComputerEntity(ctx, "ABCD1234-...")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Computer: %s (%s)\n", computer.Name, computer.Label)
func (*ComputersGroup) ConstrainedDelegationRights ¶
func (g *ComputersGroup) ConstrainedDelegationRights(objectID string) *ComputersQuery
ConstrainedDelegationRights returns a query builder that lists services this computer is allowed to delegate credentials to via Kerberos constrained delegation.
func (*ComputersGroup) ConstrainedUsers ¶
func (g *ComputersGroup) ConstrainedUsers(objectID string) *ComputersQuery
ConstrainedUsers returns a query builder that lists users allowed to delegate credentials to this computer via Kerberos constrained delegation.
func (*ComputersGroup) Controllables ¶
func (g *ComputersGroup) Controllables(objectID string) *ComputersQuery
Controllables returns a query builder that lists AD objects this computer can control via outbound ACL-based relationships (GenericAll, WriteDacl, etc.).
func (*ComputersGroup) Controllers ¶
func (g *ComputersGroup) Controllers(objectID string) *ComputersQuery
Controllers returns a query builder that lists AD objects with control over this computer via inbound ACL-based relationships.
func (*ComputersGroup) DcomRights ¶
func (g *ComputersGroup) DcomRights(objectID string) *ComputersQuery
DcomRights returns a query builder that lists computers where this computer has DCOM (Distributed COM) execution rights.
func (*ComputersGroup) DcomUsers ¶
func (g *ComputersGroup) DcomUsers(objectID string) *ComputersQuery
DcomUsers returns a query builder that lists users with DCOM execution rights on this computer.
func (*ComputersGroup) GroupMembership ¶
func (g *ComputersGroup) GroupMembership(objectID string) *ComputersQuery
GroupMembership returns a query builder that lists the AD groups this computer belongs to.
func (*ComputersGroup) PsRemoteRights ¶
func (g *ComputersGroup) PsRemoteRights(objectID string) *ComputersQuery
PsRemoteRights returns a query builder that lists computers where this computer has PowerShell Remoting (WinRM) access.
func (*ComputersGroup) PsRemoteUsers ¶
func (g *ComputersGroup) PsRemoteUsers(objectID string) *ComputersQuery
PsRemoteUsers returns a query builder that lists users with PowerShell Remoting (WinRM) access on this computer.
func (*ComputersGroup) RdpRights ¶
func (g *ComputersGroup) RdpRights(objectID string) *ComputersQuery
RdpRights returns a query builder that lists computers where this computer has Remote Desktop Protocol access.
func (*ComputersGroup) RdpUsers ¶
func (g *ComputersGroup) RdpUsers(objectID string) *ComputersQuery
RdpUsers returns a query builder that lists users with Remote Desktop Protocol access on this computer.
func (*ComputersGroup) Sessions ¶
func (g *ComputersGroup) Sessions(objectID string) *ComputersQuery
Sessions returns a query builder that lists users with active logon sessions on this computer.
func (*ComputersGroup) SqlAdmins ¶
func (g *ComputersGroup) SqlAdmins(objectID string) *ComputersQuery
SqlAdmins returns a query builder that lists users with SQL Server sysadmin privileges on this computer.
type ComputersQuery ¶
type ComputersQuery struct {
API *generated.ClientWithResponses
// contains filtered or unexported fields
}
ComputersQuery is a fluent query builder for paginated computer relationship lookups.
func (*ComputersQuery) All ¶
func (q *ComputersQuery) All(ctx context.Context) ([]RelatedEntity, error)
All executes paginated queries in a loop until all matching entities are collected and returned as a flat slice.
entities, err := client.Community().Computers().Admins(objectID).All(ctx)
func (*ComputersQuery) Limit ¶
func (q *ComputersQuery) Limit(n int) *ComputersQuery
Limit sets the maximum number of items to return. It returns the query for method chaining.
func (*ComputersQuery) Results ¶
func (q *ComputersQuery) Results(ctx context.Context) (RelatedEntityList, error)
Results executes the query and returns a paginated RelatedEntityList. The list includes the matched entities along with Count, Skip, and Limit metadata for cursor-based pagination.
func (*ComputersQuery) Skip ¶
func (q *ComputersQuery) Skip(n int) *ComputersQuery
Skip sets the number of items to skip for pagination. It returns the query for method chaining.
func (*ComputersQuery) SortBy ¶
func (q *ComputersQuery) SortBy(field string) *ComputersQuery
SortBy sets the field name used to order results. It returns the query for method chaining.
type ConfigGroup ¶
type ConfigGroup struct {
API *generated.ClientWithResponses
}
ConfigGroup provides methods for reading and updating BloodHound application configuration parameters.
Access this group via [CommunityClient.Config] or [EnterpriseClient.Config]:
config := client.Community().Config()
func (*ConfigGroup) AppConfigParams ¶
func (g *ConfigGroup) AppConfigParams(ctx context.Context) ([]AppConfigParam, error)
AppConfigParams lists all application configuration parameters. Each returned AppConfigParam contains the parameter key, value, and description.
params, err := client.Community().Config().AppConfigParams(ctx)
if err != nil {
log.Fatal(err)
}
for _, p := range params {
fmt.Printf("%s = %v\n", p.Key, p.Value)
}
func (*ConfigGroup) FeatureFlags ¶
func (g *ConfigGroup) FeatureFlags(ctx context.Context) ([]FeatureFlag, error)
FeatureFlags lists all feature flags and their current enabled/disabled state.
flags, err := client.Community().Config().FeatureFlags(ctx)
if err != nil {
log.Fatal(err)
}
for _, f := range flags {
fmt.Printf("%s: enabled=%v\n", *f.Key, *f.Enabled)
}
func (*ConfigGroup) SetAppConfigParam ¶
func (g *ConfigGroup) SetAppConfigParam(ctx context.Context, body generated.SetAppConfigParamJSONRequestBody) (*AppConfigUpdateResult, error)
SetAppConfigParam updates an application configuration parameter. The returned AppConfigUpdateResult contains the updated key and value.
result, err := client.Community().Config().SetAppConfigParam(ctx, generated.SetAppConfigParamJSONRequestBody{
Key: "session.ttl",
Value: map[string]any{"value": 3600},
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Updated: %s\n", result.Key)
func (*ConfigGroup) ToggleFeatureFlag ¶
func (g *ConfigGroup) ToggleFeatureFlag(ctx context.Context, featureId int32) (*ToggleFeatureFlagResult, error)
ToggleFeatureFlag enables or disables a feature flag by its numeric ID.
result, err := client.Community().Config().ToggleFeatureFlag(ctx, featureId)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Enabled: %v\n", result.Enabled)
type ContainersGroup ¶
type ContainersGroup struct {
API *generated.ClientWithResponses
}
ContainersGroup provides methods for querying Active Directory container entities and their relationships.
Access this group via [CommunityClient.Containers] or [EnterpriseClient.Containers]:
containers := client.Community().Containers()
func (*ContainersGroup) ContainerEntity ¶
ContainerEntity retrieves a single AD container entity (OU, domain, or other container object) by its BloodHound object ID. The returned Entity includes the container's name, label, kind tags, and all collected properties.
container, err := client.Community().Containers().ContainerEntity(ctx, "ABCD1234-...")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Container: %s (%s)\n", container.Name, container.Label)
func (*ContainersGroup) Controllers ¶
func (g *ContainersGroup) Controllers(objectID string) *ContainersQuery
Controllers returns a query builder that lists AD objects with control over this container via inbound ACL-based relationships.
ctrls, err := client.Community().Containers().
Controllers("ABCD1234-...").Limit(50).Results(ctx)
type ContainersQuery ¶
type ContainersQuery struct {
API *generated.ClientWithResponses
// contains filtered or unexported fields
}
ContainersQuery is a fluent query builder for paginated container relationship lookups.
func (*ContainersQuery) All ¶
func (q *ContainersQuery) All(ctx context.Context) ([]RelatedEntity, error)
All executes paginated queries in a loop until all matching entities are collected and returned as a flat slice.
entities, err := client.Community().Containers().Controllers(objectID).All(ctx)
func (*ContainersQuery) Limit ¶
func (q *ContainersQuery) Limit(n int) *ContainersQuery
Limit sets the maximum number of items to return. It returns the query for method chaining.
func (*ContainersQuery) Results ¶
func (q *ContainersQuery) Results(ctx context.Context) (RelatedEntityList, error)
Results executes the query and returns a paginated RelatedEntityList. The list includes the matched entities along with Count, Skip, and Limit metadata for cursor-based pagination.
func (*ContainersQuery) Skip ¶
func (q *ContainersQuery) Skip(n int) *ContainersQuery
Skip sets the number of items to skip for pagination. It returns the query for method chaining.
func (*ContainersQuery) SortBy ¶
func (q *ContainersQuery) SortBy(field string) *ContainersQuery
SortBy sets the field name used to order results. It returns the query for method chaining.
type CountByKind ¶
CountByKind represents grouped object counts.
type CustomNode ¶
type CustomNode = generated.ModelCustomNode
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type CustomNodeManagementGroup ¶
type CustomNodeManagementGroup struct {
API *generated.ClientWithResponses
}
CustomNodeManagementGroup provides methods for managing custom nodes in the BloodHound graph, allowing user-defined entities beyond standard AD/Azure types.
Access this group via [CommunityClient.CustomNodeManagement] or [EnterpriseClient.CustomNodeManagement]:
nodes := client.Community().CustomNodeManagement()
func (*CustomNodeManagementGroup) CreateCustomNodes ¶
func (g *CustomNodeManagementGroup) CreateCustomNodes(ctx context.Context, body generated.CreateCustomNodesJSONRequestBody) ([]CustomNode, error)
CreateCustomNodes creates one or more custom node type definitions in the graph.
func (*CustomNodeManagementGroup) CustomNode ¶
func (g *CustomNodeManagementGroup) CustomNode(ctx context.Context, kindName string) (*CustomNode, error)
CustomNode retrieves a single custom node type definition by its kind name.
Note: unlike most get-by-id wrappers, this returns the bare model because GET/PUT /api/v2/custom-nodes/{kind_name} respond without a {"data": ...} envelope (verified against api/openapi.json). The list endpoint CustomNodes DOES use the envelope.
func (*CustomNodeManagementGroup) CustomNodes ¶
func (g *CustomNodeManagementGroup) CustomNodes(ctx context.Context) ([]CustomNode, error)
CustomNodes lists all custom node type definitions. Each returned CustomNode describes a user-defined node kind and its properties.
func (*CustomNodeManagementGroup) DeleteCustomNode
deprecated
func (g *CustomNodeManagementGroup) DeleteCustomNode(ctx context.Context, kindName string) (*ActionResult, error)
DeleteCustomNode removes a custom node type definition by its kind name.
Deprecated: This endpoint is no longer supported by BloodHound; it always returns 410 Gone. There is no replacement.
func (*CustomNodeManagementGroup) UpdateCustomNode ¶
func (g *CustomNodeManagementGroup) UpdateCustomNode(ctx context.Context, kindName string, body generated.UpdateCustomNodeJSONRequestBody) (*CustomNode, error)
UpdateCustomNode updates an existing custom node type definition by its kind name.
Note: like CustomNodeManagementGroup.CustomNode, this returns the bare model because PUT /api/v2/custom-nodes/{kind_name} responds without a {"data": ...} envelope (verified against api/openapi.json).
type CypherGroup ¶
type CypherGroup struct {
API *generated.ClientWithResponses
}
CypherGroup provides methods for executing raw Cypher queries against the BloodHound graph database.
Access this group via [CommunityClient.Cypher] or [EnterpriseClient.Cypher]:
cypher := client.Community().Cypher()
func (*CypherGroup) CreateSavedQuery ¶
func (g *CypherGroup) CreateSavedQuery(ctx context.Context, body generated.CreateSavedQueryJSONRequestBody) (*SavedQuery, error)
CreateSavedQuery saves a new Cypher query for later reuse.
q, err := client.Community().Cypher().CreateSavedQuery(ctx, generated.CreateSavedQueryJSONRequestBody{
Name: ptr("All Admins"),
Query: ptr("MATCH (u:User)-[:MemberOf*1..]->(g:Group {name:'DOMAIN ADMINS'}) RETURN u"),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(q.Name)
func (*CypherGroup) DeleteSavedQuery ¶
func (g *CypherGroup) DeleteSavedQuery(ctx context.Context, savedQueryID int64) (*ActionResult, error)
DeleteSavedQuery removes a saved Cypher query by its numeric ID.
_, err := client.Community().Cypher().DeleteSavedQuery(ctx, 42)
if err != nil {
log.Fatal(err)
}
func (*CypherGroup) DeleteSavedQueryPermissions ¶
func (g *CypherGroup) DeleteSavedQueryPermissions(ctx context.Context, savedQueryID int64, body generated.DeleteSavedQueryPermissionsJSONRequestBody) (*ActionResult, error)
DeleteSavedQueryPermissions removes sharing permissions from a saved query.
_, err := client.Community().Cypher().DeleteSavedQueryPermissions(ctx, 42, generated.DeleteSavedQueryPermissionsJSONRequestBody{})
if err != nil {
log.Fatal(err)
}
func (*CypherGroup) ExportSavedQueries ¶
func (g *CypherGroup) ExportSavedQueries(ctx context.Context) (string, error)
ExportSavedQueries exports all saved queries as a string suitable for import.
data, err := client.Community().Cypher().ExportSavedQueries(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println(data)
func (*CypherGroup) ExportSavedQuery ¶
ExportSavedQuery exports a single saved query by its numeric ID as a string.
data, err := client.Community().Cypher().ExportSavedQuery(ctx, 42)
if err != nil {
log.Fatal(err)
}
fmt.Println(data)
func (*CypherGroup) FindSavedQueryByName ¶
func (g *CypherGroup) FindSavedQueryByName(ctx context.Context, name string) (*SavedQuery, error)
FindSavedQueryByName finds a saved query by its name (case-insensitive). It searches through all saved queries accessible to the current user and returns nil if no matching query is found.
q, err := client.Community().Cypher().FindSavedQueryByName(ctx, "Shortest Paths to Domain Admins")
func (*CypherGroup) ImportSavedQueries ¶
func (g *CypherGroup) ImportSavedQueries(ctx context.Context, body generated.ImportSavedQueriesJSONRequestBody) (int, error)
ImportSavedQueries imports saved queries from a previously exported payload.
status, err := client.Community().Cypher().ImportSavedQueries(ctx, generated.ImportSavedQueriesJSONRequestBody{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Import returned status %d\n", status)
func (*CypherGroup) LoadSavedQueryPack ¶
func (g *CypherGroup) LoadSavedQueryPack(ctx context.Context, data []byte) error
LoadSavedQueryPack imports a Community Query pack or custom saved queries JSON payload directly into BloodHound.
err := client.Community().Cypher().LoadSavedQueryPack(ctx, queryPackJSON)
func (*CypherGroup) LoadSavedQueryPackFile ¶
func (g *CypherGroup) LoadSavedQueryPackFile(ctx context.Context, filePath string) error
LoadSavedQueryPackFile reads a saved query pack JSON file from disk and imports it directly into BloodHound.
err := client.Community().Cypher().LoadSavedQueryPackFile(ctx, "community-queries.json")
func (*CypherGroup) LoadSavedQueryPackFromURL ¶
func (g *CypherGroup) LoadSavedQueryPackFromURL(ctx context.Context, rawURL string) error
LoadSavedQueryPackFromURL downloads a saved query pack JSON from the given HTTP/HTTPS URL and imports it into BloodHound.
err := client.Community().Cypher().LoadSavedQueryPackFromURL(ctx, "https://example.com/queries.json")
func (*CypherGroup) LoadSpecterOpsQueryLibrary ¶
func (g *CypherGroup) LoadSpecterOpsQueryLibrary(ctx context.Context) error
LoadSpecterOpsQueryLibrary downloads and imports the official SpecterOps BloodHound Query Library (https://github.com/SpecterOps/BloodHoundQueryLibrary) directly into the BloodHound database.
err := client.Community().Cypher().LoadSpecterOpsQueryLibrary(ctx)
func (*CypherGroup) RunCypher ¶
func (g *CypherGroup) RunCypher(ctx context.Context, query string) (*UnifiedGraphGraphWithKeys, error)
RunCypher executes a raw Cypher query string directly against the BloodHound graph database.
graph, err := client.Community().Cypher().RunCypher(ctx, "MATCH (u:User) RETURN u LIMIT 10")
if err != nil {
log.Fatal(err)
}
func (*CypherGroup) RunCypherQuery ¶
func (g *CypherGroup) RunCypherQuery(ctx context.Context, body generated.RunCypherQueryJSONRequestBody) (*UnifiedGraphGraphWithKeys, error)
RunCypherQuery executes a raw Cypher query against the BloodHound graph database and returns the result as an UnifiedGraphGraphWithKeys.
result, err := client.Community().Cypher().RunCypherQuery(ctx, generated.RunCypherQueryJSONRequestBody{
Query: "MATCH (u:User) WHERE u.enabled = true RETURN u LIMIT 10",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Returned %d nodes\n", len(result.Nodes))
func (*CypherGroup) RunSavedQuery ¶
func (g *CypherGroup) RunSavedQuery(ctx context.Context, savedQueryID int32) (*UnifiedGraphGraphWithKeys, error)
RunSavedQuery retrieves a saved Cypher query by ID and executes it against the graph database.
graph, err := client.Community().Cypher().RunSavedQuery(ctx, 42)
func (*CypherGroup) RunSavedQueryByName ¶
func (g *CypherGroup) RunSavedQueryByName(ctx context.Context, name string) (*UnifiedGraphGraphWithKeys, error)
RunSavedQueryByName finds a saved Cypher query by its name (case-insensitive) and executes it against the graph database in a single call.
graph, err := client.Community().Cypher().RunSavedQueryByName(ctx, "Shortest Paths to Domain Admins")
func (*CypherGroup) SavedQueries ¶
func (g *CypherGroup) SavedQueries(ctx context.Context, opts *ListOptions) ([]SavedQuery, error)
SavedQueries lists all saved Cypher queries accessible to the current user. Pass a *ListOptions to paginate or sort results, or nil for server defaults.
queries, err := client.Community().Cypher().SavedQueries(ctx, nil)
if err != nil {
log.Fatal(err)
}
for _, q := range queries {
fmt.Println(q.Name)
}
func (*CypherGroup) SavedQuery ¶
func (g *CypherGroup) SavedQuery(ctx context.Context, savedQueryID int32) (*SavedQuery, error)
SavedQuery retrieves a single saved Cypher query by its numeric ID.
q, err := client.Community().Cypher().SavedQuery(ctx, 42)
if err != nil {
log.Fatal(err)
}
fmt.Println(q.Name, q.Query)
func (*CypherGroup) SavedQueryPermissions ¶
func (g *CypherGroup) SavedQueryPermissions(ctx context.Context, savedQueryID int64) (*SavedQueriesPermissionsResult, error)
SavedQueryPermissions retrieves the sharing permissions for a saved query.
perms, err := client.Community().Cypher().SavedQueryPermissions(ctx, 42)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Permissions: %+v\n", perms)
func (*CypherGroup) ShareSavedQuery ¶
func (g *CypherGroup) ShareSavedQuery(ctx context.Context, savedQueryID int64, body generated.ShareSavedQueryJSONRequestBody) ([]SavedQueriesPermissions, error)
ShareSavedQuery shares a saved query with other users by setting permissions. Enterprise only.
perms, err := client.Enterprise().Cypher().ShareSavedQuery(ctx, 42, generated.ShareSavedQueryJSONRequestBody{})
if err != nil {
log.Fatal(err)
}
for _, p := range perms {
fmt.Printf("Shared with user %s\n", p.SharedToUserId)
}
func (*CypherGroup) UpdateSavedQuery ¶
func (g *CypherGroup) UpdateSavedQuery(ctx context.Context, savedQueryID int64, body generated.UpdateSavedQueryJSONRequestBody) (*SavedQuery, error)
UpdateSavedQuery updates an existing saved Cypher query by its numeric ID.
q, err := client.Community().Cypher().UpdateSavedQuery(ctx, 42, generated.UpdateSavedQueryJSONRequestBody{
Name: ptr("Renamed Query"),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(q.Name)
type DataQualityAggregation ¶
type DataQualityAggregation = generated.ModelDataQualityAggregation
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type DataQualityAggregationsOptions ¶
type DataQualityAggregationsOptions struct {
// SchemaExtensionId restricts aggregations to one extension.
SchemaExtensionId *int32
// Start bounds the query window (inclusive).
Start *time.Time
// End bounds the query window (inclusive).
End *time.Time
// SortBy orders results.
SortBy string
// Skip skips the first N results.
Skip *int
// Limit caps the number of results.
Limit *int
}
DataQualityAggregationsOptions tunes the aggregation query.
type DataQualityGroup ¶
type DataQualityGroup struct {
API *generated.ClientWithResponses
}
DataQualityGroup provides methods for retrieving data quality statistics that measure the completeness and freshness of collected AD and Azure data.
Access this group via [CommunityClient.DataQuality]:
dq := client.Community().DataQuality()
func (*DataQualityGroup) AdDomainDataQualityStats ¶
func (g *DataQualityGroup) AdDomainDataQualityStats(ctx context.Context, domainID string, opts *ListOptions) ([]AdDataQualityStat, error)
AdDomainDataQualityStats returns data quality statistics for a specific AD domain, including collection freshness and object completeness metrics. Pass a *ListOptions to paginate or sort results, or nil for server defaults.
func (*DataQualityGroup) AzureTenantDataQualityStats ¶
func (g *DataQualityGroup) AzureTenantDataQualityStats(ctx context.Context, tenantId string, opts *ListOptions) ([]AzureDataQualityStat, error)
AzureTenantDataQualityStats returns data quality statistics for a specific Azure tenant, including collection freshness and object completeness metrics. Pass a *ListOptions to paginate or sort results, or nil for server defaults.
func (*DataQualityGroup) CompletenessStats ¶
CompletenessStats returns a map of data completeness percentages keyed by metric name.
func (*DataQualityGroup) DataQualityAggregations ¶
func (g *DataQualityGroup) DataQualityAggregations(ctx context.Context, schemaEnvironmentKindId int32, opts *DataQualityAggregationsOptions) ([]DataQualityAggregation, error)
DataQualityAggregations returns aggregated data quality stats for an environment kind, optionally scoped to a single extension.
func (*DataQualityGroup) GlobalDataQualityStats ¶
func (g *DataQualityGroup) GlobalDataQualityStats(ctx context.Context, environmentId string, opts *DataQualityStatsOptions) ([]DataQualityStat, error)
GlobalDataQualityStats returns data quality statistics across all collected environments for the given environment ID.
stats, err := client.Community().DataQuality().GlobalDataQualityStats(ctx, "env-id", nil)
if err != nil {
log.Fatal(err)
}
for _, s := range stats {
fmt.Printf("%s: %d\n", *s.Label, deref(s.Count))
}
func (*DataQualityGroup) PlatformDataQualityAggregate ¶
func (g *DataQualityGroup) PlatformDataQualityAggregate(ctx context.Context, platformId string, opts *ListOptions) (*DataQualityPlatformAggregate, error)
PlatformDataQualityAggregate returns the aggregate data quality summary for a platform (AD or Azure), returned as a DataQualityPlatformAggregate. Pass a *ListOptions to paginate or sort results, or nil for server defaults.
type DataQualityPlatformAggregate ¶
type DataQualityPlatformAggregate = generated.ApiResponseDataQualityPlatformAggregate
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type DataQualityStat ¶
type DataQualityStat = generated.ModelDataQualityStat
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type DataQualityStatsOptions ¶
type DataQualityStatsOptions struct {
// Start bounds the query window (inclusive).
Start *time.Time
// End bounds the query window (inclusive).
End *time.Time
// SortBy orders results, e.g. "-collected_at".
SortBy string
// Skip skips the first N results.
Skip *int
// Limit caps the number of results.
Limit *int
}
DataQualityStatsOptions tunes the platform-wide data quality stats query.
type DatabaseGroup ¶
type DatabaseGroup struct {
API *generated.ClientWithResponses
}
DatabaseGroup provides methods for BloodHound graph database management operations.
Access this group via [CommunityClient.Database]:
db := client.Community().Database()
func (*DatabaseGroup) DeleteBloodHoundDatabase ¶
func (g *DatabaseGroup) DeleteBloodHoundDatabase(ctx context.Context, body generated.DeleteBloodHoundDatabaseJSONRequestBody) (*ActionResult, error)
DeleteBloodHoundDatabase deletes the BloodHound graph database using the provided request body to specify which data to remove.
type DatapipeGroup ¶
type DatapipeGroup struct {
API *generated.ClientWithResponses
}
DatapipeGroup provides methods for monitoring the BloodHound datapipe, which processes ingested data and runs attack path analysis.
Access this group via [CommunityClient.Datapipe]:
dp := client.Community().Datapipe()
func (*DatapipeGroup) AnalysisRequest ¶
func (g *DatapipeGroup) AnalysisRequest(ctx context.Context) (*AnalysisRequestDetails, error)
AnalysisRequest retrieves details about the current or most recent analysis request, returned as an AnalysisRequestDetails.
request, err := client.Community().Datapipe().AnalysisRequest(ctx)
if err != nil {
log.Fatal(err)
}
if request != nil {
fmt.Printf("Requested by: %s\n", *request.RequestedBy)
}
func (*DatapipeGroup) CancelAnalysisRequest ¶
func (g *DatapipeGroup) CancelAnalysisRequest(ctx context.Context) (*ActionResult, error)
CancelAnalysisRequest cancels a pending analysis request.
result, err := client.Community().Datapipe().CancelAnalysisRequest(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("HTTP status: %d\n", result.StatusCode)
func (*DatapipeGroup) CurrentDatapipeStatus ¶
func (g *DatapipeGroup) CurrentDatapipeStatus(ctx context.Context) (*DatapipeStatusDetails, error)
CurrentDatapipeStatus retrieves the current datapipe processing status, returned as a DatapipeStatusDetails.
status, err := client.Community().Datapipe().CurrentDatapipeStatus(ctx)
if err != nil {
log.Fatal(err)
}
if status != nil && status.Status != nil {
fmt.Printf("Status: %s\n", *status.Status)
}
func (*DatapipeGroup) DatapipeStatus ¶
func (g *DatapipeGroup) DatapipeStatus(ctx context.Context) (*DatapipeStatusDetails, error)
DatapipeStatus retrieves the current datapipe processing status. This is an alias for DatapipeGroup.CurrentDatapipeStatus.
status, err := client.Community().Datapipe().DatapipeStatus(ctx)
if err != nil {
log.Fatal(err)
}
if status != nil && status.Status != nil {
fmt.Printf("Datapipe state: %s\n", *status.Status)
}
func (*DatapipeGroup) StartAnalysis ¶
func (g *DatapipeGroup) StartAnalysis(ctx context.Context) (*ActionResult, error)
StartAnalysis triggers a new attack path analysis run.
result, err := client.Community().Datapipe().StartAnalysis(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("HTTP status: %d\n", result.StatusCode)
func (*DatapipeGroup) StartAnalysisAndWait ¶
func (g *DatapipeGroup) StartAnalysisAndWait(ctx context.Context, options *WaitOptions) (*DatapipeStatusDetails, error)
StartAnalysisAndWait triggers a new analysis run and blocks until the datapipe returns to idle. Polling behavior is controlled via WaitOptions; pass nil to use defaults.
status, err := client.Community().Datapipe().StartAnalysisAndWait(ctx, nil)
if err != nil {
log.Fatal(err)
}
if status != nil {
fmt.Printf("Updated at: %v\n", status.UpdatedAt)
}
func (*DatapipeGroup) WaitForAnalysisIdle ¶
func (g *DatapipeGroup) WaitForAnalysisIdle(ctx context.Context, options *WaitOptions) (*DatapipeStatusDetails, error)
WaitForAnalysisIdle blocks until the datapipe finishes analysis and returns to idle. Polling behavior (interval, timeout) is controlled via WaitOptions; pass nil to use defaults.
status, err := client.Community().Datapipe().WaitForAnalysisIdle(ctx, &WaitOptions{
PollInterval: 2 * time.Second,
Timeout: 10 * time.Minute,
})
if err != nil {
log.Fatal(err)
}
if status != nil && status.Status != nil {
fmt.Printf("Final datapipe status: %s\n", *status.Status)
}
type DatapipeStatus ¶
type DatapipeStatus = generated.EnumDatapipeStatus
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type DatapipeStatusDetails ¶
type DatapipeStatusDetails struct {
LastCompleteAnalysisAt *time.Time `json:"last_complete_analysis_at,omitempty"`
Status *DatapipeStatus `json:"status,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
DatapipeStatusDetails contains the current datapipe processing status, including when the last analysis completed and the current pipeline state.
type DomainRelatedQuery ¶
type DomainRelatedQuery struct {
API *generated.ClientWithResponses
// contains filtered or unexported fields
}
DomainRelatedQuery is a fluent query builder for paginated domain relationship lookups.
func (*DomainRelatedQuery) All ¶
func (q *DomainRelatedQuery) All(ctx context.Context) ([]RelatedEntity, error)
All executes paginated queries in a loop until all matching entities are collected and returned as a flat slice.
entities, err := client.Community().Domains().Users(domainID).All(ctx)
func (*DomainRelatedQuery) Limit ¶
func (q *DomainRelatedQuery) Limit(n int) *DomainRelatedQuery
Limit sets the maximum number of items to return. It returns the query for method chaining.
func (*DomainRelatedQuery) Results ¶
func (q *DomainRelatedQuery) Results(ctx context.Context) (RelatedEntityList, error)
Results executes the query and returns a paginated RelatedEntityList. The list includes the matched entities along with Count, Skip, and Limit metadata for cursor-based pagination.
func (*DomainRelatedQuery) Skip ¶
func (q *DomainRelatedQuery) Skip(n int) *DomainRelatedQuery
Skip sets the number of items to skip for pagination. It returns the query for method chaining.
func (*DomainRelatedQuery) SortBy ¶
func (q *DomainRelatedQuery) SortBy(field string) *DomainRelatedQuery
SortBy sets the field name used to order results. It returns the query for method chaining.
type DomainSelector ¶
type DomainSelector = generated.ModelDomainSelector
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type DomainUpdateResult ¶
type DomainUpdateResult struct {
ActionResult
Collected *bool
}
DomainUpdateResult is returned by domain update actions.
type DomainsGroup ¶
type DomainsGroup struct {
API *generated.ClientWithResponses
}
DomainsGroup provides methods for querying Active Directory domain entities and their relationships.
Access this group via [CommunityClient.Domains]:
domains := client.Community().Domains()
func (*DomainsGroup) ADCSEscalations ¶
func (g *DomainsGroup) ADCSEscalations(objectID string) *DomainRelatedQuery
ADCSEscalations returns a query builder that lists AD Certificate Services privilege escalation paths in this domain.
func (*DomainsGroup) Computers ¶
func (g *DomainsGroup) Computers(objectID string) *DomainRelatedQuery
Computers returns a query builder that lists computer objects belonging to this domain.
results, err := client.Community().Domains().
Computers("ABCD1234-...").Limit(50).Results(ctx)
func (*DomainsGroup) Controllers ¶
func (g *DomainsGroup) Controllers(objectID string) *DomainRelatedQuery
Controllers returns a query builder that lists domain controller servers for this domain.
func (*DomainsGroup) DCSyncers ¶
func (g *DomainsGroup) DCSyncers(objectID string) *DomainRelatedQuery
DCSyncers returns a query builder that lists principals with DCSync replication rights in this domain.
func (*DomainsGroup) ForeignAdmins ¶
func (g *DomainsGroup) ForeignAdmins(objectID string) *DomainRelatedQuery
ForeignAdmins returns a query builder that lists principals from other domains with administrative access to this domain.
func (*DomainsGroup) ForeignGPOControllers ¶
func (g *DomainsGroup) ForeignGPOControllers(objectID string) *DomainRelatedQuery
ForeignGPOControllers returns a query builder that lists principals from other domains with control over GPOs in this domain.
func (*DomainsGroup) ForeignGroups ¶
func (g *DomainsGroup) ForeignGroups(objectID string) *DomainRelatedQuery
ForeignGroups returns a query builder that lists groups from other domains that have membership or rights in this domain.
func (*DomainsGroup) ForeignUsers ¶
func (g *DomainsGroup) ForeignUsers(objectID string) *DomainRelatedQuery
ForeignUsers returns a query builder that lists users from other domains that have membership or rights in this domain.
func (*DomainsGroup) GPOs ¶
func (g *DomainsGroup) GPOs(objectID string) *DomainRelatedQuery
GPOs returns a query builder that lists Group Policy Objects defined in this domain.
func (*DomainsGroup) Get ¶
Get retrieves a single AD domain entity by its BloodHound object ID. The returned Entity includes the domain's name, label, and collected properties.
domain, err := client.Community().Domains().Get(ctx, "ABCD1234-...")
if err != nil {
log.Fatal(err)
}
fmt.Println(domain.Name)
func (*DomainsGroup) Groups ¶
func (g *DomainsGroup) Groups(objectID string) *DomainRelatedQuery
Groups returns a query builder that lists security groups in this domain.
func (*DomainsGroup) InboundTrusts ¶
func (g *DomainsGroup) InboundTrusts(objectID string) *DomainRelatedQuery
InboundTrusts returns a query builder that lists domains that trust this domain (inbound trust direction).
func (*DomainsGroup) LinkedGPOs ¶
func (g *DomainsGroup) LinkedGPOs(objectID string) *DomainRelatedQuery
LinkedGPOs returns a query builder that lists GPOs linked to this domain.
func (*DomainsGroup) OUs ¶
func (g *DomainsGroup) OUs(objectID string) *DomainRelatedQuery
OUs returns a query builder that lists Organizational Units in this domain.
func (*DomainsGroup) OutboundTrusts ¶
func (g *DomainsGroup) OutboundTrusts(objectID string) *DomainRelatedQuery
OutboundTrusts returns a query builder that lists domains this domain trusts (outbound trust direction).
func (*DomainsGroup) Update ¶
func (g *DomainsGroup) Update(ctx context.Context, objectID string, collected bool) (*DomainUpdateResult, error)
Update modifies a domain entity's collected status.
func (*DomainsGroup) Users ¶
func (g *DomainsGroup) Users(objectID string) *DomainRelatedQuery
Users returns a query builder that lists user accounts in this domain.
type EULAGroup ¶
type EULAGroup struct {
API *generated.ClientWithResponses
}
EULAGroup provides methods for retrieving and accepting the BloodHound End User License Agreement.
Access this group via [EnterpriseClient.EULA]:
eula := client.Enterprise().EULA()
func (*EULAGroup) AcceptEula ¶
func (g *EULAGroup) AcceptEula(ctx context.Context) (*ActionResult, error)
AcceptEula accepts the BloodHound End User License Agreement for the authenticated user.
type EdgeKind ¶
type EdgeKind = generated.ModelGraphSchemaEdgeKinds
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type EnterpriseAssetIsolationGroup ¶
type EnterpriseAssetIsolationGroup struct {
*AssetIsolationGroup
}
EnterpriseAssetIsolationGroup extends AssetIsolationGroup with enterprise-only tag creation, deletion, and certification operations.
Access this group via [EnterpriseClient.AssetIsolation]:
isolation := client.Enterprise().AssetIsolation()
func (*EnterpriseAssetIsolationGroup) AssetGroupTagsCertifications ¶
func (g *EnterpriseAssetIsolationGroup) AssetGroupTagsCertifications(ctx context.Context, opts *ListOptions) (*AssetGroupTagsCertification, error)
AssetGroupTagsCertifications retrieves the current certification status for asset group tags (enterprise only). Pass a *ListOptions to paginate results, or nil for server defaults.
func (*EnterpriseAssetIsolationGroup) CertifyOrRevokeObjects ¶
func (g *EnterpriseAssetIsolationGroup) CertifyOrRevokeObjects(ctx context.Context, body generated.CertifyOrRevokeObjectsJSONRequestBody) (*ActionResult, error)
CertifyOrRevokeObjects certifies or revokes objects in an asset group tag (enterprise only).
func (*EnterpriseAssetIsolationGroup) CreateAssetGroupTag ¶
func (g *EnterpriseAssetIsolationGroup) CreateAssetGroupTag(ctx context.Context, body generated.CreateAssetGroupTagJSONRequestBody) (*AssetGroupTag, error)
CreateAssetGroupTag creates a new asset group tag (enterprise only).
func (*EnterpriseAssetIsolationGroup) DeleteAssetGroupTag ¶
func (g *EnterpriseAssetIsolationGroup) DeleteAssetGroupTag(ctx context.Context, assetGroupTagID int32) (*ActionResult, error)
DeleteAssetGroupTag removes an asset group tag (enterprise only).
type EnterpriseCAsGroup ¶
type EnterpriseCAsGroup struct {
API *generated.ClientWithResponses
}
EnterpriseCAsGroup provides methods for querying AD Certificate Services Enterprise CA entities and their relationships.
Access this group via [CommunityClient.EnterpriseCAs]:
cas := client.Community().EnterpriseCAs()
func (*EnterpriseCAsGroup) Controllers ¶
func (g *EnterpriseCAsGroup) Controllers(objectID string) *EnterpriseCAsQuery
Controllers returns a query builder that lists principals with control over this Enterprise CA via ACL-based relationships.
func (*EnterpriseCAsGroup) EnterpriseCaEntity ¶
func (g *EnterpriseCAsGroup) EnterpriseCaEntity(ctx context.Context, objectID string) (*Entity, error)
EnterpriseCaEntity retrieves a single Enterprise CA entity by its BloodHound object ID. The returned Entity includes the CA's name, label, and collected properties.
ca, err := client.Community().EnterpriseCAs().EnterpriseCaEntity(ctx, "ABCD1234-...")
if err != nil {
log.Fatal(err)
}
fmt.Println(ca.Name)
func (*EnterpriseCAsGroup) PkiHierarchy ¶
func (g *EnterpriseCAsGroup) PkiHierarchy(objectID string) *EnterpriseCAsQuery
PkiHierarchy returns a query builder that lists the PKI hierarchy chain (root and intermediate CAs) for this Enterprise CA.
func (*EnterpriseCAsGroup) PublishedTemplates ¶
func (g *EnterpriseCAsGroup) PublishedTemplates(objectID string) *EnterpriseCAsQuery
PublishedTemplates returns a query builder that lists certificate templates published by this Enterprise CA.
type EnterpriseCAsQuery ¶
type EnterpriseCAsQuery struct {
API *generated.ClientWithResponses
// contains filtered or unexported fields
}
EnterpriseCAsQuery is a fluent query builder for paginated Enterprise CA relationship lookups.
func (*EnterpriseCAsQuery) All ¶
func (q *EnterpriseCAsQuery) All(ctx context.Context) ([]RelatedEntity, error)
All executes paginated queries in a loop until all matching entities are collected and returned as a flat slice.
entities, err := client.Community().EnterpriseCAs().Controllers(objectID).All(ctx)
func (*EnterpriseCAsQuery) Limit ¶
func (q *EnterpriseCAsQuery) Limit(n int) *EnterpriseCAsQuery
Limit sets the maximum number of items to return. It returns the query for method chaining.
func (*EnterpriseCAsQuery) Results ¶
func (q *EnterpriseCAsQuery) Results(ctx context.Context) (RelatedEntityList, error)
Results executes the query and returns a paginated RelatedEntityList. The list includes the matched entities along with Count, Skip, and Limit metadata for cursor-based pagination.
func (*EnterpriseCAsQuery) Skip ¶
func (q *EnterpriseCAsQuery) Skip(n int) *EnterpriseCAsQuery
Skip sets the number of items to skip for pagination. It returns the query for method chaining.
func (*EnterpriseCAsQuery) SortBy ¶
func (q *EnterpriseCAsQuery) SortBy(field string) *EnterpriseCAsQuery
SortBy sets the field name used to order results. It returns the query for method chaining.
type EnterpriseCollectorsGroup ¶
type EnterpriseCollectorsGroup struct {
*CollectorsGroup
}
EnterpriseCollectorsGroup provides enterprise-only methods for collector management, including kennel manifest and asset downloads.
Access this group via [EnterpriseClient.Collectors]:
collectors := client.Enterprise().Collectors()
func (*EnterpriseCollectorsGroup) KennelAsset ¶
func (g *EnterpriseCollectorsGroup) KennelAsset(ctx context.Context, assetName string) (io.ReadSeeker, error)
KennelAsset downloads a specific kennel asset by name. The returned io.ReadSeeker contains the raw asset content. Enterprise only.
reader, err := client.Enterprise().Collectors().KennelAsset(ctx, "collector-linux-amd64")
if err != nil {
log.Fatal(err)
}
io.Copy(outFile, reader)
func (*EnterpriseCollectorsGroup) KennelEnterpriseManifest ¶
func (g *EnterpriseCollectorsGroup) KennelEnterpriseManifest(ctx context.Context) (*KennelEnterpriseManifest, error)
KennelEnterpriseManifest retrieves the enterprise-specific kennel manifest. The returned KennelEnterpriseManifest includes enterprise collector configuration and deployment metadata. Enterprise only.
manifest, err := client.Enterprise().Collectors().KennelEnterpriseManifest(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Enterprise manifest: %v\n", manifest)
func (*EnterpriseCollectorsGroup) KennelManifest ¶
func (g *EnterpriseCollectorsGroup) KennelManifest(ctx context.Context) (*KennelManifest, error)
KennelManifest retrieves the kennel (managed collector infrastructure) manifest. The returned KennelManifest describes available kennel components and their versions. Enterprise only.
manifest, err := client.Enterprise().Collectors().KennelManifest(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Manifest: %v\n", manifest)
type Entity ¶
type Entity struct {
ObjectID string
Name string
Label string
Kinds []string
Props map[string]interface{}
}
Entity represents a BloodHound graph entity (node). Props contains the node's collected properties keyed by property name, with flat scalar, array, or object values as returned by the server.
type EnumClientType ¶
type EnumClientType = generated.EnumClientType
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type EnumJobStatus ¶
type EnumJobStatus = generated.EnumJobStatus
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type EnumPostureHistoryType ¶
type EnumPostureHistoryType = generated.EnumPostureHistoryType
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type EventsGroup ¶
type EventsGroup struct {
API *generated.ClientWithResponses
}
EventsGroup provides methods for managing scheduled events in BloodHound Enterprise, such as collection schedules and analysis triggers.
Access this group via [EnterpriseClient.Events]:
events := client.Enterprise().Events()
func (*EventsGroup) ClientSchedule ¶
func (g *EventsGroup) ClientSchedule(ctx context.Context, eventID int32) (*ClientScheduleDisplay, error)
ClientSchedule retrieves a single client collection schedule by event ID.
schedule, err := client.Enterprise().Events().ClientSchedule(ctx, eventID)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", schedule)
func (*EventsGroup) ClientSchedules ¶
func (g *EventsGroup) ClientSchedules(ctx context.Context, opts *ListOptions) ([]ClientScheduleDisplay, error)
ClientSchedules returns the list of all configured client collection schedules. Pass a *ListOptions to set SortBy, or nil for server defaults.
schedules, err := client.Enterprise().Events().ClientSchedules(ctx, nil)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Schedules: %d\n", len(schedules))
func (*EventsGroup) CreateClientSchedule ¶
func (g *EventsGroup) CreateClientSchedule(ctx context.Context, body generated.CreateClientScheduleJSONRequestBody) (*ClientScheduleDisplay, error)
CreateClientSchedule creates a new client collection schedule.
created, err := client.Enterprise().Events().CreateClientSchedule(ctx, body)
if err != nil {
log.Fatal(err)
}
if created != nil {
fmt.Printf("Created schedule ID: %d\n", *created.Id)
}
func (*EventsGroup) DeleteClientEvent ¶
func (g *EventsGroup) DeleteClientEvent(ctx context.Context, eventID int32) (*ActionResult, error)
DeleteClientEvent deletes a client collection schedule by event ID.
result, err := client.Enterprise().Events().DeleteClientEvent(ctx, eventID)
if err != nil {
log.Fatal(err)
}
fmt.Printf("HTTP status: %d\n", result.StatusCode)
func (*EventsGroup) UpdateClientEvent ¶
func (g *EventsGroup) UpdateClientEvent(ctx context.Context, eventID int32, body generated.UpdateClientEventJSONRequestBody) (*ClientScheduleDisplay, error)
UpdateClientEvent updates an existing client collection schedule.
updated, err := client.Enterprise().Events().UpdateClientEvent(ctx, eventID, body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", updated)
type FeatureFlag ¶
type FeatureFlag = generated.ModelFeatureFlag
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type FileUploadJob ¶
type FileUploadJob = generated.ModelFileUploadJob
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type FileUploadJobCompletedTasks ¶
type FileUploadJobCompletedTasks = generated.ModelFileUploadJobCompletedTasks
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type Finding ¶
type Finding = generated.ApiResponseFinding
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type GPOsGroup ¶
type GPOsGroup struct {
API *generated.ClientWithResponses
}
GPOsGroup provides methods for querying Active Directory Group Policy Object (GPO) entities and their relationships from the BloodHound API.
Access this group via [CommunityClient.GPOs] or [EnterpriseClient.GPOs]:
gpos := client.Community().GPOs()
func (*GPOsGroup) Computers ¶
Computers returns a query builder that lists the computer objects this GPO is applied to or linked to within the domain.
results, err := client.Community().GPOs().
Computers("ABCD1234-...").Limit(50).Results(ctx)
func (*GPOsGroup) Controllers ¶
Controllers returns a query builder that lists AD objects with control over this GPO via inbound ACL-based relationships.
results, err := client.Community().GPOs().
Controllers("ABCD1234-...").Limit(50).Results(ctx)
func (*GPOsGroup) GpoEntity ¶
GpoEntity retrieves a single AD Group Policy Object entity by its BloodHound object ID. The returned Entity includes the GPO's name, label, kind tags, and all collected properties.
gpo, err := client.Community().GPOs().GpoEntity(ctx, "ABCD1234-...")
if err != nil {
log.Fatal(err)
}
fmt.Printf("GPO: %s (%s)\n", gpo.Name, gpo.Label)
func (*GPOsGroup) Ous ¶
Ous returns a query builder that lists the Organizational Units this GPO is linked to.
results, err := client.Community().GPOs().
Ous("ABCD1234-...").Limit(50).Results(ctx)
type GPOsQuery ¶
type GPOsQuery struct {
API *generated.ClientWithResponses
// contains filtered or unexported fields
}
GPOsQuery is a fluent query builder for paginated GPO relationship lookups.
func (*GPOsQuery) All ¶
func (q *GPOsQuery) All(ctx context.Context) ([]RelatedEntity, error)
All executes paginated queries in a loop until all matching entities are collected and returned as a flat slice.
entities, err := client.Community().GPOs().Computers(objectID).All(ctx)
func (*GPOsQuery) Limit ¶
Limit sets the maximum number of items to return. It returns the query for method chaining.
func (*GPOsQuery) Results ¶
func (q *GPOsQuery) Results(ctx context.Context) (RelatedEntityList, error)
Results executes the query and returns a paginated RelatedEntityList. The list includes the matched entities along with Count, Skip, and Limit metadata for cursor-based pagination.
type GraphExtensionPayload ¶
type GraphExtensionPayload = generated.ModelGraphExtensionPayload
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type GraphGroup ¶
type GraphGroup struct {
API *generated.ClientWithResponses
}
GraphGroup provides methods for querying the BloodHound graph, including shortest-path searches and edge composition lookups.
Access this group via [CommunityClient.Graph] or [EnterpriseClient.Graph]:
graph := client.Community().Graph()
func (*GraphGroup) ACLInheritancePath ¶
func (g *GraphGroup) ACLInheritancePath(ctx context.Context, sourceNode int32, targetNode int32, edgeType string) (*UnifiedGraphGraph, error)
ACLInheritancePath returns the ACL inheritance path graph for a specific edge between two nodes, showing how permissions are inherited through the AD hierarchy.
graph, err := client.Community().Graph().ACLInheritancePath(ctx, 1, 2, "WriteDacl")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Inheritance path: %d nodes\n", len(graph.Nodes))
func (*GraphGroup) Kinds ¶
func (g *GraphGroup) Kinds(ctx context.Context) ([]string, error)
Kinds returns the list of all node and relationship kind labels known to the BloodHound graph.
kinds, err := client.Community().Graph().Kinds(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Known kinds: %d\n", len(kinds))
func (*GraphGroup) PathComposition ¶
func (g *GraphGroup) PathComposition(ctx context.Context, sourceNode int32, targetNode int32, edgeType string) (*UnifiedGraphGraph, error)
PathComposition returns the composition (sub-graph breakdown) of a specific edge between two nodes. This reveals the underlying relationships that make up a composite edge.
graph, err := client.Community().Graph().PathComposition(ctx, 1, 2, "GenericAll")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Composition nodes: %d\n", len(graph.Nodes))
func (*GraphGroup) Pathfinding
deprecated
func (g *GraphGroup) Pathfinding(ctx context.Context, startNode string, endNode string) (*BHGraphGraph, error)
Pathfinding computes attack paths between two nodes in the BloodHound graph. It returns a BHGraphGraph containing the discovered paths from startNode to endNode.
graph, err := client.Community().Graph().Pathfinding(ctx, startNode, endNode)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Nodes: %d\n", len(graph.Nodes))
Deprecated: This endpoint is deprecated by BloodHound and will no longer be supported in a future release. Use GraphGroup.ShortestPath instead.
func (*GraphGroup) RelayTargets ¶
func (g *GraphGroup) RelayTargets(ctx context.Context, sourceNode int32, targetNode int32, edgeType string) (*UnifiedGraphGraph, error)
RelayTargets returns the relay target graph for a specific edge between two nodes, showing potential NTLM relay paths.
graph, err := client.Community().Graph().RelayTargets(ctx, 1, 2, "CoerceAndRelayNTLMToSMB")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Relay targets: %d nodes\n", len(graph.Nodes))
func (*GraphGroup) SearchResult ¶
func (g *GraphGroup) SearchResult(ctx context.Context, query string) (map[string]BHGraphNode, error)
SearchResult performs a fuzzy search across graph nodes and returns matching results keyed by their identifier.
nodes, err := client.Community().Graph().SearchResult(ctx, "Domain Admins")
if err != nil {
log.Fatal(err)
}
for id, node := range nodes {
fmt.Printf("%s: %v\n", id, node)
}
func (*GraphGroup) ShortestPath ¶
func (g *GraphGroup) ShortestPath(ctx context.Context, startNode string, endNode string, relationshipKinds []string, onlyTraversable *bool) (*UnifiedGraphGraph, error)
ShortestPath computes the shortest attack path between two nodes. Optionally filter by relationship kinds and restrict to traversable edges only.
graph, err := client.Community().Graph().ShortestPath(ctx, startNode, endNode, nil, nil)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Nodes: %d, Edges: %d\n", len(graph.Nodes), len(graph.Edges))
type GraphStats ¶
type GraphStats struct {
TotalNodes int
TotalEdges int
NodesByKind map[string]int
EdgesByKind map[string]int
TierZero int
Owned int
}
GraphStats contains summary statistics for a Cypher query result graph.
func GetGraphStats ¶
func GetGraphStats(graph *UnifiedGraphGraphWithKeys) GraphStats
GetGraphStats computes aggregate metrics across nodes and edges in the graph.
type GroupsGroup ¶
type GroupsGroup struct {
API *generated.ClientWithResponses
}
GroupsGroup provides methods for querying Active Directory group entities and their relationships from the BloodHound API.
Access this group via [CommunityClient.Groups] or [EnterpriseClient.Groups]:
groups := client.Community().Groups()
func (*GroupsGroup) AdminRights ¶
func (g *GroupsGroup) AdminRights(objectID string) *GroupsQuery
AdminRights returns a query builder that lists computers where members of this group have local administrator privileges.
results, err := client.Community().Groups().
AdminRights("ABCD1234-...").Limit(50).Results(ctx)
func (*GroupsGroup) Controllables ¶
func (g *GroupsGroup) Controllables(objectID string) *GroupsQuery
Controllables returns a query builder that lists AD objects this group can control via outbound ACL-based relationships (GenericAll, WriteDacl, etc.).
results, err := client.Community().Groups().
Controllables("ABCD1234-...").Limit(50).Results(ctx)
func (*GroupsGroup) Controllers ¶
func (g *GroupsGroup) Controllers(objectID string) *GroupsQuery
Controllers returns a query builder that lists AD objects with control over this group via inbound ACL-based relationships.
results, err := client.Community().Groups().
Controllers("ABCD1234-...").Limit(50).Results(ctx)
func (*GroupsGroup) DcomRights ¶
func (g *GroupsGroup) DcomRights(objectID string) *GroupsQuery
DcomRights returns a query builder that lists computers where members of this group have DCOM (Distributed COM) execution rights.
results, err := client.Community().Groups().
DcomRights("ABCD1234-...").Limit(50).Results(ctx)
func (*GroupsGroup) GroupEntity ¶
GroupEntity retrieves a single AD group entity by its BloodHound object ID. The returned Entity includes the group's name, label, kind tags, and all collected properties.
group, err := client.Community().Groups().GroupEntity(ctx, "ABCD1234-...")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Group: %s (%s)\n", group.Name, group.Label)
func (*GroupsGroup) Members ¶
func (g *GroupsGroup) Members(objectID string) *GroupsQuery
Members returns a query builder that lists the direct members of this AD group.
members, err := client.Community().Groups().
Members("ABCD1234-...").SortBy("name").Results(ctx)
if err != nil {
log.Fatal(err)
}
for _, m := range members.Data {
fmt.Println(m.Name)
}
func (*GroupsGroup) Memberships ¶
func (g *GroupsGroup) Memberships(objectID string) *GroupsQuery
Memberships returns a query builder that lists the AD groups this group belongs to (i.e., nested group membership).
results, err := client.Community().Groups().
Memberships("ABCD1234-...").Limit(50).Results(ctx)
func (*GroupsGroup) PsRemoteRights ¶
func (g *GroupsGroup) PsRemoteRights(objectID string) *GroupsQuery
PsRemoteRights returns a query builder that lists computers where members of this group have PowerShell Remoting (WinRM) access.
results, err := client.Community().Groups().
PsRemoteRights("ABCD1234-...").Limit(50).Results(ctx)
func (*GroupsGroup) RdpRights ¶
func (g *GroupsGroup) RdpRights(objectID string) *GroupsQuery
RdpRights returns a query builder that lists computers where members of this group have Remote Desktop Protocol access.
results, err := client.Community().Groups().
RdpRights("ABCD1234-...").Limit(50).Results(ctx)
func (*GroupsGroup) Sessions ¶
func (g *GroupsGroup) Sessions(objectID string) *GroupsQuery
Sessions returns a query builder that lists computers where members of this group have active logon sessions.
results, err := client.Community().Groups().
Sessions("ABCD1234-...").Limit(50).Results(ctx)
type GroupsQuery ¶
type GroupsQuery struct {
API *generated.ClientWithResponses
// contains filtered or unexported fields
}
GroupsQuery is a fluent query builder for paginated AD group relationship lookups.
func (*GroupsQuery) All ¶
func (q *GroupsQuery) All(ctx context.Context) ([]RelatedEntity, error)
All executes paginated queries in a loop until all matching entities are collected and returned as a flat slice.
entities, err := client.Community().Groups().Members(objectID).All(ctx)
func (*GroupsQuery) Limit ¶
func (q *GroupsQuery) Limit(n int) *GroupsQuery
Limit sets the maximum number of items to return. It returns the query for method chaining.
func (*GroupsQuery) Results ¶
func (q *GroupsQuery) Results(ctx context.Context) (RelatedEntityList, error)
Results executes the query and returns a paginated RelatedEntityList. The list includes the matched entities along with Count, Skip, and Limit metadata for cursor-based pagination.
func (*GroupsQuery) Skip ¶
func (q *GroupsQuery) Skip(n int) *GroupsQuery
Skip sets the number of items to skip for pagination. It returns the query for method chaining.
func (*GroupsQuery) SortBy ¶
func (q *GroupsQuery) SortBy(field string) *GroupsQuery
SortBy sets the field name used to order results. It returns the query for method chaining.
type JobsGroup ¶
type JobsGroup struct {
API *generated.ClientWithResponses
}
JobsGroup provides methods for managing BloodHound data collection jobs, including status monitoring, cancellation, and log retrieval.
Access this group via [EnterpriseClient.Jobs]:
jobs := client.Enterprise().Jobs()
func (*JobsGroup) AvailableClientJobs ¶
func (g *JobsGroup) AvailableClientJobs(ctx context.Context, opts *ListOptions) ([]ClientScheduledJobDisplay, error)
AvailableClientJobs returns the list of collection jobs available to be started. Pass a *ListOptions to set SortBy, or nil for server defaults.
jobs, err := client.Enterprise().Jobs().AvailableClientJobs(ctx, nil)
if err != nil {
log.Fatal(err)
}
for _, j := range jobs {
fmt.Printf("Job %d: %s\n", *j.Id, *j.Status)
}
func (*JobsGroup) CancelClientJob ¶
func (g *JobsGroup) CancelClientJob(ctx context.Context, jobID int64) (*ClientScheduledJobDisplay, error)
CancelClientJob cancels a running or scheduled collection job by its job ID.
job, err := client.Enterprise().Jobs().CancelClientJob(ctx, 42)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Cancelled job: %d\n", *job.Id)
func (*JobsGroup) ClientCurrentJob ¶
func (g *JobsGroup) ClientCurrentJob(ctx context.Context) (*ClientScheduledJobDisplay, error)
ClientCurrentJob returns the currently running collection job, or nil if no job is active.
job, err := client.Enterprise().Jobs().ClientCurrentJob(ctx)
if err != nil {
log.Fatal(err)
}
if job != nil {
fmt.Printf("Current job: %d\n", *job.Id)
}
func (*JobsGroup) ClientFinishedJobs ¶
func (g *JobsGroup) ClientFinishedJobs(ctx context.Context, opts *ListOptions) ([]ClientScheduledJobDisplay, error)
ClientFinishedJobs returns the list of collection jobs that have completed. Pass a *ListOptions to paginate or sort results, or nil for server defaults.
jobs, err := client.Enterprise().Jobs().ClientFinishedJobs(ctx, nil)
if err != nil {
log.Fatal(err)
}
for _, j := range jobs {
fmt.Printf("Finished job %d: %s\n", *j.Id, *j.Status)
}
func (*JobsGroup) ClientJob ¶
ClientJob retrieves a single collection job by its job ID.
job, err := client.Enterprise().Jobs().ClientJob(ctx, 42)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Job %d status: %s\n", *job.Id, *job.Status)
func (*JobsGroup) ClientJobLog ¶
ClientJobLog retrieves the log output for a collection job by its job ID.
logOutput, err := client.Enterprise().Jobs().ClientJobLog(ctx, 42)
if err != nil {
log.Fatal(err)
}
fmt.Println(logOutput)
func (*JobsGroup) ClientJobs ¶
func (g *JobsGroup) ClientJobs(ctx context.Context) ([]ClientScheduledJobDisplay, error)
ClientJobs returns the list of all collection jobs for the current client.
jobs, err := client.Enterprise().Jobs().ClientJobs(ctx)
if err != nil {
log.Fatal(err)
}
for _, j := range jobs {
fmt.Printf("Job %d: %s\n", *j.Id, *j.Status)
}
func (*JobsGroup) EndClientJob ¶
func (g *JobsGroup) EndClientJob(ctx context.Context) (*ClientScheduledJob, error)
EndClientJob ends the currently running collection job.
job, err := client.Enterprise().Jobs().EndClientJob(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Ended job: %d\n", *job.Id)
func (*JobsGroup) StartAndWaitClientJob ¶
func (g *JobsGroup) StartAndWaitClientJob(ctx context.Context, jobID int64, options *WaitOptions) (*ClientScheduledJobDisplay, error)
StartAndWaitClientJob starts a scheduled job by ID and polls until it reaches a terminal status. This is a convenience wrapper around JobsGroup.StartClientJobByID and JobsGroup.WaitForClientJob.
job, err := client.Enterprise().Jobs().StartAndWaitClientJob(ctx, jobID, nil)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Job %d finished with status: %s\n", *job.Id, *job.Status)
func (*JobsGroup) StartClientJob ¶
func (g *JobsGroup) StartClientJob(ctx context.Context, body generated.StartClientJobJSONRequestBody) (*ClientScheduledJob, error)
StartClientJob starts a new collection job with the given request body.
job, err := client.Enterprise().Jobs().StartClientJob(ctx, body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Started job: %d\n", *job.Id)
func (*JobsGroup) StartClientJobByID ¶
func (g *JobsGroup) StartClientJobByID(ctx context.Context, jobID int64) (*ClientScheduledJob, error)
StartClientJobByID starts a scheduled collection job by its job ID.
job, err := client.Enterprise().Jobs().StartClientJobByID(ctx, 42)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Started job: %d\n", *job.Id)
func (*JobsGroup) WaitForClientJob ¶
func (g *JobsGroup) WaitForClientJob(ctx context.Context, jobID int64, options *WaitOptions) (*ClientScheduledJobDisplay, error)
WaitForClientJob polls the given job until it reaches a terminal status. Use WaitOptions to configure the poll interval and timeout.
job, err := client.Enterprise().Jobs().WaitForClientJob(ctx, 42, nil)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Job %d finished: %s\n", *job.Id, *job.Status)
type KennelEnterpriseManifest ¶
type KennelEnterpriseManifest = generated.ModelKennelEnterpriseManifest
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type KennelManifest ¶
type KennelManifest = generated.ModelKennelManifest
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type ListOptions ¶
type ListOptions struct {
// Skip skips the first N results.
Skip *int
// Limit caps the number of results returned.
Limit *int
// SortBy orders results by the given field, e.g. "-created_at" for descending.
SortBy string
}
ListOptions carries common pagination parameters accepted by list endpoints. Pass nil (or a zero ListOptions) to accept server defaults.
type LoginResult ¶
type LoginResult struct {
AuthExpired *bool
SessionToken *string
UserID *openapi_types.UUID
}
LoginResult contains session details returned from Auth.Login.
type MetaEntitiesGroup ¶
type MetaEntitiesGroup struct {
API *generated.ClientWithResponses
}
MetaEntitiesGroup provides methods for querying BloodHound meta-entity nodes and their relationships from the BloodHound API. Meta entities represent aggregate or summary nodes in the graph.
Access this group via [EnterpriseClient.MetaEntities]:
meta := client.Enterprise().MetaEntities()
func (*MetaEntitiesGroup) MetaEntity ¶
func (g *MetaEntitiesGroup) MetaEntity(ctx context.Context, objectID string) (map[string]interface{}, error)
MetaEntity retrieves a single meta-entity node by its BloodHound object ID. The returned map contains the node's collected properties keyed by property name.
props, err := client.Enterprise().MetaEntities().MetaEntity(ctx, "ABCD1234-...")
if err != nil {
log.Fatal(err)
}
for name, value := range props {
fmt.Printf("%s: %v\n", name, value)
}
type MfaActivationStatus ¶
type MfaActivationStatus = generated.EnumMfaActivationStatus
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type NTAuthStoresGroup ¶
type NTAuthStoresGroup struct {
API *generated.ClientWithResponses
}
NTAuthStoresGroup provides methods for querying AD Certificate Services NTAuth store entities and their relationships from the BloodHound API.
Access this group via [CommunityClient.NTAuthStores] or [EnterpriseClient.NTAuthStores]:
stores := client.Community().NTAuthStores()
func (*NTAuthStoresGroup) Controllers ¶
func (g *NTAuthStoresGroup) Controllers(objectID string) *NTAuthStoresQuery
Controllers returns a query builder that lists AD objects with control over this NTAuth store via inbound ACL-based relationships.
results, err := client.Community().NTAuthStores().
Controllers("ABCD1234-...").Limit(50).Results(ctx)
func (*NTAuthStoresGroup) NtAuthStoreEntity ¶
func (g *NTAuthStoresGroup) NtAuthStoreEntity(ctx context.Context, objectID string) (*Entity, error)
NtAuthStoreEntity retrieves a single AD NTAuth store entity by its BloodHound object ID. The returned Entity includes the store's name, label, kind tags, and all collected properties.
store, err := client.Community().NTAuthStores().NtAuthStoreEntity(ctx, "ABCD1234-...")
if err != nil {
log.Fatal(err)
}
fmt.Printf("NTAuth Store: %s (%s)\n", store.Name, store.Label)
func (*NTAuthStoresGroup) TrustedCas ¶
func (g *NTAuthStoresGroup) TrustedCas(objectID string) *NTAuthStoresQuery
TrustedCas returns a query builder that lists the Certificate Authorities trusted by this NTAuth store in the PKI hierarchy.
results, err := client.Community().NTAuthStores().
TrustedCas("ABCD1234-...").Limit(50).Results(ctx)
type NTAuthStoresQuery ¶
type NTAuthStoresQuery struct {
API *generated.ClientWithResponses
// contains filtered or unexported fields
}
NTAuthStoresQuery is a fluent query builder for paginated NTAuth store relationship lookups.
func (*NTAuthStoresQuery) All ¶
func (q *NTAuthStoresQuery) All(ctx context.Context) ([]RelatedEntity, error)
All executes paginated queries in a loop until all matching entities are collected and returned as a flat slice.
entities, err := client.Community().NTAuthStores().Controllers(objectID).All(ctx)
func (*NTAuthStoresQuery) Limit ¶
func (q *NTAuthStoresQuery) Limit(n int) *NTAuthStoresQuery
Limit sets the maximum number of items to return. It returns the query for method chaining.
func (*NTAuthStoresQuery) Results ¶
func (q *NTAuthStoresQuery) Results(ctx context.Context) (RelatedEntityList, error)
Results executes the query and returns a paginated RelatedEntityList. The list includes the matched entities along with Count, Skip, and Limit metadata for cursor-based pagination.
func (*NTAuthStoresQuery) Skip ¶
func (q *NTAuthStoresQuery) Skip(n int) *NTAuthStoresQuery
Skip sets the number of items to skip for pagination. It returns the query for method chaining.
func (*NTAuthStoresQuery) SortBy ¶
func (q *NTAuthStoresQuery) SortBy(field string) *NTAuthStoresQuery
SortBy sets the field name used to order results. It returns the query for method chaining.
type NodeKind ¶
type NodeKind = generated.ModelNodeKindResponse
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type NodeKindResult ¶
type NodeKindResult struct {
Data *NodeKind
}
NodeKindResult wraps a node kind response.
type OUsGroup ¶
type OUsGroup struct {
API *generated.ClientWithResponses
}
OUsGroup provides methods for querying Active Directory Organizational Unit (OU) entities and their relationships from the BloodHound API.
Access this group via [CommunityClient.OUs] or [EnterpriseClient.OUs]:
ous := client.Community().OUs()
func (*OUsGroup) Computers ¶
Computers returns a query builder that lists computer objects contained within this OU.
results, err := client.Community().OUs().
Computers("ABCD1234-...").Limit(50).Results(ctx)
func (*OUsGroup) Gpos ¶
Gpos returns a query builder that lists Group Policy Objects linked to this OU.
func (*OUsGroup) Groups ¶
Groups returns a query builder that lists AD groups contained within this OU.
func (*OUsGroup) OuEntity ¶
OuEntity retrieves a single AD Organizational Unit entity by its BloodHound object ID. The returned Entity includes the OU's name, label, kind tags, and all collected properties.
ou, err := client.Community().OUs().OuEntity(ctx, "ABCD1234-...")
if err != nil {
log.Fatal(err)
}
fmt.Printf("OU: %s (%s)\n", ou.Name, ou.Label)
type OUsQuery ¶
type OUsQuery struct {
API *generated.ClientWithResponses
// contains filtered or unexported fields
}
OUsQuery is a fluent query builder for paginated OU relationship lookups.
func (*OUsQuery) All ¶
func (q *OUsQuery) All(ctx context.Context) ([]RelatedEntity, error)
All executes paginated queries in a loop until all matching entities are collected and returned as a flat slice.
entities, err := client.Community().OUs().Computers(objectID).All(ctx)
func (*OUsQuery) Limit ¶
Limit sets the maximum number of items to return. It returns the query for method chaining.
func (*OUsQuery) Results ¶
func (q *OUsQuery) Results(ctx context.Context) (RelatedEntityList, error)
Results executes the query and returns a paginated RelatedEntityList. The list includes the matched entities along with Count, Skip, and Limit metadata for cursor-based pagination.
type OidcProvider ¶
type OidcProvider = generated.ModelOidcProvider
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type OpenGraphGroup ¶
type OpenGraphGroup struct {
API *generated.ClientWithResponses
}
OpenGraphGroup provides methods for the experimental OpenGraph extensions surface: custom graph extensions, nodes, relationships, and their kinds.
Access this group via [CommunityClient.OpenGraph]:
og := client.Community().OpenGraph()
func (*OpenGraphGroup) DeleteExtension ¶
func (g *OpenGraphGroup) DeleteExtension(ctx context.Context, extensionId int32) (*ActionResult, error)
DeleteExtension removes a graph extension by ID.
func (*OpenGraphGroup) EdgeKinds ¶
func (g *OpenGraphGroup) EdgeKinds(ctx context.Context) ([]EdgeKind, error)
EdgeKinds lists graph edge kinds contributed by extensions.
func (*OpenGraphGroup) Extensions ¶
func (g *OpenGraphGroup) Extensions(ctx context.Context) (json.RawMessage, error)
Extensions lists registered graph extensions. The endpoint returns a raw JSON document (the experimental schema is intentionally untyped here).
func (*OpenGraphGroup) Node ¶
func (g *OpenGraphGroup) Node(ctx context.Context, nodeId int64, includeInfo bool) (json.RawMessage, error)
Node retrieves a graph node by ID. Set includeInfo to populate rendered kind info. The experimental response shape is returned as raw JSON.
func (*OpenGraphGroup) NodeKind ¶
func (g *OpenGraphGroup) NodeKind(ctx context.Context, nodeKindId int32) (*NodeKindResult, error)
NodeKind retrieves a graph node kind definition by ID.
kind, err := client.Community().OpenGraph().NodeKind(ctx, 42)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Kind: %+v\n", kind.Data)
func (*OpenGraphGroup) Relationship ¶
func (g *OpenGraphGroup) Relationship(ctx context.Context, relationshipId int64, includeInfo bool) (json.RawMessage, error)
Relationship retrieves a graph relationship by ID. Set includeInfo to populate rendered kind info. The experimental response shape is returned as raw JSON.
func (*OpenGraphGroup) RelationshipKind ¶
func (g *OpenGraphGroup) RelationshipKind(ctx context.Context, relationshipKindId int32) (*RelationshipKindResult, error)
RelationshipKind retrieves a graph relationship kind definition by ID.
func (*OpenGraphGroup) UpsertExtension ¶
func (g *OpenGraphGroup) UpsertExtension(ctx context.Context, payload GraphExtensionPayload) (json.RawMessage, error)
UpsertExtension creates or replaces a graph extension payload.
type Permission ¶
type Permission = generated.ModelPermission
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type PermissionsGroup ¶
type PermissionsGroup struct {
API *generated.ClientWithResponses
}
PermissionsGroup provides methods for retrieving BloodHound role-based access control permission definitions.
Access this group via [CommunityClient.Permissions] or [EnterpriseClient.Permissions]:
perms := client.Community().Permissions()
func (*PermissionsGroup) Permission ¶
func (g *PermissionsGroup) Permission(ctx context.Context, permissionId int32) (*Permission, error)
Permission retrieves a single Permission definition by its numeric ID.
perm, err := client.Community().Permissions().Permission(ctx, 1)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", perm)
func (*PermissionsGroup) Permissions ¶
func (g *PermissionsGroup) Permissions(ctx context.Context, opts *ListOptions) ([]Permission, error)
Permissions returns the list of all available Permission definitions. Pass a *ListOptions to set SortBy, or nil for server defaults.
perms, err := client.Community().Permissions().Permissions(ctx, nil)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Permissions: %d\n", len(perms))
type PostureHistory ¶
type PostureHistory struct {
DataType *EnumPostureHistoryType
Start *time.Time
End *time.Time
Environments []string
Points []PostureHistoryPoint
}
PostureHistory contains posture history data and request metadata.
type PostureHistoryPoint ¶
PostureHistoryPoint is one point in a posture history time series.
type QueryLibraryItem ¶
type QueryLibraryItem struct {
Name string `json:"name"`
GUID string `json:"guid,omitempty"`
Prebuilt bool `json:"prebuilt,omitempty"`
Platforms []string `json:"platforms,omitempty"`
Category string `json:"category,omitempty"`
Description string `json:"description,omitempty"`
Query string `json:"query"`
Revision int `json:"revision,omitempty"`
Resources string `json:"resources,omitempty"`
Acknowledgements string `json:"acknowledgements,omitempty"`
}
QueryLibraryItem represents a single query entry from the SpecterOps BloodHound Query Library (https://github.com/SpecterOps/BloodHoundQueryLibrary).
func ParseQueryLibrary ¶
func ParseQueryLibrary(data []byte) ([]QueryLibraryItem, error)
ParseQueryLibrary parses a Queries.json payload into a slice of QueryLibraryItem entries.
type RelatedEntity ¶
RelatedEntity represents a related entity in a list response.
type RelatedEntityList ¶
type RelatedEntityList struct {
Data []RelatedEntity
Count int
Skip int
Limit int
}
RelatedEntityList is a paginated list of related entities.
type RelationshipKind ¶
type RelationshipKind = generated.ModelRelationshipKindResponse
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type RelationshipKindResult ¶
type RelationshipKindResult struct {
Data *RelationshipKind
}
RelationshipKindResult wraps a relationship kind response.
type RiskCounts ¶
type RiskCounts = generated.ModelRiskCounts
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type RiskPostureGroup ¶
type RiskPostureGroup struct {
API *generated.ClientWithResponses
}
RiskPostureGroup provides methods for retrieving enterprise risk posture statistics and historical trend data.
Access this group via [EnterpriseClient.RiskPosture]:
rp := client.Enterprise().RiskPosture()
func (*RiskPostureGroup) PostureHistoryForEnvironments ¶
func (g *RiskPostureGroup) PostureHistoryForEnvironments(ctx context.Context, dataType EnumPostureHistoryType) (*PostureHistory, error)
PostureHistoryForEnvironments retrieves historical risk posture trend data across environments for the given data type. The returned PostureHistory contains timestamped data points suitable for charting.
history, err := client.Enterprise().RiskPosture().
PostureHistoryForEnvironments(ctx, EnumPostureHistoryType("attack_path_count"))
if err != nil {
log.Fatal(err)
}
fmt.Printf("History points: %d\n", len(history.Points))
func (*RiskPostureGroup) PostureStats ¶
func (g *RiskPostureGroup) PostureStats(ctx context.Context, opts *ListOptions) ([]RiskPostureStat, error)
PostureStats returns the current risk posture statistics for all monitored domains as a list of RiskPostureStat entries. Pass a *ListOptions to set SortBy, or nil for server defaults.
stats, err := client.Enterprise().RiskPosture().PostureStats(ctx, nil)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Tracked domains: %d\n", len(stats))
type RiskPostureStat ¶
type RiskPostureStat = generated.ModelRiskPostureStat
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type Role ¶
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type RolesGroup ¶
type RolesGroup struct {
API *generated.ClientWithResponses
}
RolesGroup provides methods for retrieving BloodHound role definitions used in role-based access control.
Access this group via [CommunityClient.Roles] or [EnterpriseClient.Roles]:
roles := client.Community().Roles()
func (*RolesGroup) Role ¶
Role retrieves a single Role definition by its numeric ID.
role, err := client.Community().Roles().Role(ctx, 1)
if err != nil {
log.Fatal(err)
}
if role != nil {
fmt.Printf("Role: %s\n", *role.Name)
}
func (*RolesGroup) Roles ¶
func (g *RolesGroup) Roles(ctx context.Context, opts *ListOptions) ([]Role, error)
Roles returns the list of all available Role definitions. Pass a *ListOptions to set SortBy, or nil for server defaults.
roles, err := client.Community().Roles().Roles(ctx, nil)
if err != nil {
log.Fatal(err)
}
for _, role := range roles {
fmt.Printf("Role %d: %s\n", *role.Id, *role.Name)
}
type RootCAsGroup ¶
type RootCAsGroup struct {
API *generated.ClientWithResponses
}
RootCAsGroup provides methods for querying AD Certificate Services Root CA entities and their relationships from the BloodHound API.
Access this group via [CommunityClient.RootCAs] or [EnterpriseClient.RootCAs]:
cas := client.Community().RootCAs()
func (*RootCAsGroup) Controllers ¶
func (g *RootCAsGroup) Controllers(objectID string) *RootCAsQuery
Controllers returns a query builder that lists AD objects with control over this Root CA via inbound ACL-based relationships.
results, err := client.Community().RootCAs().
Controllers("ABCD1234-...").Limit(50).Results(ctx)
func (*RootCAsGroup) PkiHierarchy ¶
func (g *RootCAsGroup) PkiHierarchy(objectID string) *RootCAsQuery
PkiHierarchy returns a query builder that lists entities in the PKI trust chain associated with this Root CA.
hierarchy, err := client.Community().RootCAs().
PkiHierarchy("ABCD1234-...").Results(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Hierarchy entities: %d\n", hierarchy.Count)
func (*RootCAsGroup) RootCaEntity ¶
RootCaEntity retrieves a single AD Certificate Services Root CA entity by its BloodHound object ID. The returned Entity includes the CA's name, label, kind tags, and all collected properties.
ca, err := client.Community().RootCAs().RootCaEntity(ctx, "ABCD1234-...")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Root CA: %s (%s)\n", ca.Name, ca.Label)
type RootCAsQuery ¶
type RootCAsQuery struct {
API *generated.ClientWithResponses
// contains filtered or unexported fields
}
RootCAsQuery is a fluent query builder for paginated Root CA relationship lookups.
func (*RootCAsQuery) All ¶
func (q *RootCAsQuery) All(ctx context.Context) ([]RelatedEntity, error)
All executes paginated queries in a loop until all matching entities are collected and returned as a flat slice.
entities, err := client.Community().RootCAs().Controllers(objectID).All(ctx)
func (*RootCAsQuery) Limit ¶
func (q *RootCAsQuery) Limit(n int) *RootCAsQuery
Limit sets the maximum number of items to return. It returns the query for method chaining.
func (*RootCAsQuery) Results ¶
func (q *RootCAsQuery) Results(ctx context.Context) (RelatedEntityList, error)
Results executes the query and returns a paginated RelatedEntityList. The list includes the matched entities along with Count, Skip, and Limit metadata for cursor-based pagination.
results, err := client.Community().RootCAs().
Controllers("ABCD1234-...").
SortBy("name").
Limit(25).
Results(ctx)
if err != nil {
log.Fatal(err)
}
for _, r := range results.Data {
fmt.Printf("%s (%s)\n", r.Name, r.Label)
}
func (*RootCAsQuery) Skip ¶
func (q *RootCAsQuery) Skip(n int) *RootCAsQuery
Skip sets the number of items to skip for pagination. It returns the query for method chaining.
func (*RootCAsQuery) SortBy ¶
func (q *RootCAsQuery) SortBy(field string) *RootCAsQuery
SortBy sets the field name used to order results. It returns the query for method chaining.
type SSOProviderPatchResult ¶
type SSOProviderPatchResult struct {
OIDC *OidcProvider
SAML *SamlProvider
}
SSOProviderPatchResult is the parsed result of patching an SSO provider. Exactly one of OIDC or SAML is typically set.
type SSOSAMLProviderOptions ¶
type SSOSAMLProviderOptions struct {
Name string
MetadataXML []byte
AutoProvisionEnabled bool
AutoProvisionRoleID string
RoleProvision bool
}
SSOSAMLProviderOptions describes a SAML provider registered through the SSO provider endpoint, which requires auto-provisioning settings.
type SamlProvider ¶
type SamlProvider = generated.ModelSamlProvider
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type SamlSignOnEndpoint ¶
type SamlSignOnEndpoint = generated.ModelSamlSignOnEndpoint
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type SavedQueriesPermissions ¶
type SavedQueriesPermissions = generated.ModelSavedQueriesPermissions
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type SavedQueriesPermissionsResult ¶
type SavedQueriesPermissionsResult = generated.ModelSavedQueriesPermissionsResponse
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type SavedQuery ¶
type SavedQuery = generated.ModelSavedQuery
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type SearchGroup ¶
type SearchGroup struct {
API *generated.ClientWithResponses
}
SearchGroup provides methods for searching the BloodHound graph by keyword.
Access this group via [CommunityClient.Search] or [EnterpriseClient.Search]:
search := client.Community().Search()
func (*SearchGroup) AvailableDomains ¶
func (g *SearchGroup) AvailableDomains(ctx context.Context) ([]DomainSelector, error)
AvailableDomains is a convenience method that returns all collected domains with default options. For more control, use SearchGroup.Domains to build a filtered query.
domains, err := client.Community().Search().AvailableDomains(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Collected domains: %d\n", len(domains))
func (*SearchGroup) Domains ¶
func (g *SearchGroup) Domains() *AvailableDomainsQuery
Domains returns an AvailableDomainsQuery builder for listing collected AD domains. Use SortBy, ObjectID, Name, or Collected to filter before calling Results.
query := client.Community().Search().Domains().SortBy("name")
func (*SearchGroup) Query ¶
func (g *SearchGroup) Query(query string) *SearchQuery
Query returns a SearchQuery builder that searches the graph for nodes matching the given keyword string. Use Type, Skip, and Limit to refine results before calling Results.
results, err := client.Community().Search().
Query("admin").Type("User").Limit(10).Results(ctx)
func (*SearchGroup) Search ¶
func (g *SearchGroup) Search(ctx context.Context, query string) ([]SearchResult, error)
Search is a convenience method that runs a keyword search with default options. For more control, use SearchGroup.Query to build a filtered query.
results, err := client.Community().Search().Search(ctx, "tier 0")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Matches: %d\n", len(results))
type SearchQuery ¶
type SearchQuery struct {
API *generated.ClientWithResponses
// contains filtered or unexported fields
}
SearchQuery is a fluent query builder for graph keyword searches.
func (*SearchQuery) All ¶
func (q *SearchQuery) All(ctx context.Context) ([]SearchResult, error)
All executes paginated search queries in a loop until all matching results are collected.
results, err := client.Community().Search().Query("admin").Type("User").All(ctx)
func (*SearchQuery) Limit ¶
func (q *SearchQuery) Limit(n int) *SearchQuery
Limit sets the maximum number of items to return. It returns the query for method chaining.
query := client.Community().Search().Query("admin").Limit(10)
func (*SearchQuery) Results ¶
func (q *SearchQuery) Results(ctx context.Context) ([]SearchResult, error)
Results executes the search query and returns matching SearchResult entries.
results, err := client.Community().Search().
Query("admin").
Type("User").
Limit(10).
Results(ctx)
if err != nil {
log.Fatal(err)
}
for _, r := range results {
fmt.Printf("%+v\n", r)
}
func (*SearchQuery) Skip ¶
func (q *SearchQuery) Skip(n int) *SearchQuery
Skip sets the number of items to skip for pagination. It returns the query for method chaining.
query := client.Community().Search().Query("admin").Skip(25)
func (*SearchQuery) Type ¶
func (q *SearchQuery) Type(nodeType string) *SearchQuery
Type filters results to the given node type (e.g., "User", "Computer"). It returns the query for method chaining.
query := client.Community().Search().Query("admin").Type("User")
type SearchResult ¶
type SearchResult = generated.ModelSearchResult
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type TasksGroup ¶
type TasksGroup struct {
API *generated.ClientWithResponses
}
TasksGroup provides methods for managing BloodHound data collection tasks, including status monitoring, cancellation, notification, and log retrieval.
Access this group via [EnterpriseClient.Tasks]:
tasks := client.Enterprise().Tasks()
func (*TasksGroup) AvailableClientTasks
deprecated
func (g *TasksGroup) AvailableClientTasks(ctx context.Context, opts *ListOptions) ([]ClientScheduledJobDisplay, error)
AvailableClientTasks returns collection task templates that can be started by clients. This is useful for building a "run task" UI where operators choose from available task definitions. Pass a *ListOptions to set SortBy, or nil for server defaults.
available, err := client.Enterprise().Tasks().AvailableClientTasks(ctx, nil)
if err != nil {
log.Fatal(err)
}
for _, t := range available {
fmt.Printf("Task %d: %s\n", *t.Id, *t.Name)
}
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use JobsGroup.AvailableClientJobs instead.
func (*TasksGroup) CancelClientTask
deprecated
func (g *TasksGroup) CancelClientTask(ctx context.Context, taskID int64) (*ClientScheduledJobDisplay, error)
CancelClientTask cancels a scheduled or running collection task by ID.
canceled, err := client.Enterprise().Tasks().CancelClientTask(ctx, taskID)
if err != nil {
log.Fatal(err)
}
if canceled != nil {
fmt.Printf("Canceled task %d\n", *canceled.Id)
}
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use JobsGroup.CancelClientJob instead.
func (*TasksGroup) ClientCurrentTask
deprecated
func (g *TasksGroup) ClientCurrentTask(ctx context.Context) (*ClientScheduledJobDisplay, error)
ClientCurrentTask returns the currently running collection task, if one is active. It returns nil when no task is running.
current, err := client.Enterprise().Tasks().ClientCurrentTask(ctx)
if err != nil {
log.Fatal(err)
}
if current == nil {
fmt.Println("No task is currently running")
}
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use JobsGroup.ClientCurrentJob instead.
func (*TasksGroup) ClientFinishedTasks
deprecated
func (g *TasksGroup) ClientFinishedTasks(ctx context.Context, opts *ListOptions) ([]ClientScheduledJobDisplay, error)
ClientFinishedTasks returns collection tasks in terminal/completed states (for example complete, failed, canceled, or timed out). Pass a *ListOptions to paginate or sort results, or nil for server defaults.
finished, err := client.Enterprise().Tasks().ClientFinishedTasks(ctx, nil)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Finished tasks: %d\n", len(finished))
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use JobsGroup.ClientFinishedJobs instead.
func (*TasksGroup) ClientTask
deprecated
func (g *TasksGroup) ClientTask(ctx context.Context, taskID int64) (*ClientScheduledJobDisplay, error)
ClientTask retrieves a single collection task by its numeric ID.
task, err := client.Enterprise().Tasks().ClientTask(ctx, taskID)
if err != nil {
log.Fatal(err)
}
if task != nil {
fmt.Printf("Task %d status: %s\n", *task.Id, *task.Status)
}
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use JobsGroup.ClientJob instead.
func (*TasksGroup) ClientTaskLog
deprecated
ClientTaskLog retrieves the log output for a collection task by ID.
logOutput, err := client.Enterprise().Tasks().ClientTaskLog(ctx, taskID)
if err != nil {
log.Fatal(err)
}
fmt.Println(logOutput)
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use JobsGroup.ClientJobLog instead.
func (*TasksGroup) ClientTasks
deprecated
func (g *TasksGroup) ClientTasks(ctx context.Context) ([]ClientScheduledJobDisplay, error)
ClientTasks returns all collection tasks regardless of status.
tasks, err := client.Enterprise().Tasks().ClientTasks(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Total tasks: %d\n", len(tasks))
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use JobsGroup.ClientJobs instead.
func (*TasksGroup) EndClientTask
deprecated
func (g *TasksGroup) EndClientTask(ctx context.Context) (*ClientScheduledJob, error)
EndClientTask signals the currently running collection task to stop.
stopped, err := client.Enterprise().Tasks().EndClientTask(ctx)
if err != nil {
log.Fatal(err)
}
if stopped != nil {
fmt.Printf("Task %d stop requested\n", *stopped.Id)
}
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use JobsGroup.EndClientJob instead.
func (*TasksGroup) StartAndWaitClientTask
deprecated
func (g *TasksGroup) StartAndWaitClientTask(ctx context.Context, taskID int64, options *WaitOptions) (*ClientScheduledJobDisplay, error)
StartAndWaitClientTask starts a collection task by ID and blocks until it reaches a terminal status. It combines TasksGroup.StartClientTaskByID and TasksGroup.WaitForClientTask.
done, err := client.Enterprise().Tasks().StartAndWaitClientTask(ctx, taskID, nil)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Completed with status: %s\n", *done.Status)
Deprecated: These helpers target deprecated BloodHound endpoints that will be removed in a future release. Use JobsGroup.StartAndWaitClientJob instead.
func (*TasksGroup) StartClientTask
deprecated
func (g *TasksGroup) StartClientTask(ctx context.Context, body generated.StartClientTaskJSONRequestBody) (*ClientScheduledJob, error)
StartClientTask starts a collection task from a request body and returns the scheduled task record.
taskID := int64(123)
started, err := client.Enterprise().Tasks().StartClientTask(ctx, generated.StartClientTaskJSONRequestBody{
Id: &taskID,
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Started task ID: %d\n", *started.Id)
Deprecated: This endpoint is deprecated by BloodHound and will be removed in a future release. Use JobsGroup.StartClientJob instead.
func (*TasksGroup) StartClientTaskByID
deprecated
func (g *TasksGroup) StartClientTaskByID(ctx context.Context, taskID int64) (*ClientScheduledJob, error)
StartClientTaskByID starts a collection task by its numeric ID.
started, err := client.Enterprise().Tasks().StartClientTaskByID(ctx, 123)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Status: %s\n", *started.Status)
Deprecated: This helper targets a deprecated BloodHound endpoint that will be removed in a future release. Use JobsGroup.StartClientJobByID instead.
func (*TasksGroup) WaitForClientTask
deprecated
func (g *TasksGroup) WaitForClientTask(ctx context.Context, taskID int64, options *WaitOptions) (*ClientScheduledJobDisplay, error)
WaitForClientTask polls the given task until it reaches a terminal status. Use WaitOptions to configure the poll interval and timeout.
done, err := client.Enterprise().Tasks().WaitForClientTask(ctx, taskID, &WaitOptions{
PollInterval: 3 * time.Second,
Timeout: 10 * time.Minute,
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Final status: %s\n", *done.Status)
Deprecated: This helper polls a deprecated BloodHound endpoint that will be removed in a future release. Use JobsGroup.WaitForClientJob instead.
type ToggleFeatureFlagResult ¶
type ToggleFeatureFlagResult struct {
ActionResult
Enabled *bool
}
ToggleFeatureFlagResult is returned by feature-flag toggle actions.
type UnifiedGraphEdge ¶
type UnifiedGraphEdge = generated.ModelUnifiedGraphEdge
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
func InboundEdges ¶
func InboundEdges(graph *UnifiedGraphGraphWithKeys, targetNodeID string) []UnifiedGraphEdge
InboundEdges returns all edges pointing to the specified target node ID.
func OutboundEdges ¶
func OutboundEdges(graph *UnifiedGraphGraphWithKeys, sourceNodeID string) []UnifiedGraphEdge
OutboundEdges returns all edges originating from the specified source node ID.
func ShortestPath ¶
func ShortestPath(graph *UnifiedGraphGraphWithKeys, startNodeID, targetNodeID string) []UnifiedGraphEdge
ShortestPath finds the shortest sequence of edges connecting startNodeID to targetNodeID in the graph using breadth-first search (BFS). It returns nil if no path exists.
type UnifiedGraphGraph ¶
type UnifiedGraphGraph = generated.ModelUnifiedGraphGraph
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type UnifiedGraphGraphWithKeys ¶
type UnifiedGraphGraphWithKeys = generated.ModelUnifiedGraphGraphWPropertyKeys
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type UnifiedGraphNode ¶
type UnifiedGraphNode = generated.ModelUnifiedGraphNode
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
func FindNodeByLabel ¶
func FindNodeByLabel(graph *UnifiedGraphGraphWithKeys, label string) *UnifiedGraphNode
FindNodeByLabel finds the first node whose label matches the given string (case-insensitive). It returns nil if no matching node is found.
func GetNode ¶
func GetNode(graph *UnifiedGraphGraphWithKeys, nodeID string) *UnifiedGraphNode
GetNode looks up a node in the graph by its ID. It returns nil if the graph or nodes map is nil, or if the node is not found.
func NodesByKind ¶
func NodesByKind(graph *UnifiedGraphGraphWithKeys, kind string) []UnifiedGraphNode
NodesByKind returns all nodes in the graph matching the given kind (e.g. "User", "Group", "Computer").
func OwnedNodes ¶
func OwnedNodes(graph *UnifiedGraphGraphWithKeys) []UnifiedGraphNode
OwnedNodes returns all nodes marked as owned / compromised in the graph.
func TierZeroNodes ¶
func TierZeroNodes(graph *UnifiedGraphGraphWithKeys) []UnifiedGraphNode
TierZeroNodes returns all nodes marked as Tier Zero / High Value Target in the graph.
type UploadFile ¶
UploadFile represents one collector output file to upload.
type User ¶
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type UserMfaSetup ¶
UserMfaSetup contains the MFA setup details returned when enabling MFA.
type UsersMinimal ¶
type UsersMinimal = generated.ModelUsersMinimal
The type aliases below expose generated model types under the services package so consumers never need to import the internal generated package directly.
type WaitOptions ¶
type WaitOptions struct {
// PollInterval controls how often status is checked. Defaults to 2s.
PollInterval time.Duration
// Timeout adds an optional deadline for the wait operation. Zero means the
// caller's context controls cancellation/deadline behavior.
Timeout time.Duration
}
WaitOptions configures polling behavior for helper methods that wait for asynchronous operations to reach a terminal state.
Error semantics: any non-2xx poll response (including transient 404/5xx) fails the wait immediately rather than being retried until the timeout, callers wanting retry-on-transient should implement it around these helpers. Context cancellation and the optional Timeout always abort with an error wrapping ctx.Err().
done, err := client.Enterprise().Tasks().StartAndWaitClientTask(ctx, taskID, &WaitOptions{
PollInterval: 3 * time.Second,
Timeout: 10 * time.Minute,
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Final status: %s\n", services.JobStatusName(*done.Status))
Source Files
¶
- ad_base_entities.go
- ad_users.go
- aia_cas.go
- alerts.go
- analysis.go
- api_info.go
- api_tokens.go
- asset_isolation.go
- attack_paths.go
- audit.go
- auth_group.go
- azure_entities.go
- bloodhound_users.go
- cert_templates.go
- client_ingest.go
- clients.go
- collection_uploads.go
- collectors.go
- community_queries.go
- computers.go
- config.go
- containers.go
- convert.go
- custom_node_management.go
- cypher.go
- data_quality.go
- database.go
- datapipe.go
- domains.go
- enterprise_cas.go
- errors.go
- eula.go
- events.go
- gpos.go
- graph.go
- graph_helpers.go
- groups.go
- jobs.go
- list_options.go
- meta_entities.go
- models.go
- nt_auth_stores.go
- opengraph.go
- ous.go
- owned.go
- permissions.go
- risk_posture.go
- roles.go
- root_cas.go
- search.go
- tasks.go
- wait.go