
Fixes a hypothetical security issue related to privilege escalation via rootwrap/privsep. A potential vulnerable service could previously allow writes to its rootwrap/privsep config and thus allow for more commands to be run with root privileges via rootwrap/privsep. For a succesful attack, this would also require the service to allow to run arbitrary commands via rootwrap/privsep. Thus far, no such vulnerabilities have been reported and thus this fix is simply strengthening the container images against such an issue in the future. Change-Id: I92c81c77e6a16570a108cde8031f7977930fb02a Closes-Bug: #1874298
50 lines
1.6 KiB
Django/Jinja
50 lines
1.6 KiB
Django/Jinja
FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
|
|
{% block labels %}
|
|
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
|
|
{% endblock %}
|
|
|
|
{% block swift_base_header %}{% endblock %}
|
|
|
|
{% import "macros.j2" as macros with context %}
|
|
|
|
{{ macros.configure_user(name='swift') }}
|
|
|
|
{% if base_package_type == 'rpm' %}
|
|
{% set swift_base_packages = [
|
|
'liberasurecode-devel',
|
|
'nmap-ncat',
|
|
] %}
|
|
{% elif base_package_type == 'deb' %}
|
|
{% set swift_base_packages = [
|
|
'liberasurecode-dev',
|
|
'netcat-openbsd',
|
|
'rsync',
|
|
] %}
|
|
{% endif %}
|
|
|
|
{{ macros.install_packages(swift_base_packages | customizable("packages")) }}
|
|
|
|
ADD swift-base-archive /swift-base-source
|
|
|
|
{% set swift_base_pip_packages = [
|
|
'/swift'
|
|
] %}
|
|
|
|
COPY swift-rootwrap /var/lib/kolla/venv/bin/swift-rootwrap
|
|
COPY rootwrap.conf /etc/swift/rootwrap.conf
|
|
COPY swift_sudoers /etc/sudoers.d/kolla_swift_sudoers
|
|
|
|
RUN ln -s swift-base-source/* swift \
|
|
&& {{ macros.install_pip(swift_base_pip_packages | customizable("pip_packages")) }} \
|
|
&& mkdir -p /etc/swift /var/cache/swift /var/lock/swift \
|
|
&& cp -r /swift/etc/* /etc/swift/ \
|
|
&& chown -R swift: /var/cache/swift /var/lock/swift \
|
|
&& chmod 755 /var/lib/kolla/venv/bin/swift-rootwrap \
|
|
&& chmod 644 /etc/swift/rootwrap.conf \
|
|
&& sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/swift/rootwrap.conf \
|
|
&& chmod 750 /etc/sudoers.d \
|
|
&& chmod 440 /etc/sudoers.d/kolla_swift_sudoers \
|
|
&& mkdir -p /opt/swift
|
|
|
|
{% block swift_base_footer %}{% endblock %}
|