tis-grype-portable icon

grype

Silent install package for grype

0.92.2-1

  • package: tis-grype-portable
  • name: grype
  • version: 0.92.2-1
  • categories: System and network
  • maintainer: WAPT Team,Tranquil IT,Amel FRADJ
  • licence: opensource_free,wapt_public
  • target_os: windows
  • architecture: x64
  • signature_date:
  • size: 24.66 Mo
  • homepage : https://github.com/anchore/grype

package           : tis-grype-portable
version           : 0.92.2-1
architecture      : x64
section           : base
priority          : optional
name              : grype
categories        : System and network
maintainer        : WAPT Team,Tranquil IT,Amel FRADJ
description       : A vulnerability scanner for container images and file systems
depends           : 
conflicts         : 
maturity          : PROD
locale            : 
target_os         : windows
min_wapt_version  : 2.3
sources           : 
installed_size    : 
impacted_process  : 
description_fr    : Un scanner de vulnérabilité pour les images de conteneurs et les systèmes de fichiers
description_pl    : Skaner podatności dla obrazów kontenerów i systemów plików
description_de    : Ein Schwachstellen-Scanner für Container-Images und Dateisysteme
description_es    : Un escáner de vulnerabilidades para imágenes de contenedores y sistemas de archivos
description_pt    : Um scanner de vulnerabilidades para imagens de contentores e sistemas de ficheiros
description_it    : Uno scanner di vulnerabilità per immagini e file system dei container
description_nl    : Een kwetsbaarheidsscanner voor container-images en bestandssystemen
description_ru    : Сканер уязвимостей для образов контейнеров и файловых систем
audit_schedule    : 
editor            : 
keywords          : 
licence           : opensource_free,wapt_public
homepage          : https://github.com/anchore/grype
package_uuid      : f3ca3128-b7bf-4a7f-95d1-b022be86d1ed
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : b003c383713a71e50199faede2438368cf65b9faea43021065292a9ff2e08627
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2025-05-26T13:00:21.000000
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes
signature         : MUYv+4nKNXXaqAVg5Aa5mixjFyXPuJqnbKsgq3t/atak55dCp32RGTJWMyoBTWVaT0rjtz5Hcrv8ntZdlFqFcfUrg7o7ddAwGygRuxgrtQgISkdgjM95OKgiDTh5/6uIcldUwdwkPN8jIQTJGDjZ2QSCSgDDwL3crJUjdHmI6oZYcM6ugWGjWz0KPvvh2dLMXdcYe3fTM2qrh15lklrbuZLFhocWKYTY7KmdmOmHv5ZsCGDI3ur6FvMjKdfWaTWWtiL3WUvR0svokqsS5KlGnB1mwwgujFxdNOYofolbYvJnxEgESKKrpwkqVQT5Cb/okYSZPZtXOMucVyrhHdiySg==

# -*- coding: utf-8 -*-
from setuphelpers import *

"""


"""


app_name = "grype "
editor_dir = makepath(programfiles, "grype")
app_dir = makepath(editor_dir, "grype")
app_path = makepath(app_dir, "grype.exe")
audit_version = False


def get_installed_version(app_path):
    return get_file_properties(app_path).get("FileVersion", "")


def install():
    # Declaring local variables
    zip_name = glob.glob(f"grype*.zip")[0]

    unzipped_dir = "grype"


    # Installing software
    killalltasks(ensure_list(control.impacted_process))
    if isdir(app_dir) and force:
        remove_tree(app_dir)
    mkdirs(app_dir)
    print("Extracting: %s to: %s" % (zip_name, unzipped_dir))
    unzip(zip_name, unzipped_dir)
    print('Copy grype to %s' % app_dir)
    copytree2(unzipped_dir, app_dir, onreplace=default_overwrite)
    add_to_system_path(app_path)
    

    

def audit():
    # Auditing software
    audit_status = "OK"
    installed_version = get_installed_version(app_path)
    if Version(installed_version) < Version(control.get_software_version()) and audit_version:
        print("%s is installed in version (%s) instead of (%s)" % (app_name, installed_version, control.get_software_version()))
        audit_status = "WARNING"
    elif isdir(app_dir) and not dir_is_empty(app_dir):
        print("%s (%s) is installed" % (app_name, installed_version))
        audit_status = "OK"
    else:
        print("%s is not installed" % app_name)
        audit_status = "ERROR"
    return audit_status


def uninstall():
    # Uninstalling software
    killalltasks(ensure_list(control.impacted_process))
    if isdir(app_dir):
        remove_tree(app_dir)
    if dir_is_empty(editor_dir):
        remove_tree(editor_dir)

   

# -*- coding: utf-8 -*-
from setuphelpers import *
from setupdevhelpers import *
import json

# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls


def update_package():
    result = False
    proxies = get_proxies()

    if not proxies:
        proxies = get_proxies_from_wapt_console()
    dict_arch = {
        "x64" :"_windows_amd64.zip" ,
    }
    git_repo = "anchore/grype"
    url_api = "https://api.github.com/repos/%s/releases/latest" % git_repo   
    # Getting latest version information from official sources
    print("API used is: %s" % url_api)
    json_load = json.loads(wgets(url_api, proxies=proxies))

    for download in json_load["assets"]:
        if download["browser_download_url"].endswith('.zip') and dict_arch[control.architecture] in download["browser_download_url"]:
            url_dl = download["browser_download_url"]
            version = json_load["name"].replace('v','')
            filename = download["name"]
            break

    if not isfile(filename):
        package_updated = True
        wget(url_dl,filename,proxies=proxies)

    #nettoyer les fichiers temporaires
    for f in glob.glob('*.zip'):
        if f != filename:
            remove_file(f)

    
    control.set_software_version(version)
    control.save_control_to_wapt()

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
537abf598acec16e30db329af4725c26ad15f5da4645c72c28ca779be2e7f5ed : WAPT/control
b003c383713a71e50199faede2438368cf65b9faea43021065292a9ff2e08627 : WAPT/icon.png
f93f7b40c98ec8d5918ee0cf81a58fb7770b0be1c2e7e35d4f834e9eb53a697c : grype_0.92.2_windows_amd64.zip
aaf18f292a116d00eeb2fbafa254b4131148b4c7d884fe48c6ebd747a745c53e : luti.json
ae2b6deeafef4bdca37792cd82d4348b40c2f30ca53a6a5f25f13007ab909747 : setup.py
79fd331601884223c245f1eccbb64fd8d7e58e34b07a7bb79f8853af66f5990f : update_package.py