Commit graph

637 commits

Author SHA1 Message Date
Pedro Algarvio
602aa0cbf7 Reduce the number of workflows referenced
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-17 16:58:39 -07:00
Pedro Algarvio
ab6a77fcbd Reduce GitHub Actions cache usage
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-17 16:58:39 -07:00
Pedro Algarvio
b22db6db8a
Merge 3006.x into 3007.x 2024-01-17 15:15:03 +00:00
Pedro Algarvio
aad7a8ab14 Revert #64929 since it's not working as intended
See https://github.com/saltstack/salt/actions/runs/7554867564/job/20574453603#step:11:123

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-17 14:41:19 +00:00
Pedro Algarvio
a1a7dad84d Increase concurrency in CI pipelines.
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-17 14:08:35 +00:00
Pedro Algarvio
88d9589a17 Define the DEBs listing outside of the template
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-17 11:12:55 +00:00
Pedro Algarvio
9e7b942cba Fix RPM build repository for aarch64
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-17 11:12:55 +00:00
Pedro Algarvio
239e88c6e0 Missed change in 5ea3bf3a9d
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-17 11:12:55 +00:00
Pedro Algarvio
3fb1279f32 Allow excluding paths when cleaning up archives
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-17 11:12:55 +00:00
Pedro Algarvio
83e66d30b7 Fix CI nox artifacts download
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-17 11:12:55 +00:00
Pedro Algarvio
51f2b0b0c1 Define the DEBs listing outside of the template
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-17 06:14:31 +00:00
Pedro Algarvio
519755d4e7 Fix RPM build repository for aarch64
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-17 06:14:31 +00:00
Pedro Algarvio
2316440b32 Missed change in 5ea3bf3a9d
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-16 14:11:08 -07:00
Pedro Algarvio
50bcb9ebbc Allow excluding paths when cleaning up archives
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-16 09:23:16 +00:00
Pedro Algarvio
dffdcd644b Fix CI nox artifacts download
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-16 09:23:16 +00:00
Pedro Algarvio
31ac2414c1 Remove unnecessary workflow steps while still showing the information
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-09 18:50:44 +00:00
Pedro Algarvio
ae64971701 Remove unnecessary workflow steps while still showing the information
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-09 15:37:45 +00:00
David Murphy
02ca0a503d
Merge pull request #65793 from s0undt3ch/hotfix/merge-forward
[3007.x] Merge 3006.x into 3007.x
2024-01-08 13:56:41 -07:00
Pedro Algarvio
68ecf808e3
Merge 3006.x into 3007.x 2024-01-05 11:29:13 +00:00
Pedro Algarvio
2fa8fa8d2a Re-add the removed Linux OS'es for the package download tests
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-04 15:11:37 -07:00
Pedro Algarvio
5ea3bf3a9d Prefer using macos instead of darwin
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-04 15:11:37 -07:00
Pedro Algarvio
cb6e589c98 Stop using aarch64
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-04 15:11:37 -07:00
Pedro Algarvio
66b91ca316 Reduce the number of workflows referenced
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-04 15:11:37 -07:00
Pedro Algarvio
9c5ea5a324 Reduce GitHub Actions cache usage
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-04 15:11:37 -07:00
Pedro Algarvio
10341c5652
Be sure to trigger all release branches on nightly and scheduled builds
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2024-01-03 10:48:19 +00:00
Daniel A. Wozniak
5c83db6a3c Merge remote-tracking branch 'saltstack/3006.x' into merge-forward 2023-12-26 21:50:50 -07:00
Pedro Algarvio
478e2e2439 Append the .0 for Photon OS, after checking supported versions
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2023-12-26 06:49:22 +00:00
Jamie Murphy
4771edb58a add nightly minor/latest symlink to debian repos 2023-12-18 04:35:47 -07:00
Jamie (Bear) Murphy
7d198938ba adjust minor/nightly path to minor/latest 2023-12-18 04:35:47 -07:00
Jamie (Bear) Murphy
c122d225fc adjust if none check 2023-12-18 04:35:47 -07:00
Jamie Murphy
bf1dda1212 Update create.py 2023-12-18 04:35:47 -07:00
Jamie Murphy
252e86518f add a nightly_latest.repo file which always points to latest nightly build 2023-12-18 04:35:47 -07:00
Jamie Murphy
b6cb55a1f7 adjust path to minor/nightly 2023-12-18 04:35:47 -07:00
Jamie Murphy
cdf020c5c5 add nightly symlink 2023-12-18 04:35:47 -07:00
Daniel A. Wozniak
412178e48a Merge remote-tracking branch 'saltstack/3006.x' into merge-forward 2023-12-16 15:35:16 -07:00
jeanluc
f2121e5ade
Rewrite vault core, issue AppRoles to minions (#62684)
* Rewrite vault core, orchestrate AppRoles for minions

This commit represents a fundamental rewrite in how Salt interacts with
Vault. The master should still be compatible with minions running the
old code. There should be no breaking changes to public interfaces and
the old configuration format should still apply.

Core:
- Issue AppRoles to minions
- Manage entities with templatable metadata for minions
- Use inbuilt Salt cache
- Separate config cache from token cache
- Cache: introduce connection-scope vs global scope

Utility module:
- Support being imported (__utils__ deprecation)
- Raise exceptions on queries to simplify response handling
- Add classes to wrap complexity, especially regarding KV v2
- Lay some groundwork for renewing tokens

Execution module:
- Add patch_secret
- Add version support to delete_secret
- Allow returning listed keys only in list_secret
- Add policy_[fetch/write/delete] and policies_list
- Add query for arbitrary API queries

State module:
- Make use of execution module
- Change output format

Docs:
- Update for new configuration format
- Correct examples
- Add configuration examples
- Add required policies

* Fix linting for rewritten vault integration

* Add pytest unit tests for utils.vault, fix found issues

* Fix old vault runner tests

* Rewrite vault sdb tests, migrate to pytests

* Adapt vault ext_pillar tests

* Adapt vault execution module tests, migrate to pytests

* Add more vault execution module unit tests

* Support python <3.7 (vault util), time-independent tests

* Add/migrate vault runner unit tests (pytest)

* Add vault state module pytests

* Fix tests lint

* Refactor Vault container fixture, move to session scope

* Fix for existing vault execution/sdb module integration tests

* Improve existing vault runner integration tests

* Fix vault test support, add list policies

* Add more functional execution module tests, fix deprecated warning

* Refactor vault pytest support

* Add integration tests, improve/fix caching/issue_params

* Improve caching behavior, fix tests

* Always use session cache as well
* Also flush session cache when requested
* Make KV metadata caching behavior configurable
* Update tests to account for changes from prev commit

* Allow to autodiscover platform default CA bundle

* Remove runner approle param overrides

There is no simple way to ensure they are kept.

* Add clear_cache runner function

* Also manage token metadata for issued secret IDs

* Cleanup tests

* Cleanup code, pylint logging suggestions

* Do not always invalidate config when verify=default

* Ensure concatted metadata lists are sorted

* Add changelog (partly)

* Work with legacy peer_run configuration as well

* Consume a token use regardless of status code

* Correct verify semantics

* Refine token uses handling, add changelog/tests for old issues

* Add changelog for main features

* Add test for issue 58580

* Fix vault docs

* Provide all old make_request functionality, add tests

* Allow token use override, add docstrings to query funcs

* Simplify config_location merge

* Cleanup

* Fix make_request warning

* Attempt to fix memory issues during CI test run

* Increase documented version

* Improve lease handling

* Refine lease ttl handling/add token lifecycle management

* Fix docs build

* Adapt formatting

* assert what you get against what you expect
* drop empty parentheses after wrapper
* use `is` to compare against strictly boolean vars

* Fix issue param overrides

* during pillar rendering, they were always reset by the master (for
  AppRoles)
* overrides were only respected for some settings (AppRoles)
* old config syntax was using the old syntax internally (tech debt)

* Introduce session-scoped cache

* Tokens with a single use left are unrenewable

* Allow override of flushing of cached leases during lookup

* Refactor cache classes, save lease data

* Rename session token cache key

* Add lease management utility

* Fix runner integration tests

after renaming the token cache key

* Do not overwrite data of cached leases after renewal

* Pass token_lifecycle to minions

* Do not fail syncing multiple approles/entities with pillar templates

* Ensure config cache expiration can be disabled

* Rename changelog files (.md)

* Declare vaultpolicylexer as parallel read safe

* Correct meta[data] payload key

For tokens it is `meta`, but for secret IDs, `metadata`.

* Reuse TCP connection

* Refactor utils module

* Ensure client is recreated after clearing cache

* Always use unwrap_client config as expected server

This should fix the test failure in the runner integration test
TestAppRoleIssuance::test_server_switch_does_not_break_minion_auth

* Ensure client is recreated after clearing cache 2

* Simulate patch for KV v1 or missing `patch` capability

* Add `patch` option to Vault SDB driver

* Reduce lease validity when revocation fails

* Extract AppRole/Identity API from runner into utils

* Revoke tokens, fire events, improve cache/exception handling

* Tokens (and therefore associated leases) are revoked when cleared by default
* It's possible to disable clearing cache when a perfectly valid token
  is available, but a PermissionDeniedError is encountered.
* UnwrapExceptions always cause an event to be fired
* It's possible to enable sending of events when
    a) cache is cleared
    b) a lease is requested from cache, but it is/will be invalid
