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

Enable stronger cryptnono protections for public hubs + allow sharing shared directories between hubs #3657

Merged
merged 16 commits into from
Jan 31, 2024

Conversation

yuvipanda
Copy link
Member

@yuvipanda yuvipanda commented Jan 30, 2024

  • Bring in last 6 months of work on cryptnono for mybinder.org into this repo, and document it heavily. Read the documentation for more info!
  • Enable stronger cryptnono protections for HHMI spyglass ephemeral
  • Move HHMI spyglass ephemeral hub to using tmpauthenticator open to the world instead of CILogon
  • Document that ephemeral hubs should have this extra protection be enabled
  • Turns out a core part of the HHMI demonstration involves having shared directories with ~40G of
    data in them. After brainstorming a few solutions, we've currently settled on sharing the shared
    directory between the two hubs in this cluster (HHMI prod as well as spyglass ephemeral). There is
    documentation added about doing this as well.
  • I was asked to bump an image tag for this by @jmunroe and have done so.

Ref #3643

- Bring in last 6 months of work on cryptnono for mybinder.org
  into this repo, and document it heavily. Read the documentation
  for more info!
- Enable stronger cryptnono protections for HHMI spyglass ephemeral
- Move HHMI spyglass ephemeral hub to using tmpauthenticator open
  to the world instead of CILogon
- Document that ephemeral hubs should have this extra protection be
  enabled

Ref 2i2c-org#3643
@yuvipanda yuvipanda requested a review from a team as a code owner January 30, 2024 21:17
Copy link

github-actions bot commented Jan 30, 2024

Merging this PR will trigger the following deployment actions.

Support and Staging deployments

Cloud Provider Cluster Name Upgrade Support? Reason for Support Redeploy Upgrade Staging? Reason for Staging Redeploy
aws nasa-veda Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws smithsonian Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws gridsst Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws victor Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp linked-earth Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws earthscope Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp catalystproject-latam Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws ubc-eoas Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws nasa-esdis Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp pangeo-hubs Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp 2i2c Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp cloudbank Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp 2i2c-uk Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws jupyter-meets-the-earth Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp leap Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws catalystproject-africa Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp meom-ige Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp qcl Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws nasa-ghg Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp awi-ciroh Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws 2i2c-aws-us Yes Support helm chart has been modified Yes Core infrastructure has been modified
kubeconfig utoronto Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws openscapes Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws nasa-cryo Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp hhmi Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp callysto Yes Support helm chart has been modified Yes Core infrastructure has been modified

Production deployments

