Vulnerabilities > CVE-2017-6507 - Improper Privilege Management vulnerability in multiple products

047910
CVSS 5.9 - MEDIUM
Attack vector
NETWORK
Attack complexity
HIGH
Privileges required
NONE
Confidentiality impact
NONE
Integrity impact
HIGH
Availability impact
NONE
network
high complexity
apparmor
canonical
CWE-269
nessus

Summary

An issue was discovered in AppArmor before 2.12. Incorrect handling of unknown AppArmor profiles in AppArmor init scripts, upstart jobs, and/or systemd unit files allows an attacker to possibly have increased attack surfaces of processes that were intended to be confined by AppArmor. This is due to the common logic to handle 'restart' operations removing AppArmor profiles that aren't found in the typical filesystem locations, such as /etc/apparmor.d/. Userspace projects that manage their own AppArmor profiles in atypical directories, such as what's done by LXD and Docker, are affected by this flaw in the AppArmor init script logic.

Vulnerable Configurations

Part Description Count
Application
Apparmor
1
OS
Canonical
2

Common Weakness Enumeration (CWE)

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Restful Privilege Elevation
    Rest uses standard HTTP (Get, Put, Delete) style permissions methods, but these are not necessarily correlated generally with back end programs. Strict interpretation of HTTP get methods means that these HTTP Get services should not be used to delete information on the server, but there is no access control mechanism to back up this logic. This means that unless the services are properly ACL'd and the application's service implementation are following these guidelines then an HTTP request can easily execute a delete or update on the server side. The attacker identifies a HTTP Get URL such as http://victimsite/updateOrder, which calls out to a program to update orders on a database or other resource. The URL is not idempotent so the request can be submitted multiple times by the attacker, additionally, the attacker may be able to exploit the URL published as a Get method that actually performs updates (instead of merely retrieving data). This may result in malicious or inadvertent altering of data on the server.

