Skip to content

Commit 38a3873

Browse files
committed
Add tests for CRS anomaly threshold per vhost
1 parent 8eafd5d commit 38a3873

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

spec/defines/vhost_spec.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,33 @@
12021202
)
12031203
}
12041204
end
1205+
1206+
context 'modsec_anomaly_threshold' do
1207+
let :params do
1208+
{
1209+
'docroot' => '/rspec/docroot',
1210+
'modsec_inbound_anomaly_threshold' => 10_000,
1211+
'modsec_outbound_anomaly_threshold' => 10_000,
1212+
}
1213+
end
1214+
1215+
it { is_expected.to compile }
1216+
it {
1217+
is_expected.to contain_concat__fragment('rspec.example.com-security').with(
1218+
content: %r{
1219+
^\s+SecAction\ \\\n
1220+
\s+\"id:900110,\\\n
1221+
\s+phase:1,\\\n
1222+
\s+nolog,\\\n
1223+
\s+pass,\\\n
1224+
\s+t:none,\\\n
1225+
\s+setvar:tx.inbound_anomaly_score_threshold=10000,\ \\\n
1226+
\s+setvar:tx.outbound_anomaly_score_threshold=10000"$
1227+
}x,
1228+
)
1229+
}
1230+
end
1231+
12051232
context 'set only aliases' do
12061233
let :params do
12071234
{

0 commit comments

Comments
 (0)