Skip to content

Commit c43d39e

Browse files
committed
update readme
1 parent 5d33644 commit c43d39e

File tree

3 files changed

+38
-141
lines changed

3 files changed

+38
-141
lines changed

README.md

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,44 +50,53 @@ Some examples of queries are as follows:
5050

5151
![chatgpt](images/03-chatgpt.gif)
5252

53-
# Setup a connection with your Azure Firewall
54-
Azure-Firewall-mon is an open source, [Single Page Application](https://en.wikipedia.org/wiki/Single-page_application), written in [Angular](https://angular.io/) with an [Azure function](https://learn.microsoft.com/en-us/azure/azure-functions/functions-overview) backend written in C# DotNet.
53+
# Set up a connection with your Azure Firewall
54+
Azure-Firewall-mon is an open source, [Single Page Application](https://en.wikipedia.org/wiki/Single-page_application), written in [Angular](https://angular.io/) with an [Azure function](https://learn.microsoft.com/en-us/azure/azure-functions/functions-overview) backend written in C# .NET.
5555

56-
Here the current architecture:
56+
Here's the current architecture:
5757

5858
![architecture](./images/architecture.png)
5959

60-
To use this app with **YOUR data**, you must perform the following steps on your Azure Subscription:
60+
To use this app with **YOUR FIREWALL data** you have 2 options:
61+
62+
1. Use Azure Firewall mon sample deployment available at <https://az-firewall-mon.duckiesfarm.com>
63+
2. Deploy Azure Firewall mon in your environment
64+
65+
The recommended option is number 2, because this way you are 100% sure your logs are not going outside your environment. I suggest you use the public deployment only for testing purposes.
66+
67+
> <https://az-firewall-mon.duckiesfarm.com> uses resources of my subscription (Azure Maps API, Azure OpenAI, Azure Static Web App Standard). These resources have a cost, so consider that I am limiting their cost as much as possible. The result is that the tool can be quite slow. In your deployment, you can dedicate more resources and also have better performance.
68+
69+
# Use az-firewall-mon sample deployment
70+
To use this version with your data, you must perform the following steps on your Azure Subscription:
6171

6272
1. Create an Azure Event Hub Namespace
6373
2. Create an Azure Event Hub inside the namespace, with a `1-day retention` and `1 partition`
64-
3. Create a Shared Access Policy, with _Listen_ claim
65-
4. Create an Azure Map Account
66-
5. Create an Azure OpenAI Service
67-
6. Go to OpenAI Studio > Deployments > Create a new deployment using as model `gpt-4o version 2024-05-13`
68-
7. Open the Azure Firewall instance you want to monitor, go to Monitoring > Diagnostic Settings > Add Diagnostic Settings:
74+
3. Create a Shared Access Policy, with _Listen_ claim
75+
4. Open the Azure Firewall instance you want to monitor, go to Monitoring > Diagnostic Settings > Add Diagnostic Settings:
6976

7077
- Select _all_ _logs_ and "Stream to Event Hub"
7178
- Select the Event Hub Namespace and Hub created above
7279
- click `SAVE`
7380

74-
Lazy engineers can performs steps from 1 to 6 by clicking the following button [![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fnicolgit%2Fazure-firewall-mon%2Fmain%2Fbicep%2Ffirewall-mon-azure-stuff.json) :-)
81+
If you are a lazy engineer, like me, you can perform all these steps by clicking the following button😊
7582

76-
Now, open <https://az-firewall-mon.duckiesfarm.com/> and do the following:
83+
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fnicolgit%2Fazure-firewall-mon%2Fmain%2Fbicep%2Ffirewall-mon-azure-stuff.json)
84+
85+
Open the Azure Firewall instance you want to monitor from Azure portal, go to Monitoring > Diagnostic Settings > Add Diagnostic Settings:
7786

78-
1. copy in the `Event Hub Connection String` field the connection string of the Shared Access Policy created above
79-
2. copy the corresponding `Event Hub Consumer Group` Name
80-
3. copy in the `Azure Map Account Shared Key` field the primary or secondary Shared Key of the Azure Map Account created above
81-
4. copy in the `Azure OpenAi Endpoint` field the enpoint URI for the OpenAI resouce created above
82-
5. copy in the `Azure OpenAI deployment` field tne name of the deployment created above
83-
6. copy in the `Azure OpenAI access key` field the primary or secondary Shared Key of the Azure OpenAI account created above
84-
7. click on `Let's begin`.
87+
* Select all logs and "Stream to Event Hub"
88+
* Select the Event Hub Namespace and Hub created above
89+
* Click SAVE
90+
91+
Now, open <https://az-firewall-mon.duckiesfarm.com/> and do the following:
8592

86-
# Install Azure-firewall-mon in your environment
93+
1. Copy the connection string of the Shared Access Policy created above into the `Event Hub Connection String` field
94+
2. Copy the corresponding `Event Hub Consumer Group` name
95+
3. Click on `Let's begin`.
8796

88-
[@lukemurraynz](https://github.com/lukemurraynz) has written a very detailed blog post on how deploy Azure-Firewall-mon in an Azure Static Web App. If you prefer this approach, have a look at his blog post <https://luke.geek.nz/azure/deploy-azure-firewall-mon-to-a-static-web-app/>
97+
# Install az-firewall-mon in your environment
8998

90-
> NOTE: `environment.prod.ts` must be updated with your environment information. az-firewall-mon requires an [Application Insights](https://learn.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview) instance to work properly.
99+
to install az-firewall-mon in your environment, follow this guide. Once the instance is ready and working, you can go back and follow instructions in the [Use az-firewall-mon sample deployment](#use-az-firewall-mon-sample-deployment) section. Just change the URL with the one of your deployment.
91100

92101
# More Information
93102

bicep/firewall-mon-azure-stuff.bicep

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
param namespace string = 'fwmonns354526'
1+
@description('Namespace for the Event Hub')
2+
param namespace string = 'fwmonns${uniqueString(resourceGroup().id, deployment().name)}'
23
param hubname string = 'fwmonhub'
34
param sharedkey string = 'fwmonkey'
4-
param mapAccountName string = 'fwmonflags'
5-
param openAiAccountName string = 'fwmonaoai'
65
param location string = resourceGroup().location
7-
param locationaoai string = 'swedencentral'
8-
param fwmonappinsights string = 'fwmonappinsights'
96

107
resource eventHubNamespace 'Microsoft.EventHub/namespaces@2017-04-01' = {
118
name: namespace
@@ -37,49 +34,4 @@ resource firewallMonHub 'Microsoft.EventHub/namespaces/eventhubs/authorizationRu
3734
}
3835
}
3936

40-
resource mapsAccount 'Microsoft.Maps/accounts@2023-06-01' = {
41-
name: mapAccountName
42-
location: location
43-
sku: {
44-
name: 'G2'
45-
}
46-
kind: 'Gen2'
47-
}
48-
49-
resource openAiService 'Microsoft.CognitiveServices/accounts@2022-03-01' = {
50-
name: openAiAccountName
51-
location: locationaoai
52-
sku: {
53-
name: 'S0'
54-
}
55-
kind: 'OpenAI'
56-
properties: {
57-
customSubDomainName: openAiAccountName
58-
networkAcls: {
59-
defaultAction: 'Allow'
60-
virtualNetworkRules: []
61-
ipRules: []
62-
}
63-
publicNetworkAccess: 'Enabled'
64-
}
65-
}
66-
67-
resource cognitiveServicesDeployment 'Microsoft.CognitiveServices/accounts/deployments@2024-04-01-preview' = {
68-
parent: openAiService
69-
name: 'mygpt4'
70-
sku: {
71-
name: 'Standard'
72-
capacity: 2
73-
}
74-
properties: {
75-
model: {
76-
format: 'OpenAI'
77-
name: 'gpt-4o'
78-
version: '2024-05-13'
79-
}
80-
versionUpgradeOption: 'OnceNewDefaultVersionAvailable'
81-
currentCapacity: 2
82-
raiPolicyName: 'Microsoft.Default'
83-
}
84-
}
8537

bicep/firewall-mon-azure-stuff.json

Lines changed: 6 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44
"metadata": {
55
"_generator": {
66
"name": "bicep",
7-
"version": "0.33.93.31351",
8-
"templateHash": "8760060908616098772"
7+
"version": "0.36.1.42791",
8+
"templateHash": "14141912891136746926"
99
}
1010
},
1111
"parameters": {
1212
"namespace": {
1313
"type": "string",
14-
"defaultValue": "fwmonns354526"
14+
"defaultValue": "[format('fwmonns{0}', uniqueString(resourceGroup().id, deployment().name))]",
15+
"metadata": {
16+
"description": "Namespace for the Event Hub"
17+
}
1518
},
1619
"hubname": {
1720
"type": "string",
@@ -21,25 +24,9 @@
2124
"type": "string",
2225
"defaultValue": "fwmonkey"
2326
},
24-
"mapAccountName": {
25-
"type": "string",
26-
"defaultValue": "fwmonflags"
27-
},
28-
"openAiAccountName": {
29-
"type": "string",
30-
"defaultValue": "fwmonaoai"
31-
},
3227
"location": {
3328
"type": "string",
3429
"defaultValue": "[resourceGroup().location]"
35-
},
36-
"locationaoai": {
37-
"type": "string",
38-
"defaultValue": "swedencentral"
39-
},
40-
"fwmonappinsights": {
41-
"type": "string",
42-
"defaultValue": "fwmonappinsights"
4330
}
4431
},
4532
"resources": [
@@ -78,57 +65,6 @@
7865
"[resourceId('Microsoft.EventHub/namespaces/eventhubs', parameters('namespace'), parameters('hubname'))]",
7966
"[resourceId('Microsoft.EventHub/namespaces', parameters('namespace'))]"
8067
]
81-
},
82-
{
83-
"type": "Microsoft.Maps/accounts",
84-
"apiVersion": "2023-06-01",
85-
"name": "[parameters('mapAccountName')]",
86-
"location": "[parameters('location')]",
87-
"sku": {
88-
"name": "G2"
89-
},
90-
"kind": "Gen2"
91-
},
92-
{
93-
"type": "Microsoft.CognitiveServices/accounts",
94-
"apiVersion": "2022-03-01",
95-
"name": "[parameters('openAiAccountName')]",
96-
"location": "[parameters('locationaoai')]",
97-
"sku": {
98-
"name": "S0"
99-
},
100-
"kind": "OpenAI",
101-
"properties": {
102-
"customSubDomainName": "[parameters('openAiAccountName')]",
103-
"networkAcls": {
104-
"defaultAction": "Allow",
105-
"virtualNetworkRules": [],
106-
"ipRules": []
107-
},
108-
"publicNetworkAccess": "Enabled"
109-
}
110-
},
111-
{
112-
"type": "Microsoft.CognitiveServices/accounts/deployments",
113-
"apiVersion": "2024-04-01-preview",
114-
"name": "[format('{0}/{1}', parameters('openAiAccountName'), 'mygpt4')]",
115-
"sku": {
116-
"name": "Standard",
117-
"capacity": 2
118-
},
119-
"properties": {
120-
"model": {
121-
"format": "OpenAI",
122-
"name": "gpt-4o",
123-
"version": "2024-05-13"
124-
},
125-
"versionUpgradeOption": "OnceNewDefaultVersionAvailable",
126-
"currentCapacity": 2,
127-
"raiPolicyName": "Microsoft.Default"
128-
},
129-
"dependsOn": [
130-
"[resourceId('Microsoft.CognitiveServices/accounts', parameters('openAiAccountName'))]"
131-
]
13268
}
13369
]
13470
}

0 commit comments

Comments
 (0)