Nessus

  • NASL familySuSE Local Security Checks
    NASL idOPENSUSE-2017-452.NASL
    descriptionThis update for apparmor fixes the following issues : These security issues were fixed : - CVE-2017-6507: Preserve unknown profiles when reloading apparmor.service (lp#1668892, boo#1029696) - boo#1017260: Migration to apparmor.service accidentally disable AppArmor. Note: This will re-enable AppArmor if it was disabled by the last update. You
    last seen2020-06-05
    modified2017-04-11
    plugin id99277
    published2017-04-11
    reporterThis script is Copyright (C) 2017-2020 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/99277
    titleopenSUSE Security Update : apparmor (openSUSE-2017-452)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from openSUSE Security Update openSUSE-2017-452.
    #
    # The text description of this plugin is (C) SUSE LLC.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(99277);
      script_version("3.3");
      script_set_attribute(attribute:"plugin_modification_date", value:"2020/06/04");
    
      script_cve_id("CVE-2017-6507");
    
      script_name(english:"openSUSE Security Update : apparmor (openSUSE-2017-452)");
      script_summary(english:"Check for the openSUSE-2017-452 patch");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote openSUSE host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "This update for apparmor fixes the following issues :
    
    These security issues were fixed :
    
      - CVE-2017-6507: Preserve unknown profiles when reloading
        apparmor.service (lp#1668892, boo#1029696)
    
      - boo#1017260: Migration to apparmor.service accidentally
        disable AppArmor. Note: This will re-enable AppArmor if
        it was disabled by the last update. You'll need to
        'rcapparmor reload' to actually load the profiles, and
        then check aa-status for programs that need to be
        restarted to apply the profiles.
    
    These non-security issues were fixed :
    
      - Fixed crash in aa-logprof on specific change_hat events
    
      - boo#1016259: Added var.mount dependeny to
        apparmor.service
    
    The aa-remove-unknown utility was added to unload unknown profiles
    (lp#1668892)"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.opensuse.org/show_bug.cgi?id=1016259"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.opensuse.org/show_bug.cgi?id=1017260"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.opensuse.org/show_bug.cgi?id=1029696"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected apparmor packages."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:N/I:P/A:N");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:apache2-mod_apparmor");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:apache2-mod_apparmor-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:apparmor-abstractions");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:apparmor-debugsource");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:apparmor-parser");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:apparmor-parser-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:apparmor-parser-lang");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:apparmor-profiles");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:apparmor-utils");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:apparmor-utils-lang");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libapparmor-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libapparmor1");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libapparmor1-32bit");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libapparmor1-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libapparmor1-debuginfo-32bit");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:pam_apparmor");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:pam_apparmor-32bit");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:pam_apparmor-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:pam_apparmor-debuginfo-32bit");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:perl-apparmor");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:perl-apparmor-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:python3-apparmor");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:python3-apparmor-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:ruby-apparmor");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:ruby-apparmor-debuginfo");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:opensuse:42.1");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:opensuse:42.2");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2017/04/10");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/04/11");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2017-2020 Tenable Network Security, Inc.");
      script_family(english:"SuSE Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/SuSE/release", "Host/SuSE/rpm-list", "Host/cpu");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/SuSE/release");
    if (isnull(release) || release =~ "^(SLED|SLES)") audit(AUDIT_OS_NOT, "openSUSE");
    if (release !~ "^(SUSE42\.1|SUSE42\.2)$") audit(AUDIT_OS_RELEASE_NOT, "openSUSE", "42.1 / 42.2", release);
    if (!get_kb_item("Host/SuSE/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    ourarch = get_kb_item("Host/cpu");
    if (!ourarch) audit(AUDIT_UNKNOWN_ARCH);
    if (ourarch !~ "^(i586|i686|x86_64)$") audit(AUDIT_ARCH_NOT, "i586 / i686 / x86_64", ourarch);
    
    flag = 0;
    
    if ( rpm_check(release:"SUSE42.1", reference:"apache2-mod_apparmor-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"apache2-mod_apparmor-debuginfo-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"apparmor-abstractions-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"apparmor-debugsource-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"apparmor-parser-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"apparmor-parser-debuginfo-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"apparmor-parser-lang-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"apparmor-profiles-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"apparmor-utils-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"apparmor-utils-lang-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"libapparmor-devel-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"libapparmor1-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"libapparmor1-debuginfo-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"pam_apparmor-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"pam_apparmor-debuginfo-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"perl-apparmor-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"perl-apparmor-debuginfo-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"python3-apparmor-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"python3-apparmor-debuginfo-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"ruby-apparmor-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", reference:"ruby-apparmor-debuginfo-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", cpu:"x86_64", reference:"libapparmor1-32bit-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", cpu:"x86_64", reference:"libapparmor1-debuginfo-32bit-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", cpu:"x86_64", reference:"pam_apparmor-32bit-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.1", cpu:"x86_64", reference:"pam_apparmor-debuginfo-32bit-2.10.2-12.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"apache2-mod_apparmor-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"apache2-mod_apparmor-debuginfo-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"apparmor-abstractions-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"apparmor-debugsource-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"apparmor-parser-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"apparmor-parser-debuginfo-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"apparmor-parser-lang-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"apparmor-profiles-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"apparmor-utils-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"apparmor-utils-lang-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"libapparmor-devel-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"libapparmor1-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"libapparmor1-debuginfo-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"pam_apparmor-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"pam_apparmor-debuginfo-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"perl-apparmor-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"perl-apparmor-debuginfo-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"python3-apparmor-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"python3-apparmor-debuginfo-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"ruby-apparmor-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"ruby-apparmor-debuginfo-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"libapparmor1-32bit-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"libapparmor1-debuginfo-32bit-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"pam_apparmor-32bit-2.10.2-12.3.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"pam_apparmor-debuginfo-32bit-2.10.2-12.3.1") ) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "apache2-mod_apparmor / apache2-mod_apparmor-debuginfo / etc");
    }
    
  • NASL familyUbuntu Local Security Checks
    NASL idUBUNTU_USN-3247-1.NASL
    descriptionStephane Graber discovered that AppArmor incorrectly unloaded some profiles when restarted or upgraded, contrary to expected behavior. Note that Tenable Network Security has extracted the preceding description block directly from the Ubuntu security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id99094
    published2017-03-30
    reporterUbuntu Security Notice (C) 2017-2019 Canonical, Inc. / NASL script (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/99094
    titleUbuntu 12.04 LTS / 14.04 LTS / 16.04 LTS / 16.10 : apparmor vulnerability (USN-3247-1)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from Ubuntu Security Notice USN-3247-1. The text 
    # itself is copyright (C) Canonical, Inc. See 
    # <http://www.ubuntu.com/usn/>. Ubuntu(R) is a registered 
    # trademark of Canonical, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(99094);
      script_version("3.7");
      script_cvs_date("Date: 2019/09/18 12:31:46");
    
      script_cve_id("CVE-2017-6507");
      script_xref(name:"USN", value:"3247-1");
    
      script_name(english:"Ubuntu 12.04 LTS / 14.04 LTS / 16.04 LTS / 16.10 : apparmor vulnerability (USN-3247-1)");
      script_summary(english:"Checks dpkg output for updated package.");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Ubuntu host is missing a security-related patch."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Stephane Graber discovered that AppArmor incorrectly unloaded some
    profiles when restarted or upgraded, contrary to expected behavior.
    
    Note that Tenable Network Security has extracted the preceding
    description block directly from the Ubuntu security advisory. Tenable
    has attempted to automatically clean and format it as much as possible
    without introducing additional issues."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://usn.ubuntu.com/3247-1/"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected apparmor package."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:N/I:P/A:N");
      script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:apparmor");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:canonical:ubuntu_linux:12.04:-:lts");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:canonical:ubuntu_linux:14.04");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:canonical:ubuntu_linux:16.04");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:canonical:ubuntu_linux:16.10");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2017/03/24");
      script_set_attribute(attribute:"patch_publication_date", value:"2017/03/28");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/03/30");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"Ubuntu Security Notice (C) 2017-2019 Canonical, Inc. / NASL script (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Ubuntu Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/cpu", "Host/Ubuntu", "Host/Ubuntu/release", "Host/Debian/dpkg-l");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("ubuntu.inc");
    include("misc_func.inc");
    
    if ( ! get_kb_item("Host/local_checks_enabled") ) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/Ubuntu/release");
    if ( isnull(release) ) audit(AUDIT_OS_NOT, "Ubuntu");
    release = chomp(release);
    if (! preg(pattern:"^(12\.04|14\.04|16\.04|16\.10)$", string:release)) audit(AUDIT_OS_NOT, "Ubuntu 12.04 / 14.04 / 16.04 / 16.10", "Ubuntu " + release);
    if ( ! get_kb_item("Host/Debian/dpkg-l") ) 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$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Ubuntu", cpu);
    
    flag = 0;
    
    if (ubuntu_check(osver:"12.04", pkgname:"apparmor", pkgver:"2.7.102-0ubuntu3.11")) flag++;
    if (ubuntu_check(osver:"14.04", pkgname:"apparmor", pkgver:"2.10.95-0ubuntu2.6~14.04.1")) flag++;
    if (ubuntu_check(osver:"16.04", pkgname:"apparmor", pkgver:"2.10.95-0ubuntu2.6")) flag++;
    if (ubuntu_check(osver:"16.10", pkgname:"apparmor", pkgver:"2.10.95-4ubuntu5.3")) flag++;
    
    if (flag)
    {
      security_report_v4(
        port       : 0,
        severity   : SECURITY_WARNING,
        extra      : ubuntu_report_get()
      );
      exit(0);
    }
    else
    {
      tested = ubuntu_pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "apparmor");
    }
    
  • NASL familySuSE Local Security Checks
    NASL idSUSE_SU-2017-1151-1.NASL
    descriptionThis update for apparmor provides the following fixes: This security issue was fixed : - CVE-2017-6507: Preserve unknown profiles when reloading apparmor.service (bsc#1029696) The update package also includes non-security fixes. See advisory for details. Note that Tenable Network Security has extracted the preceding description block directly from the SUSE security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id99978
    published2017-05-04
    reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/99978
    titleSUSE SLED12 / SLES12 Security Update : apparmor (SUSE-SU-2017:1151-1)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from SUSE update advisory SUSE-SU-2017:1151-1.
    # The text itself is copyright (C) SUSE.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(99978);
      script_version("3.8");
      script_cvs_date("Date: 2019/09/11 11:22:15");
    
      script_cve_id("CVE-2017-6507");
    
      script_name(english:"SUSE SLED12 / SLES12 Security Update : apparmor (SUSE-SU-2017:1151-1)");
      script_summary(english:"Checks rpm output for the updated packages.");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote SUSE host is missing one or more security updates."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "This update for apparmor provides the following fixes: This security
    issue was fixed :
    
      - CVE-2017-6507: Preserve unknown profiles when reloading
        apparmor.service (bsc#1029696)
    
    The update package also includes non-security fixes. See advisory for
    details.
    
    Note that Tenable Network Security has extracted the preceding
    description block directly from the SUSE security advisory. Tenable
    has attempted to automatically clean and format it as much as possible
    without introducing additional issues."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.suse.com/show_bug.cgi?id=1000201"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.suse.com/show_bug.cgi?id=1016259"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.suse.com/show_bug.cgi?id=1022610"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.suse.com/show_bug.cgi?id=1029696"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.suse.com/show_bug.cgi?id=1031529"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.suse.com/security/cve/CVE-2017-6507/"
      );
      # https://www.suse.com/support/update/announcement/2017/suse-su-20171151-1/
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?84ada445"
      );
      script_set_attribute(
        attribute:"solution", 
        value:
    "To install this SUSE Security Update use YaST online_update.
    Alternatively you can run the command listed for your product :
    
    SUSE Linux Enterprise Software Development Kit 12-SP2:zypper in -t
    patch SUSE-SLE-SDK-12-SP2-2017-669=1
    
    SUSE Linux Enterprise Software Development Kit 12-SP1:zypper in -t
    patch SUSE-SLE-SDK-12-SP1-2017-669=1
    
    SUSE Linux Enterprise Server for Raspberry Pi 12-SP2:zypper in -t
    patch SUSE-SLE-RPI-12-SP2-2017-669=1
    
    SUSE Linux Enterprise Server 12-SP2:zypper in -t patch
    SUSE-SLE-SERVER-12-SP2-2017-669=1
    
    SUSE Linux Enterprise Server 12-SP1:zypper in -t patch
    SUSE-SLE-SERVER-12-SP1-2017-669=1
    
    SUSE Linux Enterprise Desktop 12-SP2:zypper in -t patch
    SUSE-SLE-DESKTOP-12-SP2-2017-669=1
    
    SUSE Linux Enterprise Desktop 12-SP1:zypper in -t patch
    SUSE-SLE-DESKTOP-12-SP1-2017-669=1
    
    OpenStack Cloud Magnum Orchestration 7:zypper in -t patch
    SUSE-OpenStack-Cloud-Magnum-Orchestration-7-2017-669=1
    
    To bring your system up-to-date, use 'zypper patch'."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:N/I:P/A:N");
      script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:apache2-mod_apparmor");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:apache2-mod_apparmor-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:apparmor-debugsource");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:apparmor-parser");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:apparmor-parser-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:libapparmor1");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:libapparmor1-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:pam_apparmor");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:pam_apparmor-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:perl-apparmor");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:perl-apparmor-debuginfo");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:suse_linux:12");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2017/03/24");
      script_set_attribute(attribute:"patch_publication_date", value:"2017/05/03");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/05/04");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"SuSE Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/cpu", "Host/SuSE/release", "Host/SuSE/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/SuSE/release");
    if (isnull(release) || release !~ "^(SLED|SLES)") audit(AUDIT_OS_NOT, "SUSE");
    os_ver = pregmatch(pattern: "^(SLE(S|D)\d+)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "SUSE");
    os_ver = os_ver[1];
    if (! preg(pattern:"^(SLED12|SLES12)$", string:os_ver)) audit(AUDIT_OS_NOT, "SUSE SLED12 / SLES12", "SUSE " + os_ver);
    
    if (!get_kb_item("Host/SuSE/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if (cpu !~ "^i[3-6]86$" && "x86_64" >!< cpu && "s390x" >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "SUSE " + os_ver, cpu);
    
    sp = get_kb_item("Host/SuSE/patchlevel");
    if (isnull(sp)) sp = "0";
    if (os_ver == "SLES12" && (! preg(pattern:"^(1|2)$", string:sp))) audit(AUDIT_OS_NOT, "SLES12 SP1/2", os_ver + " SP" + sp);
    if (os_ver == "SLED12" && (! preg(pattern:"^(1|2)$", string:sp))) audit(AUDIT_OS_NOT, "SLED12 SP1/2", os_ver + " SP" + sp);
    
    
    flag = 0;
    if (rpm_check(release:"SLES12", sp:"1", reference:"apache2-mod_apparmor-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"1", reference:"apache2-mod_apparmor-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"1", reference:"apparmor-debugsource-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"1", reference:"apparmor-parser-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"1", reference:"apparmor-parser-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"1", reference:"libapparmor1-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"1", reference:"libapparmor1-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"1", reference:"pam_apparmor-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"1", reference:"pam_apparmor-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"1", reference:"perl-apparmor-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"1", reference:"perl-apparmor-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"1", reference:"libapparmor1-32bit-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"1", reference:"libapparmor1-debuginfo-32bit-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"1", reference:"pam_apparmor-32bit-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"1", reference:"pam_apparmor-debuginfo-32bit-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"apache2-mod_apparmor-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"apache2-mod_apparmor-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"apparmor-debugsource-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"apparmor-parser-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"apparmor-parser-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"libapparmor1-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"libapparmor1-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"pam_apparmor-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"perl-apparmor-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"perl-apparmor-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"pam_apparmor-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"libapparmor1-32bit-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"libapparmor1-debuginfo-32bit-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"pam_apparmor-32bit-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"pam_apparmor-debuginfo-32bit-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"1", cpu:"x86_64", reference:"apparmor-debugsource-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"1", cpu:"x86_64", reference:"apparmor-parser-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"1", cpu:"x86_64", reference:"apparmor-parser-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"1", cpu:"x86_64", reference:"libapparmor1-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"1", cpu:"x86_64", reference:"libapparmor1-32bit-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"1", cpu:"x86_64", reference:"libapparmor1-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"1", cpu:"x86_64", reference:"libapparmor1-debuginfo-32bit-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"1", cpu:"x86_64", reference:"pam_apparmor-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"1", cpu:"x86_64", reference:"pam_apparmor-32bit-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"1", cpu:"x86_64", reference:"pam_apparmor-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"1", cpu:"x86_64", reference:"pam_apparmor-debuginfo-32bit-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"1", cpu:"x86_64", reference:"perl-apparmor-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"1", cpu:"x86_64", reference:"perl-apparmor-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"2", cpu:"x86_64", reference:"apparmor-debugsource-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"2", cpu:"x86_64", reference:"apparmor-parser-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"2", cpu:"x86_64", reference:"apparmor-parser-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"2", cpu:"x86_64", reference:"libapparmor1-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"2", cpu:"x86_64", reference:"libapparmor1-32bit-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"2", cpu:"x86_64", reference:"libapparmor1-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"2", cpu:"x86_64", reference:"libapparmor1-debuginfo-32bit-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"2", cpu:"x86_64", reference:"pam_apparmor-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"2", cpu:"x86_64", reference:"pam_apparmor-32bit-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"2", cpu:"x86_64", reference:"pam_apparmor-debuginfo-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"2", cpu:"x86_64", reference:"pam_apparmor-debuginfo-32bit-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"2", cpu:"x86_64", reference:"perl-apparmor-2.8.2-54.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"2", cpu:"x86_64", reference:"perl-apparmor-debuginfo-2.8.2-54.1")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "apparmor");
    }