Commit Graph

143 Commits

Author SHA1 Message Date
1cee562cf5 Support for retention policies on containers (#3501)
- [x] ability to specify a retention period on a container, which applies to newly-created blobs
- [x] specify default retention periods in templates from CLI side 

There's a small breaking change to the Python JobHelper class.
2023-10-03 11:51:41 -07:00
e15acaf55c Starting integration tests (#3438)
* Starting integration tests

* Ready to test the test

* Parametrize test

* checkpoint

* Test works

* Run integration tests in pipeline

* fmt

* .

* -p

* Install clang

* quotes not required in yaml?

* Hopefully fixed windows?

* Try without killondrop

* lint

* small test

* another test

* Reuse core name

* Wrong step

* bump tokio?

* Try with rust

* make build happy

* Bump pete and small clean up

* Clean up and make the test pass regularly

* fix broken ci

* Lower the poll timeout

* Set the timeout in a nicer way

* fix windows

* fmt

* Include and copy pdbs

* Ignore if pdb is missing on linux

* It takes too long for coverage to be generated

* lint

* Only warn on missing coverage since it's flaky

* Fix windows build

* Small clean up

* Try lowering the poll delay

* fix coverage

* PR comments

* .

* Apparently make is missing?

* Remove aggressive step skipping in CI
2023-10-03 11:51:40 -07:00
34dc7e5e7d install LLVm 16 before running dotnet-fuzzing-tools.ps1 (#3462) 2023-08-28 20:43:26 +00:00
bdb2f1337d Add mariner support (#3306)
* Updating setup.sh

* logger works

* Install omi

* syntax

* Add option to create mariner pool in checkpr

* .

* Need to install sudo

* .

* Include both logging extensions

* Revert because we already isntall the azure monitor for linux extension

* Downgrade type handler version

* Add data collection rules and fuzzing articacts for integration test

* TODOs

* Fix linux jobs getting sent to mariner

* Fix linux jobs going to marienr pool

* Fix pools

* Remove the old logging extension on linux

* try to retain syslog

* Value to be set was not clear

* Trying to route logs

* Maybe we need to specify properties even if we don't set anything

* Start adding a data collection association

* Create association

* update packages.lock

* .

* Remove auto config and add dependency map

* Bring back GCS autoconfig

* Undo DCR stuff

* Undo package version bump

* Fix up files

* Remove TODO
2023-08-18 13:52:53 +00:00
9c4bc3eed6 Bump to Rust 1.71.1 (#3401) 2023-08-10 21:08:27 +00:00
020c4d5caa Cargo updates (#3400)
* Cargo updates

* Fix build
2023-08-10 20:42:12 +00:00
a364051923 Capture crash dumps from libfuzzer, when provided (#2793)
Enables capturing crashdumps generated by ASAN at point of failure.

This helps in several ways:
- provides a crash dump in the case that we cannot repro a failure later
- some people have stated that crash dumps would be more useful to their team than the repro VM
- we should be able to use these for automated submission to Watson or similar

---

Crash dumps are automatically collected (for libfuzzer) jobs, if we find any. They should be activated by enabling crash dumps in ASAN, via:

- On Linux: `ASAN_OPTIONS=disable_coredump=0:abort_on_error=1:unmap_shadow_on_exit=1`
  - OneFuzz will override the (Ubuntu) crash dump options to generate core dumps instead and then upload them.
- On Windows: `ASAN_SAVE_DUMPS=my_dump.dmp`
  - OneFuzz will look for any `*.dmp` files in the working directory and then upload them.

In both cases, the crash dump will be renamed to match the crashing input, if possible, and uploaded to a new `crashdumps` container.

---

Also updated: the “simple” LibFuzzer test has been updated to be compiled with `cl.exe` instead of `clang` on Windows, so that we are exercising the MSVC implementation of ASAN/LibFuzzer, and the CI image has been updated to `windows-2022`. The restriction to an old version of the Windows SDK has been removed.
2023-08-09 21:55:27 +00:00
5d05cdd403 Fix some CI flakiness by separating more artifacts (#3250)
Many jobs uploading output into the same artifact causes spurious failures unless the job which consumes the artifact depends upon all of the previous jobs. So, split the uploads into separate artifacts so that the CLI job (which is the main one that fails) can depend upon only a subset of the jobs.

Also add caching to the AFL/AFLPP builds.
2023-07-17 21:58:25 +00:00
7a92dab7c2 Rust 1.71 (#3292) 2023-07-13 22:00:05 +00:00
e1923b4e89 Cache integration test artifacts (#3249)
We build integration test executables every time even when they rarely change; so only build them if they change.
2023-06-29 02:10:41 +00:00
9d9df7c6cb Change how Git hash is appended to .NET version string (#3244) 2023-06-28 21:20:19 +00:00
85c3e10991 Correlate cli to service (#3137)
* Start event retention policy

* .

* Correlate telemetry from cli to service and out

* Traces end to end

* Linting

* .

* Fix build failures

* Trying to fix python dependency error

* .

* Lets let pip figure it out

* .

* Modified the wrong file

* .

* .

* .

* .

* .

* .

* This is the one

* fix lints?

* I _love_ python

* ...

* Undo some unnecessary changes

* Works again

* PR comments
2023-06-28 18:47:21 +00:00
4b437533f0 Enable codecov for ARM64 (#3236) 2023-06-27 15:13:47 -07:00
28e36ef2c9 Rust build caching improvements & fixes (#3197)
Caches are getting too big and we are exceeding the 10GB limit, leading to cache churning.

1. Try to make the caches smaller by using `Swatinem/rust-cache`, which is smarter about what gets cached.
    - After doing this it turns out we don't really need `sccache` any more, it has very little impact upon compile times as the cache hit ratio is low. So remove it, to reduce complexity of build and size of build caches.

2. Also fix artifact caching which had been broken by a version format change (4956cf5406).
2023-06-19 08:20:04 -07:00
b3955ab4ae Onboarding to GitOps.ResourceManagement (#3193)
* Add prIssueManagement.yml to onboard repo to GitOps.ResourceManagement as FabricBot replacement

* Deleting fabricbot.json

---------

Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com>
2023-06-18 23:12:01 +00:00
15351a7b44 Bump Rust to 1.70 (#3165)
https://releases.rs/docs/1.70.0/
2023-06-08 08:53:51 -04:00
49240ba46d Bump Rust version to 1.69 (#3049)
* Bump Rust version to 1.69

* Bump clap to fix clippy lints

See: https://github.com/clap-rs/clap/issues/4733
2023-04-21 09:56:40 -04:00
6f06b8ffd4 Add basic test for coverage example and library (#3035)
The coverage code is not currently exercised by any test.

* Add a test to the `coverage` example so that it can run in PR builds.
* Specify `--all-targets` so that example tests are run.
* Install and use [`nextest`](https://nexte.st/) instead of the standard test runner.
  * This will parallelize test runs across binaries so the overall test run is faster.
* Make sleep duration of agent configurable and reduce it in the test run so that it doesn't wait for 30 seconds.
2023-04-19 09:10:28 -04:00
4084d0a72e Basic Linux ARM64 build (#3030)
* Attempt an ARM64 build

* Try bumping unwind

* Fixup uses of RIP

* Update check-dependencies.sh

* Further fix

* Platform-specific output directories

* Further fix

* Don't actually copy ARM64 binaries yet
2023-04-19 01:01:36 +00:00
4dcc49cfb0 Use global.json to specify .NET version (#3007)
Rather than specifying this in `ci.yml`, specify it in the `global.json` file. This allows us to share the version amongst several workflows (and ADO pipelines) without needing to synchronize them.
2023-04-11 01:29:34 +00:00
947bb7f141 Update codeql-config.yml (#2989) 2023-04-06 08:59:49 -04:00
ad7e5fa85e Rust problem matchers (#2974) 2023-04-05 20:38:34 +00:00
96db6d4862 Add dependabot config for .NET (#2966) 2023-04-04 16:01:27 -07:00
658d2aa01f Bump to Rust 1.68 (#2934) 2023-03-21 13:04:45 -04:00
4956cf5406 fix condition when generating the task config (#2925) 2023-03-17 20:44:30 +00:00
aad0d817cc Update to use new Work item time (#2908)
Moving work items to a different project
2023-03-06 11:01:58 -08:00
4caaf8fc32 Remove old libfuzzer dotnet template (#2875)
### Context
The original `libfuzzer dotnet` job template was a proof of concept that demonstrated how the `libfuzzer_fuzz` task could be used to express fuzzing via the (pre SharpFuzz 2.0) `libfuzzer-dotnet` tool. It (and its associated integration test) used a harness that linked an older version of SharpFuzz, and which is incompatible with LibFuzzerDotnetLoader (which requires SharpFuzz 2.0 or greater).

### Changes
- Rename `libfuzzer dotnet_dll` job template to `libfuzzer dotnet`, making it the _only_ `libfuzzer-dotnet` template
- Remove integration tests and docs for the old proof-of-concept job type

### Notice

This is a breaking change.

Closes #2874.
2023-02-21 10:54:36 +13:00
e0e6981f75 Update "Needs Triage" label to the one we use. (#2845) 2023-02-15 23:53:40 +00:00
fbdba5d76b Add the new fabricBot IssueResponder. For now only trigger to add the Needs Triage label. (#2822)
Update the Sync workflow so that it does not run when labels are added or removed.
2023-02-15 10:45:58 -08:00
00031156bc Rust 1.67 (#2781)
Mostly automated `clippy` fixes.
2023-01-27 16:00:24 +13:00
7de23af60c delete python function (#2763)
* delete python function

* fix build
2023-01-25 22:05:55 +00:00
188a7ca42e Rust 1.66 (#2704)
* Bump to Rust 1.66

* Another fix

* One more

* Lint
2022-12-19 10:04:04 -08:00
ba9d6acbe2 Unpin pipenv version (#2659)
* updated contrib/deploy-onefuzz-via-azure-devops/tox.ini
* updated .github/workflows/ci.yml
2022-11-29 12:51:46 -08:00
461053cb43 Check Bicep files during CI (#2658) 2022-11-29 20:15:34 +00:00
e0634a3365 Deploy update (#2650)
* Remove Python App Function Deployment Code and  Code.

* Updating yml and zip names.

* Fixing ci.yml.

* Typo.

* Format

* Trying to remove python service.

* Updating directories.

* Removing flag.

* Format.

* Fixng api-service-net ref.

* Re-add requirement.

* Fixing refs in bicep.

* Specifying version.

* Removing dotnet refs in integration tests.

* Updating role assignment naming convention.

* Adding ignore.

* Update src/deny.toml

Co-authored-by: George Pollard <porges@porg.es>

* Update version.

* Removing onefuzztypes dependency.

* Switch app service plan to windows.

* Update test version.

* Changing version.

* Returning version.

* Trying to add onefuzz types back.

* Force pipenv version.

* Fix.

* Syntax.

* Renaming.

* Trying different version.

* Removing build step.

* Fixing bicep parameter.

* Retrying run with older version.

* Trying pipenv with another version.

* Forcing pipenv version in tox.

* Adding pipenv fix and updating version.

Co-authored-by: George Pollard <porges@porg.es>
2022-11-23 17:48:30 -08:00
04d39a3f28 Setup cargo-deny (#2638)
Using [`cargo-deny`](https://embarkstudios.github.io/cargo-deny/) to ensure that disallowed dependencies removed in #2423 do not accidentally make their way back in.

`cargo-deny` subsumes the `cargo-audit` functionality, so switch to the `cargo-deny` version.

Setting this up required explicitly stating the license which was not in some of our `Cargo.toml` files.
2022-11-21 08:23:20 -05:00
894dcc62be Update to .NET 7 (#2615)
Update service code to .NET 7.0.

Also update the version installed onto agent nodes via setup scripts to 7.0.100.
2022-11-18 10:39:45 +13:00
c277cd1ec3 Update References to Ubuntu 18.04 to 20.04 (#2535)
* Update References to 18.04 to 20.04

* Fixing Ubuntu Image.

* Fix image.
2022-10-28 10:17:57 -07:00
539861b573 Fix Github actions warnings (#2576)
Node.js 12 actions are deprecated, as well as `::set-output` 

- Update `actions/checkout` to v3
- Update `actions/upload-artifact` to v3
- Update `actions/setup-python` to v4
- Update `actions/cache` to v3
- `set-output` on stdout is deprecated, update to `$GITHOUT_OUTPUT` method
- Change from `actions-rs/toolchain` (unsupported) to `dtolnay/rust-toolchain`

The only warning remaining after this is the one about Ubuntu 18.04.
2022-10-27 17:21:30 -07:00
c10cb08fcd Remove use of unapproved crypto libraries (#2423)
To comply with Microsoft security policies, we must use only approved crypto libraries.

Notably, `ring` is not on the approved libraries list. We should use the platform crypto libraries instead. The official guidance is:

- on Windows, schannel and friends
- on Linux, the OpenSSL 1.1.1 series if available, otherwise OpenSSL 3.0. OpenSSL _must_ be dynamically and not statically linked so that distro-provided updates can be used.

Following these guidelines strictly would mean that we have to build distro/version specific binaries for Linux. Instead we have an exception which allows us to statically link against the OpenSSL 1.1.1 series, allowing us to have a (somewhat) portable binary.

OpenSSL 1.1.1. can be statically linked by switching to the `native-tls-vendored` feature of `reqwest`.  (Verified by inspection that `ring` and `rustls` are no longer in `Cargo.lock` files.)

So the result is:

- on Windows, we use schannel
- on Linux we statically link against 1.1.1

It is up to us to ensure we keep up-to-date with OpenSSL issues and releases. The version can be checked by looking at the version of `openssl-src` that we depend upon. Currently this is `111.22.0+1.1.1q`. This is the latest version; also check the [Vulnerabilities page](https://www.openssl.org/news/vulnerabilities-1.1.1.html).

--- 

Verified by inspection that `rustls` and `ring` are no longer present in `Cargo.lock`.

Current dynamic library dependencies are:

```console
$ ldd ./onefuzz-agent 
        linux-vdso.so.1 (0x00007ffd9ba60000)
        libunwind.so.8 => /lib/x86_64-linux-gnu/libunwind.so.8 (0x00007ff5ab5e5000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff5ac1d1000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff5ac1cc000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff5ab4fe000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff5ac1c7000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff5ab2d4000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff5ac1dc000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007ff5ab2a9000)
```
2022-10-19 22:39:00 +00:00
f6a680bb3d Attempt to fix integration-tests-linux failure (#2487) 2022-10-05 00:29:08 +00:00
7809b40e74 Update to Rust 1.64 (#2488)
[Release notes.](https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html)

Probably one of the more important things is:
> performance improvements of 10-20% for compiling Rust code on Windows
2022-10-04 22:31:53 +00:00
b918720083 Update download-artifact action (#2453) 2022-09-27 22:38:17 +00:00
39c3736bef Adjust concurrency spec (#2426) 2022-09-20 22:12:53 +00:00
f22dee18df CodeQL needs explicit permissions to run (#2404) 2022-09-15 09:05:18 -04:00
4cc4de9c9e Codecov setup for C# & Rust code (#2400)
Use Codecov to show coverage reports, so we get highlighted versions of the files where it is easy to see missing coverage.

- Setup Rust coverage using [`cargo-llvm-cov`](https://github.com/taiki-e/cargo-llvm-cov).
- Add the `ci/agent.sh` build script to the agent artifact cache key, since it wasn't there before.
- Don't run Rust tests in `--release` mode (have been meaning to change this so doing it at the same time).

There is some subtlety about putting the coverage result into the cached agent artifact, so that when we reuse the agent artifact we can still upload the coverage information for it to Codecov. Without this it would look like the coverage had dropped.
2022-09-15 02:29:22 +00:00
61a797e224 Restore self-hosted configuration (#2394) 2022-09-14 23:59:41 +00:00
3b8cbc3f1e Cancel any previous PR builds when new one starts (#2393) 2022-09-14 01:34:42 +00:00
2ff758464e Use Github-hosted Ubuntu until issue with self-hosted pool is resolved (#2391) 2022-09-14 12:39:18 +12:00
9f03a174ec Use self-hosted runner for Rust agent builds (#2366)
Use a 1ES hosted pool with more powerful machines to do the build for Rust agents.
2022-09-13 09:11:24 +12:00