* A VaultAuthException does not immediately lead to clearing
  the connection cache
* get_authd_client and others: multiple small enhancements and fixes

* Allow updating cached config w/o closing session

* Homogenize funcs, update docs, cleanup

* Minor internal fixes

`is_valid_for` is present on all lease-like objects, while `is_valid`
specifically should account for more, e.g. the number of uses.

The Vault API does not return 404 when a lookup fails.

* Add release note

* Address review remarks

* Fix release notes

* Remove loading minion_mods from factory

* Address other review remarks

* Add inline specification of trusted CA root cert

* Small QoL additions

* Fix lint

* Fix lint for Python >=3.8 support

* Add missing fixes

* Fix unit tests

In some cases, the `spec` calls were failing because the underlying
object was already patched

---------

Co-authored-by: Thomas Phipps <tphipps@vmware.com>
2023-12-15 21:42:08 -07:00
Felippe Burk
55042e396d update photon paths to use their $releasever string 2023-12-15 16:45:52 -07:00
Felippe Burk
99c6260b8f
Revert "update photon paths to use their $releasever string string which includes .0"
This reverts commit fd4e3a225a.
2023-12-15 13:14:23 -07:00
Felippe Burk
fd4e3a225a
update photon paths to use their $releasever string string which includes .0 2023-12-15 11:13:20 -07:00
Pedro Algarvio
e3ba31dc7a
Merge 3006.x into 3007.x 2023-12-14 11:32:20 +00:00
Pedro Algarvio
c9b42a19ae Stop importing salt in tools/
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2023-12-12 15:30:18 -07:00
Pedro Algarvio
baa5858c03 Make sure that the package artifacts are uploaded to VMs
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2023-12-12 15:29:41 -07:00
Pedro Algarvio
a6ca3ec5f7 It's a single nox.*.tar.xz archive now
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2023-12-12 15:29:41 -07:00
Pedro Algarvio
4e1ac179e2 Fix the path to where package downloads should go
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2023-12-12 15:29:41 -07:00
Megan Wilhite
d453007a8f Migrate package tests to the main test suite 2023-12-12 15:29:41 -07:00
Daniel A. Wozniak
d7549bd155 Fix docstring 2023-12-10 21:06:45 -07:00
Pedro Algarvio
0401d581ab
Stop importing salt in tools/
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2023-12-07 17:08:55 +00:00
Pedro Algarvio
b3d4a5e2c5
Merge 3006.x into master 2023-12-06 10:17:35 +00:00
Daniel A. Wozniak
4ff201ac03 Fix onedir pkg download test 2023-12-06 01:46:28 -07:00
Pedro Algarvio
e93d3fcc9c
ctx.print is not the same as python's print
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2023-12-05 18:30:32 +00:00