Commit Graph

970 Commits

Author SHA1 Message Date
Giuseppe Scrivano 70fd91a3bb pkg: check ownership for XDG_RUNTIME_DIR
check whether the user owns the specified XDG_RUNTIME_DIR.  Hopefully
it will help catching errors when running in a "sudo -u" session that
uses the wrong value for XDG_RUNTIME_DIR.

Closes: https://github.com/containers/podman/issues/9114

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-01-28 10:11:51 +01:00
Aleksa Sarai 1478f9331d seccomp: update profile to Linux 5.11 list
This mirrors the Docker and containerd changes, with the caveat that
because mount(2) is permitted under podman for all containers we
therefore add all of the v2 mount API syscalls as available to all
containers.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-01-27 21:40:48 +11:00
Aleksa Sarai 4e485f45ab seccomp: add CI check for up-to-date seccomp.json
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-01-27 21:40:45 +11:00
Aleksa Sarai 1195c8bb0b seccomp: re-add generation script
The generate.go script used to fill the default seccomp profile file is
quite important as otherwise distributions will end up having outdated
seccomp filters even after a podman update.

This script comes from the Docker repo.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-01-27 21:40:42 +11:00
Aleksa Sarai 624d0aa703 seccomp: deduplicate default profile
Several syscalls were enabled globally (SCMP_ACT_ALLOW without any
conditions for all containers), but also had conditional rules later in
the profile (likely inherited from Docker). The following syscalls do
not need special casing because they were globally enabled:

 * clone, unshare, mount, umount, umount2 all had special CAP_SYS_ADMIN
   restrictions but those don't make sense since they were also enabled
   for all containers.
 * reboot was permitted for CAP_SYS_BOOT and all containers.
 * name_to_handle_at was permitted for CAP_SYS_ADMIN, CAP_SYS_NICE(?),
   and all containers.

And certain syscalls had globally-enabled rules when they shouldn't
have:

 * socket has special rules for CAP_AUDIT_WRITE but it also had a global
   "allow unconditionally" rule. It turns out that libseccomp will
   override unconditional rules with conditional ones but this is
   somewhat of an implementation detail and it's much safer to remove
   the rule and use the existing cases.

Now the only syscalls remaining with complicated rules (meaning they
appear more than once in the profile) are:

 * sync_file_range2 which is architecture specific (though in principle
   we could move it to enabled-without-rules because runc ignores
   unknown syscalls).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-01-27 21:39:54 +11:00
OpenShift Merge Robot 422eb91f40 Merge pull request #415 from rhatdan/pulls
Add image_parallel_copies engine config
2021-01-21 17:49:29 -05:00
Daniel J Walsh 952d2c9991 Add image_parallel_copies engine config
This will allow users to configure the amount of parallel copies that
the container engines are allowed to do. This allows users to configure
their systems to match their available network settings.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-21 14:59:34 -05:00
OpenShift Merge Robot ab2c85a60c Merge pull request #416 from ashley-cui/nameprefix
Fix secret create prefix
2021-01-21 14:15:02 -05:00
Ashley Cui 2aecd17ed8 Fix secret create prefix
Fix a bug where if the secret name was a prefix of an existing id, secrets would reject the new name
Now, you can use the secret name as expected

Example: if a secret with id "abcdefg" already exists:
Previously, it would error if you tried to create a secret with name "abc"
Now it allows you to do so

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-01-20 08:25:48 -05:00
OpenShift Merge Robot e11260664d Merge pull request #418 from giuseppe/fix-duplicated-wording
cgroupv2: fix typo in comment
2021-01-20 05:10:48 -05:00
Giuseppe Scrivano 8f15d23f10 cgroupv2: fix typo in comment
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-01-20 09:44:05 +01:00
OpenShift Merge Robot 767d30bb38 Merge pull request #417 from baude/logdriver
Add accessor for log-driver
2021-01-19 16:47:26 -05:00
OpenShift Merge Robot 8fedf17690 Merge pull request #414 from ashley-cui/secretfix
Fix secret name validation
2021-01-19 16:38:27 -05:00
baude c0b1b9a368 Add accessor for log-driver
For podman, we need to be able to get the log driver from common config.

