Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The cache now gets x509ClientAuthenticationPrefixes from the director… #1624

Merged
merged 3 commits into from
Oct 21, 2024

Conversation

turetske
Copy link
Collaborator

@turetske turetske commented Oct 8, 2024

… and uses them in its config

-- Creates a DirectorAPI endpoint which returns the list of x509ClientAuthenticationPrefixes
-- The Cache retrieves this list from the director while getting NSAds from the Director
-- The xrootd cache config now sets "http.tlsclientauth defer"
-- for each entry in the x509ClientAuthenticationPrefixes, the xrootd cache config sets "http.tlsrequiredprefix <prefix>"
-- Adding tests

The behavior is that if a prefix is in http.tlsrequiredprefix <prefix> then when an access occurs with proper x509 certs, then it can pass even if it doesn't have a proper token. This will also remove the issue where when accessing an object via a browser, it will ask for an x509 certificate even when it's not needed.

For the testing, there are few things you want to do.

No longer asking for a certificate for browser accesses:

  1. Start up a federation (cache/origin/registry/director)
  2. Access an object from the cache via a web browser - ensure that it does not ask for a certificate

Testing that the defer check works:

  1. Start up a federation (cache/origin/registry/director) with some prefix in Director.ClientAuthenticationPrefixes, ensure that PublicReads is NOT enabled
  2. Use a tls cert to generate a user to add to an authfile with the same prefix
    i. openssl x509 -in <configdir>/certifications/tls.crt -noout -hash
    ii. add u <user>.0 <prefix> lr to <configdir>/xrootd/authfile
  3. Ensure you have a version of curl which uses tlsv1.3 (should be in the dev containers already)
  4. Run curl -v -k -L https://<directorurl>/<prefix>/<object> --tlsv1.3 --cert <configdir>/certificates/tls.crt --key <configdir>/certificates/tls.key and see that it successfully accesses the file

@turetske turetske marked this pull request as ready for review October 11, 2024 15:40
@turetske turetske added this to the v7.11.0 milestone Oct 11, 2024
@turetske turetske linked an issue Oct 11, 2024 that may be closed by this pull request
Copy link
Member

@jhiemstrawisc jhiemstrawisc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor requests for changes/explanations but I've verified that both test cases work as expected for me locally.

cache/advertise_test.go Outdated Show resolved Hide resolved
cache/advertise_test.go Outdated Show resolved Hide resolved
cache/advertise_test.go Outdated Show resolved Hide resolved
cache/advertise_test.go Outdated Show resolved Hide resolved
cache/advertise_test.go Outdated Show resolved Hide resolved
github_scripts/x509_test.sh Outdated Show resolved Hide resolved
github_scripts/x509_test.sh Outdated Show resolved Hide resolved
github_scripts/x509_test.sh Outdated Show resolved Hide resolved
xrootd/xrootd_config_test.go Outdated Show resolved Hide resolved
github_scripts/x509_test.sh Outdated Show resolved Hide resolved
Emma Turetsky added 2 commits October 17, 2024 15:58
… and uses them in its config

	-- Creates a DirectorAPI endpoint which returns the list of x509ClientAuthenticationPrefixes
	-- The Cache retrieves this list from the director while getting NSAds from the Director
	-- The xrootd cache config now sets "http.tlsclientauth defer"
	-- for each entry in the x509ClientAuthenticationPrefixes, the xrootd cache config sets "http.tlsrequiredprefeix <prefix>"
	-- Adding tests
-- Test cleanup and clarity
Copy link
Member

@jhiemstrawisc jhiemstrawisc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jhiemstrawisc jhiemstrawisc merged commit 24be153 into PelicanPlatform:main Oct 21, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add http.tlsclientauth and http.tlsrequiredprefer to cache config
2 participants