Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Merge branch 'main' into sharpfuzz-update
Browse files Browse the repository at this point in the history
  • Loading branch information
Porges authored Feb 23, 2023
2 parents 4b7bca6 + b848968 commit 7e59a24
Show file tree
Hide file tree
Showing 48 changed files with 372 additions and 32 deletions.
1 change: 1 addition & 0 deletions docs/command-replacements.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The following values are replaced with the specific values at runtime.
* `{crashes_container}`: Container name for the `crashes` container
* `{microsoft_telemetry_key}`: Application Insights key used for collecting [non-attributable telemetry](telemetry.md) to improve OneFuzz.
* `{instance_telemetry_key}`: Application Insights key used for private, instance-owned telemetry and logging (See [OneFuzz Telemetry](telemetry.md).
* `{extra}`: Path to the optionally provided `extra` directory

## Example

Expand Down
10 changes: 5 additions & 5 deletions docs/unmnaged-nodes.md → docs/unmanaged-nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ The default mode of OneFuzz is to run the agents inside scalesets managed by the
This is the unmanaged scenario. In this mode, the user can use their own resource to participate in the fuzzing.

## Set-up
These are the steps to run an unmanaged node
These are the steps to run an unmanaged node.


### Create an Application Registration in Azure Active Directory
We will create the authentication method for the unmanaged node.
Create the authentication method for the unmanaged node.
From the [azure cli](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) create a new **application registration**:
```cmd
az ad app create --display-name <registration_name>
```
Then use the application `app_id` in the result to create the associated **service principal**:
Then use the application's `app_id` in the newly created application registration to create the associated **service principal**:

```cmd
az ad sp create --id <app_id>
Expand Down Expand Up @@ -63,7 +63,7 @@ Save the config to the file.
### Start the agent.
Navigate to the folder corresponding to your OS.
Set the necessary environment variable by running the script `set-env.ps1` (for Windows) or `set-env.sh` (for Linux).
Run the agent with the following command. If you need more nodes use a different `machine_guid` for each one:
Run the agent with the following command. If you need more nodes, use a different `machine_guid` for each one:
```cmd
onefuzz-agent run --machine_id <machine_guid> -c <path_to_config_file> --reset_lock
```
Expand All @@ -87,7 +87,7 @@ onefuzz nodes get <machine_guid>
```

This should return one entry. Verify that the `pool_name` matched the pool name created earlier.
From here you will be able to schedule jobs on that pool and they will be running.
From here you will be able to schedule jobs on that pool and they will run.


## Troubleshooting
Expand Down
24 changes: 16 additions & 8 deletions docs/webhook_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ If webhook is set to have Event Grid message format then the payload will look a
"unique_inputs",
"unique_reports",
"regression_reports",
"logs"
"logs",
"extra"
],
"title": "ContainerType"
},
Expand Down Expand Up @@ -2001,7 +2002,8 @@ If webhook is set to have Event Grid message format then the payload will look a
"unique_inputs",
"unique_reports",
"regression_reports",
"logs"
"logs",
"extra"
],
"title": "ContainerType"
},
Expand Down Expand Up @@ -2927,7 +2929,8 @@ If webhook is set to have Event Grid message format then the payload will look a
"unique_inputs",
"unique_reports",
"regression_reports",
"logs"
"logs",
"extra"
],
"title": "ContainerType"
},
Expand Down Expand Up @@ -3408,7 +3411,8 @@ If webhook is set to have Event Grid message format then the payload will look a
"unique_inputs",
"unique_reports",
"regression_reports",
"logs"
"logs",
"extra"
],
"title": "ContainerType"
},
Expand Down Expand Up @@ -3932,7 +3936,8 @@ If webhook is set to have Event Grid message format then the payload will look a
"unique_inputs",
"unique_reports",
"regression_reports",
"logs"
"logs",
"extra"
],
"title": "ContainerType"
},
Expand Down Expand Up @@ -4380,7 +4385,8 @@ If webhook is set to have Event Grid message format then the payload will look a
"unique_inputs",
"unique_reports",
"regression_reports",
"logs"
"logs",
"extra"
],
"title": "ContainerType"
},
Expand Down Expand Up @@ -4855,7 +4861,8 @@ If webhook is set to have Event Grid message format then the payload will look a
"unique_inputs",
"unique_reports",
"regression_reports",
"logs"
"logs",
"extra"
],
"title": "ContainerType"
},
Expand Down Expand Up @@ -5460,7 +5467,8 @@ If webhook is set to have Event Grid message format then the payload will look a
"unique_inputs",
"unique_reports",
"regression_reports",
"logs"
"logs",
"extra"
],
"title": "ContainerType"
},
Expand Down
3 changes: 2 additions & 1 deletion src/ApiService/ApiService/OneFuzzTypes/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ public enum ContainerType {
UniqueInputs,
UniqueReports,
RegressionReports,
Logs
Logs,
Extra
}


