-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
1,222 additions
and
56 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
changelog.d/20241115_095433_kevin_implement_pam_for_meps.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
New Functionality | ||
^^^^^^^^^^^^^^^^^ | ||
|
||
- Implement optional PAM capabilities for ensuring user accounts meet | ||
site-specific criteria before starting user endpoints. Within the multi user | ||
endpoint, PAM defaults to off, but is enabled via the ``pam`` field: | ||
|
||
.. code-block:: yaml | ||
:caption: ``config.yaml`` -- Example MEP configuration opting-in to PAM | ||
multi_user: true | ||
pam: | ||
enable: true | ||
As authentication is implemented via Globus Auth and identity mapping, the | ||
Globus Compute Endpoint does not implement the authorization or password | ||
managment phases of PAM. It implements account | ||
(|pam_acct_mgmt(3)|_) and session (|pam_open_session(3)|) management. | ||
|
||
For more information, consult :ref:`the PAM section <pam>` of the | ||
documentation. | ||
|
||
.. |pam_acct_mgmt(3)| replace:: ``pam_acct_mgmt(3)`` | ||
.. _pam_acct_mgmt(3): https://www.man7.org/linux/man-pages/man3/pam_acct_mgmt.3.html | ||
.. |pam_open_session(3)| replace:: ``pam_open_session(3)`` | ||
.. _pam_open_session(3): https://www.man7.org/linux/man-pages/man3/pam_open_session.3.html | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ | |
ManagerEndpointConfigModel, | ||
UserEndpointConfigModel, | ||
) | ||
from .pam import PamConfiguration # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
compute_endpoint/globus_compute_endpoint/endpoint/config/pam.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from dataclasses import asdict, dataclass | ||
|
||
import yaml | ||
|
||
|
||
@dataclass | ||
class PamConfiguration: | ||
""" | ||
:param enable: Whether to initiate a PAM session for each UEP start request. | ||
:param service_name: What PAM service name with which to initialize the PAM | ||
session. If a particular MEP has different requirements, define those PAM | ||
requirements in ``/etc/pam.d/``, and specify the service name with this field. | ||
See :ref:`MEP § PAM <pam>` for more information | ||
""" | ||
|
||
enable: bool = True | ||
service_name: str = "globus-compute-endpoint" | ||
|
||
|
||
def _to_yaml(dumper: yaml.SafeDumper, data: PamConfiguration): | ||
return dumper.represent_mapping("tag:yaml.org,2002:map", asdict(data)) | ||
|
||
|
||
yaml.SafeDumper.add_representer(PamConfiguration, _to_yaml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.