Commit Graph

3403 Commits

Author SHA1 Message Date
Nick Mathewson 4262e9d0ec Merge branch 'use-fs-mistrust' 2022-05-09 15:27:25 -04:00
Nick Mathewson 5c33499f28 Loosen checking for readable files within target directories.
If the target directory itself is unreadable by untrusted users,
then its contents can't be read[*] by them regardless of their
permissions.  If the target directory _is_ readable, then _it_ will
be rejected if we are forbidding readable objects.  (And if we
aren't we don't care if the contents are readable.)

A similar argument would apply to writable objects within an
unreadable target directory.  We're not making that argument, since
such contents are likelier to be a mistake.

[*] Unless they're hard-linked; see comments in "Limitations"
section.
2022-05-09 14:40:29 -04:00
Nick Mathewson dcc5a3cfe8 Add a CLI option to disable FS permission checks. 2022-05-09 14:40:29 -04:00
Nick Mathewson 8a62f9ce52 Remove "Mistrust" from the public API of arti-client.
I'm doing this per discussion, so that we can have it be part of the
TorConfig later on, and not break stuff as we change the Mistrust
API to have a builder.

This change, unfortunately, results in a little more internal
complexity and duplicated code in arti and arti-client.  I've marked
those points with TODOs.
2022-05-09 14:40:29 -04:00
Nick Mathewson b0f39abe32 arti: use fs-mistrust to validate configuration file locations. 2022-05-09 14:40:29 -04:00
Nick Mathewson 2938268f34 arti-client: Configure and use fs-mistrust.
This is derived from the environment, not the configuration file: We
might not want to trust the configuration file until we've decided
whether we like its permissions.
2022-05-09 14:40:29 -04:00
Nick Mathewson 20a85061b6 Update tor-dirmgr to use fs-mistrust. 2022-05-09 14:40:29 -04:00
Nick Mathewson 984190b3a3 tor-persist: Use fs-mistrust to verify state file permissions. 2022-05-09 14:40:29 -04:00
Nick Mathewson 8509ffff7a Add new FsPermissions ErrorKind. 2022-05-09 14:40:29 -04:00
Nick Mathewson 14e8243bdc fs-mistrust: add various methods.
This includes:

  * a CachedDir::join method.
  * functions to read and write from provided filenames in a
    CachedDir.
  * a method to tell whether a fs-mistrust error is about bad file
    permissions, or failure to inspect file permissions or some other
    kind of IO problem.
2022-05-09 14:39:49 -04:00
Nick Mathewson 0eda471aaf Merge branch 'netparams' into 'main'
NetParams: Document its role as a validated config parameter

See merge request tpo/core/arti!492
2022-05-09 16:13:30 +00:00
Ian Jackson cc99efb72a NetParams: Document its role as a validated config parameter 2022-05-09 15:35:50 +01:00
Ian Jackson 3a0da9e86a Merge branch 'coverage-weekly' into 'main'
export coverage to pages

See merge request tpo/core/arti!489
2022-05-06 16:31:26 +00:00
Nick Mathewson 1dfb58a23c A few small changelog style edits. 2022-05-06 10:21:38 -04:00
Nick Mathewson 9fa93f961b Merge remote-tracking branch 'origin/mr/491' 2022-05-06 10:21:25 -04:00
Nick Mathewson 16eeb16b4c Clear semver_status now that 0.3.0 is coming out. 2022-05-06 10:08:08 -04:00
Nick Mathewson 7b93091f57 Bump the version of every* crate to 0.3.0
* Except for safelog and fs-mistrust, which are new.
2022-05-06 10:03:15 -04:00
Nick Mathewson 89b38b16c7 Change safelog version to 0.1.0.
(This is okay because we haven't published it yet, or any crate that
uses it.)
2022-05-06 09:59:13 -04:00
eta 3aca6a1915 CHANGELOG.md: resolve minor typos 2022-05-06 14:55:20 +01:00
Nick Mathewson 9447e69355 Update README.md files (automated). 2022-05-06 09:51:11 -04:00
Nick Mathewson 59cd3b8a53 CHANGELOG.md: light reformatting. 2022-05-06 09:42:23 -04:00
Nick Mathewson c763ef6743 Finish the CHANGELOG.md for 0.3.0 2022-05-06 09:41:37 -04:00
Nick Mathewson 013bb26040 Merge branch 'derive-builder-fork' into 'main'
Switch to derive_builder_arti_fork

Closes #446

See merge request tpo/core/arti!490
2022-05-06 13:07:51 +00:00
Ian Jackson 030289481f Switch to derive_builder_arti_fork
For reference, the git source for this crate (and the others in its
workspace) currently lives in my personal github account (ijackson).
If this fork turns out to be long-lived and gains features and/or
users, it would be good to move it to a gitlab somewhere.

