From 004b24186bd2f0bb5a1ca2ea53648f529c88940c Mon Sep 17 00:00:00 2001 From: Teo Voinea Date: Wed, 8 Feb 2023 18:53:28 +0000 Subject: [PATCH 1/3] Add new command --- src/cli/onefuzz/api.py | 9 +++++++++ src/pytypes/onefuzztypes/requests.py | 1 + 2 files changed, 10 insertions(+) diff --git a/src/cli/onefuzz/api.py b/src/cli/onefuzz/api.py index d241284c8a..a276069cbd 100644 --- a/src/cli/onefuzz/api.py +++ b/src/cli/onefuzz/api.py @@ -859,6 +859,15 @@ def list( data=requests.NotificationSearch(container=container), ) + def get(self, notification_id: UUID_EXPANSION) -> List[models.Notification]: + """Get a notification""" + self.logger.debug("getting notification") + return self._req_model_list( + "GET", + models.Notification, + data=requests.NotificationSearch(notification_id=notification_id), + ) + class Tasks(Endpoint): """Interact with tasks""" diff --git a/src/pytypes/onefuzztypes/requests.py b/src/pytypes/onefuzztypes/requests.py index b2ceba3a44..f11f2255b7 100644 --- a/src/pytypes/onefuzztypes/requests.py +++ b/src/pytypes/onefuzztypes/requests.py @@ -52,6 +52,7 @@ class NotificationCreate(BaseRequest, NotificationConfig): class NotificationSearch(BaseRequest): container: Optional[List[Container]] + notification_id: Optional[UUID] class NotificationGet(BaseRequest): From aec6c016ff26333cfa9b0f3b7a0881e7fd601b42 Mon Sep 17 00:00:00 2001 From: Teo Voinea Date: Wed, 15 Feb 2023 14:04:27 +0000 Subject: [PATCH 2/3] Update remaining jinja templates and references to use scriban --- docs/notifications/github.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/notifications/github.md b/docs/notifications/github.md index a8b541b0bc..6be93787f1 100644 --- a/docs/notifications/github.md +++ b/docs/notifications/github.md @@ -3,7 +3,7 @@ OneFuzz can create or update [Github Issues](https://guides.github.com/features/issues/) upon creation of crash reports in OneFuzz managed [containers](../containers.md). -Nearly every field can be customized using [jinja2](https://jinja.palletsprojects.com/) +Nearly every field can be customized using [scriban](https://github.com/scriban/scriban) templates. There are multiple python objects provided via the template engine that can be used such that any arbitrary component can be used to flesh out the configuration: @@ -43,7 +43,7 @@ There are additional values that can be used in any template: "organization": "contoso", "repository": "sample-project", "title": "{{ report.executable }} - {{report.crash_site}}", - "body": "## Files\n\n* input: [{{ report.input_blob.name }}]({{ input_url }})\n* exe: [{{ report.executable }}]( {{ target_url }})\n* report: [{{ report_filename }}]({{ report_url }})\n\n## Repro\n\n `{{ repro_cmd }}`\n\n## Call Stack\n\n```{% for item in report.call_stack %}{{ item }}\n{% endfor %}```\n\n## ASAN Log\n\n```{{ report.asan_log }}```", + "body": "## Files\n\n* input: [{{ report.input_blob.name }}]({{ input_url }})\n* exe: [{{ report.executable }}]( {{ target_url }})\n* report: [{{ report_filename }}]({{ report_url }})\n\n## Repro\n\n `{{ repro_cmd }}`\n\n## Call Stack\n\n```{{ for item in report.call_stack }}{{ item }}\n{{ end }}```\n\n## ASAN Log\n\n```{{ report.asan_log }}```", "unique_search": { "field_match": ["title"], "string": "{{ report.executable }}" @@ -76,4 +76,4 @@ issues will be created and updated based on the reports. The OneFuzz SDK provides an example tool [fake-report.py](../../src/cli/examples/fake-report.py), which can be used to generate a synthetic crash report to verify the integration -is functional. \ No newline at end of file +is functional. From 6fcd8cf0f414695dd34f55122f00035ce69beb29 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 15:21:19 +0000 Subject: [PATCH 3/3] Bump nix from 0.25.0 to 0.26.2 in /src/agent Bumps [nix](https://github.com/nix-rust/nix) from 0.25.0 to 0.26.2. - [Release notes](https://github.com/nix-rust/nix/releases) - [Changelog](https://github.com/nix-rust/nix/blob/v0.26.2/CHANGELOG.md) - [Commits](https://github.com/nix-rust/nix/compare/v0.25.0...v0.26.2) --- updated-dependencies: - dependency-name: nix dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- src/agent/Cargo.lock | 41 +++++++++++++++++++++++------- src/agent/onefuzz-agent/Cargo.toml | 2 +- src/agent/onefuzz/Cargo.toml | 2 +- 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/src/agent/Cargo.lock b/src/agent/Cargo.lock index bfc9280716..967102e2b0 100644 --- a/src/agent/Cargo.lock +++ b/src/agent/Cargo.lock @@ -541,7 +541,7 @@ dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", "lazy_static", - "memoffset", + "memoffset 0.6.4", "scopeguard", ] @@ -615,7 +615,7 @@ version = "3.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d91974fbbe88ec1df0c24a4f00f99583667a7e2e6272b2b92d294d81e462173" dependencies = [ - "nix", + "nix 0.25.1", "winapi", ] @@ -1618,6 +1618,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + [[package]] name = "mime" version = "0.3.16" @@ -1705,18 +1714,32 @@ checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" [[package]] name = "nix" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb" +checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" dependencies = [ "autocfg", "bitflags", "cfg-if 1.0.0", "libc", - "memoffset", + "memoffset 0.6.4", "pin-utils", ] +[[package]] +name = "nix" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "libc", + "memoffset 0.7.1", + "pin-utils", + "static_assertions", +] + [[package]] name = "nom" version = "5.1.2" @@ -1843,7 +1866,7 @@ dependencies = [ "input-tester", "lazy_static", "log", - "nix", + "nix 0.26.2", "notify", "onefuzz-telemetry", "pete", @@ -1887,7 +1910,7 @@ dependencies = [ "env_logger", "futures", "log", - "nix", + "nix 0.26.2", "onefuzz", "onefuzz-telemetry", "reqwest", @@ -2180,8 +2203,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "493eb0f2954de9a30ee85b01891f6519e9d065464eaab79aff65d949f44b7850" dependencies = [ "libc", - "memoffset", - "nix", + "memoffset 0.6.4", + "nix 0.25.1", "thiserror", ] diff --git a/src/agent/onefuzz-agent/Cargo.toml b/src/agent/onefuzz-agent/Cargo.toml index ffec30635d..29395bcff8 100644 --- a/src/agent/onefuzz-agent/Cargo.toml +++ b/src/agent/onefuzz-agent/Cargo.toml @@ -32,7 +32,7 @@ backtrace = "0.3" [target.'cfg(target_family = "unix")'.dependencies] users = "0.11" -nix = "0.25" +nix = "0.26" [target.'cfg(target_family = "windows")'.dependencies] winapi = "0.3" diff --git a/src/agent/onefuzz/Cargo.toml b/src/agent/onefuzz/Cargo.toml index 4b66f19868..27dead8385 100644 --- a/src/agent/onefuzz/Cargo.toml +++ b/src/agent/onefuzz/Cargo.toml @@ -55,7 +55,7 @@ winapi = { version = "0.3", features = ["impl-default", "psapi"] } [target.'cfg(target_family = "unix")'.dependencies] cpp_demangle = "0.4" -nix = "0.25" +nix = "0.26" [target.'cfg(target_os = "linux")'.dependencies] pete = "0.9"