Commit Graph
58 Commits
Author SHA1 Message Date
Josh Patterson 098699613e FIX: pip install wheels from a root-owned directory
Root ran `pip install --find-links` against directories under /opt/so/conf, which
is 939:939 mode 770. Hardening those directories would not have helped: renaming an
entry requires write permission on the parent, not on the entry, so uid 939 could
move the wheel tree aside and substitute its own between the file.recurse that
populates it and the pip install that reads it. clean: True plus the onchanges
requisite narrowed that to a race rather than a straight win, but the window is
real and the install runs as root.

Move both wheel trees to /opt/saltstack, which is created by the salt package and
is root-owned, and state the ownership explicitly rather than relying on the files
being new:

  /opt/so/conf/salt/module_packages/docker
    -> /opt/saltstack/module_packages/docker
  /opt/so/conf/libvirt/source-packages/libvirt-python
    -> /opt/saltstack/source-packages/libvirt-python

salt.python_modules is included by salt/salt/minion/init.sls, so the docker wheels
are staged on every minion in the grid, not just the manager.

Upgraded installs keep a now-unused wheel tree in the old socore-writable location,
so remove it -- nothing reads it after this change, but leaving a writable staging
directory behind serves no purpose.
2026-09-17 12:43:37 -04:00
Josh Patterson 1e86be11b2 FIX: install /usr/sbin management scripts as root
Salt installed the so-* scripts into /usr/sbin owned by unprivileged service
UIDs (939/socore, plus 930-960 per service) at mode 755, while root executes
those same files from cron, systemd and state cmd.run. Any file-write
primitive as one of those UIDs was therefore root.

Two mechanisms behind this are not visible in the diff:

file.recurse also manages the destination directory, so /usr/sbin itself was
chowned to whichever service UID ran last. A directory's owner may always
chmod it, so that UID could replace even the scripts already declared
user: root -- so-config-backup, so-suricata-eve-clean, so-nsm-mount-nvme.
usr_sbin_perms now pins the directory to root:root 555, the mode the
filesystem RPM ships.

