Commit Graph

19 Commits

Author SHA1 Message Date
Thomas Waldmann 9de07ebd46
update "modern" error RCs (docs and code) 2024-02-13 22:58:02 +01:00
Thomas Waldmann fa1e9df0d1
--sort-by: support "archive" as alias of "name", fixes #7873 2023-11-05 18:05:27 +01:00
Thomas Waldmann 1cf62d8fc7
remove manifest TAMs 2023-09-24 20:10:53 +02:00
Thomas Waldmann 1b6f928917
ro_type: typed repo objects, see #7670
writing: put type into repoobj metadata
reading: check wanted type against type we got

repoobj metadata is encrypted and authenticated.
repoobj data is encrypted and authenticated, also (separately).
encryption and decryption of both metadata and data get the
same "chunk ID" as AAD, so both are "bound" to that (same) ID.

a repo-side attacker can neither see cleartext metadata/data,
nor successfully tamper with it (AEAD decryption would fail).

also, a repo-side attacker could not replace a repoobj A with a
differently typed repoobj B without borg noticing:
- the metadata/data is cryptographically bound to its ID.
  authentication/decryption would fail on mismatch.
- the type check would fail.

thus, the problem (see CVEs in changelog) solved in borg 1 by the
manifest and archive TAMs is now already solved by the type check.
2023-09-24 20:10:50 +02:00
Thomas Waldmann 55f0798b15
fix src code formatting
not sure why this changed!?
2023-09-05 00:34:03 +02:00
Thomas Waldmann 21d4407170
always implicitly require manifest TAMs
remove a lot of complexity from the code that was just there to
support legacy borg versions < 1.0.9 which did not TAM authenticate
the manifest.

since then, borg writes TAM authentication to the manifest,
even if the repo is unencrypted.
if the repo is unencrypted, it did not check the somehow pointless
authentication that was generated without any secret, but
if we add that fake TAM, we can also verify the fake TAM.

if somebody explicitly switches off all crypto, they can not
expect authentication.

for everybody else, borg now always generates the TAM and also
verifies it.
2023-09-03 22:01:46 +02:00
Thomas Waldmann 5013121bd8
fix E501 2023-07-26 01:24:20 +02:00
Thomas Waldmann 51e68c24e4
manifest: move item_keys into config dict, fixes #7710
also: manifest.version == 2 now
2023-07-05 01:11:24 +02:00
jetchirag eeefa55428
do not crash for empty archives list in borg rlist date based matching (#7544)
fix ValueError for empty archives list, add a test

Signed-off-by: Chirag Aggarwal <thechiragaggarwal@gmail.com>
2023-05-20 12:30:03 +02:00
Thomas Waldmann 52793be923
pyupgrade --py39-plus ./**/*.py 2023-04-02 02:14:54 +02:00
Michael Deyaso 8af9eb47c2
Added date-matching support for list_considering (#7306)
added date-matching support for list_considering, fixes #7296

Co-authored-by: Michael Deyaso <mdeyaso@fusioniq.io>
2023-02-01 11:32:53 +01:00
Thomas Waldmann 60ebd1d2b0
Archives.list: reorder args 2023-01-23 15:11:53 +01:00
Michael Deyaso b2654bc17d
Support for date-based matching during archive listing (#7272)
check --archives: add --newer/--older/--newest/--oldest, fixes #7062

Options accept a timespan, like Nd for N days or Nm for N months.

Use these to do date-based matching on archives and only check some of them,
like: borg check --archives --newer=1m --newest=7d

Author: Michael Deyaso <mdeyaso@fusioniq.io>
2023-01-23 15:00:05 +01:00
Josh Soref a3af1ffc32 spelling: trade-offs
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-01-12 11:24:04 -05:00
Paul D 253d8e8d4e Docs grammar fixes
joined split infinitives, and relocated adverbs appropriately.
2022-12-29 22:26:54 +00:00
Thomas Waldmann 4493d396e6 implement pattern support for --match-archives, fixes #6504
also:
- rename --glob-archives option to --match-archives (short: -a, unchanged)
- globbing patterns now need sh: prefix
- regex patterns need re: prefix
- "identical" match "patterns" use an id: prefix
- new default style is id: pattern (--glob-archives used sh: glob pattern)
- source code: glob -> match, GLOB -> PATTERN
2022-09-16 15:10:13 +02:00
Thomas Waldmann fa986a9f19 repoobj: add a layer to format/parse repo objects
borg < 2:

obj = encrypted(compressed(data))

borg 2:

obj = enc_meta_len32 + encrypted(msgpacked(meta)) + encrypted(compressed(data))

handle compr / decompr in repoobj

move the assert_id call from decrypt to RepoObj.parse

also:
- for AEADKeyBase, add a dummy assert_id (not needed here)
- only test assert_id for other if not AEADKeyBase instance
- remove test_getting_wrong_chunk. assert_id is called elsewhere
  and is not needed any more anyway with the new AEAD crypto.
- only give manifest (includes key, repo, repo_objs)
- only return manifest from Manifest.load (includes key, repo, repo_objs)
2022-09-04 00:49:38 +02:00
Thomas Waldmann ecd7bce5b8 move shellpattern module to borg.helpers 2022-08-13 22:03:44 +02:00
Thomas Waldmann 9beaced33c move manifest module from helpers to borg.manifest 2022-08-13 21:55:12 +02:00
Renamed from src/borg/helpers/manifest.py (Browse further)