Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
5 changes: 2 additions & 3 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ on:
env:
REGISTRY: ghcr.io
REPO: ghcr.io/datadog/dd-trace-rb
# Broken system-test: https://github.com/DataDog/system-tests/pull/3904
SYSTEM_TESTS_REF: 239c3eba6de0473817d3d88ebbc025c9d0c9574b
# SYSTEM_TESTS_REF: main # This must always be set to `main` on dd-trace-rb's master branch
# TODO: remove this change before merging to master
SYSTEM_TESTS_REF: enable-ip-blocking-for-ruby
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this supposed to be removed before merge?


jobs:
build-harness:
Expand Down
3 changes: 3 additions & 0 deletions lib/datadog/appsec/remote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,15 @@ def receivers(telemetry)
case content.path.product
when 'ASM_DD'
rules << parsed_content
content.applied
when 'ASM_DATA'
data << parsed_content['rules_data'] if parsed_content['rules_data']
content.applied
when 'ASM'
overrides << parsed_content['rules_override'] if parsed_content['rules_override']
exclusions << parsed_content['exclusions'] if parsed_content['exclusions']
custom_rules << parsed_content['custom_rules'] if parsed_content['custom_rules']
content.applied
end
end

Expand Down
20 changes: 20 additions & 0 deletions spec/datadog/appsec/remote_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@
receiver.call(repository, changes)
end

it 'sets apply_state to ACKNOWLEDGED on content' do
receiver.call(repository, transaction)

expect(content.apply_state).to eq(Datadog::Core::Remote::Configuration::Content::ApplyState::ACKNOWLEDGED)
end

context 'content product' do
before do
# Stub the reconfigure method, so we do not trigger background reconfiguration
Expand Down Expand Up @@ -290,6 +296,13 @@

context 'ASM' do
let(:path) { 'datadog/603646/ASM/whatevername/config' }
let(:data) { {} }

it 'sets apply_state to ACKNOWLEDGED on content' do
receiver.call(repository, transaction)

expect(content.apply_state).to eq(Datadog::Core::Remote::Configuration::Content::ApplyState::ACKNOWLEDGED)
end

context 'overrides' do
let(:data) do
Expand Down Expand Up @@ -405,6 +418,13 @@

context 'ASM_DATA' do
let(:path) { 'datadog/603646/ASM_DATA/whatevername/config' }
let(:data) { {} }

it 'sets apply_state to ACKNOWLEDGED on content' do
receiver.call(repository, transaction)

expect(content.apply_state).to eq(Datadog::Core::Remote::Configuration::Content::ApplyState::ACKNOWLEDGED)
end

context 'with rules_data information' do
let(:data) do
Expand Down
Loading