{"id":22138957,"url":"https://github.com/cwaldbieser/globalprotect_cli","last_synced_at":"2025-10-26T18:35:06.848Z","repository":{"id":141567532,"uuid":"283840967","full_name":"cwaldbieser/globalprotect_cli","owner":"cwaldbieser","description":"Helper script to allow SAML authentication for GlobalProtect VPN via command line.","archived":false,"fork":false,"pushed_at":"2025-03-12T20:02:32.000Z","size":123,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-12T21:19:20.974Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cwaldbieser.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-30T17:49:46.000Z","updated_at":"2024-09-20T13:15:18.000Z","dependencies_parsed_at":"2025-03-12T21:29:16.345Z","dependency_job_id":null,"html_url":"https://github.com/cwaldbieser/globalprotect_cli","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwaldbieser%2Fglobalprotect_cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwaldbieser%2Fglobalprotect_cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwaldbieser%2Fglobalprotect_cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwaldbieser%2Fglobalprotect_cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cwaldbieser","download_url":"https://codeload.github.com/cwaldbieser/globalprotect_cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245256775,"owners_count":20585968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-01T20:13:07.562Z","updated_at":"2025-10-14T11:07:22.690Z","avatar_url":"https://github.com/cwaldbieser.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"##################################\n GlobalProtext SAML CLI interface\n##################################\n\n**************\n Installation\n**************\n\nUses `pipenv` to create Python virtual environment and track\ndependencies.\n\n.. code:: shell\n\n   $ pipenv install\n\nInstalling `pipenv`\n===================\n\nIf you are unfamiliar with `pipenv`, the docs are at\nhttps://pipenv.pypa.io/en/latest/ . In brief, if you run:\n\n..\n   code::bash\n\n   $ pip install --user pipenv\n\nThis will install `pipenv` at ~/.local/bin/pipenv for the current user\non most Linux systems.\n\n*********\n Duo MFA\n*********\n\nThis script supports using the following Duo MFA authentication methods.\nAll methods assume you are using the Duo Universal Prompt.\n\n-  WebAuthn\n-  Duo Push\n\n.. note::\n\n   The program potentially may prompt for both a Duo Factor and Device\n   if there are multiple choices. This won't work out if you are trying\n   to eval the results of the script. After determining what\n   factor/device you'd like to use interactively, you should set the\n   following environment variables as needed:\n\n   -  DUO_FACTOR\n   -  DUO_DEVICE\n\n   Supported factors are 'Duo Push' and 'WebAuthn Security Key'.\n\n***************\n Example Usage\n***************\n\n.. code:: shell\n\n   $ eval $(pipenv run ./login.py https://globalprotect.example.net/ssl-vpn/prelogin.esp waldbiec -l ERROR)\n   $ echo \"$COOKIE\" | openconnect --protocol=gp -u \"$VPN_USER\" --passwd-on-stdin \"https://$VPN_HOST/gateway:prelogin-cookie\"\n\n***************\n Sample Script\n***************\n\nBelow is a sample script that takes 2 arguments-- your GlobalProtect\nbase URL and your username. It must have permission to run the\nopenconnect software (i.e. you might need to run as root). Your\nOpenConnect client must be modern enough to support the \"gp\" protocol.\n\n.. code:: shell\n\n   #! /bin/bash\n\n   # Requires Python 3.x\n   # Set this to the full path of your pipenv executable.\n   PIPENV=/root/.local/bin/pipenv\n   # Set this to the folder where this project is located.\n   GP_CLI_SOFTWARE_DIR=/opt/globalprotect_cli\n\n   function usage\n   {\n       echo \"Usage: $0 GP_ENDPOINT SSO_USER\" \u003e\u00262\n   }\n\n   GP_ENDPOINT=\"$1\"\n   SSO_USER=\"$2\"\n   if [ -z $GP_ENDPOINT ]; then\n       usage\n       exit 1\n   fi\n   if [ -z $SSO_USER ]; then\n       usage\n       exit 1\n   fi\n\n   export DUO_FACTOR='WebAuthn Security Key'\n   PRELOGIN=\"$GP_ENDPOINT/ssl-vpn/prelogin.esp\"\n   cd \"$GP_CLI_SOFTWARE_DIR\"\n   eval $($PIPENV run ./login.py \"$PRELOGIN\" \"$SSO_USER\" --duo-mfa -l ERROR)\n   echo \"VPN_HOST: $VPN_HOST\"\n   echo \"VPN_USER: $VPN_USER\"\n   echo \"COOKIE:   $COOKIE\"\n   # You can comment out these last 2 lines if you just want to test that\n   # authentication works.  Once you get a cookie back in your output,\n   # uncomment these lines to actually log into the VPN.\n   PREAUTH_ENDPOINT=\"https://$VPN_HOST/gateway:prelogin-cookie\"\n   echo \"$COOKIE\" | openconnect --protocol=gp -u \"$VPN_USER\" --passwd-on-stdin \"$PREAUTH_ENDPOINT\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwaldbieser%2Fglobalprotect_cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcwaldbieser%2Fglobalprotect_cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwaldbieser%2Fglobalprotect_cli/lists"}