Documentation ¶
Index ¶
- Constants
- Variables
- func CapabilityAdd(capFile string, c CapManageConfig) error
- func CapabilityAvail(c CapAvailConfig) error
- func CapabilityDrop(capFile string, c CapManageConfig) error
- func CapabilityList(capFile string, c CapListConfig) error
- func CleanApptainerCache(imgCache *cache.Handle, dryRun bool, cacheCleanTypes []string, days int) error
- func CompilePlugin(sourceDir, destSif, buildTags string) error
- func CreatePlugin(dir, name string) error
- func DeleteImage(ctx context.Context, clientConfig *client.Config, imageRef, arch string) error
- func DisablePlugin(name, libexecdir string) error
- func EnablePlugin(name string) error
- func FakerootConfig(username string, op FakerootConfigOp) error
- func GlobalConfig(args []string, configFile string, dry bool, op GlobalConfigOp) error
- func InspectPlugin(name string) error
- func InstallPlugin(pluginPath string) error
- func InstanceStats(ctx context.Context, name, instanceUser string, formatJSON bool, noStream bool) error
- func LibraryPush(ctx context.Context, pushSpec LibraryPushSpec, libraryConfig *client.Config, ...) error
- func ListApptainerCache(imgCache *cache.Handle, cacheListTypes []string, cacheListVerbose bool) error
- func ListPlugins() error
- func OCSPVerify(chain ...*x509.Certificate) error
- func OciAttach(ctx context.Context, containerID string) error
- func OciCreate(containerID string, args *OciArgs) error
- func OciDelete(ctx context.Context, containerID string) error
- func OciExec(containerID string, cmdArgs []string) error
- func OciKill(containerID string, killSignal string, killTimeout int) error
- func OciMount(image string, bundle string) error
- func OciPauseResume(containerID string, pause bool) error
- func OciRun(ctx context.Context, containerID string, args *OciArgs) error
- func OciStart(containerID string) error
- func OciState(containerID string, args *OciArgs) error
- func OciUmount(bundle string) error
- func OciUpdate(containerID string, args *OciArgs) error
- func OverlayCreate(size int, imgPath string, overlaySparse bool, isFakeroot bool, ...) error
- func PrintInstanceList(w io.Writer, name, user string, formatJSON bool, showLogs bool) error
- func RemoteAdd(configFile, name, uri string, global bool, insecure bool) (err error)
- func RemoteAddKeyserver(name, uri string, order uint32, insecure bool) error
- func RemoteGetLoginPassword(config *scslibclient.Config) (string, error)
- func RemoteList(usrConfigFile string) (err error)
- func RemoteLogin(usrConfigFile string, args *LoginArgs) (err error)
- func RemoteLogout(usrConfigFile, name string) (err error)
- func RemoteRemove(configFile, name string) (err error)
- func RemoteRemoveKeyserver(name, uri string) error
- func RemoteStatus(usrConfigFile, name string) (err error)
- func RemoteUse(usrConfigFile, name string, global, exclusive bool) (err error)
- func Sign(ctx context.Context, path string, opts ...SignOpt) error
- func StopInstance(name, user string, sig syscall.Signal, timeout time.Duration) error
- func UninstallPlugin(name string) error
- func Verify(ctx context.Context, path string, opts ...VerifyOpt) error
- func VerifyFingerprints(ctx context.Context, path string, fingerprints []string, opts ...VerifyOpt) error
- func WriteInstancePidFile(name, pidFile string) error
- type CapAvailConfig
- type CapListConfig
- type CapManageConfig
- type FakerootConfigOp
- type GlobalConfigOp
- type LibraryPushSpec
- type LoginArgs
- type OciArgs
- type SignOpt
- type VerifyCallback
- type VerifyOpt
- func OptVerifyAll() VerifyOpt
- func OptVerifyCallback(cb VerifyCallback) VerifyOpt
- func OptVerifyGroup(groupID uint32) VerifyOpt
- func OptVerifyLegacy() VerifyOpt
- func OptVerifyObject(id uint32) VerifyOpt
- func OptVerifyWithCertificate(c *x509.Certificate) VerifyOpt
- func OptVerifyWithIntermediates(p *x509.CertPool) VerifyOpt
- func OptVerifyWithOCSP() VerifyOpt
- func OptVerifyWithPGP(opts ...client.Option) VerifyOpt
- func OptVerifyWithRoots(p *x509.CertPool) VerifyOpt
- func OptVerifyWithVerifier(sv signature.Verifier) VerifyOpt
Constants ¶
const ( // PKIXOCSPNoCheck refers to the Revocation Checking of an Authorized Responder. // More more info check https://oidref.com/1.3.6.1.5.5.7.48.1.5 PKIXOCSPNoCheck = "1.3.6.1.5.5.7.48.1.5" )
Variables ¶
var ErrLibraryUnsigned = errors.New("image is not signed")
ErrLibraryUnsigned indicated that the image intended to be used is not signed, nor has an override for requiring a signature been provided
var ErrLoginAborted = errors.New("user aborted login")
ErrLoginAborted is raised when the login process has been aborted by the user
Functions ¶
func CapabilityAdd ¶
func CapabilityAdd(capFile string, c CapManageConfig) error
CapabilityAdd adds the specified capability set to the capability file
func CapabilityAvail ¶
func CapabilityAvail(c CapAvailConfig) error
CapabilityAvail lists the capabilities based on the CapAvailConfig
func CapabilityDrop ¶
func CapabilityDrop(capFile string, c CapManageConfig) error
CapabilityDrop drops the specified capability set from the capability file
func CapabilityList ¶
func CapabilityList(capFile string, c CapListConfig) error
CapabilityList lists the capabilities based on the CapListConfig
func CleanApptainerCache ¶
func CleanApptainerCache(imgCache *cache.Handle, dryRun bool, cacheCleanTypes []string, days int) error
CleanApptainerCache is the main function that drives all these other functions. If force is true, remove the entries, otherwise only provide a summary of what would have been done. If cacheCleanTypes contains something, only clean that type. The special value "all" is interpreted as "all types of entries". If cacheName contains something, clean only cache entries matching that name.
func CompilePlugin ¶
CompilePlugin compiles a plugin. It takes as input: sourceDir, the path to the plugin's source code directory; and destSif, the path to the intended final location of the plugin SIF file.
func CreatePlugin ¶
CreatePlugin create the plugin directory skeleton.
func DeleteImage ¶
DeleteImage deletes an image from a remote library.
func DisablePlugin ¶
DisablePlugin disables the named plugin.
func FakerootConfig ¶
func FakerootConfig(username string, op FakerootConfigOp) error
FakerootConfig allows to add/remove/enable/disable a user fakeroot mapping entry in /etc/subuid and /etc/subgid files.
func GlobalConfig ¶
func GlobalConfig(args []string, configFile string, dry bool, op GlobalConfigOp) error
GlobalConfig allows to set/unset/reset a configuration directive value in apptainer.conf
func InstallPlugin ¶
InstallPlugin takes a plugin located at path and installs it into the apptainer plugin installation directory.
Installing a plugin will also automatically enable it.
func InstanceStats ¶ added in v1.1.0
func InstanceStats(ctx context.Context, name, instanceUser string, formatJSON bool, noStream bool) error
InstanceStats uses underlying cgroups to get statistics for a named instance
func LibraryPush ¶
func LibraryPush(ctx context.Context, pushSpec LibraryPushSpec, libraryConfig *client.Config, co []keyClient.Option) error
LibraryPush will upload an image file according to the provided LibraryPushSpec Before uploading, the image will be checked for a valid signature unless AllowUnsigned is true
func ListApptainerCache ¶
func ListApptainerCache(imgCache *cache.Handle, cacheListTypes []string, cacheListVerbose bool) error
ListApptainerCache will list the local apptainer cache for the types specified by cacheListTypes. If cacheListTypes contains the value "all", all the cache entries are considered. If cacheListVerbose is true, the entries will be shown in the output, otherwise only a summary is provided.
func ListPlugins ¶
func ListPlugins() error
ListPlugins lists the apptainer plugins installed in the plugin plugin installation directory.
func OCSPVerify ¶ added in v1.2.0
func OCSPVerify(chain ...*x509.Certificate) error
func OciPauseResume ¶
OciPauseResume pauses/resumes processes in a container
func OverlayCreate ¶
func OverlayCreate(size int, imgPath string, overlaySparse bool, isFakeroot bool, overlayDirs ...string) error
OverlayCreate creates the overlay with an optional size, image path, dirs, fakeroot and sparse option.
func PrintInstanceList ¶
PrintInstanceList fetches instance list, applying name and user filters, and prints it in a regular or a JSON format (if formatJSON is true) to the passed writer. Additionally, fetches log paths (if showLogs is true).
func RemoteAddKeyserver ¶
func RemoteGetLoginPassword ¶ added in v1.2.0
func RemoteGetLoginPassword(config *scslibclient.Config) (string, error)
RemoteGetLoginPassword retrieves cli token from oci library shim
func RemoteList ¶
RemoteList prints information about remote configurations
func RemoteLogin ¶
RemoteLogin logs in remote by setting API token If the supplied remote name is an empty string, it will attempt to use the default remote.
func RemoteLogout ¶
RemoteLogout logs out from an endpoint or service.
func RemoteRemove ¶
RemoteRemove deletes a remote endpoint from the configuration
func RemoteRemoveKeyserver ¶
func RemoteStatus ¶
RemoteStatus checks status of services related to an endpoint If the supplied remote name is an empty string, it will attempt to use the default remote.
func Sign ¶
Sign adds one or more digital signatures to the SIF image found at path, according to opts. Key material must be provided via OptSignEntitySelector.
By default, one digital signature is added per object group in f. To override this behavior, consider using OptSignGroup and/or OptSignObject.
func StopInstance ¶
StopInstance fetches instance list, applying name and user filters, and stops them by sending a signal sig. If an instance is still running after a grace period defined by timeout is expired, it will be forcibly killed.
func UninstallPlugin ¶
UninstallPlugin removes the named plugin from the system.
func Verify ¶
Verify verifies digital signature(s) in the SIF image found at path, according to opts.
To use key material from an x.509 certificate, use OptVerifyWithCertificate. The system roots or the platform verifier will be used to verify the certificate, unless OptVerifyWithIntermediates and/or OptVerifyWithRoots are specified.
To use raw key material, use OptVerifyWithVerifier.
To use PGP key material, use OptVerifyWithPGP.
By default, non-legacy signatures for all object groups are verified. To override the default behavior, consider using OptVerifyGroup, OptVerifyObject, OptVerifyAll, and/or OptVerifyLegacy.
func VerifyFingerprints ¶
func VerifyFingerprints(ctx context.Context, path string, fingerprints []string, opts ...VerifyOpt) error
VerifyFingerprints verifies an image and checks it was signed by *all* of the provided fingerprints.
To use key material from an x.509 certificate, use OptVerifyWithCertificate. The system roots or the platform verifier will be used to verify the certificate, unless OptVerifyWithIntermediates and/or OptVerifyWithRoots are specified.
To use raw key material, use OptVerifyWithVerifier.
To use PGP key material, use OptVerifyWithPGP.
By default, non-legacy signatures for all object groups are verified. To override the default behavior, consider using OptVerifyGroup, OptVerifyObject, OptVerifyAll, and/or OptVerifyLegacy.
func WriteInstancePidFile ¶
WriteInstancePidFile fetches instance's PID and writes it to the pidFile, truncating it if it already exists. Note that the name should not be a glob, i.e. name should identify a single instance only, otherwise an error is returned.
Types ¶
type CapAvailConfig ¶
CapAvailConfig instructs CapabilityAvail on what capability to list/describe
type CapListConfig ¶
CapListConfig instructs CapabilityList on what to list
type CapManageConfig ¶
CapManageConfig specifies what capability set to edit in the capability file
type FakerootConfigOp ¶
type FakerootConfigOp uint8
FakerootConfigOp defines a type for a fakeroot configuration operation.
const ( // FakerootAddUser is the operation to add a user fakeroot mapping. FakerootAddUser FakerootConfigOp = iota // FakerootRemoveUser is the operation to remove a user fakeroot mapping. FakerootRemoveUser // FakerootEnableUser is the operation to enable a user fakeroot mapping. FakerootEnableUser // FakerootDisableUser is the operation to disable a user fakeroot mapping. FakerootDisableUser )
type GlobalConfigOp ¶
type GlobalConfigOp uint8
GlobalConfigOp defines a type for a global configuration operation.
const ( // GlobalConfigSet is the operation to set a configuration directive value. GlobalConfigSet GlobalConfigOp = iota // GlobalConfigUnset is the operation to unset a configuration directive value. GlobalConfigUnset // GlobalConfigGet is the operation to get a configuration directive value. GlobalConfigGet // GlobalConfigReset is the operation to reset a configuration directive value. GlobalConfigReset )
type LibraryPushSpec ¶
type LibraryPushSpec struct { // SourceFile is the path to the container image to be pushed to the library SourceFile string // DestRef is the destination reference that the container image will be pushed to in the library DestRef string // Description is an optional string that describes the container image Description string // AllowUnsigned must be set to true to allow push of an unsigned container image to succeed AllowUnsigned bool // FrontendURI is the URI for the frontend FrontendURI string }
LibraryPushSpec describes how a source image file should be pushed to a library server
type OciArgs ¶
type OciArgs struct { BundlePath string LogPath string LogFormat string SyncSocketPath string PidFile string FromFile string KillSignal string KillTimeout uint32 EmptyProcess bool ForceKill bool }
OciArgs contains CLI arguments
type SignOpt ¶
type SignOpt func(s *signer) error
SignOpt are used to configure s.
func OptSignEntitySelector ¶
func OptSignEntitySelector(f sypgp.EntitySelector) SignOpt
OptSignEntitySelector specifies f be used to select (and decrypt, if necessary) the entity to use to generate signature(s).
func OptSignGroup ¶
OptSignGroup specifies that a signature be applied to cover all objects in the group with the specified groupID. This may be called multiple times to add multiple group signatures.
func OptSignObjects ¶
OptSignObjects specifies that one or more signature(s) be applied to cover objects with the specified ids. One signature will be applied for each group ID associated with the object(s). This may be called multiple times to add multiple signatures.
func OptSignWithSigner ¶ added in v1.2.0
OptSignWithSigner specifies ss be used to generate signature(s).
type VerifyCallback ¶
type VerifyCallback func(*sif.FileImage, integrity.VerifyResult) bool
type VerifyOpt ¶
type VerifyOpt func(v *verifier) error
VerifyOpt are used to configure v.
func OptVerifyAll ¶
func OptVerifyAll() VerifyOpt
OptVerifyAll adds one verification task per non-signature object in the image when verification of legacy signatures is enabled. When verification of legacy signatures is disabled (the default), this option has no effect.
func OptVerifyCallback ¶
func OptVerifyCallback(cb VerifyCallback) VerifyOpt
OptVerifyCallback registers f as the verification callback.
func OptVerifyGroup ¶
OptVerifyGroup adds a verification task for the group with the specified groupID. This may be called multiple times to request verification of more than one group.
func OptVerifyLegacy ¶
func OptVerifyLegacy() VerifyOpt
OptVerifyLegacy enables verification of legacy signatures.
func OptVerifyObject ¶
OptVerifyObject adds a verification task for the object with the specified id. This may be called multiple times to request verification of more than one object.
func OptVerifyWithCertificate ¶ added in v1.2.0
func OptVerifyWithCertificate(c *x509.Certificate) VerifyOpt
OptVerifyWithCertificate appends c as a source of key material to verify signatures.
func OptVerifyWithIntermediates ¶ added in v1.2.0
OptVerifyWithIntermediates specifies p as the pool of certificates that can be used to form a chain from the leaf certificate to a root certificate.
func OptVerifyWithOCSP ¶ added in v1.2.0
func OptVerifyWithOCSP() VerifyOpt
OptVerifyWithOCSP subjects the x509 certificate chains to online revocation checks, before the leaf certificate is deemed as trusted for validating the signature.
func OptVerifyWithPGP ¶ added in v1.2.0
OptVerifyWithPGP adds the local public keyring as a source of key material to verify signatures. If supplied, opts specify a keyserver to use in addition to the local public keyring.
func OptVerifyWithRoots ¶ added in v1.2.0
OptVerifyWithRoots specifies p as the pool of root certificates to use, instead of the system roots or the platform verifier.
func OptVerifyWithVerifier ¶ added in v1.2.0
OptVerifyWithVerifier appends sv as a source of key material to verify signatures.
Source Files ¶
- cache_clean_linux.go
- cache_list_linux.go
- capability_avail_linux.go
- capability_list_linux.go
- capability_manage_linux.go
- config_fakeroot_linux.go
- config_global_linux.go
- delete.go
- instance_linux.go
- oci_attach_linux.go
- oci_create_linux.go
- oci_delete_linux.go
- oci_exec_linux.go
- oci_kill_linux.go
- oci_linux.go
- oci_mount_linux.go
- oci_pause_linux.go
- oci_run_linux.go
- oci_start_linux.go
- oci_state_linux.go
- oci_update_linux.go
- overlay_create.go
- plugin_compile_linux.go
- plugin_create_linux.go
- plugin_disable_linux.go
- plugin_enable_linux.go
- plugin_inspect_linux.go
- plugin_install_linux.go
- plugin_list_linux.go
- plugin_uninstall_linux.go
- push.go
- remote_add.go
- remote_add_keyserver.go
- remote_get_login_password.go
- remote_list.go
- remote_login.go
- remote_logout.go
- remote_remove.go
- remote_remove_keyserver.go
- remote_status.go
- remote_use.go
- sign.go
- verify.go
- verify_ocsp.go