Skip to content

Commit

Permalink
feat: schema definitions for new cert template properties and logic u…
Browse files Browse the repository at this point in the history
…pdate to EnrollOnBehalfOfSelfControl (#308)

* feat: schema definitions for new cert template properties and logic update to EnrollOnBehalfOfSelfControl

* fix: remove redundant dcfor schema definition, run schemagen

* fix: remove isdc property definition

* fix: remove redundat canabuse definitions
  • Loading branch information
urangel authored Jan 17, 2024
1 parent 242fb35 commit 207f4b9
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 14 deletions.
19 changes: 18 additions & 1 deletion cmd/api/src/test/integration/harnesses/esc3harness1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 18 additions & 1 deletion cmd/api/src/test/integration/harnesses/esc3harness2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions examples/helm/templates/cmbh.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# Copyright 2023 Specter Ops, Inc.
#
# Licensed under the Apache License, Version 2.0
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
16 changes: 16 additions & 0 deletions examples/helm/templates/ingressgraphdb.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# Copyright 2023 Specter Ops, Inc.
#
# Licensed under the Apache License, Version 2.0
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

{{- if .Values.graphdb.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand Down
52 changes: 46 additions & 6 deletions packages/cue/bh/ad/ad.cue
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,41 @@ SubjectAltRequireUPN: types.#StringEnum & {
representation: "subjectaltrequireupn"
}

SubjectAltRequireDNS: types.#StringEnum & {
symbol: "SubjectAltRequireDNS"
schema: "ad"
name: "Subject Alternative Name Require DNS"
representation: "subjectaltrequiredns"
}

SubjectAltRequireDomainDNS: types.#StringEnum & {
symbol: "SubjectAltRequireDomainDNS"
schema: "ad"
name: "Subject Alternative Name Require Domain DNS"
representation: "subjectaltrequiredomaindns"
}

SubjectAltRequireEmail: types.#StringEnum & {
symbol: "SubjectAltRequireEmail"
schema: "ad"
name: "Subject Alternative Name Require Email"
representation: "subjectaltrequireemail"
}

SubjectAltRequireSPN: types.#StringEnum & {
symbol: "SubjectAltRequireSPN"
schema: "ad"
name: "Subject Alternative Name Require SPN"
representation: "subjectaltrequirespn"
}

SubjectRequireEmail: types.#StringEnum & {
symbol: "SubjectRequireEmail"
schema: "ad"
name: "Subject Require Email"
representation: "subjectrequireemail"
}

AuthorizedSignatures: types.#StringEnum & {
symbol: "AuthorizedSignatures"
schema: "ad"
Expand Down Expand Up @@ -539,6 +574,11 @@ Properties: [
StrongCertificateBindingEnforcement,
EKUs,
SubjectAltRequireUPN,
SubjectAltRequireDNS,
SubjectAltRequireDomainDNS,
SubjectAltRequireEmail,
SubjectAltRequireSPN,
SubjectRequireEmail,
AuthorizedSignatures,
ApplicationPolicies,
IssuancePolicies,
Expand Down Expand Up @@ -786,11 +826,6 @@ DCSync: types.#Kind & {
schema: "active_directory"
}

DCFor: types.#Kind & {
symbol: "DCFor"
schema: "active_directory"
}

ReadLAPSPassword: types.#Kind & {
symbol: "ReadLAPSPassword"
schema: "active_directory"
Expand Down Expand Up @@ -851,6 +886,11 @@ RootCAFor: types.#Kind & {
schema: "active_directory"
}

DCFor: types.#Kind & {
symbol: "DCFor"
schema: "active_directory"
}