Cloud Provider Cluster Name Hub Name Reason for Redeploy
aws nasa-veda prod Core infrastructure has been modified
aws smithsonian prod Core infrastructure has been modified
aws gridsst prod Core infrastructure has been modified
aws victor prod Core infrastructure has been modified
gcp linked-earth prod Core infrastructure has been modified
aws earthscope prod Core infrastructure has been modified
gcp catalystproject-latam unitefa-conicet Core infrastructure has been modified
gcp catalystproject-latam cicada Core infrastructure has been modified
gcp catalystproject-latam gita Core infrastructure has been modified
aws ubc-eoas prod Core infrastructure has been modified
aws nasa-esdis prod Core infrastructure has been modified
gcp pangeo-hubs prod Core infrastructure has been modified
gcp pangeo-hubs coessing Core infrastructure has been modified
gcp 2i2c imagebuilding-demo Core infrastructure has been modified
gcp 2i2c demo Core infrastructure has been modified
gcp 2i2c ohw Core infrastructure has been modified
gcp 2i2c aup Core infrastructure has been modified
gcp 2i2c temple Core infrastructure has been modified
gcp 2i2c ucmerced Core infrastructure has been modified
gcp 2i2c climatematch Core infrastructure has been modified
gcp 2i2c mtu Core infrastructure has been modified
gcp 2i2c tufts Core infrastructure has been modified
gcp cloudbank bcc Core infrastructure has been modified
gcp cloudbank ccsf Core infrastructure has been modified
gcp cloudbank csm Core infrastructure has been modified
gcp cloudbank dvc Core infrastructure has been modified
gcp cloudbank elcamino Core infrastructure has been modified
gcp cloudbank evc Core infrastructure has been modified
gcp cloudbank glendale Core infrastructure has been modified
gcp cloudbank howard Core infrastructure has been modified
gcp cloudbank miracosta Core infrastructure has been modified
gcp cloudbank skyline Core infrastructure has been modified
gcp cloudbank demo Core infrastructure has been modified
gcp cloudbank fresno Core infrastructure has been modified
gcp cloudbank humboldt Core infrastructure has been modified
gcp cloudbank laney Core infrastructure has been modified
gcp cloudbank sbcc Core infrastructure has been modified
gcp cloudbank sbcc-dev Core infrastructure has been modified
gcp cloudbank elac Core infrastructure has been modified
gcp cloudbank lacc Core infrastructure has been modified
gcp cloudbank lamission Core infrastructure has been modified
gcp cloudbank mills Core infrastructure has been modified
gcp cloudbank mission Core infrastructure has been modified
gcp cloudbank norco Core infrastructure has been modified
gcp cloudbank palomar Core infrastructure has been modified
gcp cloudbank pasadena Core infrastructure has been modified
gcp cloudbank sjcc Core infrastructure has been modified
gcp cloudbank sacramento Core infrastructure has been modified
gcp cloudbank srjc Core infrastructure has been modified
gcp cloudbank saddleback Core infrastructure has been modified
gcp cloudbank santiago Core infrastructure has been modified
gcp cloudbank sjsu Core infrastructure has been modified
gcp cloudbank sierra Core infrastructure has been modified
gcp cloudbank tuskegee Core infrastructure has been modified
gcp cloudbank wlac Core infrastructure has been modified
gcp cloudbank csulb Core infrastructure has been modified
gcp cloudbank csum Core infrastructure has been modified
gcp 2i2c-uk lis Core infrastructure has been modified
aws jupyter-meets-the-earth prod Core infrastructure has been modified
gcp leap prod Core infrastructure has been modified
aws catalystproject-africa nm-aist Core infrastructure has been modified
aws catalystproject-africa must Core infrastructure has been modified
aws catalystproject-africa uvri Core infrastructure has been modified
gcp meom-ige prod Core infrastructure has been modified
gcp qcl prod Core infrastructure has been modified
aws nasa-ghg prod Core infrastructure has been modified
gcp awi-ciroh prod Core infrastructure has been modified
aws 2i2c-aws-us showcase Core infrastructure has been modified
aws 2i2c-aws-us ncar-cisl Core infrastructure has been modified
aws 2i2c-aws-us go-bgc Core infrastructure has been modified
aws 2i2c-aws-us itcoocean Core infrastructure has been modified
aws 2i2c-aws-us cosmicds Core infrastructure has been modified
kubeconfig utoronto prod Core infrastructure has been modified
kubeconfig utoronto r-prod Core infrastructure has been modified
aws openscapes prod Core infrastructure has been modified
aws nasa-cryo prod Core infrastructure has been modified
gcp hhmi prod Core infrastructure has been modified
gcp hhmi spyglass Core infrastructure has been modified
gcp callysto prod Core infrastructure has been modified

- Also enable this for the HHMI spyglass ephemeral hub, as it
  turns out this is a critical part of the demo
@yuvipanda yuvipanda changed the title Enable stronger cryptnono protections for public hubs Enable stronger cryptnono protections for public hubs + allow sharing shared directories between hubs Jan 31, 2024
Comment on lines 50 to 66
name: quay.io/lorenlab/hhmi-spyglass-image
tag: "c307f9418a60"
name: quay.io/2i2c/hhmi-spyglass-image
tag: "8be848d09076"
Copy link
Member Author

Choose a reason for hiding this comment

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

@consideRatio yes, unrelated but necessary - I put this in the description:

I was asked to bump an image tag for this by @jmunroe and have done so.

I couldn't keep it separate because it was needed for him to test his changes.

"""
Update the secret blocklist for cryptnono
"""
unencrypted_path = HERE / "unencrypted_secret_blocklist.py"
Copy link
Member

Choose a reason for hiding this comment

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

This should be following the pattern on how to name encrypted / decrypted conten to make our .gitignore file protect us from adding it unencrypted.

# This section handles sensitive content that is or isn't encrypted in our repo.
#
# Ignore files (but not directories) with secret in their name
*secret*
!*secret*/
# Don't ignore enc- prefixed files
!enc-*
# Don't ignore Helm chart templates with secret in their name as
# they are not supposed to contain sensitive content but can often
# have secret in their name.
!**/templates/**/*secret*.yaml

Let's make enc-<name>.secret.<file extension> to <name>.secret.<file extension>.

