{ "info": { "author": "James Macdonell", "author_email": "jmacdone@csusb.edu", "bugtrack_url": null, "classifiers": [], "description": "# cas-simulation\n\nA way to simulate a web browser visiting a service authenticated by\n[CAS](https://en.wikipedia.org/wiki/Central_Authentication_Service) and\nproceeding through the authentication.\n\nOriginally developed to facilitate authenticated service checks in Nagios.\n\n# `check_cas_sp`\n\n`cas_simulation` object instances are created using the included `check_cas_sp`\nscript, intended to be called from Nagios\n\nThe simulation will follow redirects from a starting URL (typically a service\nprovider like https://myportal.example.edu) until it reaches a form that it\nbelieves is a CAS authentication page (at least the one presented by the\nJASIG/Apereo implementation). It will then submit the form using the\ncredentials provided. It will follow redirects and submit forms (e.g. \"Click\nhere to continue\" javascript alternatives) until it receives a 200 OK page\nwithout a form, or the form contains an `id` or `action` attribute matching\nargument provided to the `--form`.\n\nThe final landing page is searched for an expected pattern using\n`--expression`. If it matches, the script returns 0 which corresponds to a OK\nin Nagios API. Otherwise it returns 2 for CRITICAL\n\nOptionally, the `check_cas_sp` will also fetch and check an expression against\na URL that is only expected to be available after authentication. This would\nsimulate clicking a link on a portal after logging in.\n\n## Gotchas\n\nNotably, the `--verbose` option stupidly assumes it can write to\n`/var/log/nagios`\n\n## Examples\n\n`check_cas_sp --help`\n\nList all current command line options\n\n\n```\ncheck_cas_sp \\\n --url https://fee-portal.csusb.edu/auth/shibboleth\" \\\n --expression \"Fines .{1,30}for Joe Coyote\" \\\n -w 5.0 \\\n --post-auth-check https://fee-portal.csusb.edu/fines/alma \"Balance [Dd]ue\" \\\n --credentials \"/etc/cas/joe-creds.json\" \\\n```\n\nAuthenticate fee-portal.csusb.edu using the credentials in\n/etc/cas/joe-creds.json. The post authentication redirect contains \"Fines and\nfees for Joe Coyote\" and should match the regular expression given.\n\nAfter that check, also check a url that requires an authenticated active\nsession. In this case, a check for the Alma library fees that should contain\nthe text \"Balance Due\". Return WARNING if the authentication takes more than 5\nseconds. (It probably *should* be `--post-auth-url` and\n`--post-auth-expression` instead of being combined like it is.)\n\n\n```\ncheck_cas_sp \\\n --url https://my.csusb.edu \\\n --expression 'Signed in as Joe Coyote
Tap to sign out' \\\n -w 10 \\\n --form '/default/kurogo_module_search/search' \\\n --credentials credentails.json\n```\n\nAuthenticate to my.csusb.edu and expect a name next to a \"Tap to sign out\"\nafter authentication. Do not proceed past the form with the name or id of\n'/default/kurogo_module_search/search' Typically, the simulation will submit\nany forms it encounters, assuming they are \"Click here to continue\" type forms)\n\n\n## Examples Nagios command objects\n\n```\ndefine command {\n command_name check-cas-sp\n command_line /opt/virtualenv/cas-simulation/bin/check_cas_sp --url '$ARG1$' --expression '$ARG2$' $ARG3$ --verbose --credentials /etc/nagios/secrets/credentials.json\n}\n```\n\n```\ndefine command {\n command_name check-cas-sp-post-auth\n command_line /opt/virtualenv/cas-simulation/bin/check_cas_sp --url '$ARG1$' --expresison '$ARG2$' $ARG3$ --post-auth-check '$ARG4$' '$ARG5$' --verbose --credentials /etc/nagios/secrets/credentials.json\n}\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/csusb/cas-simulation", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "cas-simulation", "package_url": "https://pypi.org/project/cas-simulation/", "platform": "", "project_url": "https://pypi.org/project/cas-simulation/", "project_urls": { "Homepage": "https://bitbucket.org/csusb/cas-simulation" }, "release_url": "https://pypi.org/project/cas-simulation/1.1.1/", "requires_dist": null, "requires_python": "", "summary": "Simulate an authentication workflow for CAS, particularly for service checks", "version": "1.1.1", "yanked": false, "yanked_reason": null }, "last_serial": 6043178, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "09b9972140f193854a7ce761d569a5cf", "sha256": "6800dae80a90c6514af142daabcbfa46a3acdd368b466e83be992413e4a9f52c" }, "downloads": -1, "filename": "cas-simulation-1.0.1.tar.gz", "has_sig": false, "md5_digest": "09b9972140f193854a7ce761d569a5cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6206, "upload_time": "2019-10-11T22:30:24", "upload_time_iso_8601": "2019-10-11T22:30:24.053569Z", "url": "https://files.pythonhosted.org/packages/58/cf/0bc09e8668ea87862475aa22563b181b5aa1940dc622f32dde0e8e79237e/cas-simulation-1.0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "e9695f9d95c42a42af23ca23287948cf", "sha256": "f819b21884cd54bdd04280039fa60cb51a3e45c030ce9fcad022698595a1252e" }, "downloads": -1, "filename": "cas-simulation-1.1.1.tar.gz", "has_sig": false, "md5_digest": "e9695f9d95c42a42af23ca23287948cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6145, "upload_time": "2019-10-28T18:02:10", "upload_time_iso_8601": "2019-10-28T18:02:10.086964Z", "url": "https://files.pythonhosted.org/packages/6e/85/aa2ae8ed3a817ac2f49554c49c01c0e33c737eb2083783dfbd6773f5a413/cas-simulation-1.1.1.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e9695f9d95c42a42af23ca23287948cf", "sha256": "f819b21884cd54bdd04280039fa60cb51a3e45c030ce9fcad022698595a1252e" }, "downloads": -1, "filename": "cas-simulation-1.1.1.tar.gz", "has_sig": false, "md5_digest": "e9695f9d95c42a42af23ca23287948cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6145, "upload_time": "2019-10-28T18:02:10", "upload_time_iso_8601": "2019-10-28T18:02:10.086964Z", "url": "https://files.pythonhosted.org/packages/6e/85/aa2ae8ed3a817ac2f49554c49c01c0e33c737eb2083783dfbd6773f5a413/cas-simulation-1.1.1.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }