You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 1, 2023. It is now read-only.
* .
* It doesn't work yet but we're making progress
* Added graceful shutdown and tests
* Small fix
* Fix crate issues
* test fix
* Fix build
* make clippy happy
* The order changed
* Use timeout in kill
* Almost done shutting down ipc
* It should all work now
* Update deny.toml
* Fix warning
Copy file name to clipboardExpand all lines: docs/unmanaged-nodes.md
+32-8Lines changed: 32 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,48 +1,61 @@
1
1
# Unmanaged Nodes
2
+
2
3
The default mode of OneFuzz is to run the agents inside scalesets managed by the the Onefuzz instance. But it is possible to run outside of the Instance infrastructure.
3
4
This is the unmanaged scenario. In this mode, the user can use their own resource to participate in the fuzzing.
4
5
5
6
## Set-up
6
-
These are the steps to run an unmanaged node.
7
7
8
+
These are the steps to run an unmanaged node.
8
9
9
10
### Create an Application Registration in Azure Active Directory
11
+
10
12
Create the authentication method for the unmanaged node.
11
13
From the [azure cli](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) create a new **application registration**:
14
+
12
15
```cmd
13
16
az ad app create --display-name <registration_name>
14
17
```
18
+
15
19
Then use the application's `app_id` in the newly created application registration to create the associated **service principal**:
16
20
17
21
```cmd
18
22
az ad sp create --id <app_id>
19
23
```
24
+
20
25
Take note of the `id` returned by this request. We will call it the `principal_id`.
21
26
22
27
Next, create a `client_secret`:
23
28
24
29
```
25
-
az ad app credential reset --id <pp_id> --append
30
+
az ad app credential reset --id <app_id> --append
26
31
```
32
+
27
33
Take note of the `password` returned.
28
34
29
35
### Authorize the application in OneFuzz
36
+
30
37
From the OneFuzz `deployment` folder run the following script using the `app_id` from above:
Under the `client_credential` section of the agent config file, update `client_id` and `client_secret`:
68
+
55
69
```json
56
70
{
57
-
"client_id": "<app_id>",
58
-
"client_secret": "<password>",
71
+
"client_id": "<app_id>",
72
+
"client_secret": "<password>"
59
73
}
60
74
```
75
+
61
76
Save the config to the file.
62
77
63
78
### Start the agent.
79
+
64
80
Navigate to the folder corresponding to your OS.
65
81
Set the necessary environment variable by running the script `set-env.ps1` (for Windows) or `set-env.sh` (for Linux).
66
82
Run the agent with the following command. If you need more nodes, use a different `machine_guid` for each one:
83
+
67
84
```cmd
68
85
onefuzz-agent run --machine_id <machine_guid> -c <path_to_config_file> --reset_lock
69
86
```
70
87
71
88
Alternatively, the agent folder contains a Dockerfile which provide the configuration of a docker container.
72
89
you can use it by first building the container
90
+
73
91
```cmd
74
92
docker build --t <container_name> .
75
93
```
94
+
76
95
Then start the agent inside the container
96
+
77
97
```cmd
78
98
docker run <container_name> --machine_id <machine_id> --reset_lock
79
99
```
@@ -89,32 +109,36 @@ onefuzz nodes get <machine_guid>
89
109
This should return one entry. Verify that the `pool_name` matched the pool name created earlier.
90
110
From here you will be able to schedule jobs on that pool and they will run.
91
111
92
-
93
112
## Troubleshooting
94
113
95
114
### increase the verbosity of the logs
115
+
96
116
It can help when investigating issues to increase the log verbosity. you will need to set the [RUST_LOG](https://docs.rs/env_logger/latest/env_logger/#enabling-logging) environment variable when starting docker
97
117
98
118
```
99
119
docker run --rm --env RUST_LOG=<log_level> <image_name> --machine_id <machine_id>
100
120
```
121
+
101
122
log_level can be any of
123
+
102
124
- error
103
125
- warn
104
126
- info
105
127
- debug
106
128
- trace
107
129
108
-
109
130
### use the container interactively
131
+
110
132
you can use the container interactively by with the following command
111
133
112
134
windows
135
+
113
136
```
114
137
docker run --it --rm --entrypoint powershell <image_name>
115
138
```
116
139
117
140
linux
141
+
118
142
```
119
143
docker run --it --rm --entrypoint bash <image_name>
0 commit comments