<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>
<div id="appendonsend" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
David is totally correct. Not related to the public user at all as I had initially speculated.</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 wonder why some of the get endpoints never got specific permissions? At a minimum I think they should all be 'view_repository' but that might have some other consequences downstream.<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);">
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 David P. Steelman
<dsteelma@umd.edu><br>
<b>Sent:</b> Tuesday, September 29, 2020 12:28 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>
<div dir="ltr">I was able to find the endpoints in the list by searching for ".permissions([])", for example in archivesspace/backend/app/controllers/agent_family.rb:
<div><br>
</div>
<div><font face="monospace"> Endpoint.get('/agents/families')<br>
.description("List all family agents")<br>
.params()<br>
.paginated(true)<br>
.permissions([])<br>
.returns([200, "[(:agent_family)]"]) \<br>
do<br>
handle_listing(AgentFamily, params)<br>
end</font><br>
</div>
<div><font face="monospace"><br>
</font></div>
<div>The permissions on this code (and several other classes) were set when the ".nopermissionsyet" scaffolding was replaced about 7 years ago in <a href="https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Farchivesspace%2Farchivesspace%2Fcommit%2Fff972d222b91a005f6514ba1d30cd772f8b674c4&data=02%7C01%7Cjoshua.d.shaw%40dartmouth.edu%7C4d54a77c5b5f4b7eb15e08d86494c298%7C995b093648d640e5a31ebf689ec9446f%7C0%7C0%7C637369937387429327&sdata=u2y8VNCm0cCJAO5VGL6g0MH6NxFID5yF01G6vVRX0Hk%3D&reserved=0" originalsrc="https://github.com/archivesspace/archivesspace/commit/ff972d222b91a005f6514ba1d30cd772f8b674c4" shash="LTIz2Ve23rkbNWAh/mzyo0d6v/iASiEca6VMbrFeGXt7yE4T7mGG9KJwLv/dqcmPhxw9JlyCBh1u0BpuLeRjlwQqoG5xmbHW4wLWMEzZrdVVzQpJoIjUvahIafQ4Edtr0HhvcJPTI/cdCTjz+sJpuXrcLMVXmROMcOeQBeRi5fU=">https://github.com/archivesspace/archivesspace/commit/ff972d222b91a005f6514ba1d30cd772f8b674c4</a><font face="monospace"><br>
</font></div>
<div><br>
</div>
<div>So it has been this way for quite a while.</div>
<div><br>
</div>
<div>David</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Tue, Sep 29, 2020 at 12:19 PM Joshua D. Shaw <<a href="mailto:Joshua.D.Shaw@dartmouth.edu">Joshua.D.Shaw@dartmouth.edu</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div 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://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Farchivesspace%2Farchivesspace%2Fblob%2Fmaster%2Fbackend%2Fapp%2Fmodel%2Fgroup.rb&data=02%7C01%7Cjoshua.d.shaw%40dartmouth.edu%7C4d54a77c5b5f4b7eb15e08d86494c298%7C995b093648d640e5a31ebf689ec9446f%7C0%7C0%7C637369937387429327&sdata=duyanMKYMzsbj7KesfEkIEmpK%2F9xfGI2V0Kj6x0ehsA%3D&reserved=0" originalsrc="https://github.com/archivesspace/archivesspace/blob/master/backend/app/model/group.rb" shash="JGQAWrlg9t2bePYfFMGaOm8uo5P98hp1azAeC0rXY7zTIRYADkztHQZdEbhZLYkZl22tRlp1Q8/xfL7gsS6i6owXgjso7OTsL7qx9LzLf4GOONZseKQAOKOV5sS1sEcdHe3C2fmpjFj4i6I4qjY0t6Ms/HjloHhoog4d+l+i290=" target="_blank">
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="x_gmail-m_-7495862805652461365appendonsend"><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 style="display:inline-block; width:98%">
<div id="x_gmail-m_-7495862805652461365divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b>
<a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org" target="_blank">
archivesspace_users_group-bounces@lyralists.lyrasis.org</a> <<a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org" target="_blank">archivesspace_users_group-bounces@lyralists.lyrasis.org</a>> on behalf of Custer, Mark <<a href="mailto:mark.custer@yale.edu" target="_blank">mark.custer@yale.edu</a>><br>
<b>Sent:</b> Tuesday, September 29, 2020 12:15 PM<br>
<b>To:</b> Archivesspace Users Group <<a href="mailto:archivesspace_users_group@lyralists.lyrasis.org" target="_blank">archivesspace_users_group@lyralists.lyrasis.org</a>><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_gmail-m_-7495862805652461365x_"> 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_gmail-m_-7495862805652461365x_appendonsend"></div>
<hr style="display:inline-block; width:98%">
<div id="x_gmail-m_-7495862805652461365x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b>
<a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org" target="_blank">
archivesspace_users_group-bounces@lyralists.lyrasis.org</a> <<a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org" target="_blank">archivesspace_users_group-bounces@lyralists.lyrasis.org</a>> on behalf of Joshua D. Shaw <<a href="mailto:Joshua.D.Shaw@dartmouth.edu" target="_blank">Joshua.D.Shaw@dartmouth.edu</a>><br>
<b>Sent:</b> Tuesday, September 29, 2020 11:54 AM<br>
<b>To:</b> Archivesspace Users Group <<a href="mailto:archivesspace_users_group@lyralists.lyrasis.org" target="_blank">archivesspace_users_group@lyralists.lyrasis.org</a>><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_gmail-m_-7495862805652461365x_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 style="display:inline-block; width:98%">
<div id="x_gmail-m_-7495862805652461365x_x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b>
<a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org" target="_blank">
archivesspace_users_group-bounces@lyralists.lyrasis.org</a> <<a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org" target="_blank">archivesspace_users_group-bounces@lyralists.lyrasis.org</a>> on behalf of David P. Steelman <<a href="mailto:dsteelma@umd.edu" target="_blank">dsteelma@umd.edu</a>><br>
<b>Sent:</b> Tuesday, September 29, 2020 11:36 AM<br>
<b>To:</b> Archivesspace Users Group <<a href="mailto:archivesspace_users_group@lyralists.lyrasis.org" target="_blank">archivesspace_users_group@lyralists.lyrasis.org</a>><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>
</div>
_______________________________________________<br>
Archivesspace_Users_Group mailing list<br>
<a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org" target="_blank">Archivesspace_Users_Group@lyralists.lyrasis.org</a><br>
<a href="https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Flyralists.lyrasis.org%2Fmailman%2Flistinfo%2Farchivesspace_users_group&data=02%7C01%7Cjoshua.d.shaw%40dartmouth.edu%7C4d54a77c5b5f4b7eb15e08d86494c298%7C995b093648d640e5a31ebf689ec9446f%7C0%7C0%7C637369937387439325&sdata=IGpUVa%2ByKgJBQDRZYvKGoVxkuxz9szM6DCAvVKAQOIM%3D&reserved=0" originalsrc="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group" shash="ZBEO1i+2kr2xHPo+/9d3i39UOBpJ2pdkcjy9Uhlx5BepsL9UmPeX6b5W8XcQ03oLjKekLcTdW849rNl/ZHi0MdSsB9NdK8yD8vzAvm5jKIRTYJKZR2iqFqnx/imKfygRIEQyvynNeSYAMkUe65v7crrIxrpIIzDMFJYVYkozx1s=" rel="noreferrer" target="_blank">http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group</a><br>
</blockquote>
</div>
</div>
</div>
</body>
</html>