Skip to content

Commit

Permalink
added support for BloodHound 4.3 and AzureHound
Browse files Browse the repository at this point in the history
  • Loading branch information
dekelpaz committed Jul 5, 2023
1 parent d39f0ca commit 687c7ad
Show file tree
Hide file tree
Showing 4 changed files with 2,719 additions and 1,025 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bluehound",
"productName": "BlueHound",
"version": "1.1.1",
"version": "1.1.2",
"description": "BlueHound",
"neo4jDesktop": {
"apiVersion": "^1.2.0"
Expand Down
81 changes: 51 additions & 30 deletions src/collectors/BloodHoundUploader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,7 @@ const IngestFuncMap = {
ous: NewIngestion.buildOuJsonNew,
gpos: NewIngestion.buildGpoJsonNew,
containers: NewIngestion.buildContainerJsonNew,
azdevices: NewIngestion.buildAzureDevices,
azusers: NewIngestion.buildAzureUsers,
azgroups: NewIngestion.buildAzureGroups,
aztenants: NewIngestion.buildAzureTenants,
azsubscriptions: NewIngestion.buildAzureSubscriptions,
azresourcegroups: NewIngestion.buildAzureResourceGroups,
azvms: NewIngestion.buildAzureVMs,
azkeyvaults: NewIngestion.buildAzureKeyVaults,
azgroupowners: NewIngestion.buildAzureGroupOwners,
azgroupmembers: NewIngestion.buildAzureGroupMembers,
azvmpermissions: NewIngestion.buildAzureVmPerms,
azrgpermissions: NewIngestion.buildAzureRGPermissions,
azkvpermissions: NewIngestion.buildAzureKVPermissions,
azkvaccesspolicies: NewIngestion.buildAzureKVAccessPolicies,
azpwresetrights: NewIngestion.buildAzurePWResetRights,
azgroupsrights: NewIngestion.buildAzureGroupRights,
azglobaladminrights: NewIngestion.buildAzureGlobalAdminRights,
azprivroleadminrights: NewIngestion.buildAzurePrivRileAdminRights,
azapplicationadmins: NewIngestion.buildAzureApplicationAdmins,
azcloudappadmins: NewIngestion.buildAzureCloudApplicationAdmins,
azapplicationowners: NewIngestion.buildAzureAppOwners,
azapplicationtosp: NewIngestion.buildAzureAppToSP,
azure: NewIngestion.convertAzureData,
};

const uploadData = async (statement, props) => {
Expand Down Expand Up @@ -212,14 +191,56 @@ const processJson = async (file, event) => {
count += data.length

let processedData = processor(data, event)
for (let key in processedData){
let props = processedData[key].props;
if (props.length === 0) continue
let chunked = props.chunk();
let statement = processedData[key].statement;

for (let chunk of chunked){
await uploadData(statement, chunk)

if (file.type === 'azure') {
for (let value of Object.values(
processedData.AzurePropertyMaps
)) {
let props = value.Props;
if (props.length === 0) continue;
let chunked = props.chunk();
let statement = value.Statement;

for (let chunk of chunked) {
await uploadData(statement, chunk);
}
}

for (let item of Object.values(
processedData.OnPremPropertyMaps
)) {
let props = item.Props;
if (props.length === 0) continue;
let chunked = props.chunk();
let statement = item.Statement;

for (let chunk of chunked) {
await uploadData(statement, chunk);
}
}

for (let item of Object.values(
processedData.RelPropertyMaps
)) {
let props = item.Props;
if (props.length === 0) continue;
let chunked = props.chunk();
let statement = item.Statement;

for (let chunk of chunked) {
await uploadData(statement, chunk);
}
}
} else {
for (let key in processedData) {
let props = processedData[key].props;
if (props.length === 0) continue
let chunked = props.chunk();
let statement = processedData[key].statement;

for (let chunk of chunked) {
await uploadData(statement, chunk)
}
}
}

Expand Down
Loading

0 comments on commit 687c7ad

Please sign in to comment.