I have granted Nick crate ownership on the crates.io system.
2022-05-06 13:36:40 +01:00
Nick Mathewson c302a29169 Merge branch 'safelogging' into 'main'
Implement a safe-logging facility.

Closes #189

See merge request tpo/core/arti!485
2022-05-06 12:06:43 +00:00
eta 373934efbf Punctuation fix. 2022-05-06 07:38:16 -04:00
Nick Mathewson b879125668 Disable safe-logging when logging to console. 2022-05-06 07:38:16 -04:00
Nick Mathewson 7e34692a65 arti: add support for safe-logging configuration
Here we add a config option to disable safe logging, and ensure that
safe logging is disabled when we are formatting an error message on
exit (since we assume it's safe to write sensitive info to stderr.)
2022-05-06 07:38:14 -04:00
Nick Mathewson 4679023c39 Apply `sensitive` in some info-level log messages.
This specifically applies the `sensitive` wrapper in the places
where we're logging target addresses at level "info" or higher.
2022-05-06 07:36:50 -04:00
Nick Mathewson 7aacc6e30c Implement a safe-logging facility.
This is a rough first-cut of an API that I think might help us with
keeping limited categories of sensitive information out of our logs.
I'll refine it based on experiences with using it.
2022-05-06 07:36:48 -04:00
trinity-1686a 98de5cff3c only deploy pages on main 2022-05-05 22:21:09 +02:00
trinity-1686a 3464cae490 use true instead of /bin/true
see https://gitlab.torproject.org/tpo/core/arti/-/issues/400#note_2800763
2022-05-05 21:05:42 +02:00
trinity-1686a 9ed5983c76 add schedulable job to generate aggregated coverage 2022-05-05 21:05:42 +02:00
trinity-1686a 5bd38ab6dc generate aggregated coverage reports 2022-05-05 18:35:34 +02:00
eta de2b23642d Merge branch 'typos-20220504' into 'main'
Fix typos (using the typos-cli tool).

See merge request tpo/core/arti!486
2022-05-05 15:55:22 +00:00
Nick Mathewson 62d159e3c4 Derive Clone and Debug for CheckedDir. 2022-05-05 09:47:13 -04:00
Nick Mathewson b9c54af707 gitlab-ci: Disable fs mistrust in integration test
The environment where the test runner does its thing seems to want
to run as root with umask 000, which naturally makes the fs
permissions checks freak out.
2022-05-05 09:47:13 -04:00
Nick Mathewson 5b9d71f708 Merge branch 'config-serde' into 'main'
Make config builders, not validated structs, [de]serialize

See merge request tpo/core/arti!487
2022-05-05 13:15:10 +00:00
trinity-1686a ee9730cab4 chutney test stop network when arti died or did not start 2022-05-05 13:12:30 +02:00
Ian Jackson acf38505ee semver notes: Fix a missing paren 2022-05-05 10:35:52 +01:00
Ian Jackson 31ce7f4bc0 semver note about serde attribute changes 2022-05-05 10:35:52 +01:00
Ian Jackson d47e94b459 config derive attrs: Make builders serde, and validated structs not
* Builders additionally derive: Debug, Serialize, Deserialize.

 * Validated structs no longer derive: Serialize, Deserialize
   and all related attributes deleted.

 * As a consequence, all the `#[serde(deny_unknown_fields)]`
   are gone.  That means that right now unknown fields are totally
   ignored.  This is good for compatibility but poor for useability.
   Doing something better here is arti#417, in progress.

 * As a consequence, delete tor_dirmgr::retry::default_parallelism.
   (The default value was already duplicated into a builder attr.)
2022-05-05 10:35:52 +01:00
Ian Jackson 6a39f9d8da serde attributes: A tiny bit of reordering
Having a consistent order will make the nest commit easier to read.
2022-05-05 10:19:29 +01:00
Ian Jackson 2c1282f537 Make LogRotation Serialize
We want to be able to serialise as well as deserialise configurations.
2022-05-05 10:19:29 +01:00
Nick Mathewson 08eba63a99 Start drafting a changelog for 0.3.0 2022-05-04 16:38:59 -04:00
Nick Mathewson fc33fc3efb Fix typos (using the typos-cli tool). 2022-05-04 14:41:50 -04:00
Nick Mathewson 66ee39995d Run "cargo update" in preparation for a release... next week? 2022-05-04 14:17:11 -04:00
Ian Jackson a334f17262 Merge branch 'socket-addr-list-builder' into 'main'
FallbackDir: orports: Introduce and use VecBuilder

See merge request tpo/core/arti!474
2022-05-04 18:13:45 +00:00
Ian Jackson df2813ed55 list_builder: Add some xrefs about macro_rules limitations
Apropos
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/474#note_2800481
2022-05-04 18:35:33 +01:00
Nick Mathewson cb892116dc Fix typo 2022-05-04 17:34:47 +00:00