Expand Down
2 changes: 2 additions & 0 deletions src/ApiService/ApiService/OneFuzzTypes/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ public record TaskDefinition(
public record WorkSet(
bool Reboot,
Uri SetupUrl,
Uri? ExtraUrl,
bool Script,
List<WorkUnit> WorkUnits
);
Expand Down Expand Up @@ -1020,6 +1021,7 @@ Uri HeartbeatQueue
public IContainerDef? UniqueInputs { get; set; }
public IContainerDef? UniqueReports { get; set; }
public IContainerDef? RegressionReports { get; set; }
public IContainerDef? Extra { get; set; }

}

Expand Down
3 changes: 3 additions & 0 deletions src/ApiService/ApiService/onefuzzlib/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ await _containers.GetContainerSasUrl(x.Item2.Name, StorageType.Corpus, ConvertPe
case ContainerType.RegressionReports:
config.RegressionReports = def;
break;
case ContainerType.Extra:
config.Extra = def;
break;
}
}

Expand Down
98 changes: 96 additions & 2 deletions src/ApiService/ApiService/onefuzzlib/Defs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ public static class Defs {
ContainerPermission.List |
ContainerPermission.Read |
ContainerPermission.Write
)},
),
new ContainerDefinition(
Type:ContainerType.Extra,
Compare: Compare.AtMost,
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
},
MonitorQueue: ContainerType.ReadonlyInputs)
},
{
Expand Down Expand Up @@ -83,6 +90,12 @@ public static class Defs {
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
new ContainerDefinition(
Type:ContainerType.Extra,
Compare: Compare.AtMost,
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
},
MonitorQueue: ContainerType.ReadonlyInputs)
},
Expand Down Expand Up @@ -135,6 +148,12 @@ public static class Defs {
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
new ContainerDefinition(
Type:ContainerType.Extra,
Compare: Compare.AtMost,
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
},
MonitorQueue: ContainerType.Crashes
)
Expand Down Expand Up @@ -185,6 +204,12 @@ public static class Defs {
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
new ContainerDefinition(
Type:ContainerType.Extra,
Compare: Compare.AtMost,
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
}
)},
{ TaskType.GenericAnalysis ,
Expand Down Expand Up @@ -222,6 +247,12 @@ public static class Defs {
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
new ContainerDefinition(
Type:ContainerType.Extra,
Compare: Compare.AtMost,
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
},
MonitorQueue: ContainerType.Crashes)
},
Expand Down Expand Up @@ -264,6 +295,12 @@ public static class Defs {
Value: 0,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
new ContainerDefinition(
Type:ContainerType.Extra,
Compare: Compare.AtMost,
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
}
)},
{
Expand Down Expand Up @@ -309,6 +346,12 @@ public static class Defs {
Value: 1,
Permissions: ContainerPermission.Write
),
new ContainerDefinition(
Type:ContainerType.Extra,
Compare: Compare.AtMost,
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
},
MonitorQueue: ContainerType.Crashes
)
Expand Down Expand Up @@ -343,7 +386,16 @@ public static class Defs {
ContainerPermission.List |
ContainerPermission.Read |
ContainerPermission.Write
)},
),
new ContainerDefinition(
Type:ContainerType.Extra,
Compare: Compare.AtMost,
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),


},
MonitorQueue: ContainerType.ReadonlyInputs
)},
{
Expand Down Expand Up @@ -377,6 +429,12 @@ public static class Defs {
Value: 0,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
new ContainerDefinition(
Type:ContainerType.Extra,
Compare: Compare.AtMost,
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
}
)
},
Expand Down Expand Up @@ -445,6 +503,12 @@ public static class Defs {
Value: 1,
Permissions: ContainerPermission.Write | ContainerPermission.Read | ContainerPermission.List
),
new ContainerDefinition(
Type:ContainerType.Extra,
Compare: Compare.AtMost,
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
}
)
},
Expand Down Expand Up @@ -486,6 +550,12 @@ public static class Defs {
Value:1,
Permissions: ContainerPermission.Write| ContainerPermission.List
),
new ContainerDefinition(
Type:ContainerType.Extra,
Compare: Compare.AtMost,
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
}
)
},
Expand Down Expand Up @@ -532,6 +602,12 @@ public static class Defs {
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
new ContainerDefinition(
Type:ContainerType.Extra,
Compare: Compare.AtMost,
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
}
)
},
Expand Down Expand Up @@ -579,6 +655,12 @@ public static class Defs {
Value:1,
Permissions: ContainerPermission.Write
),
new ContainerDefinition(
Type:ContainerType.Extra,
Compare: Compare.AtMost,
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
},
MonitorQueue: ContainerType.Crashes
)
Expand Down Expand Up @@ -640,6 +722,12 @@ public static class Defs {
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
new ContainerDefinition(
Type:ContainerType.Extra,
Compare: Compare.AtMost,
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
})
},
{
Expand Down Expand Up @@ -699,6 +787,12 @@ public static class Defs {
Permissions:
ContainerPermission.Read | ContainerPermission.List
),
new ContainerDefinition(
Type:ContainerType.Extra,
Compare: Compare.AtMost,
Value:1,
Permissions: ContainerPermission.Read | ContainerPermission.List
),
})
},
};
Expand Down
Loading

0 comments on commit 7e59a24

Please sign in to comment.