Commit Graph

719 Commits

Author SHA1 Message Date
cfcf493a23 add context to command failures (#466)
Fixes #465
2021-01-26 21:29:59 +00:00
de67c9db63 Release 2.0.0 (#464) 2.0.0 2021-01-26 15:41:29 -05:00
5027745ee2 simplify get/delete for scalesets (#468) 2021-01-26 14:43:14 -05:00
165257e989 update python prereqs (#427)
Updates the following libraries in the service:
* azure-core
* azure-functions
* azure-identity
* azure-keyvault-keys
* azure-keyvault-secrets
* azure-mgmt-compute
* azure-mgmt-core
* azure-mgmt-loganalytics
* azure-mgmt-network
* azure-mgmt-resource
* azure-mgmt-storage
* azure-mgmt-subscription
* azure-storage-blob
* azure-storage-queue
* pydantic
* requests
* jsonpatch

Removes the following libraries in the service:
* azure-cli-core
* azure-cli-nspkg
* azure-mgmt-cosmosdb
* azure-servicebus

Updates the following libraries in the CLI:
* requests
* semver
* asciimatics
* pydantic
* tenacity

Updates the following libraries in onefuzztypes:
* pydantic

The primary "legacy" libraries are [azure-graphrbac](https://pypi.org/project/azure-graphrbac/) and azure-cosmosdb-table.  The former has not been updated to use azure-identity yet. The later is being rewritten as [azure-data-tables](https://pypi.org/project/azure-data-tables/), but is still in early beta.
2021-01-25 20:53:40 +00:00
31ea71e8b6 use the unique-string based keyvault names (#462) 2021-01-25 15:02:12 -05:00
4bc90a7564 set max stdout/stderr size (#460) 2021-01-25 13:07:35 -05:00
3ae70cea6b add keyvault management to administrative role (#389)
This is a prerequisite for #326
2021-01-25 16:40:36 +00:00
3f2883d38e Storing secrets in azure keyvault (#326) 2021-01-25 11:12:07 -05:00
dc31ffc92b add support for fully self-contained fuzzers (#454) 2021-01-22 18:20:22 -05:00
e4ecf7e230 remove early-exit from cleanup_nodes that broke dead node cleanup (#458) 2021-01-22 18:04:50 -05:00
42337587ad Update QueueClient with latest SAS URL upon renewing registration (#459) 2021-01-22 17:41:42 -05:00
ec982c68c5 Update the registration logic to print manual steps when adal authentication fails (#447)
Mitigate the deployment issue related to the conditional access policy.
The registration logic is updated to use the old rbac python library when possible. 
The deployment will print some manual step for operations that cannot be automated
2021-01-22 22:21:43 +00:00
2f3139cda1 unify node resetting & deleting into delete/recreate (#450) 2021-01-22 22:04:44 +00:00
c0a4b0dba4 remove workaround for an issue addressed in latest mypy (#455) 2021-01-22 14:00:35 -05:00
3c76baa3bb Use goblin for more direct ELF handling (#453)
- Switch to using `goblin` for both ELF and PE parsing
- Refactor block entry point recovery, with better documentation
- Fix a broken example binary

Co-authored-by: bmc-msft <41130664+bmc-msft@users.noreply.github.com>
2021-01-21 15:00:19 -08:00
4f941d5ff2 add the task_id to the integration failure logs (#446) 2021-01-21 13:35:54 -05:00
95bd4ac308 add unit test to verify functionality of nested list expansion (#448) 2021-01-21 12:05:17 -05:00
e6dec041b2 move to using machine_id rather than node_id (#451)
Handle unifying onto machine_id for NodeMessage.
2021-01-21 16:22:16 +00:00
7e6415b15f ensure consistency in doc generation by always sorting json keys (#449) 2021-01-21 15:28:11 +00:00
b499b9b17d always set SignalR events at the end of handlers (#445)
Addresses an issue where events meant for SignalR do not get sent to the service when an App Service instance spins down before a timer event fires.
2021-01-21 10:31:02 +00:00
f3d81566e3 add expanding {tools_dir} to supervisor_options and supervisor_env (#444)
Fixes #443
2021-01-20 20:34:25 +00:00
fd956380d4 experimental "local fuzzing" support (#405)
This PR adds an experimental "local" mode for the agent, starting with `libfuzzer`.  For tasks that poll a queue, in local mode, they just monitor a directory for new files.

Supported commands: 
* libfuzzer-fuzz (models the `libfuzzer-fuzz` task)
* libfuzzer-coverage (models the `libfuzzer-coverage` task)
* libfuzzer-crash-report (models the `libfuzzer-crash-report` task)
* libfuzzer (models the `libfuzzer basic` job template, running libfuzzer-fuzz and libfuzzer-crash-report tasks concurrently, where any files that show up in `crashes_dir` are automatically turned into reports, and optionally runs the coverage task which runs the coverage data exporter for each file that shows up in `inputs_dir`).

Under the hood, there are a handful of changes required to the rest of the system to enable this feature.
1. `SyncedDir` URLs are now optional.  In local mode, these no longer make sense.   (We've discussed moving management of `SyncedDirs` to the Supervisor.  This is tangential to that effort.)
2. `InputPoller` uses a `tempdir` rather than abusing `task_id` for temporary directory naming.
3. Moved the `agent` to only use a single tokio runtime, rather than one for each of the subcommands.
4. Sets the default log level to `info`.  (RUST_LOG can still be used as is).

Note, this removes the `onefuzz-agent debug` commands for the tasks that are now exposed via `onefuzz-agent local`, as these provide a more featureful version of the debug tasks.
2021-01-20 03:33:25 +00:00
af2ef9f4fa verify local debugger installs before launching repro (#436)
This only launches the repro test cases if you have the os-specific prerequisite debugger installed.
2021-01-18 23:30:53 +00:00
efaa381899 Add missing prerequisites to the Getting Started guide (#435)
Fixes #434
2021-01-16 09:07:13 +00:00
2dde7f16e0 create proxy-configs container during install (#437) 2021-01-15 15:11:40 -05:00
bb83c03f5c Update Linux tracer version (#429)
Update `pete` to 0.4, which enables and requires us to use `std::process::Child` for spawning tracees.

Toward #370.
2021-01-15 14:23:45 +00:00
5cef03f234 enable sccache & incremental builds for non-release builds (#431) 2021-01-14 15:56:44 -05:00
773b8f203e Bump Github Actions revisions (#430) 2021-01-13 17:43:27 -05:00
a89065f882 adding {setup_dir} to variable expansion (#417)
## Summary of the Pull Request

Adds a new placeholder {setup_dir} for the setup directory 

## PR Checklist
* [x] Applies to work item: #221
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/onefuzz) and sign the CLI.
* [x] Requires documentation to be updated
* [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

## Info on Pull Request

_What does this include?_

## Validation Steps Performed

_How does someone test & validate?_
2021-01-13 00:39:59 +00:00
2e2ba988ee Fix condition for triggering new unique report event (#422) 2021-01-12 14:00:34 -05:00
70d41d1cc5 Switch to memmap2 (#428)
- Depend on `memmap2`, a maintained fork of the abandoned `memmap` crate
- Revert #364, which temporarily suppressed the relevant `cargo-audit` CI error

Closes #363.
2021-01-12 17:08:48 +00:00
f5dc8ad285 update MSAL to 1.8.0 (#426) 2021-01-12 10:27:32 +00:00
513d1f52c9 Unify Dashboard & Webhook events (#394)
This change unifies the previously adhoc SignalR events and Webhooks into a single event format.
2021-01-11 21:43:09 +00:00
465727680d add context to all fs calls (#423)
Adds additional context in error handling to all `std::fs` and `tokio::fs` calls.

Fixes #309
2021-01-11 20:55:22 +00:00
d573100a97 Clear node messages on deletion (#419)
## Summary of the Pull Request

_What is this about?_

## PR Checklist
* [ ] Applies to work item: #xxx
* [ ] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/onefuzz) and sign the CLI.
* [ ] Tests added/passed
* [ ] Requires documentation to be updated
* [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

## Info on Pull Request

_What does this include?_

## Validation Steps Performed

_How does someone test & validate?_
2021-01-11 20:14:43 +00:00
5f9110f97b Release 1.11.0 (#421) 1.11.0 2021-01-11 13:51:48 -05:00
08b1f74e09 fix queue_file_changes logic on corpus accounts (#425) 2021-01-11 12:12:38 -05:00
6aa7d5f6cf remove unused back_channel_address entry (#420) 2021-01-08 14:23:30 -05:00
46e8454569 compare containers rather than SAS urls when building worksets (#418)
By comparing container names rather than SAS urls, this removes a race condition that prevented co-locatable tasks from being co-located.
2021-01-08 09:45:05 +00:00
e799eb03cd Shorten the expiry window for the work queue SAS URLs assigned at node registration (#416)
The underlying impact is that nodes must re-register on a more frequent basis.

Nodes find out they are out-of-date is during registration and immediately prior to starting a new set of work.  Requiring nodes re-register on a shortened cycle provides more opportunities for nodes to get re-imaged.

Additionally, this addresses an issue handling the SAS URL expiry in a more clean fashion in the supervisor.
2021-01-07 12:34:26 +00:00
3b26ffef65 support multiple corpus accounts (#334)
Add support for sharding across multiple storage accounts for blob containers used for corpus management.

Things to note:

1. Additional storage accounts must be in the same resource group, support the "blob" endpoint, and have the tag `storage_type` with the value `corpus`.  A utility is provided (`src/utils/add-corpus-storage-accounts`), which adds storage accounts. 
2. If any secondary storage accounts exist, they are used by default for containers.
3. Storage account names are cached in memory the Azure Function instance forever.   Upon adding new storage accounts, the app needs to be restarted to pick up the new accounts.
2021-01-06 23:11:39 +00:00
f345bd239d Add ssh keys to nodes on demand (#411)
Our existing model has a per-scaleset SSH key.  This update moves towards using user provided SSH keys when they need to connect to a given node.
2021-01-06 19:29:38 +00:00
dae1759b57 update devops prereq (#399) 2021-01-06 09:57:01 -05:00
c1a50f6f6c Colocate tasks (#402)
Enables co-locating multiple tasks in a given work-set.

Tasks are bucketed by the following:
* OS
* job id
* setup container
* VM SKU & image (used in pre-1.0 style tasks)
* pool name (used in 1.0+ style tasks)
* if the task needs rebooting after the task setup script executes.

Additionally, a task will end up in a unique bucket if any of the following are true:
* The task is set to run on more than one VM
* The task is missing the `task.config.colocate` flag (all tasks created prior to this functionality) or the value is False

This updates the libfuzzer template to make use of colocation.  Users can specify co-locating all of the tasks *or* co-locating the secondary tasks.
2021-01-06 13:49:15 +00:00
883f38cb87 Multi-tenant authentication support in CLI (#346)
## Summary of the Pull Request

These are purposed changes to resolve ticket #344 

I have tested these changes and it does not effect or break the current functionality.

I don't necessarily expect this PR to be merged without some tweaks. I'll coordinate over the next week or so to get it right.

One coding issue I would like to discuss/highlight is the assumption (in code) that if "--tenant_domain" is used then the 'common' authority is also used. I am open to suggestions. 

## PR Checklist
* [X] Applies to work item: #344
* [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/onefuzz) and sign the CLI.
* [X] Tests passed (with and without multitenant authentication)
* [?] Requires documentation to be updated
* [No] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #344

## Info on Pull Request

Minor changes to the config file and the login process.

## Validation Steps Performed

Tested these changes with a multi-tenant enabled endpoint and a single-tenant endpoint.
2021-01-06 12:35:47 +00:00
986df8fcc6 limit updating outdated nodes to 500 at a time (#397) 2021-01-05 17:40:36 -05:00
633e5b5f02 restrict api endpoints (#404)
Restrict API endpoints from agents
2021-01-05 19:40:58 +00:00
7e56efa6a8 Address clippy issues (#409) 2021-01-05 15:41:46 +00:00
37f06bb324 handle libfuzzer fuzzing non-zero exits better (#381)
When running libfuzzer in 'fuzzing' mode, we expect the following on exit.

If the exit code is zero, crashing input isn't required.  This happens if the user specifies '-runs=N'

If the exit code is non-zero, then crashes are expected.  In practice, there are two causes to non-zero exits.
1. If the binary can't execute for some reason, like a missing prerequisite
2. If the binary _can_ execute, sometimes the sanitizers are put in such a bad place that they are unable to record the input that caused the crash.

This PR enables handling these two non-zero exit cases.

1. Optionally verify the libfuzzer target loads appropriately using `target_exe -help=1`.  This allows failing faster in the common issues, such a missing prerequisite library.
2. Optionally allow non-zero exits without crashes to be a warning, rather than a task failure.
2021-01-05 14:40:15 +00:00
75d2ffd7f4 lint test utils (#395) 2021-01-05 08:50:52 -05:00