Signed-off-by: baude <bbaude@redhat.com>
2021-01-19 15:08:34 -06:00
Ashley Cui f9ab37eef1 Fix secret name validation
Secret names should not end with "."

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-01-19 12:10:42 -05:00
OpenShift Merge Robot ee5a996bd2 Merge pull request #413 from ashley-cui/secretfix
Fix name validation and dir mode in secrets
2021-01-19 11:52:59 -05:00
Ashley Cui ce15873c3c Fix name validation and dir mode in secrets
fix name validation to reject secret names that end with "-"
Create filedriver dir with proper permissions

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-01-19 09:06:03 -05:00
OpenShift Merge Robot ca15b1879d Merge pull request #410 from containers/dependabot/go_modules/github.com/stretchr/testify-1.7.0
Bump github.com/stretchr/testify from 1.6.1 to 1.7.0
2021-01-15 20:50:39 -05:00
dependabot-preview[bot] a9b4d39f85 Bump github.com/stretchr/testify from 1.6.1 to 1.7.0
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.6.1 to 1.7.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.6.1...v1.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-15 04:37:03 -05:00
Daniel J Walsh 012d143d27 Merge pull request #407 from naveensrinivasan/fix/osx-make-386
fix - make target all on osx
2021-01-13 10:14:23 -05:00
Daniel J Walsh 2a0c50a82a Merge pull request #408 from giuseppe/fix-key-name
config: fix runtime_supports_nocgroup key name
2021-01-13 10:14:09 -05:00
Giuseppe Scrivano 52dd8b2d67 config: fix runtime_supports_nocgroup key name
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-01-13 15:11:54 +01:00
OpenShift Merge Robot b6b00d4850 Merge pull request #405 from ashley-cui/secretfix
Fix secret name regex
2021-01-12 13:46:38 -05:00
naveen 69afcc3574 fix - make target all on osx
Fixes the make target all on osx.
2021-01-12 13:46:02 -05:00
Ashley Cui eb63fb2ef2 Fix secret name regex
Fix secret name regex to take one character secret names

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-01-12 13:04:45 -05:00
OpenShift Merge Robot e32d0ae37f Merge pull request #403 from rhatdan/retry
Rename internal functions to make them easier to understand
2021-01-11 05:01:09 -05:00
Daniel J Walsh 72b45df084 Rename internal functions to make them easier to understand
Currently the difference between isRetryable and shouldRestart
is not clear in the function names, this simply makes them
more understandable.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-10 05:48:03 -05:00
Daniel J Walsh 6a0bdb1173 Merge pull request #402 from rhatdan/master
Move to v0.34.0-dev
2021-01-08 09:21:14 -05:00
Daniel J Walsh f5d66bfb38 Move to v0.34.0-dev
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-08 09:18:45 -05:00
Daniel J Walsh ed1c0cfbf2 Merge pull request #401 from rhatdan/VERSION
Bump to v0.33.0
2021-01-08 09:15:20 -05:00
Daniel J Walsh e85c24768a Move to v0.33.1-dev
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-08 09:14:12 -05:00
Daniel J Walsh a08eba1eb0 Bump to v0.33.0
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-08 09:13:41 -05:00
OpenShift Merge Robot 5398857622 Merge pull request #400 from rhatdan/VERSION
Update vendor of containers/storage
2021-01-08 09:08:32 -05:00
Daniel J Walsh d6d2fd11b4 Update vendor of containers/storage
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-08 08:52:21 -05:00
OpenShift Merge Robot 563ca57891 Merge pull request #399 from giuseppe/block-vmsplice
seccomp: drop 'vmsplice' from the allowed list
2021-01-08 08:44:50 -05:00
Giuseppe Scrivano 10e862731c seccomp: drop 'vmsplice' from the allowed list
More details: https://lore.kernel.org/linux-mm/X+PoXCizo392PBX7@redhat.com/

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-01-08 13:43:54 +01:00
OpenShift Merge Robot 5fab021a65 Merge pull request #398 from rhatdan/VERSION
Add new function to setup default environment
2021-01-07 16:08:51 -05:00
Daniel J Walsh 2694f2c7dc Add new function to setup default environment
Need to be able to getdefault container environment
based on use provided functions on httpProxy and use
the environment from the host.

This way users can modify the environment from podman

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-07 15:48:11 -05:00
OpenShift Merge Robot e6e15542ec Merge pull request #375 from ashley-cui/secrets
Implement secrets pkg: backend and filedriver
2021-01-06 11:07:46 -05:00
Daniel J Walsh df306144b8 Merge pull request #397 from rhatdan/VERSION
Bump to v0.32.1
2021-01-06 05:46:59 -05:00
Daniel J Walsh 9b118648e5 Move to v0.32.2-dev
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-06 05:46:01 -05:00
Daniel J Walsh 8ae21423c6 Bump to v0.32.1
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-06 05:45:41 -05:00
OpenShift Merge Robot 5b556f05a9 Merge pull request #396 from rhatdan/VERSION
Current code fails to compile on Darwin no syscall.ERESTART
2021-01-05 15:16:30 -05:00
Daniel J Walsh 79e8da1cbf Current code fails to compile on Darwin
syscall.ERESTART is not defined on Darwin, so move to
an unsupported package. While this would work on Windows
this code most likey never will, so rather then complicate
code, I just left ERESTART on Windows as not supported.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-05 13:46:11 -05:00
Ashley Cui 46550afb85 Implement secrets pkg: backend and filedriver
This is the implementation of the backend of secrets. pkg/secrets takes a secret name and data and does these operations on that secret data:  store, delete, lookup, and list, using a secretsmanager.

The first driver implemented here is a filedriver - where the data is stored unencrypted on disk in a file.

The secrets package can be easily expanded to use more drivers as the package implements an interface to accept different drivers

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-01-05 09:38:35 -05:00
Daniel J Walsh 10382ba516 Merge pull request #394 from rhatdan/VERSION
Bump to v0.32.0
2021-01-04 13:00:18 -05:00
Daniel J Walsh baaf5adc4c Move to v0.32.1-dev 2021-01-04 12:58:55 -05:00
Daniel J Walsh cc77e99ac6 Bump to v0.32.0 2021-01-04 12:58:33 -05:00
OpenShift Merge Robot 5a4c3fcfa7 Merge pull request #392 from rhatdan/retry
Do not retry on most syscall failures
2021-01-04 11:37:07 -05:00
OpenShift Merge Robot 6345892d1b Merge pull request #393 from rhatdan/completions
http_proxy is supposed to default to true.
2021-01-04 10:41:26 +01:00