Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a documentation regarding networking options on QM #713

Merged
merged 2 commits into from
Feb 10, 2025

Conversation

nsednev
Copy link
Collaborator

@nsednev nsednev commented Feb 4, 2025

Added NETWORK.md explaining network=host and network=private functionality with default settings of private because of security enforcement.

explained what happens if you change network=host and network=private
and explained that by default it's private
because of security enforcement
I took more information from https://github.com/containers/podman/blob/main/docs/tutorials/basic_networking.md

Summary by Sourcery

Document the networking options for Podman, explaining the "host" and "private" modes and the security implications of each.

New Features:

  • Introduce documentation for network modes in Podman.

Documentation:

  • Add a tutorial on networking modes in Podman.

Copy link

sourcery-ai bot commented Feb 4, 2025

Reviewer's Guide by Sourcery

This pull request adds a new documentation file that explains the networking options in Podman. The documentation details the 'host' and 'private' networking modes, highlights the security implications of using the host network, and reinforces that 'private' is the default mode due to security reasons. An example usage is also provided to illustrate the difference between these modes.

Flow Diagram for Podman Networking Options

flowchart TD
    A[Run Podman Container Command] --> B{Is --network flag specified?}
    B -- "--network=host" --> C[Container uses host network stack]
    C --> D[Shares host's network interfaces, IP addresses, ports]
    D --> E[Exposes sensitive network resources]
    E --> F[Security risks: container escape, lateral movement]

    B -- "--network not specified or set to private" --> G[Container uses isolated network namespace]
    G --> H[Communicates only with containers on the same network]
    H --> I[Security enforced by default]

    style E fill:#f88,stroke:#333,stroke-width:2px
    style I fill:#afa,stroke:#333,stroke-width:2px
Loading

File-Level Changes

Change Details Files
Added NETWORK.md to document Podman networking options.
  • Introduced a new markdown file with comprehensive details on network modes.
  • Explained the functionality of both 'network=host' and 'network=private' modes.
  • Outlined security concerns associated with using the host network and the reasons for defaulting to the private network.
  • Provided an example demonstrating how to run containers using both network modes.
docs/tutorials/NETWORK.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@nsednev nsednev force-pushed the VROOM-19418 branch 2 times, most recently from 27ff3de to ad48599 Compare February 4, 2025 13:47
@nsednev nsednev marked this pull request as ready for review February 4, 2025 13:51
@Yarboa
Copy link
Collaborator

Yarboa commented Feb 5, 2025

@nsednev
Maybe this tutorial could be explained with quadlet files in some internal service
Try to curl https http request of this quadlet.

like this in qm:

podman exec qm cat /etc/containers/systemd/nginx.container
[Container]
Image=localhost/nginx
PublishPort=8080:80
Network=host
[Install]
WantedBy=multi-user.target

Then curl inside QM with different Network values
MHO, is shows more option of how do run services inside QM and understand networking

@nsednev
Copy link
Collaborator Author

nsednev commented Feb 5, 2025

@nsednev Maybe this tutorial could be explained with quadlet files in some internal service Try to curl https http request of this quadlet.

like this in qm:

podman exec qm cat /etc/containers/systemd/nginx.container [Container] Image=localhost/nginx PublishPort=8080:80 Network=host [Install] WantedBy=multi-user.target

Then curl inside QM with different Network values MHO, is shows more option of how do run services inside QM and understand networking

AFAIK Quadlets are a type of configuration file used by the qm command in Podman to manage containers. A quadlet file is a text file that contains a set of key-value pairs that define the configuration for a container.
Quadlet files are used to specify the image, ports, network, and other settings for a container. They are typically used to deploy and manage containers in a production environment.

In this ticket I was asked to document specific network options, rather than to create configuration files.
I think that this will be over complication of the initial requested task and if needed, we may create separate task for it and prepare quadlets as needed.

@Yarboa
Copy link
Collaborator

Yarboa commented Feb 6, 2025

@nsednev Maybe this tutorial could be explained with quadlet files in some internal service Try to curl https http request of this quadlet.
like this in qm:
podman exec qm cat /etc/containers/systemd/nginx.container [Container] Image=localhost/nginx PublishPort=8080:80 Network=host [Install] WantedBy=multi-user.target
Then curl inside QM with different Network values MHO, is shows more option of how do run services inside QM and understand networking

AFAIK Quadlets are a type of configuration file used by the qm command in Podman to manage containers. A quadlet file is a text file that contains a set of key-value pairs that define the configuration for a container. Quadlet files are used to specify the image, ports, network, and other settings for a container. They are typically used to deploy and manage containers in a production environment.

In this ticket I was asked to document specific network options, rather than to create configuration files. I think that this will be over complication of the initial requested task and if needed, we may create separate task for it and prepare quadlets as needed.

I think the missing part here is about the qm network

@nsednev Maybe this tutorial could be explained with quadlet files in some internal service Try to curl https http request of this quadlet.
like this in qm:
podman exec qm cat /etc/containers/systemd/nginx.container [Container] Image=localhost/nginx PublishPort=8080:80 Network=host [Install] WantedBy=multi-user.target
Then curl inside QM with different Network values MHO, is shows more option of how do run services inside QM and understand networking

AFAIK Quadlets are a type of configuration file used by the qm command in Podman to manage containers. A quadlet file is a text file that contains a set of key-value pairs that define the configuration for a container. Quadlet files are used to specify the image, ports, network, and other settings for a container. They are typically used to deploy and manage containers in a production environment.

In this ticket I was asked to document specific network options, rather than to create configuration files. I think that this will be over complication of the initial requested task and if needed, we may create separate task for it and prepare quadlets as needed.

I will try to explain, related this doc. which is under docs/tutorials/networking.md of qm
There is no one context the pinds the podman networking into the product,

I assume binding a context to QM is missing
Which netwrok discussed ? the one of podman host network or QM network?
There a re two podmans in QM which one do you want to explain?
MHO, detailed context with short example could help

@nsednev
Copy link
Collaborator Author

nsednev commented Feb 6, 2025

@nsednev Maybe this tutorial could be explained with quadlet files in some internal service Try to curl https http request of this quadlet.
like this in qm:
podman exec qm cat /etc/containers/systemd/nginx.container [Container] Image=localhost/nginx PublishPort=8080:80 Network=host [Install] WantedBy=multi-user.target
Then curl inside QM with different Network values MHO, is shows more option of how do run services inside QM and understand networking

AFAIK Quadlets are a type of configuration file used by the qm command in Podman to manage containers. A quadlet file is a text file that contains a set of key-value pairs that define the configuration for a container. Quadlet files are used to specify the image, ports, network, and other settings for a container. They are typically used to deploy and manage containers in a production environment.
In this ticket I was asked to document specific network options, rather than to create configuration files. I think that this will be over complication of the initial requested task and if needed, we may create separate task for it and prepare quadlets as needed.

I think the missing part here is about the qm network

@nsednev Maybe this tutorial could be explained with quadlet files in some internal service Try to curl https http request of this quadlet.
like this in qm:
podman exec qm cat /etc/containers/systemd/nginx.container [Container] Image=localhost/nginx PublishPort=8080:80 Network=host [Install] WantedBy=multi-user.target
Then curl inside QM with different Network values MHO, is shows more option of how do run services inside QM and understand networking

AFAIK Quadlets are a type of configuration file used by the qm command in Podman to manage containers. A quadlet file is a text file that contains a set of key-value pairs that define the configuration for a container. Quadlet files are used to specify the image, ports, network, and other settings for a container. They are typically used to deploy and manage containers in a production environment.
In this ticket I was asked to document specific network options, rather than to create configuration files. I think that this will be over complication of the initial requested task and if needed, we may create separate task for it and prepare quadlets as needed.

I will try to explain, related this doc. which is under docs/tutorials/networking.md of qm There is no one context the pinds the podman networking into the product,

I assume binding a context to QM is missing Which netwrok discussed ? the one of podman host network or QM network? There a re two podmans in QM which one do you want to explain? MHO, detailed context with short example could help

This readme was created after I discussed it with @dougsland and according to our discussion.

docs/tutorials/NETWORK.md Outdated Show resolved Hide resolved
docs/tutorials/NETWORK.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@dougsland dougsland left a comment

Choose a reason for hiding this comment

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

please use fedora not ubuntu.

@dougsland
Copy link
Collaborator

@nsednev Maybe this tutorial could be explained with quadlet files in some internal service Try to curl https http request of this quadlet.

like this in qm:

podman exec qm cat /etc/containers/systemd/nginx.container [Container] Image=localhost/nginx PublishPort=8080:80 Network=host [Install] WantedBy=multi-user.target

Then curl inside QM with different Network values MHO, is shows more option of how do run services inside QM and understand networking

I agree it's useful change but let's open a different issue for that so @nsednev can work and improve the doc.

@dougsland
Copy link
Collaborator

@nsednev @Yarboa #717

@Yarboa
Copy link
Collaborator

Yarboa commented Feb 6, 2025

@nsednev @Yarboa #717

I do not understand the PR, sorry, in case no relevance data related QM context of networking
It is up to you Doug to decide, i chose not to debate on that, just sharing my input

@dougsland
Copy link
Collaborator

@nsednev @Yarboa #717

I do not understand the PR, sorry, in case no relevance data related QM context of networking It is up to you Doug to decide, i chose not to debate on that, just sharing my input

It will help support as soon we release the product and offload us.

…ality with default settings of private because of security enforcements.

Signed-off-by: nsednev <[email protected]>
Copy link
Collaborator Author

@nsednev nsednev left a comment

Choose a reason for hiding this comment

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

Made changes as requested.

Copy link
Collaborator Author

@nsednev nsednev left a comment

Choose a reason for hiding this comment

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

@dougsland Made changes as requested.

@nsednev nsednev requested a review from dougsland February 9, 2025 15:13
…ality with default settings of private because of security enforcements.

Signed-off-by: nsednev <[email protected]>
@nsednev nsednev marked this pull request as draft February 10, 2025 10:54
@nsednev nsednev marked this pull request as ready for review February 10, 2025 10:54
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @nsednev - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding a section on how to create and manage custom networks in Podman.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

docs/tutorials/NETWORK.md Show resolved Hide resolved
@dougsland
Copy link
Collaborator

@nsednev could you please add in another patch a link from the main README.md to this documentation ? Like "Network session in the README"

@dougsland dougsland merged commit a7966f2 into containers:main Feb 10, 2025
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants