Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function App Recompilation #11756

Merged
merged 10 commits into from
Feb 12, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "myTimer",
"type": "timerTrigger",
"direction": "in",
"schedule": "0 0 1,13 * * *"
"schedule": "%Schedule%"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,7 @@
},
{
"title": "",
"description": "**STEP 2 - Choose ONE from the following two deployment options to deploy the connector and the associated Azure Function**\n\n>**IMPORTANT:** Before deploying the BloodHound Enterprise connector, have the Workspace Name (can be copied from the following), as well as the BloodHound Enterprise API authorization key(s) or Token, readily available.",
"instructions": [
{
"parameters": {
"fillWith": [
"workspaceName"
],
"label": "Workspace Name"
},
"type": "CopyableLabel"
}
]
"description": "**STEP 2 - Choose ONE from the following two deployment options to deploy the connector and the associated Azure Function**\n\n>**IMPORTANT:** Before deploying the BloodHound Enterprise connector, have the Log Analytics Workspace Name, as well as the BloodHound Enterprise API authorization key(s) or Token, readily available."
},
{
"title": "",
Expand Down
30 changes: 30 additions & 0 deletions Solutions/BloodHound Enterprise/Data Connectors/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.PHONY: build clean package

# Packaging variables
FUNCTION_NAME := function
BINARY_NAME := function
ZIP_NAME := bhe-funcapp.zip

# Go build variables
GOOS := linux
GOARCH := amd64

# Package the function app
package: build
@echo "Packaging"
rm -f $(ZIP_NAME)
zip -r $(ZIP_NAME) AzureFunctionBloodHoundEnterprise/ AzureFunctionBloodHoundEnterprise/function.json function host.json
@echo "Packaging complete"

# Build binary
build: clean
@echo "Building $(BINARY_NAME)"
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(BINARY_NAME)

# Clean up build artifacts
clean:
@echo "Clean"
go clean
rm -f $(ZIP_NAME)


Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
"metadata": {
"description": "Token Key from the BloodHound Enterprise API"
}
},
"Schedule": {
"type": "string",
"defaultValue": "0 0 1,13 * * *",
"metadata": {
"description": "Please enter a valid Quartz cron schedule. The default runs at 1am and 1pm"
}
}
},
"variables": {
Expand Down Expand Up @@ -77,6 +84,9 @@
"workspaceID": {
"value": "[resourceId('Microsoft.OperationalInsights/workspaces', parameters('workspaceName'))]"
},
"Schedule": {
"value": "[parameters('Schedule')]"
},
"BHEDomain": {
"value": "[parameters('BHEDomain')]"
},
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
"metadata": {
"description": " The immutable Id of the Data Collection Rule"
}
},
"Schedule": {
"type": "string",
"defaultValue": "0 0 1,13 * * *",
"metadata": {
"description": "Please enter a valid Quartz cron schedule. The default runs at 1am and 1pm"
}
}
},
"variables": {
Expand All @@ -55,6 +62,7 @@
"KeyVaultName": "[substring(variables('functionName'), 0, 22)]",
"BHETokenId": "BHETokenId",
"BHETokenKey": "BHETokenKey",
"Schedule": "[parameters('Schedule')]",
"keyVaultSecretReader": "[format('/subscriptions/){0}/providers/Microsoft.Authorization/roleDefinitions/4633458b-17de-408a-b874-0445c86b69e6', subscription().subscriptionId)]",
"metricsPublisher": "[format('/subscriptions/){0}/providers/Microsoft.Authorization/roleDefinitions/3913510d-42f4-4e42-8a64-420c390055eb', subscription().subscriptionId)]",
"uniqueRoleGuidMetricsPublisher": "[guid(resourceId('Microsoft.Storage/storageAccounts', variables('functionName')))]",
Expand Down Expand Up @@ -204,6 +212,7 @@
"logAnalyticsUri": "[variables('LogAnaltyicsUri')]",
"logsIngestionUrl": "[parameters('logsIngestionUrl')]",
"dcrImmutableId": "[parameters('dcrImmutableId')]",
"Schedule": "[variables('Schedule')]",
"WEBSITE_RUN_FROM_PACKAGE": "https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/Solutions/BloodHound%20Enterprise/Data%20Connectors/bhe-funcapp.zip"
}
}
Expand Down
Binary file modified Solutions/BloodHound Enterprise/Package/3.1.1.zip
Binary file not shown.
Loading
Loading