Project

General

Profile

Actions

action #94132

closed

Test running container networking with firewall

Added by jlausuch over 3 years ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Start date:
2021-06-17
Due date:
% Done:

0%

Estimated time:

Description

In container tests we are purely testing containers with firewall disabled.

QE shall have at least 1 test to check the functionality of containers with firewall running to avoid these kind of problems.

At least, this use case should be covered:
1) Enable firewall
2) Install docker/podman
3) Create containers
4) Ping/netcat host and outside world from the container

In some cases this works out of the box, but I have the experience that firewall might need to be restarted.

We should also check the iptables rules that are created when starting docker service. For example I have seen some warning messages like this in the firewall log:

> Jun 16 11:56:25 localhost firewalld[4824]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t nat -X DOCKER' failed: iptables: No chain/target/match by that name.
> Jun 16 11:56:26 localhost firewalld[4824]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t filter -F DOCKER' failed: iptables: No chain/target/match by that name.
> Jun 16 11:56:26 localhost firewalld[4824]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t filter -X DOCKER' failed: iptables: No chain/target/match by that name.
> Jun 16 11:56:26 localhost firewalld[4824]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t filter -F DOCKER-ISOLATION-STAGE-1' failed: iptables: No chain/target/match by that name.
> Jun 16 11:56:26 localhost firewalld[4824]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t filter -X DOCKER-ISOLATION-STAGE-1' failed: iptables: No chain/target/match by that name.
> Jun 16 11:56:26 localhost firewalld[4824]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t filter -F DOCKER-ISOLATION-STAGE-2' failed: iptables: No chain/target/match by that name.
> Jun 16 11:56:26 localhost firewalld[4824]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t filter -X DOCKER-ISOLATION-STAGE-2' failed: iptables: No chain/target/match by that name.
> Jun 16 11:56:26 localhost firewalld[4824]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t filter -F DOCKER-ISOLATION' failed: iptables: No chain/target/match by that name.
> Jun 16 11:56:26 localhost firewalld[4824]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t filter -X DOCKER-ISOLATION' failed: iptables: No chain/target/match by that name.

The test should also double check that the iptable rules/forwarding are correct.


Related issues 1 (0 open1 closed)

Related to Containers and images - action #87805: Investigate security test cases for automationRejectedrbranco2021-01-15

Actions
Actions #1

Updated by jlausuch over 3 years ago

  • Related to action #87805: Investigate security test cases for automation added
Actions #2

Updated by jlausuch over 3 years ago

  • Status changed from New to Workable
Actions #3

Updated by ph03nix about 3 years ago

  • Status changed from Workable to In Progress
  • Assignee set to ph03nix
Actions #4

Updated by jlausuch about 3 years ago

Just for the record, this is a host test that should apply only for maintenance jobs (or 15-SP4 under development).
It could be part of docker.pm and podman.pm or creating a new module container_firewall.pm or whatever suits best.

Actions #5

Updated by ph03nix about 3 years ago

  • Status changed from In Progress to Workable
  • Assignee deleted (ph03nix)

I unassign myself, got caught up in other tasks and cannot do this at the moment.

Actions #6

Updated by pdostal about 3 years ago

  • Status changed from Workable to In Progress
  • Assignee set to pdostal
Actions #7

Updated by pdostal about 3 years ago

We are apparently already doin this in docker.pm via containers::utils::check_docker_firewall() - see the openqa. I'm going to do the same for podman.pm.

Actions #8

Updated by jlausuch about 3 years ago

pdostal wrote:

We are apparently already doin this in docker.pm via containers::utils::check_docker_firewall() - see the [openqa]. I'm going to do the same for podman.pm.

[openqa]: https://openqa.suse.de/tests/7635224#step/docker/109

perfect!

Actions #10

Updated by pdostal about 3 years ago

The pull request has been reverted as it breaks MicroOS.

I'm working on pr#13758.

Actions #11

Updated by pdostal about 3 years ago

  • Status changed from In Progress to Resolved
Actions #12

Updated by ph03nix about 2 months ago

  • Tags set to containers
Actions

Also available in: Atom PDF