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

docs(ses): Document environment lockdown options #2018

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

kriskowal
Copy link
Member

Closes #1910

Description

This change adds documentation to the existing lockdown environment options.

Security Considerations

No impact on security except a reduction in obscurity.

Scaling Considerations

No code changes.

Documentation Considerations

Fills a void in documentation. The issue remains that this documentation is not easy to find.

Testing Considerations

No changes.

Compatibility Considerations

No effects.

Upgrade Considerations

No changes.

@kriskowal kriskowal requested a review from erights January 30, 2024 02:36
Copy link
Contributor

@erights erights left a comment

Choose a reason for hiding this comment

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

LGTM with corrections

Thanks for doing this! Was badly needed.


In the absence of any of these options in lockdown arguments, lockdown will
attempt to read these from the Node.js `process.env` environment.
The corresponding environment variables are the same but in `UPPER_SNAKE_CASE`.
attempt to read these options from the corresponding Node.js `process.env` environment.
Copy link
Contributor

Choose a reason for hiding this comment

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

Might want to additionally explain, for those not familiar with this node feature, that for the start compartment these typically reflect *Nix environment variables in the context that the node process was launched from. Or just link to the @endo/env-options package.

The corresponding environment variables are the same but in `UPPER_SNAKE_CASE`.
attempt to read these options from the corresponding Node.js `process.env` environment.

| option | environment variable | |
Copy link
Contributor

Choose a reason for hiding this comment

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

Three column table looks weird without a heading for the third column. How about simply "notes"?

Comment on lines 208 to 216
The `consoleTaming: 'safe'` setting replaces the global console with a tamed
console, and that tamed console is safe to endow to a guest `Compartment`.
Additionally, any errors created with the `assert` function or methods on its
namespace may have redacted details: information included in the error message
that is informative to a debugger and made invisible to an attacker.
The tamed console removes redactions and shows these details to the original
console.
Copy link
Contributor

Choose a reason for hiding this comment

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

New paragraph is great and was badly needed. Please also add a link to https://github.com/endojs/endo/blob/master/packages/ses/src/error/README.md

Comment on lines +225 to +228
Until we know otherwise, we should assume these are unsafe. Such a raw
`console` object should only be handled by very trustworthy code.
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI

// The untamed Node.js console cannot itself be hardened as it has mutable
// internal properties, but some of these properties expose internal versions
// of classes from node's "primordials" concept.
from @mhofman 's #1939 does mitigate the case we're aware of.

Comment on lines +493 to +496
throw new TypeError();
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Too bad eslint doesn't run on "```js" blocks in .md files ;)

@@ -617,6 +709,15 @@ lockdown({ overrideTaming: 'min' }); // Minimal mitigations for purely modern co
lockdown({ overrideTaming: 'severe' }); // More severe legacy compat
```

If `lockdown` receives no election for `stackFiltering`, it will
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If `lockdown` receives no election for `stackFiltering`, it will
If `lockdown` receives no election for `overrideTaming`, it will

Other similar cut/paste errors in this same position below. Please check them all.

@kriskowal kriskowal force-pushed the kriskowal-lockdown-environment-options-1910 branch from a54fdaf to a2d796a Compare January 30, 2024 06:49
@kriskowal kriskowal enabled auto-merge January 30, 2024 06:49
@kriskowal kriskowal merged commit 4040f0e into master Jan 30, 2024
14 checks passed
@kriskowal kriskowal deleted the kriskowal-lockdown-environment-options-1910 branch January 30, 2024 06:56
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.

Document discrete LOCKDOWN_*_TAMING environment variables
2 participants