PublishedTo: types.#Kind & {
symbol: "PublishedTo"
schema: "active_directory"
Expand Down Expand Up @@ -988,7 +1028,6 @@ RelationshipKinds: [
HasSIDHistory,
AddSelf,
DCSync,
DCFor,
ReadLAPSPassword,
ReadGMSAPassword,
DumpSMSAPassword,
Expand All @@ -1002,6 +1041,7 @@ RelationshipKinds: [
SyncLAPSPassword,
WriteAccountRestrictions,
RootCAFor,
DCFor,
PublishedTo,
ManageCertificates,
ManageCA,
Expand Down
1 change: 1 addition & 0 deletions packages/go/analysis/ad/esc3.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package ad

import (
"context"

"github.com/specterops/bloodhound/analysis"
"github.com/specterops/bloodhound/dawgs/graph"
"github.com/specterops/bloodhound/dawgs/util/channels"
Expand Down
41 changes: 38 additions & 3 deletions packages/go/graphschema/ad/ad.go

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

21 changes: 18 additions & 3 deletions packages/javascript/bh-shared-ui/src/graphSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export enum ActiveDirectoryRelationshipKind {
HasSIDHistory = 'HasSIDHistory',
AddSelf = 'AddSelf',
DCSync = 'DCSync',
DCFor = 'DCFor',
ReadLAPSPassword = 'ReadLAPSPassword',
ReadGMSAPassword = 'ReadGMSAPassword',
DumpSMSAPassword = 'DumpSMSAPassword',
Expand All @@ -107,6 +106,7 @@ export enum ActiveDirectoryRelationshipKind {
SyncLAPSPassword = 'SyncLAPSPassword',
WriteAccountRestrictions = 'WriteAccountRestrictions',
RootCAFor = 'RootCAFor',
DCFor = 'DCFor',
PublishedTo = 'PublishedTo',
ManageCertificates = 'ManageCertificates',
ManageCA = 'ManageCA',
Expand Down Expand Up @@ -182,8 +182,6 @@ export function ActiveDirectoryRelationshipKindToDisplay(value: ActiveDirectoryR
return 'AddSelf';
case ActiveDirectoryRelationshipKind.DCSync:
return 'DCSync';
case ActiveDirectoryRelationshipKind.DCFor:
return 'DCFor';
case ActiveDirectoryRelationshipKind.ReadLAPSPassword:
return 'ReadLAPSPassword';
case ActiveDirectoryRelationshipKind.ReadGMSAPassword:
Expand All @@ -210,6 +208,8 @@ export function ActiveDirectoryRelationshipKindToDisplay(value: ActiveDirectoryR
return 'WriteAccountRestrictions';
case ActiveDirectoryRelationshipKind.RootCAFor:
return 'RootCAFor';
case ActiveDirectoryRelationshipKind.DCFor:
return 'DCFor';
case ActiveDirectoryRelationshipKind.PublishedTo:
return 'PublishedTo';
case ActiveDirectoryRelationshipKind.ManageCertificates:
Expand Down Expand Up @@ -309,6 +309,11 @@ export enum ActiveDirectoryKindProperties {
StrongCertificateBindingEnforcement = 'strongcertificatebindingenforcement',
EKUs = 'ekus',
SubjectAltRequireUPN = 'subjectaltrequireupn',
SubjectAltRequireDNS = 'subjectaltrequiredns',
SubjectAltRequireDomainDNS = 'subjectaltrequiredomaindns',
SubjectAltRequireEmail = 'subjectaltrequireemail',
SubjectAltRequireSPN = 'subjectaltrequirespn',
SubjectRequireEmail = 'subjectrequireemail',
AuthorizedSignatures = 'authorizedsignatures',
ApplicationPolicies = 'applicationpolicies',
IssuancePolicies = 'issuancepolicies',
Expand Down Expand Up @@ -427,6 +432,16 @@ export function ActiveDirectoryKindPropertiesToDisplay(value: ActiveDirectoryKin
return 'Enhanced Key Usage';
case ActiveDirectoryKindProperties.SubjectAltRequireUPN:
return 'Subject Alternative Name Require UPN';
case ActiveDirectoryKindProperties.SubjectAltRequireDNS:
return 'Subject Alternative Name Require DNS';
case ActiveDirectoryKindProperties.SubjectAltRequireDomainDNS:
return 'Subject Alternative Name Require Domain DNS';
case ActiveDirectoryKindProperties.SubjectAltRequireEmail:
return 'Subject Alternative Name Require Email';
case ActiveDirectoryKindProperties.SubjectAltRequireSPN:
return 'Subject Alternative Name Require SPN';
case ActiveDirectoryKindProperties.SubjectRequireEmail:
return 'Subject Require Email';
case ActiveDirectoryKindProperties.AuthorizedSignatures:
return 'Authorized Signatures Required';
case ActiveDirectoryKindProperties.ApplicationPolicies:
Expand Down

0 comments on commit 207f4b9

Please sign in to comment.