<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0)">
I think this is an unintended consequence of the PUI. <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0)">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0)">
In <a href="https://github.com/archivesspace/archivesspace/blob/master/backend/app/model/group.rb">
https://github.com/archivesspace/archivesspace/blob/master/backend/app/model/group.rb</a> there is a PUBLIC_GROUP_CODE which is name 'publicanonymous' which is granted view_repository rights - presumably so that the PUI can function.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0)">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0)">
I'm guessing that that specific user should be explicitly *excluded* in the RESTHelpers module or maybe the User class where the permissions are actually calculated.</div>
<div>
<div id="appendonsend"><br>
</div>
<div>Joshua<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> archivesspace_users_group-bounces@lyralists.lyrasis.org <archivesspace_users_group-bounces@lyralists.lyrasis.org> on behalf of Custer, Mark
 <mark.custer@yale.edu><br>
<b>Sent:</b> Tuesday, September 29, 2020 12:15 PM<br>
<b>To:</b> Archivesspace Users Group <archivesspace_users_group@lyralists.lyrasis.org><br>
<b>Subject:</b> Re: [Archivesspace_Users_Group] ArchivesSpace RESTful API authentication and access</font>
<div> </div>
</div>
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I'm curious if this has always been the case, as well, but it would seem like it has been.<span id="x_��">  I knew that the repository and location endpoints could be accessed but didn't try any of the rest for some inexplicable reason.  Not good to have agent
 contact details available that way.</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Given which endpoints are available, I wonder if this has to do with the concept of the 'global' repository in ArchivesSpace, to which all agents, subjects, locations, etc., belong?  If so, it seems like that should be something that could (and should!) be
 locked down.  </div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
But, as you mention, Joshua, a very good reason to have further restrictions on access to the API endpoints...  but in this case, I wouldn't think that should be necessary at all.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div id="x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> archivesspace_users_group-bounces@lyralists.lyrasis.org <archivesspace_users_group-bounces@lyralists.lyrasis.org> on behalf of Joshua D.
 Shaw <Joshua.D.Shaw@dartmouth.edu><br>
<b>Sent:</b> Tuesday, September 29, 2020 11:54 AM<br>
<b>To:</b> Archivesspace Users Group <archivesspace_users_group@lyralists.lyrasis.org><br>
<b>Subject:</b> Re: [Archivesspace_Users_Group] ArchivesSpace RESTful API authentication and access</font>
<div> </div>
</div>
<div dir="ltr">
<div>
<div id="x_x_appendonsend" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
That's a *very* interesting find! I had naively believed the docs that indicated that most of the endpoints required authentication without actually trying to bounce off a random endpoint without a token.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
The controllers indicate that there should be permissions involved and that they should be tied to user roles, but that is obviously not the case. FYI - This issue has been around since at least 2.5.0 (I tested against 2.5.0, 2.7.1 and 2.80 running locally).</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
For what it's worth, we have additional firewall rules in place (for other reasons) that limit access to the backend to only a select few IPs. That doesn't address the actual problem but is a workaround if you have the resources.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Joshua<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> archivesspace_users_group-bounces@lyralists.lyrasis.org <archivesspace_users_group-bounces@lyralists.lyrasis.org> on behalf of David P.
 Steelman <dsteelma@umd.edu><br>
