RHEL 8 : container-tools:rhel8 (RHSA-2020:3053)

2020-07-21T00:00:00
ID REDHAT-RHSA-2020-3053.NASL
Type nessus
Reporter This script is Copyright (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof.
Modified 2020-07-21T00:00:00

Description

The remote Redhat Enterprise Linux 8 host has packages installed that are affected by a vulnerability as referenced in the RHSA-2020:3053 advisory.

  • QEMU: slirp: use-after-free in ip_reass() function in ip_input.c (CVE-2020-1983)

Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version number.

                                        
                                            ##
# (C) Tenable Network Security, Inc.
#
# The descriptive text and package checks in this plugin were
# extracted from Red Hat Security Advisory RHSA-2020:3053. The text
# itself is copyright (C) Red Hat, Inc.
##

include('compat.inc');

if (description)
{
  script_id(138804);
  script_version("1.3");
  script_set_attribute(attribute:"plugin_modification_date", value:"2020/11/18");

  script_cve_id("CVE-2020-1983");
  script_xref(name:"RHSA", value:"2020:3053");

  script_name(english:"RHEL 8 : container-tools:rhel8 (RHSA-2020:3053)");
  script_summary(english:"Checks the rpm output for the updated packages");

  script_set_attribute(attribute:"synopsis", value:
"The remote Red Hat host is missing a security update.");
  script_set_attribute(attribute:"description", value:
"The remote Redhat Enterprise Linux 8 host has packages installed that are affected by a vulnerability as referenced in the RHSA-2020:3053 advisory.

  - QEMU: slirp: use-after-free in ip_reass() function in     ip_input.c (CVE-2020-1983)

Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version number.");
  script_set_attribute(attribute:"see_also", value:"https://cwe.mitre.org/data/definitions/416.html");
  script_set_attribute(attribute:"see_also", value:"https://access.redhat.com/security/cve/CVE-2020-1983");
  script_set_attribute(attribute:"see_also", value:"https://access.redhat.com/errata/RHSA-2020:3053");
  script_set_attribute(attribute:"see_also", value:"https://bugzilla.redhat.com/1829825");
  script_set_attribute(attribute:"solution", value:
"Update the affected packages.");
  script_set_cvss_base_vector("CVSS2#AV:L/AC:L/Au:N/C:N/I:N/A:P");
  script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2020-1983");

  script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
  script_cwe_id(416);

  script_set_attribute(attribute:"vuln_publication_date", value:"2020/04/22");
  script_set_attribute(attribute:"patch_publication_date", value:"2020/07/21");
  script_set_attribute(attribute:"plugin_publication_date", value:"2020/07/21");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:8");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:rhel_eus:8.4");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:redhat:enterprise_linux:8::appstream");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:redhat:rhel_eus:8.4::appstream");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:buildah");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:buildah-debugsource");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:buildah-tests");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:cockpit-podman");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:conmon");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:container-selinux");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:containernetworking-plugins");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:containernetworking-plugins-debugsource");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:containers-common");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:crit");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:criu");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:criu-debugsource");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:fuse-overlayfs");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:fuse-overlayfs-debugsource");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:libslirp");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:libslirp-debugsource");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:libslirp-devel");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:podman");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:podman-debugsource");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:podman-docker");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:podman-remote");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:podman-tests");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:python-podman-api");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:python3-criu");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:runc");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:runc-debugsource");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:skopeo");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:skopeo-debugsource");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:skopeo-tests");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:slirp4netns");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:slirp4netns-debugsource");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:toolbox");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:udica");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Red Hat Local Security Checks");

  script_copyright(english:"This script is Copyright (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/local_checks_enabled", "Host/RedHat/release", "Host/RedHat/rpm-list", "Host/cpu");

  exit(0);
}


include('audit.inc');
include('global_settings.inc');
include('misc_func.inc');
include('rpm.inc');

if (!get_kb_item('Host/local_checks_enabled')) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
release = get_kb_item('Host/RedHat/release');
if (isnull(release) || 'Red Hat' >!< release) audit(AUDIT_OS_NOT, 'Red Hat');
os_ver = pregmatch(pattern: "Red Hat Enterprise Linux.*release ([0-9]+(\.[0-9]+)?)", string:release);
if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, 'Red Hat');
os_ver = os_ver[1];
if (! preg(pattern:"^8([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, 'Red Hat 8.x', 'Red Hat ' + os_ver);

if (!get_kb_item('Host/RedHat/rpm-list')) audit(AUDIT_PACKAGE_LIST_MISSING);

cpu = get_kb_item('Host/cpu');
if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
if ('x86_64' >!< cpu && cpu !~ "^i[3-6]86$" && 's390' >!< cpu && 'aarch64' >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, 'Red Hat', cpu);

repositories = {
    'enterprise_linux_8_appstream': [
      'rhel-8-for-aarch64-appstream-debug-rpms',
      'rhel-8-for-aarch64-appstream-rpms',
      'rhel-8-for-aarch64-appstream-source-rpms',
      'rhel-8-for-s390x-appstream-debug-rpms',
      'rhel-8-for-s390x-appstream-rpms',
      'rhel-8-for-s390x-appstream-source-rpms',
      'rhel-8-for-x86_64-appstream-debug-rpms',
      'rhel-8-for-x86_64-appstream-rpms',
      'rhel-8-for-x86_64-appstream-source-rpms'
    ]
};

found_repos = NULL;
host_repo_list = get_kb_list('Host/RedHat/repo-list/*');
if (!(empty_or_null(host_repo_list))) {
  found_repos = make_list();
  foreach repo_key (keys(repositories)) {
    foreach repo ( repositories[repo_key] ) {
      if (get_kb_item('Host/RedHat/repo-list/' + repo)) {
        append_element(var:found_repos, value:repo_key);
        break;
      }
    }
  }
  if(empty_or_null(found_repos)) audit(AUDIT_RHSA_NOT_AFFECTED, 'RHSA-2020:3053');
}

module_ver = get_kb_item('Host/RedHat/appstream/container-tools');
if (isnull(module_ver)) audit(AUDIT_PACKAGE_NOT_INSTALLED, 'Module container-tools:rhel8');
if ('rhel8' >!< module_ver) audit(AUDIT_PACKAGE_NOT_AFFECTED, 'Module container-tools:' + module_ver);

appstreams = {
    'container-tools:rhel8': [
      {'reference':'buildah-1.14.9-1.module+el8.2.1+6689+748e6520', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'buildah-1.14.9-1.module+el8.2.1+6689+748e6520', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'buildah-1.14.9-1.module+el8.2.1+6689+748e6520', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'buildah-debugsource-1.14.9-1.module+el8.2.1+6689+748e6520', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'buildah-debugsource-1.14.9-1.module+el8.2.1+6689+748e6520', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'buildah-debugsource-1.14.9-1.module+el8.2.1+6689+748e6520', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'buildah-tests-1.14.9-1.module+el8.2.1+6689+748e6520', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'buildah-tests-1.14.9-1.module+el8.2.1+6689+748e6520', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'buildah-tests-1.14.9-1.module+el8.2.1+6689+748e6520', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'cockpit-podman-17-1.module+el8.2.1+6636+bf4db4ab', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'allowmaj':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'conmon-2.0.17-1.module+el8.2.1+6771+3533eb4c', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'epoch':'2', 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'conmon-2.0.17-1.module+el8.2.1+6771+3533eb4c', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'epoch':'2', 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'conmon-2.0.17-1.module+el8.2.1+6771+3533eb4c', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'epoch':'2', 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'container-selinux-2.135.0-1.module+el8.2.1+6849+893e4f4a', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'epoch':'2', 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'containernetworking-plugins-0.8.6-1.module+el8.2.1+6626+598993b4', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'containernetworking-plugins-0.8.6-1.module+el8.2.1+6626+598993b4', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'containernetworking-plugins-0.8.6-1.module+el8.2.1+6626+598993b4', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'containernetworking-plugins-debugsource-0.8.6-1.module+el8.2.1+6626+598993b4', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'containernetworking-plugins-debugsource-0.8.6-1.module+el8.2.1+6626+598993b4', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'containernetworking-plugins-debugsource-0.8.6-1.module+el8.2.1+6626+598993b4', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'containers-common-1.0.0-1.module+el8.2.1+6676+604e1b26', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'epoch':'1', 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'containers-common-1.0.0-1.module+el8.2.1+6676+604e1b26', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'epoch':'1', 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'containers-common-1.0.0-1.module+el8.2.1+6676+604e1b26', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'epoch':'1', 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'crit-3.14-2.module+el8.2.1+6750+e53a300c', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'crit-3.14-2.module+el8.2.1+6750+e53a300c', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'crit-3.14-2.module+el8.2.1+6750+e53a300c', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'criu-3.14-2.module+el8.2.1+6750+e53a300c', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'criu-3.14-2.module+el8.2.1+6750+e53a300c', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'criu-3.14-2.module+el8.2.1+6750+e53a300c', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'criu-debugsource-3.14-2.module+el8.2.1+6750+e53a300c', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'criu-debugsource-3.14-2.module+el8.2.1+6750+e53a300c', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'criu-debugsource-3.14-2.module+el8.2.1+6750+e53a300c', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'fuse-overlayfs-1.0.0-2.module+el8.2.1+6465+1a51e8b6', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'fuse-overlayfs-1.0.0-2.module+el8.2.1+6465+1a51e8b6', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'fuse-overlayfs-1.0.0-2.module+el8.2.1+6465+1a51e8b6', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'fuse-overlayfs-debugsource-1.0.0-2.module+el8.2.1+6465+1a51e8b6', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'fuse-overlayfs-debugsource-1.0.0-2.module+el8.2.1+6465+1a51e8b6', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'fuse-overlayfs-debugsource-1.0.0-2.module+el8.2.1+6465+1a51e8b6', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'libslirp-4.3.0-3.module+el8.2.1+6816+bedf4f91', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'libslirp-4.3.0-3.module+el8.2.1+6816+bedf4f91', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'libslirp-4.3.0-3.module+el8.2.1+6816+bedf4f91', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'libslirp-debugsource-4.3.0-3.module+el8.2.1+6816+bedf4f91', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'libslirp-debugsource-4.3.0-3.module+el8.2.1+6816+bedf4f91', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'libslirp-debugsource-4.3.0-3.module+el8.2.1+6816+bedf4f91', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'libslirp-devel-4.3.0-3.module+el8.2.1+6816+bedf4f91', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'libslirp-devel-4.3.0-3.module+el8.2.1+6816+bedf4f91', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'libslirp-devel-4.3.0-3.module+el8.2.1+6816+bedf4f91', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'podman-1.9.3-2.module+el8.2.1+6867+366c07d6', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'podman-1.9.3-2.module+el8.2.1+6867+366c07d6', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'podman-1.9.3-2.module+el8.2.1+6867+366c07d6', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'podman-debugsource-1.9.3-2.module+el8.2.1+6867+366c07d6', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'podman-debugsource-1.9.3-2.module+el8.2.1+6867+366c07d6', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'podman-debugsource-1.9.3-2.module+el8.2.1+6867+366c07d6', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'podman-docker-1.9.3-2.module+el8.2.1+6867+366c07d6', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'podman-remote-1.9.3-2.module+el8.2.1+6867+366c07d6', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'podman-remote-1.9.3-2.module+el8.2.1+6867+366c07d6', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'podman-remote-1.9.3-2.module+el8.2.1+6867+366c07d6', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'podman-tests-1.9.3-2.module+el8.2.1+6867+366c07d6', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'podman-tests-1.9.3-2.module+el8.2.1+6867+366c07d6', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'podman-tests-1.9.3-2.module+el8.2.1+6867+366c07d6', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'python-podman-api-1.2.0-0.2.gitd0a45fe.module+el8.2.1+6465+1a51e8b6', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'python3-criu-3.14-2.module+el8.2.1+6750+e53a300c', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'python3-criu-3.14-2.module+el8.2.1+6750+e53a300c', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'python3-criu-3.14-2.module+el8.2.1+6750+e53a300c', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'runc-1.0.0-66.rc10.module+el8.2.1+6465+1a51e8b6', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'runc-1.0.0-66.rc10.module+el8.2.1+6465+1a51e8b6', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'runc-1.0.0-66.rc10.module+el8.2.1+6465+1a51e8b6', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'runc-debugsource-1.0.0-66.rc10.module+el8.2.1+6465+1a51e8b6', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'runc-debugsource-1.0.0-66.rc10.module+el8.2.1+6465+1a51e8b6', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'runc-debugsource-1.0.0-66.rc10.module+el8.2.1+6465+1a51e8b6', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'skopeo-1.0.0-1.module+el8.2.1+6676+604e1b26', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'epoch':'1', 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'skopeo-1.0.0-1.module+el8.2.1+6676+604e1b26', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'epoch':'1', 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'skopeo-1.0.0-1.module+el8.2.1+6676+604e1b26', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'epoch':'1', 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'skopeo-debugsource-1.0.0-1.module+el8.2.1+6676+604e1b26', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'epoch':'1', 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'skopeo-debugsource-1.0.0-1.module+el8.2.1+6676+604e1b26', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'epoch':'1', 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'skopeo-debugsource-1.0.0-1.module+el8.2.1+6676+604e1b26', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'epoch':'1', 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'skopeo-tests-1.0.0-1.module+el8.2.1+6676+604e1b26', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'epoch':'1', 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'skopeo-tests-1.0.0-1.module+el8.2.1+6676+604e1b26', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'epoch':'1', 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'skopeo-tests-1.0.0-1.module+el8.2.1+6676+604e1b26', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'epoch':'1', 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'slirp4netns-1.0.1-1.module+el8.2.1+6595+03641d72', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'slirp4netns-1.0.1-1.module+el8.2.1+6595+03641d72', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'slirp4netns-1.0.1-1.module+el8.2.1+6595+03641d72', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'slirp4netns-debugsource-1.0.1-1.module+el8.2.1+6595+03641d72', 'cpu':'aarch64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'slirp4netns-debugsource-1.0.1-1.module+el8.2.1+6595+03641d72', 'cpu':'s390x', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'slirp4netns-debugsource-1.0.1-1.module+el8.2.1+6595+03641d72', 'cpu':'x86_64', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'toolbox-0.0.7-1.module+el8.2.1+6465+1a51e8b6', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']},
      {'reference':'udica-0.2.1-2.module+el8.2.1+6465+1a51e8b6', 'release':'8', 'el_string':'el8.2.1', 'rpm_spec_vers_cmp':TRUE, 'repo_list':['enterprise_linux_8_appstream']}
    ]
};

flag = 0;
appstreams_found = 0;
foreach module (keys(appstreams)) {
  appstream = NULL;
  appstream_name = NULL;
  appstream_version = NULL;
  appstream_split = split(module, sep:':', keep:FALSE);
  if (!empty_or_null(appstream_split)) {
    appstream_name = appstream_split[0];
    appstream_version = appstream_split[1];
    if (!empty_or_null(appstream_name)) appstream = get_one_kb_item('Host/RedHat/appstream/' + appstream_name);
  }
  if (!empty_or_null(appstream) && appstream_version == appstream || appstream_name == 'all') {
    appstreams_found++;
    foreach package_array ( appstreams[module] ) {
      reference = NULL;
      release = NULL;
      sp = NULL;
      cpu = NULL;
      el_string = NULL;
      rpm_spec_vers_cmp = NULL;
      epoch = NULL;
      allowmaj = NULL;
      repo_list = NULL;
      if (!empty_or_null(package_array['repo_list'])) repo_list = package_array['repo_list'];
      if (!empty_or_null(package_array['reference'])) reference = package_array['reference'];
      if (!empty_or_null(package_array['release'])) release = 'RHEL' + package_array['release'];
      if (!empty_or_null(package_array['sp'])) sp = package_array['sp'];
      if (!empty_or_null(package_array['cpu'])) cpu = package_array['cpu'];
      if (!empty_or_null(package_array['el_string'])) el_string = package_array['el_string'];
      if (!empty_or_null(package_array['rpm_spec_vers_cmp'])) rpm_spec_vers_cmp = package_array['rpm_spec_vers_cmp'];
      if (!empty_or_null(package_array['epoch'])) epoch = package_array['epoch'];
      if (!empty_or_null(package_array['allowmaj'])) allowmaj = package_array['allowmaj'];
      if (reference && release) {
        repocheck = FALSE;
        if (empty_or_null(found_repos))
        {
          repocheck = TRUE;
        }
        else
        {
          foreach repo (repo_list) {
            if (contains_element(var:found_repos, value:repo))
            {
              repocheck = TRUE;
              break;
            }
          }
        }
        if (repocheck && rpm_check(release:release, sp:sp, cpu:cpu, reference:reference, epoch:epoch, el_string:el_string, rpm_spec_vers_cmp:rpm_spec_vers_cmp, allowmaj:allowmaj)) flag++;
      }
    }
  }
}

if (!appstreams_found) audit(AUDIT_PACKAGE_NOT_INSTALLED, 'Module container-tools:rhel8');

if (flag)
{
  if (empty_or_null(host_repo_list)) extra = rpm_report_get() + redhat_report_repo_caveat();
  else extra = rpm_report_get();
  security_report_v4(
      port       : 0,
      severity   : SECURITY_NOTE,
      extra      : extra
  );
  exit(0);
}
else
{
  tested = pkg_tests_get();
  if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
  else audit(AUDIT_PACKAGE_NOT_INSTALLED, 'buildah / buildah-debugsource / buildah-tests / cockpit-podman / etc');
}