[Feature Request] Automate custom domain VHOST support in CSC Cloud #87

Open
opened 2022-12-07 12:35:35 -05:00 by n4chung · 5 comments
Owner

Currently, creating vhosts with custom domains require manual verification on an individual basis as it's not currently possible to verify a particular user's ownership of a domain name.

A few ideas for domain verification:

  • Verify using CNAME/TXT DNS record
  • File upload/host a file at the desired domain/subdomain.

For verifying ownership of an entire domain, it should be sufficient to prove verification for the root of the domain. Verification through CNAME/TXT is probably the best.

For verifying a subdomain (where the user doesn't own the entire domain, eg. third level domains), file upload is likely the only option.

Other Considerations

  • How long should verification last? Should it be checked periodically? Every 3 months?? And every time a verification is requested (through Pyceo)?

  • If multiple users use subdomains from the same domain, how would verification work? If they verify subdomains, there shouldn't be a problem. But if one verifies the entire domain, should that user be the only person able to control vhosts from that domain?

  • Pyceo is currently stateless...

Reference: https://docs.cloud.csclub.uwaterloo.ca/vhosts/

Currently, creating vhosts with custom domains require manual verification on an individual basis as it's not currently possible to verify a particular user's ownership of a domain name. **A few ideas for domain verification**: - Verify using CNAME/TXT DNS record - File upload/host a file at the desired domain/subdomain. For verifying ownership of an entire domain, it should be sufficient to prove verification for the root of the domain. Verification through CNAME/TXT is probably the best. For verifying a subdomain (where the user doesn't own the entire domain, eg. third level domains), file upload is likely the only option. **Other Considerations** - How long should verification last? Should it be checked periodically? Every 3 months?? And every time a verification is requested (through Pyceo)? - If multiple users use subdomains from the same domain, how would verification work? If they verify subdomains, there shouldn't be a problem. But if one verifies the entire domain, should that user be the only person able to control vhosts from that domain? - Pyceo is currently stateless... Reference: https://docs.cloud.csclub.uwaterloo.ca/vhosts/
n4chung changed title from Automate custom domain VHOST support in CSC Cloud to [Feature Request] Automate custom domain VHOST support in CSC Cloud 2022-12-07 17:54:23 -05:00
Author
Owner

To automatically verify vhosts for custom domain names, we need to automatically verify a user's ownership of a domain/subdomain name. If ownership could be proven, then a VHOST record should be created for the user.

Verification Methods:

METHOD #​1 (DNS TXT verification):

  1. ceo cloud vhosts code: A unique checksum (SHA256 perhaps?) is generated for a particular user who wishes to prove their ownership of a domain.
  2. A TXT needs to be created at the ROOT of a domain name based on the unique checksum (eg. csc-verification).
  3. ceo cloud vhosts add <custom domain/subdomain> <forwarded ip> Whenever a vhost is created (that requires verification), CEO would query the TXT record before creating the TXT record.

METHOD #​2 (File based verification):
tbd...

To automatically verify vhosts for custom domain names, we need to automatically verify a user's ownership of a domain/subdomain name. If ownership could be proven, then a VHOST record should be created for the user. **Verification Methods**: METHOD \#​1 (DNS TXT verification): 1. `ceo cloud vhosts code`: A unique checksum (SHA256 perhaps?) is generated for a particular user who wishes to prove their ownership of a domain. 2. A `TXT` needs to be created at the ROOT of a domain name based on the **unique checksum** (eg. `csc-verification`). 3. `ceo cloud vhosts add <custom domain/subdomain> <forwarded ip>` Whenever a vhost is created (that requires verification), CEO would query the TXT record before creating the TXT record. METHOD \#​2 (File based verification): tbd...
Author
Owner

Checks need to be added here:
779e35a08e/ceod/model/VHostManager.py (L93)

Checks need to be added here: https://git.csclub.uwaterloo.ca/public/pyceo/src/commit/779e35a08e0d724ffacb7864e0cb490464bc892e/ceod/model/VHostManager.py#L93
Member

You could use a long enough uuid when wanting a random string.

For file-based verification, user can upload a file containing a random string, then the ceo can download the file and verify.

You could use a long enough uuid when wanting a random string. For file-based verification, user can upload a file containing a random string, then the ceo can download the file and verify.
Author
Owner

Tests need to be added here:
779e35a08e/tests/ceod/api/test_cloud.py (L90)

Tests need to be added here: https://git.csclub.uwaterloo.ca/public/pyceo/src/commit/779e35a08e0d724ffacb7864e0cb490464bc892e/tests/ceod/api/test_cloud.py#L90
Author
Owner

@y3285wan Yup. For the UUID, it needs to be associated with a particular user. Perhaps it could be generated from the CSC username.

For file-based verification, the same UUID (unique to the user) could be used as well.

@y3285wan Yup. For the UUID, it needs to be associated with a particular user. Perhaps it could be generated from the **CSC username**. For file-based verification, the same UUID (unique to the user) could be used as well.
merenber added the
priority
low
label 2023-10-14 22:18:52 -04:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: public/pyceo#87
No description provided.