Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions lib/datadog/appsec/remote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ def receivers(telemetry)
)

Datadog::AppSec.reconfigure(ruleset: ruleset, telemetry: telemetry)

repository.contents.each do |content|
content.applied if ASM_PRODUCTS.include?(content.path.product)
end
end

[receiver]
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