<b>Sent:</b> Tuesday, September 29, 2020 11:36 AM<br>
<b>To:</b> Archivesspace Users Group <archivesspace_users_group@lyralists.lyrasis.org><br>
<b>Subject:</b> [Archivesspace_Users_Group] ArchivesSpace RESTful API authentication and access</font>
<div> </div>
</div>
<div>
<div dir="ltr">I've been investigating providing access to the ArchivesSpace RESTful API to an expanded group of users.
<div><br>
</div>
<div>Through testing, it appears that many of the RESTful API endpoints (see below) do not require user authentication (i.e., do not require a "session" key), and access apparently cannot be controlled through the ArchivesSpace permission infrastructure.</div>
<div><br>
</div>
<div>While the information provided by most of these endpoints might be considered "public", some (such as information from the "agents" endpoints) could contain names and contact information that might be considered sensitive.</div>
<div><br>
</div>
<div>Is the inability to control access to these endpoints via the ArchivesSpace permissions infrastructure intentional? Is there some way to control access to these endpoints that I'm missing?</div>
<div><br>
</div>
<div>A (non-exhaustive) list of the endpoints that will return information to anything that can reach them:</div>
<div><br>
</div>
<div>/agents/corporate_entities - List all corporate entity<br>
/agents/corporate_entities/:id - Get a corporate entity by ID<br>
/agents/families - List all family agents<br>
/agents/families/:id - Get a family by ID<br>
/agents/people - List all person agents<br>
/agents/people/:id - Get a person by ID<br>
/agents/software - List all software agents<br>
/agents/software/:id - Get a software agent by ID<br>
/container_profiles - Get a list of Container Profiles<br>
/container_profiles/:id - Get a Container Profile by ID<br>
/config/enumerations - List all defined enumerations<br>
/config/enumerations/:enum_id - Get an Enumeration<br>
/config/enumerations/names/:enum_name - Get an Enumeration by Name<br>
/config/enumeration_values/:enum_val_id - Get an Enumeration Value<br>
/repositories/:repo_id/archival_contexts/people/:id.xml - Get an EAC-CPF representation of an Agent<br>
/repositories/:repo_id/archival_contexts/people/:id.:fmt/metadata - Get metadata for an EAC-CPF export of a person<br>
/repositories/:repo_id/archival_contexts/corporate_entities/:id.xml - Get an EAC-CPF representation of a Corporate Entity<br>
/repositories/:repo_id/archival_contexts/corporate_entities/:id.:fmt/metadata - Get metadata for an EAC-CPF export of a corporate entity<br>
/repositories/:repo_id/archival_contexts/families/:id.xml - Get an EAC-CPF representation of a Family<br>
/repositories/:repo_id/archival_contexts/families/:id.:fmt/metadata - Get metadata for an EAC-CPF export of a family<br>
/repositories/:repo_id/archival_contexts/softwares/:id.xml - Get an EAC-CPF representation of a Software agent<br>
/repositories/:repo_id/archival_contexts/softwares/:id.:fmt/metadata - Get metadata for an EAC-CPF export of a software<br>
/job_types - List all supported job types<br>
/repositories/:repo_id/jobs/import_types - List all supported import job types<br>
/location_profiles - Get a list of Location Profiles<br>
/location_profiles/:id - Get a Location Profile by ID<br>
/search/location_profile - Search across Location Profile<br>
/locations - Get a list of locations<br>
/locations/:id - Get a Location by ID<br>
/notifications - Get a stream of notifications<br>
/oai_config - Get the OAI Config record<br>
/permissions - Get a list of Permissions<br>
/repositories/:repo_id/preferences/defaults - Get the default set of Preferences for a Repository and optionally a user<br>
/repositories/:repo_id/rde_templates/:id - Get an RDE template record<br>
/repositories/:repo_id/rde_templates - Get a list of RDE Templates<br>
/reports - List all reports<br>
/repositories/with_agent/:id - Get a Repository by ID, including its agent representation<br>
/repositories/:id - Get a Repository by ID<br>
/repositories - Get a list of Repositories<br>
/schemas - Get all ArchivesSpace schemas<br>
/schemas/:schema - Get an ArchivesSpace schema<br>
/search/repositories - Search across repositories<br>
/search/subjects - Search across subjects<br>
/space_calculator/buildings - Get a Location by ID<br>
/subjects - Get a list of Subjects<br>
/subjects/:id - Get a Subject by ID<br>
/terms - Get a list of Terms matching a prefix<br>
/users - Get a list of users<br>
/users/complete - Get a list of system users<br>
/version - Get the ArchivesSpace application version<br>
/vocabularies - Get a list of Vocabularies<br>
/vocabularies/:id/terms - Get a list of Terms for a Vocabulary<br>
/vocabularies/:id - Get a Vocabulary by ID<br>
</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>David</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>