Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forwardport "Update to libddwaf 1.5.1" #2320

Merged
merged 31 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f80e0a1
Update libddwaf to 1.5.1
lloeki Oct 5, 2022
891ffdf
Add AppSec spec rake tasks
lloeki Oct 11, 2022
7da6156
Update libddwaf in appraisal locks
lloeki Oct 11, 2022
ba1ef94
Use source for grpc and google-protobuf on Ruby preview
lloeki Oct 11, 2022
a7c03b5
Use source for nokogiri on 3.2 in appraisal
lloeki Oct 11, 2022
80220fc
Add rack-contrib to contrib appraisals
lloeki Oct 11, 2022
2b67d30
Update appraisal locks
lloeki Oct 11, 2022
23f77fd
Support verbs beyond GET in Rails test app routes
lloeki Oct 11, 2022
1f4d18a
Set appsec.event tag when span is still active
lloeki Oct 11, 2022
4d881c5
Make instrumentation gateway idempotent
lloeki Oct 11, 2022
b81054d
Make Rack and Rails parse known request bodies for AppSec analysis
lloeki Oct 11, 2022
f948cbb
Skip AppSec in a Rack context when AppSec is disabled
lloeki Oct 11, 2022
731028a
Release context, freeing backing C objects
lloeki Oct 11, 2022
35f67c4
Add AppSec integration specs
lloeki Oct 11, 2022
ed9a11f
Fix log for catchall case
lloeki Oct 11, 2022
eb0a401
Comply with linter
lloeki Oct 11, 2022
08d9b11
Run AppSec specs in CI
lloeki Oct 11, 2022
a961764
Handle old rack-contrib in specs
lloeki Oct 11, 2022
2990268
Handle old Rails in specs
lloeki Oct 11, 2022
052644c
Handle old rack-test
lloeki Oct 11, 2022
397ec9a
Remove useless reference to middleware
lloeki Oct 11, 2022
b24ac6a
Force grpc build CPU for integration test apps
lloeki Oct 14, 2022
3a5351f
Revert "Use source for grpc and google-protobuf on Ruby preview"
lloeki Oct 17, 2022
ef66af9
Simplify integration test spec requires
lloeki Oct 17, 2022
8798f66
Add disabled AppSec case for span shared examples on Rack
lloeki Oct 17, 2022
5fff719
Simplify result status being match
lloeki Oct 17, 2022
cdb04fe
Add spec comments explaining result.actions assertions
lloeki Oct 17, 2022
6be3263
Merge pull request #2306 from DataDog/update-libddwaf
lloeki Oct 17, 2022
759526d
Merge branch 'master' into forwardport/update-libddwaf
lloeki Oct 18, 2022
6b029c3
Revert "Force grpc build CPU for integration test apps"
lloeki Oct 19, 2022
4f19ab1
Add TODO for nokogiri on 3.2
lloeki Oct 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ if ruby_version?('2.1')
gem 'mysql2', '0.3.21'
gem 'pg', '>= 0.18.4', '< 1.0'
gem 'rack', '1.4.7'
gem 'rack-contrib'
gem 'rack-cache', '1.7.1'
gem 'rack-test', '0.7.0'
gem 'rake', '< 12.3'
Expand Down Expand Up @@ -288,6 +289,7 @@ elsif ruby_version?('2.2')
gem 'qless'
gem 'racecar', '>= 0.3.5'
gem 'rack', '< 2.1.0' # Locked due to grape incompatibility: https://github.com/ruby-grape/grape/issues/1980
gem 'rack-contrib'
gem 'rack-test'
gem 'rake', '>= 12.3'
gem 'redis', '< 4.0'
Expand Down Expand Up @@ -472,6 +474,7 @@ elsif ruby_version?('2.3')
gem 'qless'
gem 'racecar', '>= 0.3.5'
gem 'rack', '< 2.1.0' # Locked due to grape incompatibility: https://github.com/ruby-grape/grape/issues/1980
gem 'rack-contrib'
gem 'rack-test'
gem 'rake', '>= 12.3'
gem 'redis', '< 4.0'
Expand Down Expand Up @@ -590,6 +593,7 @@ elsif ruby_version?('2.4')
gem 'qless'
gem 'racecar', '>= 0.3.5'
gem 'rack'
gem 'rack-contrib'
gem 'rack-test'
gem 'rake', '>= 12.3'
gem 'redis', '< 4.0'
Expand Down Expand Up @@ -838,6 +842,7 @@ elsif ruby_version?('2.5')
gem 'qless', (RUBY_PLATFORM == 'java' ? '0.10.0' : '>= 0') # Newer releases require `rusage`, which is not available for JRuby
gem 'racecar', '>= 0.3.5'
gem 'rack'
gem 'rack-contrib'
gem 'rack-test'
gem 'rake', '>= 12.3'
gem 'redis', '< 4.0'
Expand Down Expand Up @@ -1062,6 +1067,7 @@ elsif ruby_version?('2.6')
gem 'qless', (RUBY_PLATFORM == 'java' ? '0.10.0' : '>= 0') # Newer releases require `rusage`, which is not available for JRuby
gem 'racecar', '>= 0.3.5'
gem 'rack'
gem 'rack-contrib'
gem 'rack-test'
gem 'rake', '>= 12.3'
gem 'redis', '< 4.0'
Expand Down Expand Up @@ -1266,6 +1272,7 @@ elsif ruby_version?('2.7')
gem 'qless'
gem 'racecar', '>= 0.3.5'
gem 'rack'
gem 'rack-contrib'
gem 'rack-test'
gem 'rake', '>= 12.3'
gem 'redis', '< 4.0'
Expand Down Expand Up @@ -1381,6 +1388,7 @@ elsif ruby_version?('3.0') || ruby_version?('3.1')
gem 'qless'
# gem 'racecar', '>= 0.3.5' # Pending release of our fix: https://github.com/appsignal/rdkafka-ruby/pull/144
gem 'rack'
gem 'rack-contrib'
gem 'rack-test'
gem 'rake', '>= 12.3'
gem 'redis', '< 4.0'
Expand Down Expand Up @@ -1496,6 +1504,7 @@ elsif ruby_version?('3.2')
gem 'qless'
# gem 'racecar', '>= 0.3.5' # Pending release of our fix: https://github.com/appsignal/rdkafka-ruby/pull/144
gem 'rack'
gem 'rack-contrib'
gem 'rack-test'
gem 'rake', '>= 12.3'
gem 'redis', '< 4.0'
Expand All @@ -1514,6 +1523,7 @@ elsif ruby_version?('3.2')
gem 'typhoeus'
gem 'que', '>= 1.0.0'
gem 'net-smtp'
gem 'nokogiri', platform: :ruby # TODO: binary gem has max ruby version constraint excluding previews, switch to using minimum version constraint once a non-3.2-excluding binary gem is released
end