Omitting user:/group: is a no-op on files that already exist, because
check_perms only chowns when a user is named. Explicit user: root is what
lets upgraded grids self-heal on the next highstate, and what makes a
revert chown back rather than silently do nothing.
2026-09-16 10:34:20 -04:00
Josh Patterson 517538a9a7 remove comments 2026-07-15 16:28:35 -04:00
Josh Patterson 8ea66bb0e9 create libvirt volumes directory 2025-10-30 11:02:36 -04:00
Josh Patterson c836dd2acd set interface for network.ip_addrs for hypervisors 2025-09-24 16:50:29 -04:00
Josh Patterson 3a87af805f update service file, use salt.minion state to update mine_functions 2025-09-24 15:19:46 -04:00
Josh Patterson 4587301cca only update mine for managerhype during setup 2025-09-23 15:56:00 -04:00
Josh Patterson 14ddbd32ad salt-minion service file changes for hypervisor and managerhype 2025-09-22 16:38:40 -04:00
Josh Patterson 4599b95ae7 separate salt-minion service file 2025-09-22 16:37:16 -04:00
Josh Patterson e10d00d114 support for managerhype 2025-08-26 14:54:37 -04:00
Josh Patterson cbdd369a18 ensure x509 in mine 2025-08-25 08:39:55 -04:00
Josh Patterson c5db0a7195 more ed25519 to ecdsa 2025-08-07 15:02:45 -04:00
Josh Patterson c98042fa80 match user soqemussh for ssh config. allow for user edits to not be overwritten in ssh config. 2025-07-30 09:44:58 -04:00
Josh Patterson a3fb2f13be dont show state changes for user-data 2025-07-16 14:14:16 -04:00
Josh Patterson 0f71b45e0f CPU model=host is deprecated 2025-06-09 09:55:16 -04:00
Josh Patterson d9fb79403b seems new openldap / libldap.so.2 doesnt have EVP_md2 dependency so check for it before trying to remove it 2025-06-05 15:57:56 -04:00
Josh Patterson 08d99a3890 remove unneeded files 2025-05-30 12:50:59 -04:00
Josh Patterson 6988f03ebc setup bridge and fix salt before first highstate for hypervisors 2025-05-16 14:24:07 -04:00
Josh Patterson 26d7ceebb2 libvirt.images requires scripts from hypervisor state 2025-05-02 11:30:35 -04:00
Josh Patterson 4df3070a1d ensure file permissions of libvirt images 2025-04-24 12:59:06 -04:00
Josh Patterson 0bcb6040c9 recreate sool9 if user-data or meta-data cloud-init changes 2025-04-18 14:02:17 -04:00
Josh Patterson 888ab162bd update mine_functions and mine after mainint switch to br0. ensure br0 has ip before updating mine 2025-04-10 15:04:08 -04:00
Josh Patterson 445afca6ee use vrt 2025-04-03 13:44:13 -04:00
Josh Patterson e7aa4428de managerhype udate mine when switch to br0 2025-03-31 16:03:19 -04:00
Josh Patterson c93a5de460 additional changes for managerhype 2025-03-13 10:55:49 -04:00
Josh Patterson c66cd3b2f3 ensure image is readded if removed 2025-03-10 11:23:26 -04:00
Josh Patterson f30938ed59 hypervisor annotation show if base domain is initialized or not 2025-03-06 15:26:08 -05:00
m0duspwnens 9b8dce0c77 only wait and make predicable when virt-install runs 2025-02-06 15:44:28 -05:00
m0duspwnens 7159678385 create predicatble interfaces 2025-02-06 15:30:46 -05:00
m0duspwnens ae01dc9639 manager needs more packages for salt-cloud. change location of priv key for salt-cloud config 2025-01-17 22:26:39 -05:00
m0duspwnens a74ed0daf0 fix disabling cloud-init and system shutdown. increase ram/cpu of base vm. shrink disk_size to 6G for testing 2025-01-17 21:25:40 -05:00
m0duspwnens 60387651d2 recreate the base vm if any of the cloud init files change 2025-01-17 20:13:42 -05:00
m0duspwnens 54eeb0e327 handle refreshing base image and reinstalling the vm if the source qcow2 image changes 2025-01-17 19:27:04 -05:00
m0duspwnens 1f13554bd9 move add virt install and pool creation to images/init. start moving to /nsm/libvirt/ 2025-01-17 09:43:39 -05:00
m0duspwnens 24eadf2507 add libvirt state to highstate for hypervisor. update allowed_states for libvirt 2025-01-16 17:46:20 -05:00
m0duspwnens 58be7ae5db rename from coreol9 or coreol9Small to sool9 2025-01-16 11:16:20 -05:00
m0duspwnens 837fbab96d minimize packages installed on manager for hyper 2025-01-15 17:00:06 -05:00
m0duspwnens 01ac1cdcca check features and allowed/states 2025-01-15 14:13:12 -05:00
m0duspwnens 161e8a6c21 ssh config for manager. dont need to create soqemussh user on manager 2025-01-14 16:21:17 -05:00
m0duspwnens 3cac19d498 createvm script without setting network in base domain 2025-01-09 16:31:51 -05:00
m0duspwnens 2ba8a87c9d add directory where qcow2 images will be distributed from 2025-01-09 16:20:56 -05:00
m0duspwnens ebbfcd169c add pkg required for so-qcow2-modify-network 2025-01-09 16:17:50 -05:00
m0duspwnens 574d2994d1 use cmd.run instead of cmd.script to resolve issue 64962 2025-01-09 16:16:59 -05:00
m0duspwnens 3c59858f70 improvements to createvm 2024-12-20 11:42:53 -05:00
m0duspwnens 6f0161e9da script to create base domain 2024-12-19 17:36:48 -05:00
m0duspwnens b24aa2f797 fix destroying virbr0 2024-12-19 10:11:54 -05:00
m0duspwnens 5e4f1fc279 only run fix ldap when lief installed 2024-12-16 10:23:14 -05:00
m0duspwnens e779d180f9 work around libvirt issue. add raid scripts 2024-12-13 16:03:17 -05:00
m0duspwnens 75e8c60fe2 add tools to set dhcp/static ip inside the qcow2 image 2024-09-20 11:03:16 -04:00
m0duspwnens 67f0934930 set new bridge 2024-08-16 12:21:41 -04:00