tis-duo-authentication icon

Duo Authentication for macOS

Paquet d'installation silencieuse pour Duo Authentication for macOS

3.0.1-2
Security
Security

  • package: tis-duo-authentication
  • name: Duo Authentication for macOS
  • version: 3.0.1-2
  • categories: Security
  • maintainer: WAPT Team,Tranquil IT,Amel FRADJ
  • editor: Duo Security
  • licence: proprietary_restricted,wapt_private
  • locale: all
  • target_os: darwin
  • architecture: all
  • signature_date:
  • size: 2.62 Mo
  • homepage : https://duo.com/

package           : tis-duo-authentication
version           : 3.0.1-2
architecture      : all
section           : base
priority          : optional
name              : Duo Authentication for macOS
categories        : Security
maintainer        : WAPT Team,Tranquil IT,Amel FRADJ
description       : Duo Authentication for macOS adds Duo two-factor authentication to macOS logins and screen unlocks.
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : darwin
min_wapt_version  : 2.3
sources           : https://duo.com/docs/checksums
installed_size    : 
impacted_process  : 
description_fr    : Duo Authentication for macOS ajoute l'authentification à deux facteurs Duo à l'ouverture de session et au déverrouillage de l'écran sous macOS.
description_pl    : Duo Authentication for macOS dodaje uwierzytelnianie dwuskładnikowe Duo do logowania i odblokowywania ekranu w systemie macOS.
description_de    : Duo Authentication for macOS fügt der Anmeldung und der Bildschirmentsperrung unter macOS die Duo-Zwei-Faktor-Authentifizierung hinzu.
description_es    : Duo Authentication for macOS añade la autenticación de dos factores de Duo al inicio de sesión y al desbloqueo de pantalla en macOS.
description_pt    : Duo Authentication for macOS adiciona a autenticação de dois fatores da Duo ao início de sessão e ao desbloqueio do ecrã no macOS.
description_it    : Duo Authentication for macOS aggiunge l'autenticazione a due fattori di Duo all'accesso e allo sblocco dello schermo su macOS.
description_nl    : Duo Authentication for macOS voegt Duo-tweefactorauthenticatie toe aan het aanmelden en het ontgrendelen van het scherm op macOS.
description_ru    : Duo Authentication for macOS добавляет двухфакторную аутентификацию Duo при входе в систему и разблокировке экрана в macOS.
audit_schedule    : 
editor            : Duo Security
keywords          : duo,mfa,2fa,two-factor,authentication,logon,maclogon
licence           : proprietary_restricted,wapt_private
homepage          : https://duo.com/
package_uuid      : f2b6353b-e969-4487-b585-6a591dbe5330
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://duo.com/docs/macos-notes
min_os_version    : 12.0
max_os_version    : 
icon_sha256sum    : abcd065c9c2956454456d76052b5e7a0623cbec840a1229d95d7edfe1cdc6bf6
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2026-11-23T16:44:51.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         : YmQldp1/S1eePzlR2pwtyt/EORvGTdIHmme4MUYj/fGTcMfWBuYzeeOm0yK2go5yQ+ONeEcagYVpzFUJ4tv7xSNKxOQSQOvT7ePIiMx3Pty4uSM6NHmHmMKEYZBqNKXjVLwxA23/37TKgypc4brnZhE0uiXXgg+zCMFSOPxrC3trv6F8v85tisWM4GcxMW4xx618+jkNianhfWj+tCKiUISv0QqFF0HC6qulv0p9yMIj0ap6eZOoevUuF2YpQG2p/IE5Cmh07RzpHR34s906jaBPj/NgjnviIfnTDRioNj24gAonmHqf62LdDG+Tm9gXzObhls9l2fTH9TcZk/fkbA==

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

r"""
Duo only provides an unconfigured pkg (MacLogon-NotConfigured-<version>.pkg): its postinstall
refuses to run without the Duo account settings, so this package must be configured before deployment.

How to configure this package:
1. Run update_package.py: it downloads the Duo pkgs and configure_maclogon.sh into this folder
2. On a Mac, from this folder, run:
       bash configure_maclogon.sh MacLogon-NotConfigured-<version>.pkg
   Enter the ikey, skey and API hostname of the "macOS" application created in the Duo Admin Panel
   (https://duo.com/docs/macos).
3. Check that the generated MacLogon-<version>.pkg is in this package folder, next to setup.py.
4. Build and upload the package.
"""


