From nobody Mon Sep 04 09:09:52 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RfNBT0rnbz4sRsN; Mon, 4 Sep 2023 09:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RfNBS4j18z4VYX; Mon, 4 Sep 2023 09:09:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693818592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B6Uax1NppxEIbXrSAPiA4IWRamxPf6NOdU/y3dbV8eE=; b=PhzRZNj6S4gox+LH6nJAVGM/KqmoO3eAHyYAfYhAdjbq1XPm6lxgD0lH82MvnjExvOcTTr 7sT+2Qv6HWpgiL3ZmMpiX4L65kpRfdNvnGIbjpeFsXxy5K//rguxvRecn3EZ+HRbE9pLKr NZULScott37LOpV4Yr9j6HFK/udBoruPwF8v2RJ2rvhNdNdH91jmIbAppA76aWBhRqiC/Y 7dzBhHAthQB9TF7Q+sN8pnzsopWhKzdzr4ON7W4fHAMBlo9UhlJAwIjTBAgeC57K4Oiymp JXUcNA8HY/sNbAMkcu2G+xwEPjmlp7mrQcjL7eGfONED9z0lJ56X0A5qE02Qzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693818592; a=rsa-sha256; cv=none; b=t+xyWnyCe2RU1pLepX8Z19NmwoQ94IT6VTbplZyaXNE0Ddtp8GfkNEi0M622/yvJS7mZyL whegEX8QhJ446zPcm3aPhA0W3Z3fP6Il1W9i+CrLSNUnF5wQMu2mnl/4/tjgEf9OE8Bpwl PzEr84brbHqNiRf02B557WvBEbKm2FXYg0j/bG1Zbgz4A48hye+Qzq6k+mDWIwc6h0+hO+ qtxIRVYXNJmY2lGARL9w1Pt8uZfX+0gfWbNixm4ocUrD5ujOi1wHI7li9QYop73Tk5Wa7V TFsuA8D6m+/3rVPkjB/x+zjahfrQnNt7jKRrkPhBvq/vpCmwrXFqSNvCO62aNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693818592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B6Uax1NppxEIbXrSAPiA4IWRamxPf6NOdU/y3dbV8eE=; b=HtBpKS+AkVUKR32ViHCs53v7He5JMH2CwPxLxNH41PKimqK2rj3GLNG5plrf/uSY+g5f8A C/RgjN3xE23g3/RevHmlncVttc7mPfWDTA75ou11LiUTWXcXnn9lNbJ6Uh0Lgm19gvEOFe AYJWyz0rWVd2rlQU29dwfuQ4OXjjtfctPiLjBZEk7bFb5lOVYly7dByixOXfSP1uaw0Z5V qrSn1Hkobz3vInbhEluc+TKsf3XCkSVQOwFwdj4sMtwWoqPQ624fA54B+Ivg78m+EauU4y mBN4xpu3rXYaXKL8oLxygoyH3wpGJTwN9iQ+b4DAKIdPcKRe2U/z3Nq+p2TbAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RfNBS3pf0z10kN; Mon, 4 Sep 2023 09:09:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38499qlr051300; Mon, 4 Sep 2023 09:09:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38499qJj051297; Mon, 4 Sep 2023 09:09:52 GMT (envelope-from git) Date: Mon, 4 Sep 2023 09:09:52 GMT Message-Id: <202309040909.38499qJj051297@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 2a0ece70c103 - main - devel/rubygem-ddtrace: Allow build with rubygem-libddwaf 1.11.0.0.0 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a0ece70c1034a6504f53e9e12f1008a1f0ab58c Auto-Submitted: auto-generated The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=2a0ece70c1034a6504f53e9e12f1008a1f0ab58c commit 2a0ece70c1034a6504f53e9e12f1008a1f0ab58c Author: Po-Chuan Hsieh AuthorDate: 2023-09-04 09:05:50 +0000 Commit: Po-Chuan Hsieh CommitDate: 2023-09-04 09:05:50 +0000 devel/rubygem-ddtrace: Allow build with rubygem-libddwaf 1.11.0.0.0 - Bump PORTREVISION for package change Obtained from: https://github.com/DataDog/dd-trace-rb/commit/eb5ddedf18cf9129bab06b4f3063437fc0aabfd9 --- devel/rubygem-ddtrace/Makefile | 3 +- devel/rubygem-ddtrace/files/patch-libddwaf | 84 ++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) diff --git a/devel/rubygem-ddtrace/Makefile b/devel/rubygem-ddtrace/Makefile index f6fa21f34149..8d2da3663c84 100644 --- a/devel/rubygem-ddtrace/Makefile +++ b/devel/rubygem-ddtrace/Makefile @@ -1,5 +1,6 @@ PORTNAME= ddtrace PORTVERSION= 1.14.0 +PORTREVISION= 1 CATEGORIES= devel rubygems MASTER_SITES= RG @@ -14,7 +15,7 @@ LICENSE_FILE_BSD3CLAUSE=${WRKSRC}/LICENSE.BSD3 RUN_DEPENDS= rubygem-debase-ruby_core_source>=3.2.1<3.2.1_99:devel/rubygem-debase-ruby_core_source \ rubygem-libdatadog>=3.0.0.1.0<3.0.0.2:devel/rubygem-libdatadog \ - rubygem-libddwaf>=1.9.0.0.0<1.9.0.1:devel/rubygem-libddwaf \ + rubygem-libddwaf>=1.11.0.0.0<1.11.0.1:devel/rubygem-libddwaf \ rubygem-msgpack>=0:devel/rubygem-msgpack USES= gem diff --git a/devel/rubygem-ddtrace/files/patch-libddwaf b/devel/rubygem-ddtrace/files/patch-libddwaf new file mode 100644 index 000000000000..6c5e6e3032f8 --- /dev/null +++ b/devel/rubygem-ddtrace/files/patch-libddwaf @@ -0,0 +1,84 @@ +Obtained from: https://github.com/DataDog/dd-trace-rb/commit/eb5ddedf18cf9129bab06b4f3063437fc0aabfd9 + +--- ddtrace.gemspec.orig 2023-08-30 13:30:50 UTC ++++ ddtrace.gemspec +@@ -26,7 +26,7 @@ Gem::Specification.new do |s| + + s.add_runtime_dependency(%q.freeze, [">= 0"]) + s.add_runtime_dependency(%q.freeze, ["= 3.2.1"]) +- s.add_runtime_dependency(%q.freeze, ["~> 1.9.0.0.0"]) ++ s.add_runtime_dependency(%q.freeze, ["~> 1.11.0.0.0"]) + s.add_runtime_dependency(%q.freeze, ["~> 3.0.0.1.0"]) + end + +--- lib/datadog/appsec/contrib/rack/request_middleware.rb.orig 2023-08-30 13:30:50 UTC ++++ lib/datadog/appsec/contrib/rack/request_middleware.rb +@@ -137,17 +137,19 @@ module Datadog + ) + end + +- if processor.ruleset_info +- span.set_tag('_dd.appsec.event_rules.version', processor.ruleset_info[:version]) ++ if processor.diagnostics ++ diagnostics = processor.diagnostics + ++ span.set_tag('_dd.appsec.event_rules.version', diagnostics['ruleset_version']) ++ + unless @oneshot_tags_sent + # Small race condition, but it's inoccuous: worst case the tags + # are sent a couple of times more than expected + @oneshot_tags_sent = true + +- span.set_tag('_dd.appsec.event_rules.loaded', processor.ruleset_info[:loaded].to_f) +- span.set_tag('_dd.appsec.event_rules.error_count', processor.ruleset_info[:failed].to_f) +- span.set_tag('_dd.appsec.event_rules.errors', JSON.dump(processor.ruleset_info[:errors])) ++ span.set_tag('_dd.appsec.event_rules.loaded', diagnostics['rules']['loaded'].size.to_f) ++ span.set_tag('_dd.appsec.event_rules.error_count', diagnostics['rules']['loaded'].size.to_f) ++ span.set_tag('_dd.appsec.event_rules.errors', JSON.dump(diagnostics['rules']['errors'])) + span.set_tag('_dd.appsec.event_rules.addresses', JSON.dump(processor.addresses)) + + # Ensure these tags reach the backend +--- lib/datadog/appsec/event.rb.orig 2023-08-30 13:30:50 UTC ++++ lib/datadog/appsec/event.rb +@@ -105,7 +105,7 @@ module Datadog + + # accumulate triggers + tags['_dd.appsec.triggers'] ||= [] +- tags['_dd.appsec.triggers'] += event[:waf_result].data ++ tags['_dd.appsec.triggers'] += event[:waf_result].events + end + end + end +--- lib/datadog/appsec/processor.rb.orig 2023-08-30 13:30:50 UTC ++++ lib/datadog/appsec/processor.rb +@@ -43,10 +43,10 @@ module Datadog + end + end + +- attr_reader :ruleset_info, :addresses ++ attr_reader :diagnostics, :addresses + + def initialize(ruleset:) +- @ruleset_info = nil ++ @diagnostics = nil + @addresses = [] + settings = Datadog.configuration.appsec + +@@ -83,7 +83,7 @@ module Datadog + } + + @handle = Datadog::AppSec::WAF::Handle.new(ruleset, obfuscator: obfuscator_config) +- @ruleset_info = @handle.ruleset_info ++ @diagnostics = @handle.diagnostics + @addresses = @handle.required_addresses + + true +@@ -92,7 +92,7 @@ module Datadog + "libddwaf failed to initialize, error: #{e.inspect}" + end + +- @ruleset_info = e.ruleset_info if e.ruleset_info ++ @diagnostics = e.diagnostics if e.diagnostics + + false + rescue StandardError => e