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

Add fields for TLS material to destination config #2249

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
13 changes: 13 additions & 0 deletions docs/containers.conf.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -907,11 +907,24 @@ URI to access the Podman service
- **rootless remote** - ssh://[email protected]/run/user/1000/podman/podman.sock
- **rootful local** - unix:///run/podman/podman.sock
- **rootful remote** - ssh://[email protected]:22/run/podman/podman.sock
- **tcp/tls remote** - tcp://10.10.1.136:9443

**identity="~/.ssh/id_rsa**

Path to file containing ssh identity key

**tls_cert_file="~/certs/podman/tls.crt"**
Copy link
Member

Choose a reason for hiding this comment

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

I see identity sets the same example with ~ but AFAIK our code will never expand this as we just pass it to the open syscall and normally the shell will expand ~ so this will most likely not work.

So this example might mislead some people to thinking it works, I would recommend using full paths in the example same for all the other cases here.

Copy link
Author

Choose a reason for hiding this comment

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

Ah, I think you're right. Do you think it'd be a good idea to require consumers (e.g. podman) to expand the tilde to be consistent with the identity field? Or does the identity example also need to be updated?

Copy link
Member

Choose a reason for hiding this comment

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

I would just update the docs here, so far nobody has asked for it. And if you create the connections with podman system connection add --identity ~/... the shell already did it for us and we just see the full path anyway so I don't think it matters to users.

It only matters for users that manually write the connections in the config file but I am not aware of anyone doing this.

Copy link
Author

Choose a reason for hiding this comment

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

Makes sense. Done.


Path to PEM file containing TLS client certificate

**tls_key_file="~/certs/podman/tls.key"**

Path to PEM file containing TLS client certificate private key

**tls_ca_file="~/certs/podman/ca.crt"**

Path to PEM file containing TLS certificate authority (CA) bundle

**[engine.volume_plugins]**

A table of all the enabled volume plugins on the system. Volume plugins can be
Expand Down
7 changes: 7 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,13 @@ type Destination struct {
// Identity file with ssh key, optional
Identity string `json:",omitempty" toml:"identity,omitempty"`

// Path to TLS client certificate PEM file, optional
TLSCertFile string `json:",omitempty" toml:"tls_cert_file,omitempty"`
// Path to TLS client certificate private key PEM file, optional
TLSKeyFile string `json:",omitempty" toml:"tls_key_file,omitempty"`
// Path to TLS certificate authority PEM file, optional
TLSCAFile string `json:",omitempty" toml:"tls_ca_file,omitempty"`

// isMachine describes if the remote destination is a machine.
IsMachine bool `json:",omitempty" toml:"is_machine,omitempty"`
}
Expand Down
8 changes: 8 additions & 0 deletions pkg/config/containers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -766,10 +766,18 @@ default_sysctls = [
# rootful "unix:///run/podman/podman.sock (Default)
# remote rootless ssh://engineering.lab.company.com/run/user/1000/podman/podman.sock
# remote rootful ssh://[email protected]:22/run/podman/podman.sock
# tcp/tls remote tcp://10.10.1.136:9443
#
# uri = "ssh://[email protected]/run/user/1001/podman/podman.sock"
# Path to file containing ssh identity key
# identity = "~/.ssh/id_rsa"
# Path to PEM file containing TLS client certificate
# tls_cert_file = "~/certs/podman/tls.crt"
# Path to PEM file containing TLS client certificate private key
# tls_key_file = "~/certs/podman/tls.key"
# Path to PEM file containing TLS certificate authority (CA) bundle
# tls_ca_file = "~/certs/podman/ca.crt"


# Directory for temporary files. Must be tmpfs (wiped after reboot)
#
Expand Down
7 changes: 7 additions & 0 deletions pkg/config/containers.conf-freebsd
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,17 @@ default_sysctls = [
# rootful "unix:///run/podman/podman.sock (Default)
# remote rootless ssh://engineering.lab.company.com/run/user/1000/podman/podman.sock
# remote rootful ssh://[email protected]:22/run/podman/podman.sock
# tcp/tls remote tcp://10.10.1.136:9443
#
# uri = "ssh://[email protected]/run/user/1001/podman/podman.sock"
# Path to file containing ssh identity key
# identity = "~/.ssh/id_rsa"
# Path to PEM file containing TLS client certificate
# tls_cert_file = "~/certs/podman/tls.crt"
# Path to PEM file containing TLS client certificate private key
# tls_key_file = "~/certs/podman/tls.key"
# Path to PEM file containing TLS certificate authority (CA) bundle
# tls_ca_file = "~/certs/podman/ca.crt"

# Directory for temporary files. Must be tmpfs (wiped after reboot)
#
Expand Down