Changes between Initial Version and Version 1 of cypress/SingularityImageInspection


Ignore:
Timestamp:
08/31/2026 04:58:40 PM (5 days ago)
Author:
Carl Baribault
Comment:

Initial page

Legend:

Unmodified
Added
Removed
Modified
  • cypress/SingularityImageInspection

    v1 v1  
     1= Inspecting a Singularity .sif file =
     2
     3Before running a newly acquired container, you can inspect its metadata, startup scripts, environment, and filesystem contents.
     4
     5Inspection can identify suspicious or unexpected behavior, but '''such inspection doesn't necessarily guarantee that a container is free of malicious code'''. Trust is ultimately based on review, testing, and, ideally, verification of a signature from a trusted source.
     6
     7
     8== Signed SIF Images ==
     9
     10A signed '''.sif''' file allows users to verify that the image has not changed since it was approved and signed by a trusted source. Verification identifies the signer and confirms image integrity, but it does not guarantee that the image is safe or free of malicious content. Users should still inspect and review container contents before execution.
     11
     12For more information, see the help messages for the following sub-commands.
     13
     14 1. '''singularity sign --help''' # sign a .sif file
     15 2. '''singularity verify --help''' # verify a signed .sif file
     16 3. '''singularity key --help''' # manage keys for signed .sif files
     17 4. '''singularity inspect --help''' # inspect .sif file image components
     18
     19In the following we assume that you've already entered an idev session and loaded the module singularity/3.9.0.
     20
     21
     22{{{
     23idev --partition=centos7
     24module load singularity/3.9.0
     25}}}
     26
     27Or for workshop:
     28
     29{{{
     30idev --partition=workshop7 -c 2
     31module load singularity/3.9.0
     32}}}
     33
     34
     35== Inspecting Metadata and startup behavior ==
     36
     37{{{
     38# Where did all the image components come from?
     39singularity inspect --deffile image.sif
     40
     41# Are there any shell scripts or network I/O executed when the container starts?
     42singularity inspect --runscript image.sif
     43
     44# Are any key, behavioral environment variables modified? (PATH, LD_LIBRARY_PATH, LD_PRELOAD, etc.)
     45singularity inspect --environment image.sif
     46
     47# Inspect the author, version, build source, and other metadata.
     48singularity inspect --labels image.sif
     49}}}
     50
     51
     52== Filesystem review ==
     53
     54
     55{{{
     56# Start the container's shell
     57singularity shell image.sif
     58
     59# Is the Operating System (OS) the expected value?
     60cat /etc/os-release
     61
     62# What software is installed?
     63# Ubuntu
     64dpkg -l
     65# RHEL/CentOS/Rocky/AlmaLinux/Fedora/SUSE/OpenSUSE
     66rpm -qa
     67# Arch Linux
     68pacman -Q
     69# Alpine Linux
     70apk list --installed
     71
     72# What extra, custom software was added?
     73find /opt -type f 2>/dev/null
     74
     75# What user-installed programs and scripts were added?
     76find /usr/local -type f 2>/dev/null
     77
     78# Are there any unexpected privileged programs?
     79find / -perm -4000 2>/dev/null
     80
     81# What network capabilities are included?
     82which curl wget ssh nc netcat socat
     83
     84# Are any scheduled jobs configured to run automatically?
     85ls -R /etc/cron*
     86}}}