def install():
    version = control.get_software_version()

    # Duo needs the account settings to install, which luti cannot provide
    if params.get("install_with_luti", False):
        print("Running with luti: Duo MacLogon needs a configured pkg, installation skipped")
        return

    configured_pkg = f"MacLogon-{version}.pkg"
    uninstaller_name = glob.glob(f"MacLogon-Uninstaller-{version}.pkg")[0]

    if not isfile(configured_pkg):
        error(
            f"{configured_pkg} not found: this package must be configured with your Duo settings before deployment.\n"
            f"On a Mac, run: bash configure_maclogon.sh MacLogon-NotConfigured-{version}.pkg\n"
            f"so that {configured_pkg} is generated in the package folder, then build it again.\n"
            "See https://duo.com/docs/macos and the comment at the top of setup.py."
        )

    install_pkg(
        configured_pkg,
        key="pkgid:com.duosecurity.MacLogon",
        min_version=version,
    )

    for f in glob.glob(makepath(persistent_dir, "MacLogon-Uninstaller-*.pkg")):
        remove_file(f)
    filecopyto(uninstaller_name, makepath(persistent_dir, uninstaller_name))


def uninstall():
    if params.get("install_with_luti", False):
        print("Running with luti: nothing was installed")
        return

    uninstaller_path = glob.glob(makepath(persistent_dir, "MacLogon-Uninstaller-*.pkg"))[0]
    print(f"Uninstalling with: {uninstaller_path}")
    run(f'sudo installer -package "{uninstaller_path}" -target /')

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


def update_package():
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name

    os_dict = {
        "darwin-all": "https://dl.duosecurity.com/MacLogon-latest.zip",
    }
    os_type = control.target_os.split("(")[0] + "-" + ensure_list(control.architecture)[0]
    latest_url = os_dict[os_type]

    print("URL used is: %s" % latest_url)
    latest_zip = requests.head(latest_url, allow_redirects=True, proxies=proxies).headers["Content-Disposition"].split("filename=")[-1].strip('"')
    version = latest_zip.rsplit("-", 1)[-1].split(".zip")[0]
    download_url = f"https://dl.duosecurity.com/{latest_zip}"
    print(f"Latest {app_name} version is: {version}")

    if isfile(latest_zip):
        remove_file(latest_zip)
    print(f"Downloading: {latest_zip}")
    wget(download_url, latest_zip, proxies=proxies)

    with zipfile.ZipFile(latest_zip) as archive:
        for member in archive.namelist():
            if (member.endswith(".pkg") and ("NotConfigured" in member or "Uninstaller" in member)) or member.endswith("configure_maclogon.sh"):
                pkg_name = member.rsplit("/", 1)[-1]
                with archive.open(member) as source, open(pkg_name, "wb") as target:
                    target.write(source.read())
    remove_file(latest_zip)
    latest_bin = f"MacLogon-NotConfigured-{version}.pkg"
    print(f"Binary is present: {latest_bin}")

    if Version(version) > Version(control.get_software_version()):
        print(f"Software version updated (from: {control.get_software_version()} to: {Version(version)})")
        package_updated = True
    else:
        print(f"Software version up-to-date ({Version(version)})")

    for f in glob.glob("*.pkg"):
        # keep the pkg configured with configure_maclogon.sh (see setup.py)
        if f not in (latest_bin, f"MacLogon-Uninstaller-{version}.pkg", f"MacLogon-{version}.pkg"):
            remove_file(f)

    control.set_software_version(version)
    control.save_control_to_wapt()

    return package_updated

5b77749f8df13c30d0421c63f8a01da03f8298a4e6d71232be206b3de9f9ddd1 : MacLogon-NotConfigured-3.0.1.pkg
96e3fd8a18819aaf70c106a9c7214e7bec30e22beb1fede4ebe08e4e2c3de4f2 : MacLogon-Uninstaller-3.0.1.pkg
38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
6a17931c1db13f2be153e86150bd93135aa35f107a4501cc08172cdfdc0057b0 : WAPT/control
abcd065c9c2956454456d76052b5e7a0623cbec840a1229d95d7edfe1cdc6bf6 : WAPT/icon.png
cfd0eea90665cdd1f855e91fdc01397189e0036cbfffad00e1bfa8f0d56284af : configure_maclogon.sh
3e8e091ebad19f14715413ada9d32ac7caf1dd813445c76cfa9501f12801d629 : luti.json
9f66e37f75eed776341a5c857f07dc52f4de63b0eff4a56de3be8ce5aed5f171 : setup.py
206dc365f7d8f8f5eac3152413b3d892300afd7e89d57fe6d782280e22d435e1 : update_package.py