Suggested change
unencrypted_path = HERE / "unencrypted_secret_blocklist.py"
unencrypted_path = HERE / "blocklist-generator.secret.py"

Copy link
Member Author

Choose a reason for hiding this comment

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

The paths already take into account our gitignore. The encrypted file to be checked in is called enc-something.secret.py so it can be checked in. Our gitignore ignores anything with secret but without enc, so this temporary unencrypted file will be ignored. We can't use dashes in there because then the python import statement would not work, and the same is true of additional dots in the filename. As an additional precaution, the finally block deletes this file as well.

@generate_app.command()
def cryptnono_secret_config():
"""
Update the secret blocklist for cryptnono
Copy link
Member

@consideRatio consideRatio Jan 31, 2024

Choose a reason for hiding this comment

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

I wanted to make this code and command not require pre-requisite knowledge on what this what about, but allow the help string (from the docstring) to convey that.

Suggested change
Update the secret blocklist for cryptnono
Updates secret config for the cryptnono chart bundled with the support chart, specifically banned command strings and patterns as required by cryptnono's execwhacker detector if its enabled.
This command relies on a secret script run to generate the banned command strings, and the deploy-support command relies on the generated secret config.

Copy link
Member Author

Choose a reason for hiding this comment

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

This feels a little too repetitive for my personal style. Instead, once the PR is merged, I'll link to the docs from the code comments here - I put a lot of effort into those, and I think that's a better place for this kind of information.

Comment on lines +91 to +95
TmpAuthenticator:
# This allows users to go to the hub URL directly again to
# get a new server, instead of being plopped back into their
# older, existing user with a 'start server' button.
force_new_server: true
Copy link
Member

Choose a reason for hiding this comment

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

This is no longer needed, see https://github.com/jupyterhub/tmpauthenticator/blob/main/CHANGELOG.md#breaking-changes.

Suggested change
TmpAuthenticator:
# This allows users to go to the hub URL directly again to
# get a new server, instead of being plopped back into their
# older, existing user with a 'start server' button.
force_new_server: true

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in #3669

Comment on lines +83 to +84
The `-o wide` will add an additional column, `NODE`, showing which node the pods are running in. Find the
node of the user pod you care about.
Copy link
Member

Choose a reason for hiding this comment

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

Ah!! I've done kubectl get pod jupyter-<name> -o | grep hostname or similar for this - good to know!

Copy link
Member

@consideRatio consideRatio left a comment

Choose a reason for hiding this comment

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

I made some comments, but this looks overall great to me so I'll mark it as approved! Great seeing that there are already metrics and nice logging in place in cryptnono's execwhacker!

Amazing work on this @yuvipanda!!

Copy link
Member

@GeorgianaElena GeorgianaElena left a comment

Choose a reason for hiding this comment

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

Amazing work @yuvipanda 🚀 Thank you!

deployer/commands/generate/cryptnono_config/__init__.py Outdated Show resolved Hide resolved
docs/howto/features/cryptnono.md Outdated Show resolved Hide resolved
helm-charts/basehub/values.schema.yaml Outdated Show resolved Hide resolved
@sgibson91
Copy link
Member

@yuvipanda I opened yuvipanda#31 with a suggested splitting of the docs to follow diataxis a bit more

yuvipanda and others added 2 commits January 31, 2024 08:15
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
Co-authored-by: Georgiana <georgiana.dolocan@gmail.com>
yuvipanda and others added 10 commits January 31, 2024 08:28
Co-authored-by: Sarah Gibson <44771837+sgibson91@users.noreply.github.com>
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
Co-authored-by: Georgiana <georgiana.dolocan@gmail.com>
@yuvipanda
Copy link
Member Author

yuvipanda commented Jan 31, 2024

Thanks for the review everyone! I'm going to merge this now so @jmunroe can make image tag bumps without relying on me. I have three follow-ups here:

Thanks!

@yuvipanda yuvipanda merged commit bc97ef4 into 2i2c-org:master Jan 31, 2024
34 checks passed
Copy link

🎉🎉🎉🎉

Monitor the deployment of the hubs here 👉 https://github.com/2i2c-org/infrastructure/actions/runs/7732081497

yuvipanda added a commit to yuvipanda/pilot-hubs that referenced this pull request Jan 31, 2024
yuvipanda added a commit to yuvipanda/pilot-hubs that referenced this pull request Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done 🎉
Development

Successfully merging this pull request may close these issues.

None yet

4 participants