appraise 'contrib-old' do
Expand Down
26 changes: 25 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ namespace :spec do
end

namespace :appsec do
task all: [:main]
task all: [:main, :rack, :rails, :sinatra]

# Datadog AppSec main specs
RSpec::Core::RakeTask.new(:main) do |t, args|
Expand All @@ -177,6 +177,18 @@ namespace :spec do
' spec/datadog/appsec/**/{auto_instrument,autoload}_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end

# Datadog AppSec integrations
[
:rack,
:sinatra,
:rails,
].each do |contrib|
RSpec::Core::RakeTask.new(contrib) do |t, args|
t.pattern = "spec/datadog/appsec/contrib/#{contrib}/**/*_spec.rb"
t.rspec_opts = args.to_a.join(' ')
end
end
end

task appsec: [:'appsec:all']
Expand Down Expand Up @@ -356,6 +368,18 @@ task :ci do
declare '❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby' => 'bundle exec appraisal cucumber3 rake spec:cucumber'
declare '❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby' => 'bundle exec appraisal cucumber4 rake spec:cucumber'
declare '❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby' => 'bundle exec appraisal cucumber5 rake spec:cucumber'

# AppSec contrib specs
declare '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby' => 'bundle exec appraisal contrib rake spec:appsec:rack'
declare '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby' => 'bundle exec appraisal contrib rake spec:appsec:sinatra'
declare '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ❌ 2.4 / ❌ 2.5 / ❌ 2.6 / ❌ 2.7 / ❌ 3.0 / ❌ 3.1 / ❌ 3.2 / ✅ jruby' => 'bundle exec appraisal rails4-mysql2 rake spec:rails'

# AppSec Rails specs
declare '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ❌ 2.4 / ❌ 2.5 / ❌ 2.6 / ❌ 2.7 / ❌ 3.0 / ❌ 3.1 / ❌ 3.2 / ✅ jruby' => 'bundle exec appraisal rails32-mysql2 rake spec:rails'
declare '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ❌ 2.4 / ❌ 2.5 / ❌ 2.6 / ❌ 2.7 / ❌ 3.0 / ❌ 3.1 / ❌ 3.2 / ✅ jruby' => 'bundle exec appraisal rails4-mysql2 rake spec:appsec:rails'
declare '❌ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ❌ 3.0 / ❌ 3.1 / ❌ 3.2 / ✅ jruby' => 'bundle exec appraisal rails5-mysql2 rake spec:appsec:rails'
declare '❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ❌ 3.0 / ❌ 3.1 / ❌ 3.2 / ✅ jruby' => 'bundle exec appraisal rails6-mysql2 rake spec:appsec:rails'
declare '❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ❌ 3.2 / ✅ jruby' => 'bundle exec appraisal rails61-mysql2 rake spec:appsec:rails'
end

namespace :coverage do
Expand Down
2 changes: 1 addition & 1 deletion ddtrace.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'debase-ruby_core_source', '>= 0.10.16', '<= 0.10.17'

# Used by appsec
spec.add_dependency 'libddwaf', '~> 1.3.0.2.0'
spec.add_dependency 'libddwaf', '~> 1.5.1.0.0'

# Used by profiling (and possibly others in the future)
spec.add_dependency 'libdatadog', '~> 0.9.0.1.0'
Expand Down
9 changes: 6 additions & 3 deletions gemfiles/jruby_9.2.18.0_contrib.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions gemfiles/jruby_9.2.18.0_contrib_old.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions gemfiles/jruby_9.2.18.0_core_old.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions gemfiles/jruby_9.2.18.0_cucumber3.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions gemfiles/jruby_9.2.18.0_cucumber4.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions gemfiles/jruby_9.2.18.0_cucumber5.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions gemfiles/jruby_9.2.18.0_rails5_mysql2.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions gemfiles/jruby_9.2.18.0_rails5_postgres.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions gemfiles/jruby_9.2.18.0_rails5_postgres_redis.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading