Commit Graph

188 Commits

Author SHA1 Message Date
vinay-gopalan
f06f2f8188 add missing create operation for aws secrets (#29737) 2025-02-27 09:20:12 -08:00
vinay-gopalan
e8c07ec68e Small fixes on UX of Automated Root Rotation parameters (#29685) 2025-02-25 09:14:38 -08:00
Milena Zlaticanin
6e0c771e57 Add support for cross account management of static roles in AWS Secrets (#29645)
* aws-secrets/add-cross-acc-mgmt-static-roles

* refactor

* add function pointer for tests

* delete commented out code

* update

* update comment

* update func name

* add flag

* remove docs
2025-02-14 14:13:00 -07:00
vinay-gopalan
6a9de17ac4 move logs into if block (#29634) 2025-02-13 22:56:22 +00:00
vinay-gopalan
9e38a88883 Add automated root rotation support to DB Secrets (#29557) 2025-02-11 12:09:26 -08:00
vinay-gopalan
9b70487623 Automated rotate root support for AWS Auth and Secrets (#29497) 2025-02-10 18:36:44 -05:00
vinay-gopalan
838a38443f Update Rotation Manager OSS Stubs and SDK methods (#29401) 2025-01-28 14:24:44 -06:00
vinay-gopalan
27bd3e9535 Add SDK helpers and Core stubs for plugins to communicate with Enterprise Rotation Manager (#29273)
Co-authored-by: Robert <17119716+robmonte@users.noreply.github.com>
Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
2025-01-07 22:22:45 +00:00
kpcraig
d8482b008a VAULT-32804: Add STS Fallback parameters to secrets-aws engine (#29051)
Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

---------

Co-authored-by: Robert <17119716+robmonte@users.noreply.github.com>
Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
2024-12-05 16:22:21 -05:00
miagilepner
10bd15f956 VAULT-30877: Repopulate AWS static creds queue in initialize (#28775)
* populate rotation queue in initialize

* docs, changelog

* add t.Helper()
2024-11-04 09:32:14 -06:00
Guillermo Barroso
aeca0cdee6 secrets/aws: add sts_region parameter to root config (#22726)
* Set region parameter to be used for STS only on AWS secrets engine

* Add changelog

* Fix formatting

* region fix when not setting iam_endpoint or sts_endpoint

* Add 'sts_region' parameter for AWS secrets engine.

* Update TestBackend_PathConfigRoot for aws secrets

* Update changelog entry

---------

Co-authored-by: Robert <17119716+robmonte@users.noreply.github.com>
2024-10-04 18:33:09 +00:00
JMGoldsmith
cc38383732 VAULT-30694 Adding a check for nil values returned by the queue (#28330)
* adding a check for nil values returned by the queue

* adding changelog

* changing to be more idiomatic

* fixing error message to be a bit more clear

* reverting change to error handling

* Update builtin/logical/aws/path_static_roles.go

Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>

---------

Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
2024-09-12 17:26:46 +02:00
Ben Ash
a05deb5f37 AWS secrets: add support for STS session tags (#27620)
Adds support for configuring session tags for assume role operations.
2024-07-02 10:48:52 -04:00
Austin Gebauer
df57ff46ff Add stubs for plugin WIF (#25657)
* Add stubs for plugin wif

* add header to sdk file

* drop changelog to move it

* fix test
2024-02-27 12:10:43 -08:00
Josh Black
fa13dbd381 add gosimport to make fmt and run it (#25383)
* add gosimport to make fmt and run it

* move installation to tools.sh

* correct weird spacing issue

* Update Makefile

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>

* fix a weird issue

---------

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
2024-02-13 14:07:02 -08:00
vinay-gopalan
fcf7cf6c22 WIF support for AWS secrets engine (#24987)
* add new plugin wif fields to AWS Secrets Engine

* add changelog

* go get awsutil v0.3.0

* fix up changelog

* fix test and field parsing helper

* godoc on new test

* require role arn when audience set

* make fmt

---------

Co-authored-by: Austin Gebauer <agebauer@hashicorp.com>
Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>
2024-01-29 11:34:57 -08:00
Kit Haines
fb71d7f3c8 make-fmt (#24940) 2024-01-18 20:00:00 +00:00
Robert
54bf0807c1 secrets/aws: add support for STS Session Tokens with TOTP (#23690)
* Add test coverage

* Add session_token field, deprecate security_token

* Undo auth docs

* Update api docs

* Add MFA code support

---------

Co-authored-by: Graham Christensen <graham@grahamc.com>
Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>
2023-11-08 17:06:28 -06:00
kpcraig
6aabb22b7c AWS Static Secrets: Requeue credential for rotation if initial attempt fails (#23673) 2023-10-17 14:12:33 -04:00
kpcraig
30f19b383f VAULT-18307: update rotation period for aws static roles on update (#23528) 2023-10-11 17:06:58 +00:00
hashicorp-copywrite[bot]
0b12cdcfd1 [COMPLIANCE] License changes (#22290)
* Adding explicit MPL license for sub-package.

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Adding explicit MPL license for sub-package.

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Updating the license from MPL to Business Source License.

Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl.

* add missing license headers

* Update copyright file headers to BUS-1.1

* Fix test that expected exact offset on hcl file

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Sarah Thompson <sthompson@hashicorp.com>
Co-authored-by: Brian Kassouf <bkassouf@hashicorp.com>
2023-08-10 18:14:03 -07:00
Max Bowsher
fe013a987a Add missing Query: true metadata to API definitions (#21949)
* Add missing `Query: true` metadata to API definitions

Also improve the documentation comment for `Query` to guide people better how they should be setting `Query` in the future.

Endpoints affected:
- auth/approle/role/{role_name}/secret-id/destroy
- auth/approle/role/{role_name}/secret-id-accessor/destroy
- auth/token/lookup
- auth/token/lookup-self
- sys/internal/specs/openapi
- sys/wrapping/lookup
- identity/oidc/provider/{name}/authorize

There are also endpoints in the `aws` and `gcp` secrets engines which need the same treatment in their own PRs.

When working on the `auth/token/lookup-self` path, I discovered that it
had a parameter which was completely pointless - it was even documented
as unused. It only existed because the `auth/token/lookup-self` code
path was implemented by bodging the current token into the request data
and passing control to the `auth/token/lookup` handler directly -
instead of just factoring out the common code to a reusable function -
so I fixed that whilst I was there.

Note that two of the affected endpoints currently have one form of their
OpenAPI operation ID set to something mentioning "with-parameters":
- identity/oidc/provider/{name}/authorize
- sys/internal/specs/openapi

These operation IDs should be changed, as they perpetuate
a misunderstanding - both read (GET) and update (POST/PUT) forms of
these APIs are **equally** capable of being used with parameters.

* I failed to spot that the aws plugin is in-repo! Update that too.

* Remove code cleanup changes from this PR

* Wording and wrapping adjustment as requested.
2023-07-21 15:05:29 -04:00
Austin Gebauer
bf19846b18 Adds replication state helper to framework.Backend (#21743)
* Adds replication state helper to framework.Backend

* Fix test

* adds changelog
2023-07-11 15:22:28 -07:00
Violet Hynes
3a46ecc389 Replace all remaining time.ParseDurations with parseutil.ParseDurationSeconds (#21357)
* Replace all time.ParseDurations with testutil.ParseDurationSeconds

* Changelog

* Import formatting

* Import formatting

* Import formatting

* Import formatting

* Semgrep rule that runs as part of CI
2023-06-20 14:37:46 -04:00
kpcraig
45b9dffea1 Update aws static credential fields to match dynamic credential fields (#21017)
* prospective field name change

* doc update

* we can actually update all struct tags here
2023-06-06 14:30:39 -05:00
kpcraig
cc8b856471 VAULT-12226: Add Static Roles to the AWS plugin (#20536)
Add static roles to the aws secrets engine

---------

Co-authored-by: maxcoulombe <max.coulombe@hashicorp.com>
Co-authored-by: vinay-gopalan <86625824+vinay-gopalan@users.noreply.github.com>
Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>
2023-05-24 14:55:13 -04:00
John-Michael Faircloth
578e62214e secrets/aws: fix role field description (#20686) 2023-05-19 18:33:18 +00:00
Anton Averchenkov
02742a7b9e openapi: A few fixes for display attributes (#20549) 2023-05-11 17:20:11 -04:00
John-Michael Faircloth
c585a4568e secrets/aws: fix acc test for sts (#20408) 2023-04-27 21:40:45 +00:00
Kyle Schochenmaier
8fa560568a Revert changes to STS leases but keep the ttl field (#20034)
* revert STS lease changes, now create a lease for STS credentials but keep the ttl
Co-authored-by: Calvin Leung Huang <1883212+calvn@users.noreply.github.com>
2023-04-13 15:02:39 -05:00
Anton Averchenkov
af1006a202 openapi: Add display attributes for AWS (#19366) 2023-04-06 11:08:30 -04:00
Mason Foster
cfff8d420e aws: pass cancelable context with aws calls (#19365)
* auth/aws: use cancelable context with aws calls

* secrets/aws: use cancelable context with aws calls
2023-03-23 12:02:24 -05:00
Hamid Ghaf
e55c18ed12 adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00
John-Michael Faircloth
4bfc64992a plugin/secrets/auth: enable multiplexing (#19215)
* plugin/auth: enable multiplexing

- the plugin will be multiplexed when run as an external plugin
  by vault versions that support secrets/auth plugin multiplexing (> 1.12)
- we continue to set the TLSProviderFunc to maintain backwards
  compatibility with vault versions that don't support AutoMTLS (< 1.12)

* enable multiplexing for secrets engines

* add changelog

* revert call to ServeMultiplex for pki and transit

* Revert "revert call to ServeMultiplex for pki and transit"

This reverts commit 755be28d14b4c4c4d884d3cf4d2ec003dda579b9.
2023-02-16 22:25:15 +00:00
Nick Cabatoff
192baa88db Make API not depend on SDK (#18962) 2023-02-06 09:41:56 -05:00
Michael Anthony
7209357904 [QT-309] Resolve AWS config before testing ACC (#17949)
* Check to resolve AWS config before testing ACC

* Adjust wording of error to be more clear
2022-11-17 11:55:27 -07:00
Robert
997edd7938 Update AWS secrets tests (#17736)
* Don't use a duplicate sync object for stepwise tests precheck

* Change STS test check to no longer look for a secret, add SetSourceIdentity policy to role
2022-10-31 09:52:35 -05:00
Brian Howe
465112b8bc secrets/aws: don't create leases for AWS STS secrets (#15869)
* don't create leases for AWS STS secrets

* don't create leases for aws federation tokens
2022-10-28 16:28:25 -05:00
Steven Clark
60e65ae710 Fix fmt error (#17241) 2022-09-20 13:33:01 -07:00
Kit Haines
06097d8c83 Basics of Cert-Count Non-Locking Telemetry (#16676)
Basics of Cert-Count Telemetry, changelog,  "best attempt" slice to capture (and test for) duplicates, Move sorting of possibleDoubleCountedRevokedSerials to after compare of entries. Add values to counter when still initializing.
Set lists to nil after use, Fix atomic2 import, Delay reporting metrics until after deduplication has completed, 
The test works now, Move string slice to helper function; Add backendUUID to gauge name.
2022-09-20 10:32:20 -07:00
vinay-gopalan
011b3d1136 Re-initialize v5 backend after a plugin crash (#17140) 2022-09-19 16:48:45 -07:00
Josh Black
03d2be4cb9 update gofumpt to 0.3.1 and reformat the repo (#17055)
* update gofumpt to 0.3.1 and reformat the repo

* output the version of the formatter we're using
2022-09-07 17:31:20 -07:00
swayne275
82f1216c83 Use %q for quoted strings where appropriate (#15216)
* change '%s' to %q where single vs double quotes shouldn't matter

* replace double quotes with %q in logs and errors
2022-08-03 12:32:45 -06:00
Josh Black
b17e3256dd reformat using 'make fmt' (#13794) 2022-01-27 10:06:34 -08:00
Theron Voran
56a40ba76d aws/logical: fix backend test (#13323)
Remove the `[:64]` from
`TestAcceptanceBackend_AssumedRoleWithPolicyDoc()` since max length is
handled in `generateUniqueRoleName()`
2021-12-01 10:44:22 -08:00
Theron Voran
94fa02342b tests: Add iam_tags to expected responses (#13150)
Update the AWS auth backend acceptance tests to account for the new
`iam_tags` field that comes back on responses.

* marked only tests requiring creds as acceptance

Renamed TestBackend_* to TestAcceptanceBackend_* if the test requires
AWS credentials. Otherwise left the name as TestBackend_* and set
`AcceptanceTest: false`.

* ensure generated names aren't too long

IAM roles and users have a 64 character limit, and adding Acceptance
to the test names was putting some over the length limit, so modified
generateUniqueName() to take a max length parameter and added
functions for each type of name generation (user, role, group).
2021-11-29 16:00:42 -08:00
Lars Lehtonen
c04328cd9a builtin/logical/aws: fix dropped test error (#12417) 2021-08-26 15:55:39 +01:00
vinay-gopalan
e14d32c528 Update genUsername to cap STS usernames at 32 chars (#12185)
* update genUsername to cap STS usernames at 64 chars

* add changelog

* refactor tests into t.Run block

* patch: remove warningExpected bool and include expected string

* patch: revert sts to cap at 32 chars and add assume_role case in genUsername

* update changelog

* update genUsername to return error if username generated exceeds length limits

* update changelog

* add conditional default username template to provide custom STS usernames

* update changelog

* include test for failing STS length case

* update comments for more clarity
2021-08-09 09:40:47 -07:00
Jeff Mitchell
86c1cdf9e6 Move awsutil over to the go-secure-stdlib version (#12128)
Unlike the other libraries that were migrated, there are no usages of
this lib in any of our plugins, and the only other known usage was in
go-kms-wrapping, which has been updated. Aliasing it like the other libs
would still keep the aws-sdk-go dep in the sdk module because of the
function signatures. So I've simply removed it entirely here.
2021-07-20 20:42:00 -04:00
Jeff Mitchell
4b96eaf53f Swap out stepwise for external repo version (#12089) 2021-07-20 13:20:23 -04:00