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

🥔🛠️🔐✨ Spaces: Enforce ssl connection #1473

Closed
3 tasks done
Tracked by #1154
zspencer opened this issue May 18, 2023 · 8 comments
Closed
3 tasks done
Tracked by #1154

🥔🛠️🔐✨ Spaces: Enforce ssl connection #1473

zspencer opened this issue May 18, 2023 · 8 comments
Assignees
Labels
✨ feature Reduces Client's Burden or Grants them Benefits 🛠️ infrastructure ci, build, deploy, networking, etc. 🥔 Satisfices It's good enough to use, but not particularly great 🔐 security Relates to security vulnerabilities

Comments

@zspencer
Copy link
Member

zspencer commented May 18, 2023

We're in a bit of a pickle here because we're using Cloudflare's free tier for DNS and WAF for convene.zinc.coop; which requires us to disable force_ssl for that Space to prevent a redirect loop.

However, for spaces that are not using a Web Application Firewall or other intermediary; we do want to force ssl.

Use Cases

  • Operator may force every space to use SSL by setting the FORCE_SSL environment variable to true
  • Visitors are redirected to https if they visit a space that Enforces SSL using HTTP
  • Member may force all requests to a Space to use ssl
@zspencer zspencer mentioned this issue May 18, 2023
12 tasks
@zspencer zspencer changed the title Space: Enforce ssl connection Spaces: Enforce ssl connection May 18, 2023
@zspencer zspencer changed the title Spaces: Enforce ssl connection ✨🛠️ Spaces: Enforce ssl connection May 18, 2023
@zspencer zspencer added 🔐 security Relates to security vulnerabilities 🛠️ infrastructure ci, build, deploy, networking, etc. labels May 18, 2023
@zspencer zspencer changed the title ✨🛠️ Spaces: Enforce ssl connection ✨🛠️🔐 Spaces: Enforce ssl connection May 18, 2023
@zspencer
Copy link
Member Author

@KellyAH - This may be a bit less of a stretch than you wanted; but it will give you experience digging into the Rails Routing and Controller layers. If you want to tackle it, just leave your face on and roll and tag me on PRs. If you don't just tell me "eh, no" and I'll pick it up 🔜

KellyAH added a commit that referenced this issue May 25, 2023
…#1504)

redirect http URIs to https
Co-authored-by: Zee Spencer <zspencer@users.noreply.github.com>
Co-authored-by: Ana <anaulin@users.noreply.github.com>
Co-authored-by: Dalton Pruitt <daltonrpruitt@users.noreply.github.com>
@zspencer
Copy link
Member Author

@KellyAH - When I tested this via the UI in production, the checkbox did not persist in between page-loads. I was able to confirm that when I updated the enforce_ssl flag on the Piikup space it does do the redirection tho!

@KellyAH
Copy link
Contributor

KellyAH commented May 26, 2023

@KellyAH - When I tested this via the UI in production, the checkbox did not persist in between page-loads. I was able to confirm that when I updated the enforce_ssl flag on the Piikup space it does do the redirection tho!

  1. Odd. the checkbox's checked/unchecked state persisted when testing on local. So is the Enforce SSL checkbox broken on prod right now? And is it a break on the frontend or backend?
  2. We made the unit tests together. So the unit tests failed to provide adequate coverage?

@zspencer
Copy link
Member Author

I didn't have time to do much data collection; but I'm going to set up a production space and get a repro for ya.

@zspencer
Copy link
Member Author

OK never mind; clearly I must have not been paying enough attention because it was during the onboarding for Cafe Gabriela.

I have created a new space (https://sandbox.zinc.coop/spaces/sandbox/) that we can use for testing stuff in production with lower stakes tho!

@KellyAH
Copy link
Contributor

KellyAH commented May 27, 2023

crud! I just spun up local off latest master and it's getting SSL errors! It looks like /spaces pages are auto redirecting to https. Is your local throwing SSL errors too when loading any web pages.

Did the merge of #1504 break our local environments and prod?

Screenshot 2023-05-26 at 6 17 21 PM

@zspencer
Copy link
Member Author

My local is still fine; but I have not turned on enforce_ssl for local spaces; because my local environment doesn't have SSL. You may need to go into the Rails console, find your "test" Space, and flip the enforce_ssl to false:

Space.find_by(slug:  "test").update(enforce_ssl: false)

Alternatively, you could update all your local spaces to not enforce ssl:

Space.where(enforce_ssl: true).each { |space| space.update(enforce_ssl: false) } 

@zspencer
Copy link
Member Author

Alright, well I think this is Done For Now; so I am going to mark it as a Potato and close it!

@zspencer zspencer added ✨ feature Reduces Client's Burden or Grants them Benefits 🥔 Satisfices It's good enough to use, but not particularly great labels May 27, 2023
@zspencer zspencer changed the title ✨🛠️🔐 Spaces: Enforce ssl connection 🥔🛠️🔐✨ Spaces: Enforce ssl connection May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature Reduces Client's Burden or Grants them Benefits 🛠️ infrastructure ci, build, deploy, networking, etc. 🥔 Satisfices It's good enough to use, but not particularly great 🔐 security Relates to security vulnerabilities
Projects
None yet
Development

No branches or pull requests

2 participants