Git Product home page Git Product logo

secbox's Issues

ssh-agent changes the host socket name at each reboot in opensuse

the container won't be able to automatically start after a reboot in openSUSE TW (maybe leap too) because the SSH_AUTH_SOCK env variable and "${SSH_AUTH_SOCK}:/ssh-agent" bind mounted socket are defined at container creation time, and won't be the same after an host reboot

SSHFS as alternative to NFS

Since all the required shares are already mounted in wotan.suse.de, adding the --sshfs options could allow having access to all of them without the need to locally mount them via NFS. Moreover, no higher privs will be required anymore :).

secbox build tries to invoke 'sudo', fails

Hi,

when I try to compile a package locally using oscb (default secbox alias for osc build --ccache --cpio-bulk-download --download-api-only), the build stage fails with
sudo: No such file or directory: 'sudo'

Steps to reproduce:

  1. osc co security:SELinux/selinux-policy
  2. cd security:SELinux/selinux-policy
  3. oscb

Internal network resources not available if the container was created before the host was connected to the VPN

Misbehavior

secbox container was unable to access VPN resources because it was created before the VPN was on.

Reason

secbox is using --network host option at container creation, this (among other capabilities) allows containerized software to share the same resolver of the host system. This permits to containerized tools like osc to resolve internal domains (like: build.suse.de).

The container maintains its own copy of /etc/resolv.conf, which is copied from the host at the time of the container creation. If the host was configured to use the SUSE internal resolvers once the container was created, then the container would be able to use them since they will be present in its /etc/resolv.conf. Instead, if the container is created while the host is not connected to the VPN, it will inherit a not properly configured /etc/resolv.conf. If the host connect to the VPN only after the container is created, then the host will be able to resolve internal domains since it will be reconfigured to use the internal DNS servers passed via DHCP (and its resolv.conf change), but the copy maintained by the container won't be updated.

Workarounds

  1. secbox creates a disposable container, hence it can be destroyed and recreated on-demand any time. After the VPN connection is established on the host side, the already existing container can be destroyed via secbox --destroy -f and the next issued secbox command will recreate the container, this time with access to the VPN resources.
  2. Enter the container as root via secbox --root and manually update the /etc/resolv.conf

Pass envirnoment variables to commands

It could be helpful some times to initialize or overwrite environmenet variables for that command.

Pretending a --env option is implemented for that, an example could be:

secbox --env PYTHONPATH=/opt/imtools python3.11 -m imtools.im help

It should also work for appending data, like:

secbox --env PYTHONPATH=$PYTHONPATH:/opt/imtools python3.11 -m imtools.im help

The --env option could be passed multiple time.

secbox --env PYTHONPATH=$PYTHONPATH:/opt/imtools --env ABC=DEF python3.11 -m imtools.im help

Non-interactive image update

Secbox can be called from a script and if an update is available it will make whatever command you are running interactive.
To better approach all any use-case, it is required to switch from the current interactive update prompt to an INFO message to the stderr which inform the user that an update is available. This change will require a new option --update-container.

Simplify container management by making functions only do one thing

The management of the container is currently not optimized due the fact that the logic is part of the sub-functions.
For instance start_container() calls create_container() when it should only start the container.

secbox/secbox

Lines 534 to 544 in eeb5124

start_container() {
secbox_container_exists || {
# If the container does not exist, create it
print_logo
msg "${orange}[*]${no_format} ${container} container not found"
create_container || {
msg "${red}[!]${no_format} Cannot create the ${container} container"
return 1
}
msg "${green}[.] ${no_format}${container} container created\n"
}

This generates confusion when other functions calls start_container() and then create_container(), like in update_image():

secbox/secbox

Lines 586 to 596 in eeb5124

update_image() {
local _upstream=$(upstream_image_version)
read -ep "[.] An update is available, do you want to update the container now? [Y/n] " -n 1 -r
msg "Changelog: https://gitlab.suse.de/security/secbox-image/-/tags/v${_upstream}"
if [[ ! $REPLY =~ ^[Nn]$ ]]; then
if pull_image; then
if secbox_container_exists; then
if secbox_destroy -f -i; then
if create_container; then
start_container
return 0

Functions need to be rewritten following the UNIX philosophy (or a KISS approach).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.