111 |
111 |
it {
|
112 |
112 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-INPUT-rule-log_discarded').with(
|
113 |
113 |
target: 'nftables-inet-filter-chain-INPUT',
|
114 |
|
content: %r{^ log prefix \"\[nftables\] INPUT Rejected: \" flags all counter$},
|
|
114 |
content: %r{^ limit rate 3/minute burst 5 packets log prefix \"\[nftables\] INPUT Rejected: \" flags all counter$},
|
115 |
115 |
order: '97-nftables-inet-filter-chain-INPUT-rule-log_discarded-b',
|
116 |
116 |
)
|
117 |
117 |
}
|
... | ... | |
234 |
234 |
it {
|
235 |
235 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-OUTPUT-rule-log_discarded').with(
|
236 |
236 |
target: 'nftables-inet-filter-chain-OUTPUT',
|
237 |
|
content: %r{^ log prefix \"\[nftables\] OUTPUT Rejected: \" flags all counter$},
|
|
237 |
content: %r{^ limit rate 3/minute burst 5 packets log prefix \"\[nftables\] OUTPUT Rejected: \" flags all counter$},
|
238 |
238 |
order: '97-nftables-inet-filter-chain-OUTPUT-rule-log_discarded-b',
|
239 |
239 |
)
|
240 |
240 |
}
|
... | ... | |
370 |
370 |
it {
|
371 |
371 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-FORWARD-rule-log_discarded').with(
|
372 |
372 |
target: 'nftables-inet-filter-chain-FORWARD',
|
373 |
|
content: %r{^ log prefix \"\[nftables\] FORWARD Rejected: \" flags all counter$},
|
|
373 |
content: %r{^ limit rate 3/minute burst 5 packets log prefix \"\[nftables\] FORWARD Rejected: \" flags all counter$},
|
374 |
374 |
order: '97-nftables-inet-filter-chain-FORWARD-rule-log_discarded-b',
|
375 |
375 |
)
|
376 |
376 |
}
|
... | ... | |
420 |
420 |
it {
|
421 |
421 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-INPUT-rule-log_discarded').with(
|
422 |
422 |
target: 'nftables-inet-filter-chain-INPUT',
|
423 |
|
content: %r{^ log prefix \"test " flags all counter$},
|
|
423 |
content: %r{^ limit rate 3/minute burst 5 packets log prefix \"test " flags all counter$},
|
424 |
424 |
order: '97-nftables-inet-filter-chain-INPUT-rule-log_discarded-b',
|
425 |
425 |
)
|
426 |
426 |
}
|
427 |
427 |
it {
|
428 |
428 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-OUTPUT-rule-log_discarded').with(
|
429 |
429 |
target: 'nftables-inet-filter-chain-OUTPUT',
|
430 |
|
content: %r{^ log prefix \"test " flags all counter$},
|
|
430 |
content: %r{^ limit rate 3/minute burst 5 packets log prefix \"test " flags all counter$},
|
431 |
431 |
order: '97-nftables-inet-filter-chain-OUTPUT-rule-log_discarded-b',
|
432 |
432 |
)
|
433 |
433 |
}
|
434 |
434 |
it {
|
435 |
435 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-FORWARD-rule-log_discarded').with(
|
436 |
436 |
target: 'nftables-inet-filter-chain-FORWARD',
|
437 |
|
content: %r{^ log prefix \"test " flags all counter$},
|
|
437 |
content: %r{^ limit rate 3/minute burst 5 packets log prefix \"test " flags all counter$},
|
438 |
438 |
order: '97-nftables-inet-filter-chain-FORWARD-rule-log_discarded-b',
|
439 |
439 |
)
|
440 |
440 |
}
|
... | ... | |
446 |
446 |
it {
|
447 |
447 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-INPUT-rule-log_discarded').with(
|
448 |
448 |
target: 'nftables-inet-filter-chain-INPUT',
|
449 |
|
content: %r{^ log prefix \" bar \[INPUT\] " flags all counter$},
|
|
449 |
content: %r{^ limit rate 3/minute burst 5 packets log prefix \" bar \[INPUT\] " flags all counter$},
|
|
450 |
order: '97-nftables-inet-filter-chain-INPUT-rule-log_discarded-b',
|
|
451 |
)
|
|
452 |
}
|
|
453 |
it {
|
|
454 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-OUTPUT-rule-log_discarded').with(
|
|
455 |
target: 'nftables-inet-filter-chain-OUTPUT',
|
|
456 |
content: %r{^ limit rate 3/minute burst 5 packets log prefix \" bar \[OUTPUT\] " flags all counter$},
|
|
457 |
order: '97-nftables-inet-filter-chain-OUTPUT-rule-log_discarded-b',
|
|
458 |
)
|
|
459 |
}
|
|
460 |
it {
|
|
461 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-FORWARD-rule-log_discarded').with(
|
|
462 |
target: 'nftables-inet-filter-chain-FORWARD',
|
|
463 |
content: %r{^ limit rate 3/minute burst 5 packets log prefix \" bar \[FORWARD\] " flags all counter$},
|
|
464 |
order: '97-nftables-inet-filter-chain-FORWARD-rule-log_discarded-b',
|
|
465 |
)
|
|
466 |
}
|
|
467 |
end
|
|
468 |
|
|
469 |
context 'no log limit' do
|
|
470 |
let(:params) do
|
|
471 |
{
|
|
472 |
'log_limit' => false,
|
|
473 |
}
|
|
474 |
end
|
|
475 |
|
|
476 |
it {
|
|
477 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-INPUT-rule-log_discarded').with(
|
|
478 |
target: 'nftables-inet-filter-chain-INPUT',
|
|
479 |
content: %r{^ log prefix \"\[nftables\] INPUT Rejected: \" flags all counter$},
|
|
480 |
order: '97-nftables-inet-filter-chain-INPUT-rule-log_discarded-b',
|
|
481 |
)
|
|
482 |
}
|
|
483 |
it {
|
|
484 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-OUTPUT-rule-log_discarded').with(
|
|
485 |
target: 'nftables-inet-filter-chain-OUTPUT',
|
|
486 |
content: %r{^ log prefix \"\[nftables\] OUTPUT Rejected: \" flags all counter$},
|
|
487 |
order: '97-nftables-inet-filter-chain-OUTPUT-rule-log_discarded-b',
|
|
488 |
)
|
|
489 |
}
|
|
490 |
it {
|
|
491 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-FORWARD-rule-log_discarded').with(
|
|
492 |
target: 'nftables-inet-filter-chain-FORWARD',
|
|
493 |
content: %r{^ log prefix \"\[nftables\] FORWARD Rejected: \" flags all counter$},
|
|
494 |
order: '97-nftables-inet-filter-chain-FORWARD-rule-log_discarded-b',
|
|
495 |
)
|
|
496 |
}
|
|
497 |
end
|
|
498 |
|
|
499 |
context 'custom log limit' do
|
|
500 |
let(:params) do
|
|
501 |
{
|
|
502 |
'log_limit' => '5/minute',
|
|
503 |
}
|
|
504 |
end
|
|
505 |
|
|
506 |
it {
|
|
507 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-INPUT-rule-log_discarded').with(
|
|
508 |
target: 'nftables-inet-filter-chain-INPUT',
|
|
509 |
content: %r{^ limit rate 5/minute log prefix \"\[nftables\] INPUT Rejected: \" flags all counter$},
|
450 |
510 |
order: '97-nftables-inet-filter-chain-INPUT-rule-log_discarded-b',
|
451 |
511 |
)
|
452 |
512 |
}
|
453 |
513 |
it {
|
454 |
514 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-OUTPUT-rule-log_discarded').with(
|
455 |
515 |
target: 'nftables-inet-filter-chain-OUTPUT',
|
456 |
|
content: %r{^ log prefix \" bar \[OUTPUT\] " flags all counter$},
|
|
516 |
content: %r{^ limit rate 5/minute log prefix \"\[nftables\] OUTPUT Rejected: \" flags all counter$},
|
457 |
517 |
order: '97-nftables-inet-filter-chain-OUTPUT-rule-log_discarded-b',
|
458 |
518 |
)
|
459 |
519 |
}
|
460 |
520 |
it {
|
461 |
521 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-FORWARD-rule-log_discarded').with(
|
462 |
522 |
target: 'nftables-inet-filter-chain-FORWARD',
|
463 |
|
content: %r{^ log prefix \" bar \[FORWARD\] " flags all counter$},
|
|
523 |
content: %r{^ limit rate 5/minute log prefix \"\[nftables\] FORWARD Rejected: \" flags all counter$},
|
464 |
524 |
order: '97-nftables-inet-filter-chain-FORWARD-rule-log_discarded-b',
|
465 |
525 |
)
|
466 |
526 |
}
|