mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-28 04:10:44 -04:00
Merge branch 'main' into patch-1
This commit is contained in:
commit
389ed6cc55
1430 changed files with 43158 additions and 27544 deletions
2
.github/actions/changed-files/action.yml
vendored
2
.github/actions/changed-files/action.yml
vendored
|
|
@ -53,7 +53,7 @@ runs:
|
|||
checkout_ref='${{ github.ref }}'
|
||||
fi
|
||||
echo "ref=${checkout_ref}" | tee -a "$GITHUB_OUTPUT"
|
||||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
repository: ${{ github.repository }}
|
||||
path: "changed-files"
|
||||
|
|
|
|||
2
.github/actions/checkout/action.yml
vendored
2
.github/actions/checkout/action.yml
vendored
|
|
@ -70,7 +70,7 @@ runs:
|
|||
echo "ref=${checkout_ref}"
|
||||
echo "depth=${fetch_depth}"
|
||||
} | tee -a "$GITHUB_OUTPUT"
|
||||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
path: ${{ inputs.path }}
|
||||
fetch-depth: ${{ steps.ref.outputs.depth }}
|
||||
|
|
|
|||
|
|
@ -21,15 +21,15 @@ runs:
|
|||
- uses: ./.github/actions/set-up-staticcheck
|
||||
# We assume that the Go toolchain will be managed by the caller workflow so we don't set one
|
||||
# up here.
|
||||
- run: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||
- run: ./.github/scripts/retry-command.sh go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||
shell: bash
|
||||
- run: go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
||||
- run: ./.github/scripts/retry-command.sh go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0
|
||||
shell: bash
|
||||
- run: go install github.com/favadi/protoc-go-inject-tag@latest
|
||||
- run: ./.github/scripts/retry-command.sh go install github.com/favadi/protoc-go-inject-tag@latest
|
||||
shell: bash
|
||||
- run: go install golang.org/x/tools/cmd/goimports@latest
|
||||
- run: ./.github/scripts/retry-command.sh go install golang.org/x/tools/cmd/goimports@latest
|
||||
shell: bash
|
||||
- run: go install github.com/golangci/revgrep/cmd/revgrep@latest
|
||||
- run: ./.github/scripts/retry-command.sh go install github.com/golangci/revgrep/cmd/revgrep@latest
|
||||
shell: bash
|
||||
- run: go install github.com/loggerhead/enumer@latest
|
||||
- run: ./.github/scripts/retry-command.sh go install github.com/loggerhead/enumer@latest
|
||||
shell: bash
|
||||
|
|
|
|||
9
.github/actions/metadata/action.yml
vendored
9
.github/actions/metadata/action.yml
vendored
|
|
@ -102,10 +102,11 @@ runs:
|
|||
if [ '${{ github.event_name }}' = 'pull_request' ]; then
|
||||
is_draft='${{ github.event.pull_request.draft }}'
|
||||
|
||||
# Determine our labels. If our event type is pull_request this is rather straight forward. If
|
||||
# our even_type is push (merge) we'll need to look up the pull request associated with the
|
||||
# commit and get the labels. This will return the label names as an array.
|
||||
labels=$(jq -rc <<< '${{ toJSON(github.event.pull_request.labels.*.name) }}')
|
||||
# Determine our pull request labels. We specifically look them up via the pulls API
|
||||
# because at some point they stopped being reliable in the
|
||||
# github.event.pull_request.labels.*.name context.
|
||||
|
||||
labels=$(gh api "/repos/${{ github.repository }}/issues/${{ github.event.number }}/labels" | jq -erc '. | map(.name)')
|
||||
else
|
||||
is_draft='false'
|
||||
|
||||
|
|
|
|||
4
.github/actions/set-up-buf/action.yml
vendored
4
.github/actions/set-up-buf/action.yml
vendored
|
|
@ -34,7 +34,7 @@ runs:
|
|||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
VERSION=$(gh release list -R bufbuild/buf --exclude-drafts --exclude-pre-releases | grep ${{ inputs.version }} | cut -f1)
|
||||
VERSION=$(./.github/scripts/retry-command.sh gh release list -R bufbuild/buf --exclude-drafts --exclude-pre-releases | grep ${{ inputs.version }} | cut -f1)
|
||||
|
||||
mkdir -p $(dirname ${{ inputs.destination }})
|
||||
DESTINATION="$(readlink -f "${{ inputs.destination }}")"
|
||||
|
|
@ -60,7 +60,7 @@ runs:
|
|||
fi
|
||||
|
||||
mkdir -p tmp
|
||||
gh release download "$VERSION" -p "buf-${OS}-${ARCH}.tar.gz" -O tmp/buf.tgz -R bufbuild/buf
|
||||
./.github/scripts/retry-command.sh gh release download "$VERSION" --clobber -p "buf-${OS}-${ARCH}.tar.gz" -O tmp/buf.tgz -R bufbuild/buf
|
||||
pushd tmp && tar -xvf buf.tgz && popd
|
||||
mv tmp/buf/bin/buf "$DESTINATION"
|
||||
rm -rf tmp
|
||||
|
|
|
|||
4
.github/actions/set-up-gofumpt/action.yml
vendored
4
.github/actions/set-up-gofumpt/action.yml
vendored
|
|
@ -34,7 +34,7 @@ runs:
|
|||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
VERSION=$(gh release list -R mvdan/gofumpt --exclude-drafts --exclude-pre-releases | grep ${{ inputs.version }} | cut -f1)
|
||||
VERSION=$(./.github/scripts/retry-command.sh gh release list -R mvdan/gofumpt --exclude-drafts --exclude-pre-releases | grep ${{ inputs.version }} | cut -f1)
|
||||
|
||||
mkdir -p $(dirname ${{ inputs.destination }})
|
||||
DESTINATION="$(readlink -f "${{ inputs.destination }}")"
|
||||
|
|
@ -56,6 +56,6 @@ runs:
|
|||
export OS="darwin"
|
||||
fi
|
||||
|
||||
gh release download "$VERSION" -p "gofumpt_*_${OS}_${ARCH}" -O gofumpt -R mvdan/gofumpt
|
||||
./.github/scripts/retry-command.sh gh release download "$VERSION" --clobber -p "gofumpt_*_${OS}_${ARCH}" -O gofumpt -R mvdan/gofumpt
|
||||
chmod +x gofumpt
|
||||
mv gofumpt "$DESTINATION"
|
||||
|
|
|
|||
4
.github/actions/set-up-gosimports/action.yml
vendored
4
.github/actions/set-up-gosimports/action.yml
vendored
|
|
@ -34,7 +34,7 @@ runs:
|
|||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
VERSION=$(gh release list -R rinchsan/gosimports --exclude-drafts --exclude-pre-releases | grep ${{ inputs.version }} | cut -f1)
|
||||
VERSION=$(./.github/scripts/retry-command.sh gh release list -R rinchsan/gosimports --exclude-drafts --exclude-pre-releases | grep ${{ inputs.version }} | cut -f1)
|
||||
|
||||
mkdir -p $(dirname ${{ inputs.destination }})
|
||||
DESTINATION="$(readlink -f "${{ inputs.destination }}")"
|
||||
|
|
@ -57,7 +57,7 @@ runs:
|
|||
fi
|
||||
|
||||
mkdir -p tmp
|
||||
gh release download "$VERSION" -p "gosimports_*_${OS}_${ARCH}.tar.gz" -O tmp/gosimports.tgz -R rinchsan/gosimports
|
||||
./.github/scripts/retry-command.sh gh release download "$VERSION" --clobber -p "gosimports_*_${OS}_${ARCH}.tar.gz" -O tmp/gosimports.tgz -R rinchsan/gosimports
|
||||
pushd tmp && tar -xvf gosimports.tgz && popd
|
||||
mv tmp/gosimports "$DESTINATION"
|
||||
rm -rf tmp
|
||||
|
|
|
|||
4
.github/actions/set-up-gotestsum/action.yml
vendored
4
.github/actions/set-up-gotestsum/action.yml
vendored
|
|
@ -34,7 +34,7 @@ runs:
|
|||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
VERSION=$(gh release list -R gotestyourself/gotestsum --exclude-drafts --exclude-pre-releases | grep ${{ inputs.version }} | cut -f1)
|
||||
VERSION=$(./.github/scripts/retry-command.sh gh release list -R gotestyourself/gotestsum --exclude-drafts --exclude-pre-releases | grep ${{ inputs.version }} | cut -f1)
|
||||
|
||||
mkdir -p $(dirname ${{ inputs.destination }})
|
||||
DESTINATION="$(readlink -f "${{ inputs.destination }}")"
|
||||
|
|
@ -54,7 +54,7 @@ runs:
|
|||
fi
|
||||
|
||||
mkdir -p tmp
|
||||
gh release download "$VERSION" -p "*${OS}_${ARCH}.tar.gz" -O tmp/gotestsum.tgz -R gotestyourself/gotestsum
|
||||
./.github/scripts/retry-command.sh gh release download "$VERSION" --clobber -p "*${OS}_${ARCH}.tar.gz" -O tmp/gotestsum.tgz -R gotestyourself/gotestsum
|
||||
pushd tmp && tar -xvf gotestsum.tgz && popd
|
||||
mv tmp/gotestsum "$DESTINATION"
|
||||
rm -rf tmp
|
||||
|
|
|
|||
6
.github/actions/set-up-misspell/action.yml
vendored
6
.github/actions/set-up-misspell/action.yml
vendored
|
|
@ -34,7 +34,7 @@ runs:
|
|||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
VERSION=$(gh release list -R golangci/misspell --exclude-drafts --exclude-pre-releases | grep ${{ inputs.version }} | cut -f1)
|
||||
VERSION=$(./.github/scripts/retry-command.sh gh release list -R golangci/misspell --exclude-drafts --exclude-pre-releases | grep ${{ inputs.version }} | cut -f1)
|
||||
|
||||
mkdir -p $(dirname ${{ inputs.destination }})
|
||||
DESTINATION="$(readlink -f "${{ inputs.destination }}")"
|
||||
|
|
@ -57,7 +57,7 @@ runs:
|
|||
fi
|
||||
|
||||
mkdir -p tmp
|
||||
gh release download "$VERSION" -p "misspell_*_${OS}_${ARCH}.tar.gz" -O tmp/misspell.tgz -R golangci/misspell
|
||||
./.github/scripts/retry-command.sh gh release download "$VERSION" --clobber -p "misspell_*_${OS}_${ARCH}.tar.gz" -O tmp/misspell.tgz -R golangci/misspell
|
||||
pushd tmp && tar -xvf misspell.tgz && popd
|
||||
mv tmp/misspell "$DESTINATION"
|
||||
mv tmp/misspell_"$(echo "$VERSION" | tr -d v)"_${OS}_${ARCH}/misspell "$DESTINATION"
|
||||
rm -rf tmp
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ runs:
|
|||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
VERSION=$(gh release list -R dominikh/go-tools --exclude-drafts --exclude-pre-releases | grep ${{ inputs.version }} | cut -d " " -f2)
|
||||
VERSION=$(./.github/scripts/retry-command.sh gh release list -R dominikh/go-tools --exclude-drafts --exclude-pre-releases | grep ${{ inputs.version }} | cut -d " " -f2)
|
||||
|
||||
mkdir -p $(dirname ${{ inputs.destination }})
|
||||
DESTINATION="$(readlink -f "${{ inputs.destination }}")"
|
||||
|
|
@ -57,7 +57,7 @@ runs:
|
|||
fi
|
||||
|
||||
mkdir -p tmp
|
||||
gh release download "$VERSION" -p "staticcheck_${OS}_${ARCH}.tar.gz" -O tmp/staticcheck.tgz -R dominikh/go-tools
|
||||
./.github/scripts/retry-command.sh gh release download "$VERSION" --clobber -p "staticcheck_${OS}_${ARCH}.tar.gz" -O tmp/staticcheck.tgz -R dominikh/go-tools
|
||||
pushd tmp && tar -xvf staticcheck.tgz && popd
|
||||
mv tmp/staticcheck/staticcheck "$DESTINATION"
|
||||
rm -rf tmp
|
||||
|
|
|
|||
8
.github/docs/pull_request_template.md
vendored
Normal file
8
.github/docs/pull_request_template.md
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
### Description
|
||||
Why is this docs change needed?
|
||||
|
||||
### TODO
|
||||
- [ ] Preview the changes you made either locally or in the Vercel deployment
|
||||
and make sure it looks correct.
|
||||
- [ ] If you've added a new link to the sidebar navigation, make sure it's
|
||||
sorted correctly.
|
||||
17
.github/pull_request_template.md
vendored
Normal file
17
.github/pull_request_template.md
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
### Description
|
||||
What does this PR do?
|
||||
|
||||
### TODO only if you're a HashiCorp employee
|
||||
- [ ] **Backport Labels:** If this PR is in the ENT repo and needs to be backported, backport
|
||||
to N, N-1, and N-2, using the `backport/ent/x.x.x+ent` labels. If this PR is in the CE repo, you should only backport to N, using the `backport/x.x.x` label, not the enterprise labels.
|
||||
- [ ] If this fixes a critical security vulnerability or [severity 1](https://www.hashicorp.com/customer-success/enterprise-support) bug, it will also need to be backported to the current [LTS versions](https://developer.hashicorp.com/vault/docs/enterprise/lts#why-is-there-a-risk-to-updating-to-a-non-lts-vault-enterprise-version) of Vault. To ensure this, use **all** available enterprise labels.
|
||||
- [ ] **ENT Breakage:** If this PR either 1) removes a public function OR 2) changes the signature
|
||||
of a public function, even if that change is in a CE file, _double check_ that
|
||||
applying the patch for this PR to the ENT repo and running tests doesn't
|
||||
break any tests. Sometimes ENT only tests rely on public functions in CE
|
||||
files.
|
||||
- [ ] **Jira:** If this change has an associated Jira, it's referenced either
|
||||
in the PR description, commit message, or branch name.
|
||||
- [ ] **RFC:** If this change has an associated RFC, please link it in the description.
|
||||
- [ ] **ENT PR:** If this change has an associated ENT PR, please link it in the
|
||||
description. Also, make sure the changelog is in this PR, _not_ in your ENT PR.
|
||||
18
.github/scripts/retry-command.sh
vendored
Executable file
18
.github/scripts/retry-command.sh
vendored
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright (c) HashiCorp, Inc.
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
set -uo pipefail
|
||||
|
||||
tries=5
|
||||
count=0
|
||||
|
||||
until "$@"
|
||||
do
|
||||
if [ $count -eq $tries ]; then
|
||||
echo "tried $count times, exiting"
|
||||
exit 1
|
||||
fi
|
||||
((count++))
|
||||
echo "trying again, attempt $count"
|
||||
sleep $count
|
||||
done
|
||||
2
.github/workflows/actionlint.yml
vendored
2
.github/workflows/actionlint.yml
vendored
|
|
@ -14,7 +14,7 @@ jobs:
|
|||
actionlint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: "Check workflow files"
|
||||
uses: docker://docker.mirror.hashicorp.services/rhysd/actionlint@sha256:93834930f56ca380be3e9a3377670d7aa5921be251b9c774891a39b3629b83b8
|
||||
with:
|
||||
|
|
|
|||
37
.github/workflows/backport-ce.yml
vendored
Normal file
37
.github/workflows/backport-ce.yml
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
name: Backport Assistant Runner (for OSS & ENT)
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- closed
|
||||
- labeled
|
||||
repository_dispatch:
|
||||
types: [ent-backport]
|
||||
|
||||
jobs:
|
||||
backport-targeted-release-branch:
|
||||
if: github.event.pull_request.merged && github.repository == 'hashicorp/vault'
|
||||
runs-on: ubuntu-latest
|
||||
container: hashicorpdev/backport-assistant:0.4.3
|
||||
steps:
|
||||
- name: Backport changes to targeted release branch
|
||||
run: |
|
||||
backport-assistant backport -merge-method=squash -gh-automerge
|
||||
env:
|
||||
BACKPORT_LABEL_REGEXP: "backport/(?P<target>\\d+\\.\\d+\\.[+\\w]+)"
|
||||
BACKPORT_TARGET_TEMPLATE: "release/{{.target}}"
|
||||
BACKPORT_MERGE_COMMIT: true
|
||||
GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
||||
ENABLE_VERSION_MANIFESTS: true
|
||||
backport-ent:
|
||||
if: github.event.pull_request.merged && contains(join(github.event.pull_request.labels.*.name), 'backport/ent')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Trigger backport for Enterprise
|
||||
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
|
||||
with:
|
||||
token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
||||
repository: hashicorp/vault-enterprise
|
||||
event-type: ent-backport
|
||||
client-payload: ${{ toJson(github.event) }}
|
||||
23
.github/workflows/backport.yml
vendored
23
.github/workflows/backport.yml
vendored
|
|
@ -1,23 +0,0 @@
|
|||
---
|
||||
name: Backport Assistant Runner (for OSS & ENT)
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- closed
|
||||
- labeled
|
||||
|
||||
jobs:
|
||||
backport-targeted-release-branch:
|
||||
if: github.event.pull_request.merged
|
||||
runs-on: ubuntu-latest
|
||||
container: hashicorpdev/backport-assistant:0.3.3
|
||||
steps:
|
||||
- name: Backport changes to targeted release branch
|
||||
run: |
|
||||
backport-assistant backport -merge-method=squash -gh-automerge
|
||||
env:
|
||||
BACKPORT_LABEL_REGEXP: "backport/(?P<target>\\d+\\.\\d+\\.[+\\w]+)"
|
||||
BACKPORT_TARGET_TEMPLATE: "release/{{.target}}"
|
||||
BACKPORT_MERGE_COMMIT: true
|
||||
GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
||||
6
.github/workflows/build-artifacts-ce.yml
vendored
6
.github/workflows/build-artifacts-ce.yml
vendored
|
|
@ -98,7 +98,7 @@ jobs:
|
|||
runs-on: ${{ fromJSON(inputs.compute-build) }}
|
||||
name: (${{ matrix.goos }}, ${{ matrix.goarch }})
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
ref: ${{ inputs.checkout-ref }}
|
||||
- uses: ./.github/actions/build-vault
|
||||
|
|
@ -200,7 +200,7 @@ jobs:
|
|||
name: (${{ matrix.goos }}, ${{ matrix.goarch }}${{ matrix.goarm && ' ' || '' }}${{ matrix.goarm }})
|
||||
runs-on: ${{ fromJSON(inputs.compute-build) }}
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
ref: ${{ inputs.checkout-ref }}
|
||||
- uses: ./.github/actions/build-vault
|
||||
|
|
@ -228,7 +228,7 @@ jobs:
|
|||
- core
|
||||
- extended
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
ref: ${{ inputs.checkout-ref }}
|
||||
- name: Determine status
|
||||
|
|
|
|||
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
|
|
@ -105,7 +105,7 @@ jobs:
|
|||
workflow-trigger: ${{ steps.metadata.outputs.workflow-trigger }}
|
||||
steps:
|
||||
# Run the changed-files action to determine what Git reference we should check out
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- uses: ./.github/actions/changed-files
|
||||
id: changed-files
|
||||
- uses: ./.github/actions/checkout
|
||||
|
|
@ -159,7 +159,7 @@ jobs:
|
|||
outputs:
|
||||
cache-key: ui-${{ steps.ui-hash.outputs.ui-hash }}
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
ref: ${{ needs.setup.outputs.checkout-ref }}
|
||||
- name: Get UI hash
|
||||
|
|
@ -291,7 +291,7 @@ jobs:
|
|||
- test
|
||||
- test-containers
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- id: status
|
||||
name: Determine status
|
||||
run: |
|
||||
|
|
@ -387,7 +387,7 @@ jobs:
|
|||
with:
|
||||
version: ${{ needs.setup.outputs.vault-version-metadata }}
|
||||
product: ${{ needs.setup.outputs.vault-binary-name }}
|
||||
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
||||
if: steps.generate-metadata-file.outcome == 'success' # upload our metadata if we created it
|
||||
with:
|
||||
name: metadata.json
|
||||
|
|
|
|||
12
.github/workflows/changelog-checker.yml
vendored
12
.github/workflows/changelog-checker.yml
vendored
|
|
@ -18,7 +18,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0 # by default the checkout action doesn't checkout all branches
|
||||
|
|
@ -48,8 +48,8 @@ jobs:
|
|||
echo "Not found."
|
||||
echo ""
|
||||
echo "Did not find a changelog entry named ${expected_changelog_file}"
|
||||
echo "If your changelog file is correct, skip this check with the 'pr/no-changelog' label"
|
||||
echo "Reference - https://github.com/hashicorp/vault/pull/10363 and https://github.com/hashicorp/vault/pull/11894"
|
||||
echo "If your changelog file is correct, or this change does not need a changelog, skip this check with the 'pr/no-changelog' label"
|
||||
echo "Reference - https://github.com/hashicorp/vault/blob/main/CONTRIBUTING.md#changelog-entries"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
@ -76,6 +76,12 @@ jobs:
|
|||
elif grep -q ':fix$' "$changelog_files"; then
|
||||
echo "Found invalid type (fix) in changelog - did you mean bug?"
|
||||
exit 1
|
||||
elif grep -q ':feature$' "$changelog_files"; then
|
||||
if ! grep -q '^\*\*' "$changelog_files"; then
|
||||
echo "Feature changelogs must be formatted like the following:"
|
||||
echo "**Feature Name**: Feature description"
|
||||
exit 1
|
||||
fi
|
||||
elif ! grep -q '```release-note:' "$changelog_files"; then
|
||||
# People often make changelog files like ```changelog:, which is incorrect.
|
||||
echo "Changelog file did not contain 'release-note' heading - check formatting."
|
||||
|
|
|
|||
15
.github/workflows/ci.yml
vendored
15
.github/workflows/ci.yml
vendored
|
|
@ -33,7 +33,7 @@ jobs:
|
|||
ui-changed: ${{ steps.changed-files.outputs.ui-changed }}
|
||||
workflow-trigger: ${{ steps.metadata.outputs.workflow-trigger }}
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- uses: ./.github/actions/changed-files
|
||||
id: changed-files
|
||||
- uses: ./.github/actions/checkout
|
||||
|
|
@ -146,7 +146,7 @@ jobs:
|
|||
contents: read
|
||||
runs-on: ${{ fromJSON(needs.setup.outputs.compute-test-ui) }}
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
name: status
|
||||
with:
|
||||
ref: ${{ needs.setup.outputs.checkout-ref }}
|
||||
|
|
@ -164,7 +164,10 @@ jobs:
|
|||
node-version-file: './ui/package.json'
|
||||
cache: yarn
|
||||
cache-dependency-path: ui/yarn.lock
|
||||
- uses: browser-actions/setup-chrome@9683066f53b47e92c4104e1bd5535aff208c3530 # v1.6.2
|
||||
- uses: browser-actions/setup-chrome@db1b524c26f20a8d1a10f7fc385c92387e2d0477 # v1.7.1
|
||||
with:
|
||||
# Temporarily pin our Chrome version while we sort out a broken test on latest
|
||||
chrome-version: 1314712
|
||||
- name: ui-dependencies
|
||||
working-directory: ./ui
|
||||
run: |
|
||||
|
|
@ -204,12 +207,12 @@ jobs:
|
|||
mkdir -p test-results/qunit
|
||||
yarn ${{ needs.setup.outputs.is-enterprise == 'true' && 'test' || 'test:oss' }}
|
||||
- if: always()
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
||||
with:
|
||||
name: test-results-ui
|
||||
path: ui/test-results
|
||||
- if: always()
|
||||
uses: test-summary/action@032c8a9cec6aaa3c20228112cae6ca10a3b29336 # v2.3
|
||||
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
|
||||
with:
|
||||
paths: "ui/test-results/qunit/results.xml"
|
||||
show: "fail"
|
||||
|
|
@ -226,7 +229,7 @@ jobs:
|
|||
runs-on: ${{ github.repository == 'hashicorp/vault' && 'ubuntu-latest' || fromJSON('["self-hosted","linux","small"]') }}
|
||||
permissions: write-all # Ensure we have id-token:write access for vault-auth.
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
# Determine the overall status of our required test jobs.
|
||||
- name: Determine status
|
||||
id: status
|
||||
|
|
|
|||
12
.github/workflows/code-checker.yml
vendored
12
.github/workflows/code-checker.yml
vendored
|
|
@ -17,7 +17,7 @@ jobs:
|
|||
name: Setup
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: Ensure Go modules are cached
|
||||
uses: ./.github/actions/set-up-go
|
||||
with:
|
||||
|
|
@ -30,7 +30,7 @@ jobs:
|
|||
needs: setup
|
||||
if: github.base_ref == 'main'
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ./.github/actions/set-up-go
|
||||
|
|
@ -46,7 +46,7 @@ jobs:
|
|||
needs: setup
|
||||
if: github.base_ref == 'main'
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ./.github/actions/set-up-go
|
||||
|
|
@ -66,7 +66,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
needs: setup
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- uses: ./.github/actions/set-up-go
|
||||
with:
|
||||
github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
||||
|
|
@ -79,7 +79,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
needs: setup
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- uses: ./.github/actions/install-external-tools # for buf and gofumpt
|
||||
- uses: ./.github/actions/set-up-go
|
||||
with:
|
||||
|
|
@ -97,6 +97,6 @@ jobs:
|
|||
container:
|
||||
image: returntocorp/semgrep@sha256:cfad18cfb6536aa48ad5a71017207a10320b4e17e3b2bd7b7de27b42dc9651e7 #v1.58
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: Run Semgrep Rules
|
||||
run: semgrep ci --include '*.go' --config 'tools/semgrep/ci'
|
||||
|
|
|
|||
2
.github/workflows/copywrite.yml
vendored
2
.github/workflows/copywrite.yml
vendored
|
|
@ -12,7 +12,7 @@ jobs:
|
|||
copywrite:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- uses: hashicorp/setup-copywrite@32638da2d4e81d56a0764aa1547882fc4d209636 # v1.1.3
|
||||
name: Setup Copywrite
|
||||
with:
|
||||
|
|
|
|||
22
.github/workflows/do-not-merge-checker.yml
vendored
Normal file
22
.github/workflows/do-not-merge-checker.yml
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# This workflow fails if a 'do-not-merge' label is applied to the PR.
|
||||
name: Check do-not-merge
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [reopened, labeled, unlabeled]
|
||||
# Runs on PRs to main and release branches
|
||||
branches:
|
||||
- main
|
||||
- release/**
|
||||
|
||||
jobs:
|
||||
# checks that a do-not-merge label is not present for a PR
|
||||
do-not-merge-check:
|
||||
# If there is a `do-not-merge` label we ignore this check
|
||||
if: ${{ contains(github.event.pull_request.labels.*.name, 'do-not-merge') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fail if do-not-merge label is applied
|
||||
run: |
|
||||
echo "Cannot merge with do-not-merge label applied."
|
||||
exit 1
|
||||
5
.github/workflows/enos-lint.yml
vendored
5
.github/workflows/enos-lint.yml
vendored
|
|
@ -17,7 +17,7 @@ jobs:
|
|||
runs-on: ${{ steps.metadata.outputs.runs-on }}
|
||||
version: ${{ steps.metadata.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- id: set-product-version
|
||||
uses: hashicorp/actions-set-product-version@v2
|
||||
- id: metadata
|
||||
|
|
@ -37,11 +37,10 @@ jobs:
|
|||
GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
||||
ENOS_VAR_tfc_api_token: ${{ secrets.TF_API_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- uses: hashicorp/setup-terraform@v3
|
||||
with:
|
||||
terraform_wrapper: false
|
||||
terraform_version: "1.7.5" # Pin until 1.8.x crash has been resolved
|
||||
- uses: hashicorp/action-setup-enos@v1
|
||||
with:
|
||||
github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ jobs:
|
|||
vault-version: ${{ github.event.client_payload.payload.version }}
|
||||
vault-version-package: ${{ steps.get-metadata.outputs.vault-version-package }}
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
# Check out the repository at the same Git SHA that was used to create
|
||||
# the artifacts to get the correct metadata.
|
||||
|
|
@ -64,7 +64,7 @@ jobs:
|
|||
secrets: inherit
|
||||
|
||||
save-metadata:
|
||||
runs-on: linux
|
||||
runs-on: ubuntu-latest
|
||||
if: always()
|
||||
needs: test
|
||||
steps:
|
||||
|
|
|
|||
3
.github/workflows/enos-run-k8s.yml
vendored
3
.github/workflows/enos-run-k8s.yml
vendored
|
|
@ -31,14 +31,13 @@ jobs:
|
|||
GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: Set up Terraform
|
||||
uses: hashicorp/setup-terraform@v3
|
||||
with:
|
||||
# the Terraform wrapper will break Terraform execution in Enos because
|
||||
# it changes the output to text when we expect it to be JSON.
|
||||
terraform_wrapper: false
|
||||
terraform_version: "1.7.5" # Pin until 1.8.x crash has been resolved
|
||||
- name: Set up Enos
|
||||
uses: hashicorp/action-setup-enos@v1
|
||||
with:
|
||||
|
|
|
|||
4
.github/workflows/oss.yml
vendored
4
.github/workflows/oss.yml
vendored
|
|
@ -19,7 +19,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- if: github.event.pull_request != null
|
||||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- if: github.event.pull_request != null
|
||||
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
||||
id: changes
|
||||
|
|
@ -68,7 +68,7 @@ jobs:
|
|||
- if: github.event.pull_request != null && steps.changes.outputs.ui == 'true'
|
||||
run: echo "PROJECT=171" >> "$GITHUB_ENV"
|
||||
|
||||
- uses: actions/add-to-project@9bfe908f2eaa7ba10340b31e314148fcfe6a2458 # v1.0.1
|
||||
- uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2
|
||||
with:
|
||||
project-url: https://github.com/orgs/hashicorp/projects/${{ env.PROJECT }}
|
||||
github-token: ${{ secrets.TRIAGE_GITHUB_TOKEN }}
|
||||
|
|
|
|||
4
.github/workflows/plugin-update-check.yml
vendored
4
.github/workflows/plugin-update-check.yml
vendored
|
|
@ -23,13 +23,13 @@ jobs:
|
|||
RUN_ID: "${{github.run_id}}"
|
||||
steps:
|
||||
- run: echo "Branch $PLUGIN_BRANCH of $PLUGIN_REPO"
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
# We don't use the default token so that checks are executed on the resulting PR
|
||||
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
|
||||
token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
|
||||
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
with:
|
||||
cache: false # save cache space for vault builds: https://github.com/hashicorp/vault/pull/21764
|
||||
go-version-file: .go-version
|
||||
|
|
|
|||
10
.github/workflows/plugin-update.yml
vendored
10
.github/workflows/plugin-update.yml
vendored
|
|
@ -8,6 +8,10 @@ on:
|
|||
description: 'Full name of the plugin, e.g., vault-plugin-auth-kubernetes'
|
||||
required: true
|
||||
type: string
|
||||
branch:
|
||||
description: 'Git branch name to use'
|
||||
required: true
|
||||
type: string
|
||||
version:
|
||||
description: 'Version of the plugin with *NO* "v", e.g., 1.2.3'
|
||||
required: true
|
||||
|
|
@ -21,16 +25,16 @@ jobs:
|
|||
plugin-update:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
VAULT_BRANCH: "update/${{ inputs.plugin }}/v${{ inputs.version }}"
|
||||
VAULT_BRANCH: ${{ inputs.branch }}
|
||||
REVIEWER: ${{ inputs.reviewer || github.actor }}
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
# We don't use the default token so that checks are executed on the resulting PR
|
||||
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
|
||||
token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
|
||||
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
with:
|
||||
cache: false # save cache space for vault builds: https://github.com/hashicorp/vault/pull/21764
|
||||
go-version-file: .go-version
|
||||
|
|
|
|||
15
.github/workflows/security-scan.yml
vendored
15
.github/workflows/security-scan.yml
vendored
|
|
@ -15,17 +15,18 @@ on:
|
|||
|
||||
jobs:
|
||||
scan:
|
||||
runs-on: ${{ fromJSON(vars.RUNNER_XL) }}
|
||||
runs-on: ${{ github.repository == 'hashicorp/vault' && 'ubuntu-latest' || fromJSON('["self-hosted","ondemand","os=linux","type=c6a.4xlarge"]') }}
|
||||
# The first check ensures this doesn't run on community-contributed PRs, who
|
||||
# won't have the permissions to run this job.
|
||||
if: ${{ (github.repository != 'hashicorp/vault' || (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name))
|
||||
&& (github.actor != 'dependabot[bot]') && ( github.actor != 'hc-github-team-secure-vault-core') }}
|
||||
|
||||
if: |
|
||||
(startsWith(github.repository, 'hashicorp/vault') || (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)) &&
|
||||
github.actor != 'dependabot[bot]' &&
|
||||
github.actor != 'hc-github-team-secure-vault-core'
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
with:
|
||||
cache: false # save cache space for vault builds: https://github.com/hashicorp/vault/pull/21764
|
||||
go-version-file: .go-version
|
||||
|
|
@ -36,7 +37,7 @@ jobs:
|
|||
python-version: 3.x
|
||||
|
||||
- name: Clone Security Scanner repo
|
||||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
repository: hashicorp/security-scanner
|
||||
token: ${{ secrets.HASHIBOT_PRODSEC_GITHUB_TOKEN }}
|
||||
|
|
|
|||
2
.github/workflows/stable-website.yaml
vendored
2
.github/workflows/stable-website.yaml
vendored
|
|
@ -15,7 +15,7 @@ jobs:
|
|||
name: Cherry pick to stable-website branch
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
ref: stable-website
|
||||
- run: |
|
||||
|
|
|
|||
4
.github/workflows/test-ci-bootstrap.yml
vendored
4
.github/workflows/test-ci-bootstrap.yml
vendored
|
|
@ -29,11 +29,9 @@ jobs:
|
|||
TF_VAR_aws_ssh_public_key: ${{ secrets.SSH_KEY_PUBLIC_CI }}
|
||||
TF_TOKEN_app_terraform_io: ${{ secrets.TF_API_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: Set up Terraform
|
||||
uses: hashicorp/setup-terraform@v3
|
||||
with:
|
||||
terraform_version: "1.7.5" # Pin until 1.8.x crash has been resolved
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
|
||||
with:
|
||||
|
|
|
|||
2
.github/workflows/test-ci-cleanup.yml
vendored
2
.github/workflows/test-ci-cleanup.yml
vendored
|
|
@ -49,7 +49,7 @@ jobs:
|
|||
role-skip-session-tagging: true
|
||||
role-duration-seconds: 3600
|
||||
mask-aws-account-id: false
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: Configure
|
||||
run: |
|
||||
cp enos/ci/aws-nuke.yml .
|
||||
|
|
|
|||
7
.github/workflows/test-enos-scenario-ui.yml
vendored
7
.github/workflows/test-enos-scenario-ui.yml
vendored
|
|
@ -40,7 +40,7 @@ jobs:
|
|||
runs-on: ${{ steps.get-metadata.outputs.runs-on }}
|
||||
vault_edition: ${{ steps.get-metadata.outputs.vault_edition }}
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- id: get-metadata
|
||||
env:
|
||||
IS_ENT: ${{ startsWith(github.event.repository.name, 'vault-enterprise' ) }}
|
||||
|
|
@ -72,7 +72,7 @@ jobs:
|
|||
GOPRIVATE: github.com/hashicorp
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- uses: ./.github/actions/set-up-go
|
||||
with:
|
||||
github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
||||
|
|
@ -90,7 +90,6 @@ jobs:
|
|||
with:
|
||||
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
|
||||
terraform_wrapper: false
|
||||
terraform_version: "1.7.5" # Pin until 1.8.x crash has been resolved
|
||||
- name: Prepare scenario dependencies
|
||||
run: |
|
||||
mkdir -p ./enos/support/terraform-plugin-cache
|
||||
|
|
@ -109,7 +108,7 @@ jobs:
|
|||
sudo apt install -y libnss3-dev libgdk-pixbuf2.0-dev libgtk-3-dev libxss-dev libasound2
|
||||
- name: Install Chrome
|
||||
if: steps.chrome-check.outputs.chrome-version == 'not-installed'
|
||||
uses: browser-actions/setup-chrome@9683066f53b47e92c4104e1bd5535aff208c3530 # v1.6.2
|
||||
uses: browser-actions/setup-chrome@db1b524c26f20a8d1a10f7fc385c92387e2d0477 # v1.7.1
|
||||
- name: Installed Chrome Version
|
||||
run: |
|
||||
echo "Installed Chrome Version = [$(chrome --version 2> /dev/null || google-chrome --version 2> /dev/null || google-chrome-stable --version 2> /dev/null)]"
|
||||
|
|
|
|||
17
.github/workflows/test-go.yml
vendored
17
.github/workflows/test-go.yml
vendored
|
|
@ -95,7 +95,7 @@ jobs:
|
|||
matrix: ${{ steps.build.outputs.matrix }}
|
||||
matrix_ids: ${{ steps.build.outputs.matrix_ids }}
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
ref: ${{ inputs.checkout-ref }}
|
||||
- uses: ./.github/actions/set-up-go
|
||||
|
|
@ -230,7 +230,7 @@ jobs:
|
|||
go-test-results-download-pattern: ${{ steps.metadata.outputs.go-test-results-download-pattern }}
|
||||
data-race-log-download-pattern: ${{ steps.metadata.outputs.data-race-log-download-pattern }}
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
ref: ${{ inputs.checkout-ref }}
|
||||
- uses: ./.github/actions/set-up-go
|
||||
|
|
@ -421,8 +421,9 @@ jobs:
|
|||
package_parallelism="-p 2"
|
||||
fi
|
||||
|
||||
# If running Go Test 32bit nightly tests, add a flag to rerun failed tests
|
||||
if [[ "${{inputs.name}}" == 'i386' ]]; then
|
||||
# If running Go tests on the enterprise repo, add a flag to rerun failed tests.
|
||||
# This is to address the issues with flaky tests affecting the reliability of CI.
|
||||
if [[ "${{github.repository}}" == 'hashicorp/vault-enterprise' ]]; then
|
||||
RERUN_FAILS="--rerun-fails"
|
||||
fi
|
||||
|
||||
|
|
@ -477,7 +478,7 @@ jobs:
|
|||
run: |
|
||||
tar -cvf '${{ steps.metadata.outputs.go-test-log-archive-name }}' -C "${{ steps.metadata.outputs.go-test-log-dir }}" .
|
||||
- name: Upload test logs archives
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
||||
with:
|
||||
name: ${{ steps.metadata.outputs.go-test-log-archive-name }}
|
||||
path: ${{ steps.metadata.outputs.go-test-log-archive-name }}
|
||||
|
|
@ -485,7 +486,7 @@ jobs:
|
|||
if: success() || failure()
|
||||
- name: Upload test results
|
||||
if: success() || failure()
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
||||
with:
|
||||
name: ${{ steps.metadata.outputs.go-test-results-upload-key }}
|
||||
path: |
|
||||
|
|
@ -525,7 +526,7 @@ jobs:
|
|||
if: |
|
||||
(success() || failure()) &&
|
||||
steps.data-race-check.outputs.data-race-result == 'failure'
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
||||
with:
|
||||
name: ${{ steps.metadata.outputs.data-race-log-upload-key }}
|
||||
path: ${{ steps.metadata.outputs.go-test-dir }}/${{ steps.metadata.outputs.data-race-log-file }}
|
||||
|
|
@ -598,7 +599,7 @@ jobs:
|
|||
'${{ steps.metadata.outputs.gotestsum-timing-events }}' \
|
||||
>> '${{ steps.metadata.outputs.failure-summary-file-name }}'
|
||||
- name: Upload failure summary
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
||||
if: success() || failure()
|
||||
with:
|
||||
name: ${{ steps.metadata.outputs.failure-summary-file-name }}
|
||||
|
|
|
|||
|
|
@ -20,12 +20,12 @@ jobs:
|
|||
go-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- uses: ./.github/actions/set-up-go
|
||||
with:
|
||||
github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
||||
- run: go test -v ./${{ inputs.path }}/... 2>&1 | tee ${{ inputs.name }}.txt
|
||||
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
||||
with:
|
||||
name: ${{ inputs.name }}-output
|
||||
path: ${{ inputs.name }}.txt
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ jobs:
|
|||
sample: ${{ steps.metadata.outputs.sample }}
|
||||
vault-version: ${{ steps.metadata.outputs.vault-version }}
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
ref: ${{ inputs.vault-revision }}
|
||||
- uses: hashicorp/action-setup-enos@v1
|
||||
|
|
@ -58,7 +58,7 @@ jobs:
|
|||
- id: metadata
|
||||
run: |
|
||||
build_date=$(make ci-get-date)
|
||||
sample_seed=$(date +%s%N)
|
||||
sample_seed=$(date +%s)
|
||||
sample=$(enos scenario sample observe "${{ inputs.sample-name }}" --chdir ./enos --min 1 --max "${{ inputs.sample-max }}" --seed "${sample_seed}" --format json | jq -c ".observation.elements")
|
||||
if [[ "${{ inputs.vault-edition }}" == "ce" ]]; then
|
||||
vault_version="${{ inputs.vault-version }}"
|
||||
|
|
@ -96,10 +96,16 @@ jobs:
|
|||
ENOS_VAR_vault_build_date: ${{ needs.metadata.outputs.build-date }}
|
||||
ENOS_VAR_vault_product_version: ${{ needs.metadata.outputs.vault-version }}
|
||||
ENOS_VAR_vault_revision: ${{ inputs.vault-revision }}
|
||||
ENOS_VAR_consul_license_path: ./support/consul.hclic
|
||||
ENOS_VAR_vault_license_path: ./support/vault.hclic
|
||||
ENOS_VAR_distro_version_amzz: ${{ matrix.attributes.distro_version_amzn }}
|
||||
ENOS_VAR_distro_version_leap: ${{ matrix.attributes.distro_version_leap }}
|
||||
ENOS_VAR_distro_version_rhel: ${{ matrix.attributes.distro_version_rhel }}
|
||||
ENOS_VAR_distro_version_sles: ${{ matrix.attributes.distro_version_sles }}
|
||||
ENOS_VAR_distro_version_ubuntu: ${{ matrix.attributes.distro_version_ubuntu }}
|
||||
ENOS_DEBUG_DATA_ROOT_DIR: /tmp/enos-debug-data
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
ref: ${{ inputs.vault-revision }}
|
||||
- uses: hashicorp/setup-terraform@v3
|
||||
|
|
@ -107,7 +113,6 @@ jobs:
|
|||
# the Terraform wrapper will break Terraform execution in Enos because
|
||||
# it changes the output to text when we expect it to be JSON.
|
||||
terraform_wrapper: false
|
||||
terraform_version: "1.7.5" # Pin until 1.8.x crash has been resolved
|
||||
- uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_CI }}
|
||||
|
|
@ -134,6 +139,11 @@ jobs:
|
|||
- if: contains(inputs.sample-name, 'ent')
|
||||
name: Configure Vault license
|
||||
run: echo "${{ secrets.VAULT_LICENSE }}" > ./enos/support/vault.hclic || true
|
||||
- if: contains(matrix.scenario.id.filter, 'consul_edition:ent')
|
||||
name: Configure Consul license
|
||||
run: |
|
||||
echo "matrix.scenario.id.filter: ${{ matrix.scenario.id.filter }}"
|
||||
echo "${{ secrets.CONSUL_LICENSE }}" > ./enos/support/consul.hclic || true
|
||||
- id: launch
|
||||
name: enos scenario launch ${{ matrix.scenario.id.filter }}
|
||||
# Continue once and retry to handle occasional blips when creating infrastructure.
|
||||
|
|
@ -145,7 +155,7 @@ jobs:
|
|||
run: enos scenario launch --timeout 60m0s --chdir ./enos ${{ matrix.scenario.id.filter }}
|
||||
- name: Upload Debug Data
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
||||
with:
|
||||
# The name of the artifact is the same as the matrix scenario name with the spaces replaced with underscores and colons replaced by equals.
|
||||
name: ${{ steps.prepare_scenario.outputs.debug_data_artifact_name }}
|
||||
|
|
@ -175,28 +185,28 @@ jobs:
|
|||
# https://api.slack.com/apps/A05E31CH1LG/incoming-webhooks
|
||||
- if: ${{ always() && ! cancelled() }}
|
||||
name: Notify launch failed
|
||||
uses: hashicorp/actions-slack-status@v2
|
||||
uses: hashicorp/actions-slack-status@v2.0.1
|
||||
with:
|
||||
failure-message: "enos scenario launch ${{ matrix.scenario.id.filter}} failed. \nTriggering event: `${{ github.event_name }}` \nActor: `${{ github.actor }}`"
|
||||
status: ${{ steps.launch.outcome }}
|
||||
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
- if: ${{ always() && ! cancelled() }}
|
||||
name: Notify retry launch failed
|
||||
uses: hashicorp/actions-slack-status@v2
|
||||
uses: hashicorp/actions-slack-status@v2.0.1
|
||||
with:
|
||||
failure-message: "retry enos scenario launch ${{ matrix.scenario.id.filter}} failed. \nTriggering event: `${{ github.event_name }}` \nActor: `${{ github.actor }}`"
|
||||
status: ${{ steps.launch_retry.outcome }}
|
||||
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
- if: ${{ always() && ! cancelled() }}
|
||||
name: Notify destroy failed
|
||||
uses: hashicorp/actions-slack-status@v2
|
||||
uses: hashicorp/actions-slack-status@v2.0.1
|
||||
with:
|
||||
failure-message: "enos scenario destroy ${{ matrix.scenario.id.filter}} failed. \nTriggering event: `${{ github.event_name }}` \nActor: `${{ github.actor }}`"
|
||||
status: ${{ steps.destroy.outcome }}
|
||||
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
- if: ${{ always() && ! cancelled() }}
|
||||
name: Notify retry destroy failed
|
||||
uses: hashicorp/actions-slack-status@v2
|
||||
uses: hashicorp/actions-slack-status@v2.0.1
|
||||
with:
|
||||
failure-message: "retry enos scenario destroy ${{ matrix.scenario.id.filter}} failed. \nTriggering event: `${{ github.event_name }}` \nActor: `${{ github.actor }}`"
|
||||
status: ${{ steps.destroy_retry.outcome }}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
1.22.2
|
||||
1.22.5
|
||||
|
|
|
|||
18
.release/versions.hcl
Normal file
18
.release/versions.hcl
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Copyright (c) HashiCorp, Inc.
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
# This manifest file describes active releases and is consumed by the backport tooling.
|
||||
|
||||
schema = 1
|
||||
active_versions {
|
||||
version "1.17.x" {
|
||||
ce_active = true
|
||||
}
|
||||
version "1.16.x" {
|
||||
ce_active = false
|
||||
lts = true
|
||||
}
|
||||
version "1.15.x" {
|
||||
ce_active = false
|
||||
}
|
||||
}
|
||||
545
CHANGELOG.md
545
CHANGELOG.md
|
|
@ -2,6 +2,445 @@
|
|||
- [v1.0.0 - v1.9.10](CHANGELOG-pre-v1.10.md)
|
||||
- [v0.11.6 and earlier](CHANGELOG-v0.md)
|
||||
|
||||
## 1.17.3
|
||||
### August 07, 2024
|
||||
|
||||
CHANGES:
|
||||
|
||||
* auth/cf: Update plugin to v0.18.0 [[GH-27724](https://github.com/hashicorp/vault/pull/27724)]
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
* audit: Ensure that any underyling errors from audit devices are logged even if we consider auditing to be a success. [[GH-27809](https://github.com/hashicorp/vault/pull/27809)]
|
||||
* audit: Internal implementation changes to the audit subsystem which improve performance. [[GH-27952](https://github.com/hashicorp/vault/pull/27952)]
|
||||
* audit: sinks (file, socket, syslog) will attempt to log errors to the server operational
|
||||
log before returning (if there are errors to log, and the context is done). [[GH-27859](https://github.com/hashicorp/vault/pull/27859)]
|
||||
* auth/cert: Cache full list of role trust information separately to avoid
|
||||
eviction, and avoid duplicate loading during multiple simultaneous logins on
|
||||
the same role. [[GH-27902](https://github.com/hashicorp/vault/pull/27902)]
|
||||
* license utilization reporting (enterprise): Auto-roll billing start date. [[GH-27656](https://github.com/hashicorp/vault/pull/27656)]
|
||||
* website/docs: Added API documentation for Azure Secrets Engine delete role [[GH-27883](https://github.com/hashicorp/vault/pull/27883)]
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* auth/cert: Use subject's serial number, not issuer's within error message text in OCSP request errors [[GH-27696](https://github.com/hashicorp/vault/pull/27696)]
|
||||
* core (enterprise): Fix 500 errors that occurred querying `sys/internal/ui/mounts` for a mount prefixed by a namespace path when path filters are configured. [[GH-27939](https://github.com/hashicorp/vault/pull/27939)]
|
||||
* core/identity: Fixed an issue where deleted/reassigned entity-aliases were not removed from in-memory database. [[GH-27750](https://github.com/hashicorp/vault/pull/27750)]
|
||||
* proxy/cache (enterprise): Fixed an issue where Proxy would not correctly update KV secrets when talking to a perf standby. Proxy will now attempt to forward requests to update secrets triggered by events to the active node. Note that this requires `allow_forwarding_via_header` to be configured on the cluster. [[GH-27891](https://github.com/hashicorp/vault/pull/27891)]
|
||||
* proxy/cache (enterprise): Fixed an issue where cached static secrets could fail to update if the secrets belonged to a non-root namespace. [[GH-27730](https://github.com/hashicorp/vault/pull/27730)]
|
||||
* raft/autopilot: Fixed panic that may occur during shutdown [[GH-27726](https://github.com/hashicorp/vault/pull/27726)]
|
||||
* secrets-sync (enterprise): Destination set/remove operations will no longer be blocked as "purge in progress" after a purge job ended in failure.
|
||||
* secrets-sync (enterprise): Normalize custom_tag keys and values for recoverable invalid characters.
|
||||
* secrets-sync (enterprise): Normalize secret key names before storing the external_name in a secret association.
|
||||
* secrets-sync (enterprise): Patching github sync destination credentials will properly update and save the new credentials.
|
||||
* secrets-sync (enterprise): Return an error immediately on destination creation when providing invalid custom_tags based on destination type.
|
||||
* secrets/identity (enterprise): Fix a bug that can cause DR promotion to fail in rare cases where a PR secondary has inconsistent alias information in storage.
|
||||
* sys: Fix a bug where mounts of external plugins that were registered before Vault v1.0.0 could not be tuned to
|
||||
use versioned plugins. [[GH-27881](https://github.com/hashicorp/vault/pull/27881)]
|
||||
* ui: Fix cursor jump on KVv2 json editor that would occur after pressing ENTER. [[GH-27569](https://github.com/hashicorp/vault/pull/27569)]
|
||||
* ui: fix issue where enabling then disabling "Tidy ACME" in PKI results in failed API call. [[GH-27742](https://github.com/hashicorp/vault/pull/27742)]
|
||||
* ui: fix namespace picker not working when in small screen where the sidebar is collapsed by default. [[GH-27728](https://github.com/hashicorp/vault/pull/27728)]
|
||||
|
||||
|
||||
## 1.17.2
|
||||
### July 10, 2024
|
||||
|
||||
CHANGES:
|
||||
|
||||
* core: Bump Go version to 1.22.5
|
||||
* secrets/azure: Update plugin to v0.19.2 [[GH-27652](https://github.com/hashicorp/vault/pull/27652)]
|
||||
|
||||
FEATURES:
|
||||
|
||||
* **AWS secrets engine STS session tags support**: Adds support for setting STS
|
||||
session tags when generating temporary credentials using the AWS secrets
|
||||
engine. [[GH-27620](https://github.com/hashicorp/vault/pull/27620)]
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* cli: Fixed issue with `vault hcp connect` where HCP resources with uppercase letters were inaccessible when entering the correct project name. [[GH-27694](https://github.com/hashicorp/vault/pull/27694)]
|
||||
* core (enterprise): Fix HTTP redirects in namespaces to use the correct path and (in the case of event subscriptions) the correct URI scheme. [[GH-27660](https://github.com/hashicorp/vault/pull/27660)]
|
||||
* core/config: fix issue when using `proxy_protocol_behavior` with `deny_unauthorized`,
|
||||
which causes the Vault TCP listener to close after receiving an untrusted upstream proxy connection. [[GH-27589](https://github.com/hashicorp/vault/pull/27589)]
|
||||
* core: Fixed an issue with performance standbys not being able to handle rotate root requests. [[GH-27631](https://github.com/hashicorp/vault/pull/27631)]
|
||||
* secrets/transit (enterprise): Fix an issue that caused input data be returned as part of generated CMAC values.
|
||||
* ui: Display an error and force a timeout when TOTP passcode is incorrect [[GH-27574](https://github.com/hashicorp/vault/pull/27574)]
|
||||
* ui: Ensure token expired banner displays when batch token expires [[GH-27479](https://github.com/hashicorp/vault/pull/27479)]
|
||||
|
||||
## 1.17.1
|
||||
### June 26, 2024
|
||||
|
||||
CHANGES:
|
||||
|
||||
* auth/jwt: Update plugin to v0.21.0 [[GH-27498](https://github.com/hashicorp/vault/pull/27498)]
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
* storage/raft: Improve autopilot logging on startup to show config values clearly and avoid spurious logs [[GH-27464](https://github.com/hashicorp/vault/pull/27464)]
|
||||
* ui/secrets-sync: Hide Secrets Sync from the sidebar nav if user does not have access to the feature. [[GH-27262](https://github.com/hashicorp/vault/pull/27262)]
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* agent: Fixed an issue causing excessive CPU usage during normal operation [[GH-27518](https://github.com/hashicorp/vault/pull/27518)]
|
||||
* config: Vault TCP listener config now correctly supports the documented proxy_protocol_behavior
|
||||
setting of 'deny_unauthorized' [[GH-27459](https://github.com/hashicorp/vault/pull/27459)]
|
||||
* core/audit: Audit logging a Vault request/response checks if the existing context
|
||||
is cancelled and will now use a new context with a 5 second timeout.
|
||||
If the existing context is cancelled a new context, will be used. [[GH-27531](https://github.com/hashicorp/vault/pull/27531)]
|
||||
* helper/pkcs7: Fix parsing certain messages containing only certificates [[GH-27435](https://github.com/hashicorp/vault/pull/27435)]
|
||||
* proxy: Fixed an issue causing excessive CPU usage during normal operation [[GH-27518](https://github.com/hashicorp/vault/pull/27518)]
|
||||
* replication (enterprise): fix cache invalidation issue leading to namespace custom metadata not being shown correctly on performance secondaries
|
||||
* secrets-sync (enterprise): Properly remove tags from secrets in AWS when they are removed from the source association
|
||||
* secrets-sync (enterprise): Return more accurate error code for invalid connection details
|
||||
* secrets-sync (enterprise): Skip invalid GitHub repository names when creating destinations
|
||||
* storage/azure: Fix invalid account name initialization bug [[GH-27563](https://github.com/hashicorp/vault/pull/27563)]
|
||||
* storage/raft (enterprise): Fix issue with namespace cache not getting cleared on snapshot restore, resulting in namespaces not found in the snapshot being inaccurately represented by API responses. [[GH-27474](https://github.com/hashicorp/vault/pull/27474)]
|
||||
* ui: Allow creation of session_token type roles for AWS secret backend [[GH-27424](https://github.com/hashicorp/vault/pull/27424)]
|
||||
|
||||
## 1.17.0
|
||||
### June 12, 2024
|
||||
|
||||
SECURITY:
|
||||
|
||||
* auth/jwt: Update plugin to v0.20.3 that resolves a security issue with validing JWTs [[GH-26890](https://github.com/hashicorp/vault/pull/26890), [HCSEC-2024-11](https://discuss.hashicorp.com/t/hcsec-2024-11-vault-incorrectly-validated-json-web-tokens-jwt-audience-claims/67770)]
|
||||
|
||||
CHANGES:
|
||||
|
||||
* api: Upgrade from github.com/go-jose/go-jose/v3 v3.0.3 to github.com/go-jose/go-jose/v4 v4.0.1. [[GH-26527](https://github.com/hashicorp/vault/pull/26527)]
|
||||
* audit: breaking change - Vault now allows audit logs to contain 'correlation-id' and 'x-correlation-id' headers when they
|
||||
are present in the incoming request. By default they are not HMAC'ed (but can be configured to HMAC by Vault Operators). [[GH-26777](https://github.com/hashicorp/vault/pull/26777)]
|
||||
* auth/alicloud: Update plugin to v0.18.0 [[GH-27133](https://github.com/hashicorp/vault/pull/27133)]
|
||||
* auth/azure: Update plugin to v0.18.0 [[GH-27146](https://github.com/hashicorp/vault/pull/27146)]
|
||||
* auth/centrify: Remove the deprecated Centrify auth method plugin [[GH-27130](https://github.com/hashicorp/vault/pull/27130)]
|
||||
* auth/cf: Update plugin to v0.17.0 [[GH-27161](https://github.com/hashicorp/vault/pull/27161)]
|
||||
* auth/gcp: Update plugin to v0.18.0 [[GH-27140](https://github.com/hashicorp/vault/pull/27140)]
|
||||
* auth/jwt: Update plugin to v0.20.2 [[GH-26291](https://github.com/hashicorp/vault/pull/26291)]
|
||||
* auth/kerberos: Update plugin to v0.12.0 [[GH-27177](https://github.com/hashicorp/vault/pull/27177)]
|
||||
* auth/kubernetes: Update plugin to v0.19.0 [[GH-27186](https://github.com/hashicorp/vault/pull/27186)]
|
||||
* auth/oci: Update plugin to v0.16.0 [[GH-27142](https://github.com/hashicorp/vault/pull/27142)]
|
||||
* core (enterprise): Seal High Availability (HA) must be enabled by `enable_multiseal` in configuration.
|
||||
* core/identity: improve performance for secondary nodes receiving identity related updates through replication [[GH-27184](https://github.com/hashicorp/vault/pull/27184)]
|
||||
* core: Bump Go version to 1.22.4
|
||||
* core: return an additional "invalid token" error message in 403 response when the provided request token is expired,
|
||||
exceeded the number of uses, or is a bogus value [[GH-25953](https://github.com/hashicorp/vault/pull/25953)]
|
||||
* database/couchbase: Update plugin to v0.11.0 [[GH-27145](https://github.com/hashicorp/vault/pull/27145)]
|
||||
* database/elasticsearch: Update plugin to v0.15.0 [[GH-27136](https://github.com/hashicorp/vault/pull/27136)]
|
||||
* database/mongodbatlas: Update plugin to v0.12.0 [[GH-27143](https://github.com/hashicorp/vault/pull/27143)]
|
||||
* database/redis-elasticache: Update plugin to v0.4.0 [[GH-27139](https://github.com/hashicorp/vault/pull/27139)]
|
||||
* database/redis: Update plugin to v0.3.0 [[GH-27117](https://github.com/hashicorp/vault/pull/27117)]
|
||||
* database/snowflake: Update plugin to v0.11.0 [[GH-27132](https://github.com/hashicorp/vault/pull/27132)]
|
||||
* sdk: String templates now have a maximum size of 100,000 characters. [[GH-26110](https://github.com/hashicorp/vault/pull/26110)]
|
||||
* secrets/ad: Update plugin to v0.18.0 [[GH-27172](https://github.com/hashicorp/vault/pull/27172)]
|
||||
* secrets/alicloud: Update plugin to v0.17.0 [[GH-27134](https://github.com/hashicorp/vault/pull/27134)]
|
||||
* secrets/azure: Update plugin to v0.17.1 [[GH-26528](https://github.com/hashicorp/vault/pull/26528)]
|
||||
* secrets/azure: Update plugin to v0.19.0 [[GH-27141](https://github.com/hashicorp/vault/pull/27141)]
|
||||
* secrets/gcp: Update plugin to v0.19.0 [[GH-27164](https://github.com/hashicorp/vault/pull/27164)]
|
||||
* secrets/gcpkms: Update plugin to v0.17.0 [[GH-27163](https://github.com/hashicorp/vault/pull/27163)]
|
||||
* secrets/keymgmt (enterprise): Removed `namespace` label on the `vault.kmse.key.count` metric.
|
||||
* secrets/kmip (enterprise): Update plugin to v0.15.0
|
||||
* secrets/kubernetes: Update plugin to v0.8.0 [[GH-27187](https://github.com/hashicorp/vault/pull/27187)]
|
||||
* secrets/kv: Update plugin to v0.18.0 [[GH-26877](https://github.com/hashicorp/vault/pull/26877)]
|
||||
* secrets/kv: Update plugin to v0.19.0 [[GH-27159](https://github.com/hashicorp/vault/pull/27159)]
|
||||
* secrets/mongodbatlas: Update plugin to v0.12.0 [[GH-27149](https://github.com/hashicorp/vault/pull/27149)]
|
||||
* secrets/openldap: Update plugin to v0.13.0 [[GH-27137](https://github.com/hashicorp/vault/pull/27137)]
|
||||
* secrets/pki: sign-intermediate API will truncate notAfter if calculated to go beyond the signing issuer's notAfter. Previously the notAfter was permitted to go beyond leading to invalid chains. [[GH-26796](https://github.com/hashicorp/vault/pull/26796)]
|
||||
* secrets/terraform: Update plugin to v0.8.0 [[GH-27147](https://github.com/hashicorp/vault/pull/27147)]
|
||||
* ui/kubernetes: Update the roles filter-input to use explicit search. [[GH-27178](https://github.com/hashicorp/vault/pull/27178)]
|
||||
* ui: Update dependencies including D3 libraries [[GH-26346](https://github.com/hashicorp/vault/pull/26346)]
|
||||
* ui: Upgrade Ember data from 4.11.3 to 4.12.4 [[GH-25272](https://github.com/hashicorp/vault/pull/25272)]
|
||||
* ui: Upgrade Ember to version 5.4 [[GH-26708](https://github.com/hashicorp/vault/pull/26708)]
|
||||
* ui: deleting a nested secret will no longer redirect you to the nearest path segment [[GH-26845](https://github.com/hashicorp/vault/pull/26845)]
|
||||
* ui: flash messages render on right side of page [[GH-25459](https://github.com/hashicorp/vault/pull/25459)]
|
||||
|
||||
FEATURES:
|
||||
|
||||
* **PKI Certificate Metadata (enterprise)**: Add Certificate Metadata Functionality to Record and Return Client Information about a Certificate.
|
||||
* **Adaptive Overload Protection (enterprise)**: Adds Adaptive Overload Protection
|
||||
for write requests as a Beta feature (disabled by default). This automatically
|
||||
prevents overloads caused by too many write requests while maintaining optimal
|
||||
throughput for the hardware configuration and workload.
|
||||
* **Audit Filtering (enterprise)** : Audit devices support expression-based filter rules (powered by go-bexpr) to determine which entries are written to the audit log.
|
||||
* **LDAP Secrets engine hierarchical path support**: Hierarchical path handling is now supported for role and set APIs. [[GH-27203](https://github.com/hashicorp/vault/pull/27203)]
|
||||
* **Plugin Identity Tokens**: Adds secret-less configuration of AWS auth engine using web identity federation. [[GH-26507](https://github.com/hashicorp/vault/pull/26507)]
|
||||
* **Plugin Workload Identity** (enterprise): Vault can generate identity tokens for plugins to use in workload identity federation auth flows.
|
||||
* **Transit AES-CMAC (enterprise)**: Added support to create and verify AES backed cipher-based message authentication codes
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
* activity (enterprise): Change minimum retention window in activity log to 48 months
|
||||
* agent: Added a new config option, `lease_renewal_threshold`, that controls the refresh rate of non-renewable leases in Agent's template engine. [[GH-25212](https://github.com/hashicorp/vault/pull/25212)]
|
||||
* agent: Agent will re-trigger auto auth if token used for rendering templates has been revoked, has exceeded the number of uses, or is a bogus value. [[GH-26172](https://github.com/hashicorp/vault/pull/26172)]
|
||||
* api: Move CLI token helper functions to importable packages in `api` module. [[GH-25744](https://github.com/hashicorp/vault/pull/25744)]
|
||||
* audit: timestamps across multiple audit devices for an audit entry will now match. [[GH-26088](https://github.com/hashicorp/vault/pull/26088)]
|
||||
* auth/aws: Add inferred_hostname metadata for IAM AWS authentication method. [[GH-25418](https://github.com/hashicorp/vault/pull/25418)]
|
||||
* auth/aws: add canonical ARN as entity alias option [[GH-22460](https://github.com/hashicorp/vault/pull/22460)]
|
||||
* auth/aws: add support for external_ids in AWS assume-role [[GH-26628](https://github.com/hashicorp/vault/pull/26628)]
|
||||
* auth/cert: Adds support for TLS certificate authenticaion through a reverse proxy that terminates the SSL connection [[GH-17272](https://github.com/hashicorp/vault/pull/17272)]
|
||||
* cli: Add events subscriptions commands
|
||||
* command/server: Removed environment variable requirement to generate pprof
|
||||
files using SIGUSR2. Added CPU profile support. [[GH-25391](https://github.com/hashicorp/vault/pull/25391)]
|
||||
* core (enterprise): persist seal rewrap status, so rewrap status API is consistent on secondary nodes.
|
||||
* core/activity: Include ACME client metrics to precomputed queries [[GH-26519](https://github.com/hashicorp/vault/pull/26519)]
|
||||
* core/activity: Include ACME clients in activity log responses [[GH-26020](https://github.com/hashicorp/vault/pull/26020)]
|
||||
* core/activity: Include ACME clients in vault operator usage response [[GH-26525](https://github.com/hashicorp/vault/pull/26525)]
|
||||
* core/config: reload service registration configuration on SIGHUP [[GH-17598](https://github.com/hashicorp/vault/pull/17598)]
|
||||
* core: add deadlock detection in barrier and sealwrap
|
||||
* license utilization reporting (enterprise): Add retention months to license utilization reports.
|
||||
* proxy/cache (enterprise): Support new configuration parameter for static secret caching, `static_secret_token_capability_refresh_behavior`, to control the behavior when the capability refresh request receives an error from Vault.
|
||||
* proxy: Proxy will re-trigger auto auth if the token used for requests has been revoked, has exceeded the number of uses,
|
||||
or is an otherwise invalid value. [[GH-26307](https://github.com/hashicorp/vault/pull/26307)]
|
||||
* raft/snapshotagent (enterprise): upgrade raft-snapshotagent to v0.0.0-20221104090112-13395acd02c5
|
||||
* replication (enterprise): Add replication heartbeat metric to telemetry
|
||||
* replication (enterprise): Periodically write current time on the primary to storage, use that downstream to measure replication lag in time, expose that in health and replication status endpoints. [[GH-26406](https://github.com/hashicorp/vault/pull/26406)]
|
||||
* sdk/decompression: DecompressWithCanary will now chunk the decompression in memory to prevent loading it all at once. [[GH-26464](https://github.com/hashicorp/vault/pull/26464)]
|
||||
* sdk/helper/testcluster: add some new helpers, improve some error messages. [[GH-25329](https://github.com/hashicorp/vault/pull/25329)]
|
||||
* sdk/helper/testhelpers: add namespace helpers [[GH-25270](https://github.com/hashicorp/vault/pull/25270)]
|
||||
* secrets-sync (enterprise): Added global config path to the administrative namespace.
|
||||
* secrets/pki (enterprise): Disable warnings about unknown parameters to the various CIEPS endpoints
|
||||
* secrets/pki: Add a new ACME configuration parameter that allows increasing the maximum TTL for ACME leaf certificates [[GH-26797](https://github.com/hashicorp/vault/pull/26797)]
|
||||
* secrets/transform (enterprise): Add delete by token and delete by plaintext operations to Tokenization.
|
||||
* storage/azure: Perform validation on Azure account name and container name [[GH-26135](https://github.com/hashicorp/vault/pull/26135)]
|
||||
* storage/raft (enterprise): add support for separate entry size limit for mount
|
||||
and namespace table paths in storage to allow increased mount table size without
|
||||
allowing other user storage entries to become larger. [[GH-25992](https://github.com/hashicorp/vault/pull/25992)]
|
||||
* storage/raft: panic on unknown Raft operations [[GH-25991](https://github.com/hashicorp/vault/pull/25991)]
|
||||
* ui (enterprise): Allow HVD users to access Secrets Sync. [[GH-26841](https://github.com/hashicorp/vault/pull/26841)]
|
||||
* ui (enterprise): Update dashboard to make activity log query using the same start time as the metrics overview [[GH-26729](https://github.com/hashicorp/vault/pull/26729)]
|
||||
* ui (enterprise): Update filters on the custom messages list view. [[GH-26653](https://github.com/hashicorp/vault/pull/26653)]
|
||||
* ui: Allow users to wrap inputted data again instead of resetting form [[GH-27289](https://github.com/hashicorp/vault/pull/27289)]
|
||||
* ui: Display ACME clients on a separate page in the UI. [[GH-26020](https://github.com/hashicorp/vault/pull/26020)]
|
||||
* ui: Hide dashboard client count card if user does not have permission to view clients. [[GH-26848](https://github.com/hashicorp/vault/pull/26848)]
|
||||
* ui: Show computed values from `sys/internal/ui/mounts` endpoint for auth mount configuration view [[GH-26663](https://github.com/hashicorp/vault/pull/26663)]
|
||||
* ui: Update PGP display and show error for Generate Operation Token flow with PGP [[GH-26993](https://github.com/hashicorp/vault/pull/26993)]
|
||||
* ui: Update language in Transit secret engine to reflect that not all keys are for encyryption [[GH-27346](https://github.com/hashicorp/vault/pull/27346)]
|
||||
* ui: Update userpass user form to allow setting `password_hash` field. [[GH-26577](https://github.com/hashicorp/vault/pull/26577)]
|
||||
* ui: fixes cases where inputs did not have associated labels [[GH-26263](https://github.com/hashicorp/vault/pull/26263)]
|
||||
* ui: show banner instead of permission denied error when batch token is expired [[GH-26396](https://github.com/hashicorp/vault/pull/26396)]
|
||||
* website/docs: Add note about eventual consietency with the MongoDB Atlas database secrets engine [[GH-24152](https://github.com/hashicorp/vault/pull/24152)]
|
||||
|
||||
DEPRECATIONS:
|
||||
|
||||
* Request Limiter Beta(enterprise): This Beta feature added in 1.16 has been
|
||||
superseded by Adaptive Overload Protection and will be removed.
|
||||
* secrets/azure: Deprecate field "password_policy" as we are not able to set it anymore with the new MS Graph API. [[GH-25637](https://github.com/hashicorp/vault/pull/25637)]
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* activity (enterprise): fix read-only storage error on upgrades
|
||||
* agent: Correctly constructs kv-v2 secret paths in nested namespaces. [[GH-26863](https://github.com/hashicorp/vault/pull/26863)]
|
||||
* agent: Fixes a high Vault load issue, by restarting the Conusl template server after backing off instead of immediately. [[GH-25497](https://github.com/hashicorp/vault/pull/25497)]
|
||||
* agent: `vault.namespace` no longer gets incorrectly overridden by `auto_auth.namespace`, if set [[GH-26427](https://github.com/hashicorp/vault/pull/26427)]
|
||||
* api: fixed a bug where LifetimeWatcher routines weren't respecting exponential backoff in the presence of unexpected errors [[GH-26383](https://github.com/hashicorp/vault/pull/26383)]
|
||||
* audit: Operator changes to configured audit headers (via `/sys/config/auditing`)
|
||||
will now force invalidation and be reloaded from storage when data is replicated
|
||||
to other nodes.
|
||||
* auth/ldap: Fix login error for group search anonymous bind. [[GH-26200](https://github.com/hashicorp/vault/pull/26200)]
|
||||
* auth/ldap: Fix login error missing entity alias attribute value. [[GH-26200](https://github.com/hashicorp/vault/pull/26200)]
|
||||
* auto-auth: Addressed issue where having no permissions to renew a renewable token caused auto-auth to attempt to renew constantly with no backoff [[GH-26844](https://github.com/hashicorp/vault/pull/26844)]
|
||||
* cli/debug: Fix resource leak in CLI debug command. [[GH-26167](https://github.com/hashicorp/vault/pull/26167)]
|
||||
* cli: fixed a bug where the Vault CLI would error out if
|
||||
HOME was not set. [[GH-26243](https://github.com/hashicorp/vault/pull/26243)]
|
||||
* core (enterprise): Fix 403s returned when forwarding invalid token to active node from secondary.
|
||||
* core (enterprise): Fix an issue that prevented the seal re-wrap status from reporting that a re-wrap is in progress for up to a second.
|
||||
* core (enterprise): fix bug where raft followers disagree with the seal type after returning to one seal from two. [[GH-26523](https://github.com/hashicorp/vault/pull/26523)]
|
||||
* core (enterprise): fix issue where the Seal HA rewrap system may remain running when an active node steps down.
|
||||
* core/audit: Audit logging a Vault request/response will now use a minimum 5 second context timeout.
|
||||
If the existing context deadline occurs later than 5s in the future, it will be used, otherwise a
|
||||
new context, separate from the original will be used. [[GH-26616](https://github.com/hashicorp/vault/pull/26616)]
|
||||
* core/metrics: store cluster name in unencrypted storage to prevent blank cluster name [[GH-26878](https://github.com/hashicorp/vault/pull/26878)]
|
||||
* core/namespace (enterprise): Privileged namespace paths provided in the `administrative_namespace_path` config will now be canonicalized.
|
||||
* core/seal: During a seal reload through SIGHUP, only write updated seal barrier on an active node [[GH-26381](https://github.com/hashicorp/vault/pull/26381)]
|
||||
* core/seal: allow overriding of VAULT_GCPCKMS_SEAL_KEY_RING and VAULT_GCPCKMS_SEAL_CRYPTO_KEY environment keys in seal-ha
|
||||
* core: Add missing field delegated_auth_accessors to GET /sys/mounts/:path API response [[GH-26876](https://github.com/hashicorp/vault/pull/26876)]
|
||||
* core: Address a data race updating a seal's last seen healthy time attribute [[GH-27014](https://github.com/hashicorp/vault/pull/27014)]
|
||||
* core: Fix `redact_version` listener parameter being ignored for some OpenAPI related endpoints. [[GH-26607](https://github.com/hashicorp/vault/pull/26607)]
|
||||
* core: Only reload seal configuration when enable_multiseal is set to true. [[GH-26166](https://github.com/hashicorp/vault/pull/26166)]
|
||||
* core: when listener configuration `chroot_namespace` is active, Vault will no longer report that the configuration is invalid when Vault is sealed
|
||||
* events (enterprise): Fix bug preventing subscribing and receiving events within a namepace.
|
||||
* events (enterprise): Terminate WebSocket connection when token is revoked.
|
||||
* openapi: Fixing approle reponse duration types [[GH-25510](https://github.com/hashicorp/vault/pull/25510)]
|
||||
* openapi: added the missing migrate parameter for the unseal endpoint in vault/logical_system_paths.go [[GH-25550](https://github.com/hashicorp/vault/pull/25550)]
|
||||
* pki: Fix error in cross-signing using ed25519 keys [[GH-27093](https://github.com/hashicorp/vault/pull/27093)]
|
||||
* plugin/wif: fix a bug where the namespace was not set for external plugins using workload identity federation [[GH-26384](https://github.com/hashicorp/vault/pull/26384)]
|
||||
* replication (enterprise): fix "given mount path is not in the same namespace as the request" error that can occur when enabling replication for the first time on a secondary cluster
|
||||
* replication (enterprise): fixed data integrity issue with the processing of identity aliases causing duplicates to occur in rare cases
|
||||
* router: Fix missing lock in MatchingSystemView. [[GH-25191](https://github.com/hashicorp/vault/pull/25191)]
|
||||
* secret/database: Fixed race condition where database mounts may leak connections [[GH-26147](https://github.com/hashicorp/vault/pull/26147)]
|
||||
* secrets-sync (enterprise): Fixed an issue with syncing to target projects in GCP
|
||||
* secrets/azure: Update vault-plugin-secrets-azure to 0.17.2 to include a bug fix for azure role creation [[GH-26896](https://github.com/hashicorp/vault/pull/26896)]
|
||||
* secrets/pki (enterprise): cert_role parameter within authenticators.cert EST configuration handler could not be set
|
||||
* secrets/pki: fixed validation bug which rejected ldap schemed URLs in crl_distribution_points. [[GH-26477](https://github.com/hashicorp/vault/pull/26477)]
|
||||
* secrets/transform (enterprise): Fix a bug preventing the use of alternate schemas on PostgreSQL token stores.
|
||||
* secrets/transit: Use 'hash_algorithm' parameter if present in HMAC verify requests. Otherwise fall back to deprecated 'algorithm' parameter. [[GH-27211](https://github.com/hashicorp/vault/pull/27211)]
|
||||
* storage/raft (enterprise): Fix a bug where autopilot automated upgrades could fail due to using the wrong upgrade version
|
||||
* storage/raft (enterprise): Fix a regression introduced in 1.15.8 that causes
|
||||
autopilot to fail to discover new server versions and so not trigger an upgrade. [[GH-27277](https://github.com/hashicorp/vault/pull/27277)]
|
||||
* storage/raft: prevent writes from impeding leader transfers, e.g. during automated upgrades [[GH-25390](https://github.com/hashicorp/vault/pull/25390)]
|
||||
* transform (enterprise): guard against a panic looking up a token in exportable mode with barrier storage.
|
||||
* ui: Do not show resultant-ACL banner when ancestor namespace grants wildcard access. [[GH-27263](https://github.com/hashicorp/vault/pull/27263)]
|
||||
* ui: Fix KVv2 cursor jumping inside json editor after initial input. [[GH-27120](https://github.com/hashicorp/vault/pull/27120)]
|
||||
* ui: Fix KVv2 json editor to allow null values. [[GH-27094](https://github.com/hashicorp/vault/pull/27094)]
|
||||
* ui: Fix a bug where disabling TTL on the AWS credential form would still send TTL value [[GH-27366](https://github.com/hashicorp/vault/pull/27366)]
|
||||
* ui: Fix broken help link in console for the web command. [[GH-26858](https://github.com/hashicorp/vault/pull/26858)]
|
||||
* ui: Fix configuration link from Secret Engine list view for Ember engines. [[GH-27131](https://github.com/hashicorp/vault/pull/27131)]
|
||||
* ui: Fix link to v2 generic secrets engine from secrets list page. [[GH-27019](https://github.com/hashicorp/vault/pull/27019)]
|
||||
* ui: Prevent perpetual loading screen when Vault needs initialization [[GH-26985](https://github.com/hashicorp/vault/pull/26985)]
|
||||
* ui: Refresh model within a namespace on the Secrets Sync overview page. [[GH-26790](https://github.com/hashicorp/vault/pull/26790)]
|
||||
* ui: Remove possibility of returning an undefined timezone from date-format helper [[GH-26693](https://github.com/hashicorp/vault/pull/26693)]
|
||||
* ui: Resolved accessibility issues with Web REPL. Associated label and help text with input, added a conditional to show the console/ui-panel only when toggled open, added keyboard focus trap. [[GH-26872](https://github.com/hashicorp/vault/pull/26872)]
|
||||
* ui: fix issue where a month without new clients breaks the client count dashboard [[GH-27352](https://github.com/hashicorp/vault/pull/27352)]
|
||||
* ui: fixed a bug where the replication pages did not update display when navigating between DR and performance [[GH-26325](https://github.com/hashicorp/vault/pull/26325)]
|
||||
* ui: fixes undefined start time in filename for downloaded client count attribution csv [[GH-26485](https://github.com/hashicorp/vault/pull/26485)]
|
||||
|
||||
## 1.16.7 Enterprise
|
||||
### August 07, 2024
|
||||
|
||||
**Enterprise LTS:** Vault Enterprise 1.16 is a [Long-Term Support (LTS)](https://developer.hashicorp.com/vault/docs/enterprise/lts) release.
|
||||
|
||||
CHANGES:
|
||||
|
||||
* auth/cf: Update plugin to v0.18.0 [[GH-27724](https://github.com/hashicorp/vault/pull/27724)]
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
* audit: Ensure that any underyling errors from audit devices are logged even if we consider auditing to be a success. [[GH-27809](https://github.com/hashicorp/vault/pull/27809)]
|
||||
* audit: Internal implementation changes to the audit subsystem which improve performance. [[GH-27952](https://github.com/hashicorp/vault/pull/27952)]
|
||||
* audit: sinks (file, socket, syslog) will attempt to log errors to the server operational
|
||||
log before returning (if there are errors to log, and the context is done). [[GH-27859](https://github.com/hashicorp/vault/pull/27859)]
|
||||
* auth/cert: Cache full list of role trust information separately to avoid
|
||||
eviction, and avoid duplicate loading during multiple simultaneous logins on
|
||||
the same role. [[GH-27902](https://github.com/hashicorp/vault/pull/27902)]
|
||||
* license utilization reporting (enterprise): Auto-roll billing start date. [[GH-27656](https://github.com/hashicorp/vault/pull/27656)]
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* auth/cert: Use subject's serial number, not issuer's within error message text in OCSP request errors [[GH-27696](https://github.com/hashicorp/vault/pull/27696)]
|
||||
* cli: Fixed issue with `vault hcp connect` where HCP resources with uppercase letters were inaccessible when entering the correct project name. [[GH-27694](https://github.com/hashicorp/vault/pull/27694)]
|
||||
* core (enterprise): Fix 500 errors that occurred querying `sys/internal/ui/mounts` for a mount prefixed by a namespace path when path filters are configured. [[GH-27939](https://github.com/hashicorp/vault/pull/27939)]
|
||||
* core/identity: Fixed an issue where deleted/reassigned entity-aliases were not removed from in-memory database. [[GH-27750](https://github.com/hashicorp/vault/pull/27750)]
|
||||
* proxy/cache (enterprise): Fixed an issue where Proxy would not correctly update KV secrets when talking to a perf standby. Proxy will now attempt to forward requests to update secrets triggered by events to the active node. Note that this requires `allow_forwarding_via_header` to be configured on the cluster. [[GH-27891](https://github.com/hashicorp/vault/pull/27891)]
|
||||
* raft/autopilot: Fixed panic that may occur during shutdown [[GH-27726](https://github.com/hashicorp/vault/pull/27726)]
|
||||
* secrets-sync (enterprise): Destination set/remove operations will no longer be blocked as "purge in progress" after a purge job ended in failure.
|
||||
* secrets-sync (enterprise): Normalize custom_tag keys and values for recoverable invalid characters.
|
||||
* secrets-sync (enterprise): Normalize secret key names before storing the external_name in a secret association.
|
||||
* secrets-sync (enterprise): Patching github sync destination credentials will properly update and save the new credentials.
|
||||
* secrets-sync (enterprise): Return an error immediately on destination creation when providing invalid custom_tags based on destination type.
|
||||
* secrets/identity (enterprise): Fix a bug that can cause DR promotion to fail in rare cases where a PR secondary has inconsistent alias information in storage.
|
||||
* sys: Fix a bug where mounts of external plugins that were registered before Vault v1.0.0 could not be tuned to
|
||||
use versioned plugins. [[GH-27881](https://github.com/hashicorp/vault/pull/27881)]
|
||||
* ui: Fix cursor jump on KVv2 json editor that would occur after pressing ENTER. [[GH-27569](https://github.com/hashicorp/vault/pull/27569)]
|
||||
* ui: fix issue where enabling then disabling "Tidy ACME" in PKI results in failed API call. [[GH-27742](https://github.com/hashicorp/vault/pull/27742)]
|
||||
* ui: fix namespace picker not working when in small screen where the sidebar is collapsed by default. [[GH-27728](https://github.com/hashicorp/vault/pull/27728)]
|
||||
|
||||
|
||||
## 1.16.6 Enterprise
|
||||
### July 10, 2024
|
||||
|
||||
**Enterprise LTS:** Vault Enterprise 1.16 is a [Long-Term Support (LTS)](https://developer.hashicorp.com/vault/docs/enterprise/lts) release.
|
||||
|
||||
CHANGES:
|
||||
|
||||
* core: Bump Go version to 1.22.5.
|
||||
* auth/jwt: Revert [GH-295](https://github.com/hashicorp/vault-plugin-auth-jwt/pull/295) which changed the way JWT `aud` claims were validated.
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* agent: Correctly constructs kv-v2 secret paths in nested namespaces. [[GH-26863](https://github.com/hashicorp/vault/pull/26863)]
|
||||
* core (enterprise): Fix HTTP redirects in namespaces to use the correct path and (in the case of event subscriptions) the correct URI scheme. [[GH-27660](https://github.com/hashicorp/vault/pull/27660)]
|
||||
* core/config: fix issue when using `proxy_protocol_behavior` with `deny_unauthorized`,
|
||||
which causes the Vault TCP listener to close after receiving an untrusted upstream proxy connection. [[GH-27589](https://github.com/hashicorp/vault/pull/27589)]
|
||||
* core: Fixed an issue with performance standbys not being able to handle rotate root requests. [[GH-27631](https://github.com/hashicorp/vault/pull/27631)]
|
||||
* ui: Display an error and force a timeout when TOTP passcode is incorrect [[GH-27574](https://github.com/hashicorp/vault/pull/27574)]
|
||||
* ui: Ensure token expired banner displays when batch token expires [[GH-27479](https://github.com/hashicorp/vault/pull/27479)]
|
||||
|
||||
## 1.16.5 Enterprise
|
||||
### June 26, 2024
|
||||
|
||||
**Enterprise LTS:** Vault Enterprise 1.16 is a [Long-Term Support (LTS)](https://developer.hashicorp.com/vault/docs/enterprise/lts) release.
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* cli/debug: Fix resource leak in CLI debug command. [[GH-26167](https://github.com/hashicorp/vault/pull/26167)]
|
||||
* config: Vault TCP listener config now correctly supports the documented proxy_protocol_behavior
|
||||
setting of 'deny_unauthorized' [[GH-27459](https://github.com/hashicorp/vault/pull/27459)]
|
||||
* core/audit: Audit logging a Vault request/response checks if the existing context
|
||||
is cancelled and will now use a new context with a 5 second timeout.
|
||||
If the existing context is cancelled a new context, will be used. [[GH-27531](https://github.com/hashicorp/vault/pull/27531)]
|
||||
* helper/pkcs7: Fix parsing certain messages containing only certificates [[GH-27435](https://github.com/hashicorp/vault/pull/27435)]
|
||||
* replication (enterprise): fix cache invalidation issue leading to namespace custom metadata not being shown correctly on performance secondaries
|
||||
* secrets-sync (enterprise): Properly remove tags from secrets in AWS when they are removed from the source association
|
||||
* secrets-sync (enterprise): Return more accurate error code for invalid connection details
|
||||
* secrets-sync (enterprise): Skip invalid GitHub repository names when creating destinations
|
||||
* storage/raft (enterprise): Fix issue with namespace cache not getting cleared on snapshot restore, resulting in namespaces not found in the snapshot being inaccurately represented by API responses. [[GH-27474](https://github.com/hashicorp/vault/pull/27474)]
|
||||
* ui: Allow creation of session_token type roles for AWS secret backend [[GH-27424](https://github.com/hashicorp/vault/pull/27424)]
|
||||
|
||||
## 1.16.4 Enterprise
|
||||
### June 12, 2024
|
||||
|
||||
**Enterprise LTS:** Vault Enterprise 1.16 is a [Long-Term Support (LTS)](https://developer.hashicorp.com/vault/docs/enterprise/lts) release.
|
||||
|
||||
CHANGES:
|
||||
|
||||
* core: Bump Go version to 1.22.4.
|
||||
* ui/kubernetes: Update the roles filter-input to use explicit search. [[GH-27178](https://github.com/hashicorp/vault/pull/27178)]
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
* ui: Allow users to wrap inputted data again instead of resetting form [[GH-27289](https://github.com/hashicorp/vault/pull/27289)]
|
||||
* ui: Update language in Transit secret engine to reflect that not all keys are for encyryption [[GH-27346](https://github.com/hashicorp/vault/pull/27346)]
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* secrets/transform (enterprise): Fix a bug preventing the use of alternate schemas on PostgreSQL token stores.
|
||||
* storage/raft (enterprise): Fix a regression introduced in 1.15.8 that causes
|
||||
autopilot to fail to discover new server versions and so not trigger an upgrade. [[GH-27277](https://github.com/hashicorp/vault/pull/27277)]
|
||||
* ui: Do not show resultant-ACL banner when ancestor namespace grants wildcard access. [[GH-27263](https://github.com/hashicorp/vault/pull/27263)]
|
||||
* ui: Fix a bug where disabling TTL on the AWS credential form would still send TTL value [[GH-27366](https://github.com/hashicorp/vault/pull/27366)]
|
||||
* ui: fix issue where a month with total clients but no new clients breaks the client count dashboard [[GH-5962](https://github.com/hashicorp/vault/pull/5962)]
|
||||
|
||||
## 1.16.3
|
||||
### May 30, 2024
|
||||
|
||||
**Enterprise LTS:** Vault Enterprise 1.16 is a [Long-Term Support (LTS)](https://developer.hashicorp.com/vault/docs/enterprise/lts) release.
|
||||
|
||||
SECURITY:
|
||||
|
||||
* auth/jwt: Update plugin to v0.20.3 that resolves a security issue with validing JWTs [[GH-26890](https://github.com/hashicorp/vault/pull/26890), [HCSEC-2024-11](https://discuss.hashicorp.com/t/hcsec-2024-11-vault-incorrectly-validated-json-web-tokens-jwt-audience-claims/67770)]
|
||||
|
||||
CHANGES:
|
||||
|
||||
* core/identity: improve performance for secondary nodes receiving identity related updates through replication [[GH-27184](https://github.com/hashicorp/vault/pull/27184)]
|
||||
* core: Bump Go version to 1.22.2.
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
* secrets/pki (enterprise): Disable warnings about unknown parameters to the various CIEPS endpoints
|
||||
* ui: Update PGP display and show error for Generate Operation Token flow with PGP [[GH-26993](https://github.com/hashicorp/vault/pull/26993)]
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* activity (enterprise): fix read-only storage error on upgrades
|
||||
* auto-auth: Addressed issue where having no permissions to renew a renewable token caused auto-auth to attempt to renew constantly with no backoff [[GH-26844](https://github.com/hashicorp/vault/pull/26844)]
|
||||
* core (enterprise): Fix an issue that prevented the seal re-wrap status from reporting that a re-wrap is in progress for up to a second.
|
||||
* core/audit: Audit logging a Vault request/response will now use a minimum 5 second context timeout.
|
||||
If the existing context deadline occurs later than 5s in the future, it will be used, otherwise a new context, separate from the original will be used. [[GH-26616](https://github.com/hashicorp/vault/pull/26616)]
|
||||
* core: Add missing field delegated_auth_accessors to GET /sys/mounts/:path API response [[GH-26876](https://github.com/hashicorp/vault/pull/26876)]
|
||||
* core: Address a data race updating a seal's last seen healthy time attribute [[GH-27014](https://github.com/hashicorp/vault/pull/27014)]
|
||||
* core: Fix `redact_version` listener parameter being ignored for some OpenAPI related endpoints. [[GH-26607](https://github.com/hashicorp/vault/pull/26607)]
|
||||
* events (enterprise): Fix bug preventing subscribing and receiving events within a namepace.
|
||||
* pki: Fix error in cross-signing using ed25519 keys [[GH-27093](https://github.com/hashicorp/vault/pull/27093)]
|
||||
* replication (enterprise): fix "given mount path is not in the same namespace as the request" error that can occur when enabling replication for the first time on a secondary cluster
|
||||
* secrets-sync (enterprise): Secondary nodes in a cluster now properly check activation-flags values.
|
||||
* secrets/azure: Update vault-plugin-secrets-azure to 0.17.2 to include a bug fix for azure role creation [[GH-26896](https://github.com/hashicorp/vault/pull/26896)]
|
||||
* secrets/pki (enterprise): cert_role parameter within authenticators.cert EST configuration handler could not be set
|
||||
* secrets/transit: Use 'hash_algorithm' parameter if present in HMAC verify requests. Otherwise fall back to deprecated 'algorithm' parameter. [[GH-27211](https://github.com/hashicorp/vault/pull/27211)]
|
||||
* ui: Fix KVv2 cursor jumping inside json editor after initial input. [[GH-27120](https://github.com/hashicorp/vault/pull/27120)]
|
||||
* ui: Fix KVv2 json editor to allow null values. [[GH-27094](https://github.com/hashicorp/vault/pull/27094)]
|
||||
* ui: Fix broken help link in console for the web command. [[GH-26858](https://github.com/hashicorp/vault/pull/26858)]
|
||||
* ui: Fix link to v2 generic secrets engine from secrets list page. [[GH-27019](https://github.com/hashicorp/vault/pull/27019)]
|
||||
* ui: Prevent perpetual loading screen when Vault needs initialization [[GH-26985](https://github.com/hashicorp/vault/pull/26985)]
|
||||
* ui: Refresh model within a namespace on the Secrets Sync overview page. [[GH-26790](https://github.com/hashicorp/vault/pull/26790)]
|
||||
|
||||
## 1.16.2
|
||||
### April 24, 2024
|
||||
|
||||
|
|
@ -415,6 +854,97 @@ leading to failure to complete merkle sync without a full re-index. [[GH-23013](
|
|||
* ui: remove user_lockout_config settings for unsupported methods [[GH-25867](https://github.com/hashicorp/vault/pull/25867)]
|
||||
* ui: show error from API when seal fails [[GH-23921](https://github.com/hashicorp/vault/pull/23921)]
|
||||
|
||||
## 1.15.13 Enterprise
|
||||
### August 07, 2024
|
||||
|
||||
CHANGES:
|
||||
|
||||
* auth/cf: Update plugin to v0.18.0 [[GH-27724](https://github.com/hashicorp/vault/pull/27724)]
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
* audit: Ensure that any underyling errors from audit devices are logged even if we consider auditing to be a success. [[GH-27809](https://github.com/hashicorp/vault/pull/27809)]
|
||||
* auth/cert: Cache full list of role trust information separately to avoid
|
||||
eviction, and avoid duplicate loading during multiple simultaneous logins on
|
||||
the same role. [[GH-27902](https://github.com/hashicorp/vault/pull/27902)]
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* auth/cert: Use subject's serial number, not issuer's within error message text in OCSP request errors [[GH-27696](https://github.com/hashicorp/vault/pull/27696)]
|
||||
* core (enterprise): Fix 500 errors that occurred querying `sys/internal/ui/mounts` for a mount prefixed by a namespace path when path filters are configured. [[GH-27939](https://github.com/hashicorp/vault/pull/27939)]
|
||||
* raft/autopilot: Fixed panic that may occur during shutdown [[GH-27726](https://github.com/hashicorp/vault/pull/27726)]
|
||||
* secrets/identity (enterprise): Fix a bug that can cause DR promotion to fail in rare cases where a PR secondary has inconsistent alias information in storage.
|
||||
* ui: Fix cursor jump on KVv2 json editor that would occur after pressing ENTER. [[GH-27569](https://github.com/hashicorp/vault/pull/27569)]
|
||||
* ui: fix issue where enabling then disabling "Tidy ACME" in PKI results in failed API call. [[GH-27742](https://github.com/hashicorp/vault/pull/27742)]
|
||||
* ui: fix namespace picker not working when in small screen where the sidebar is collapsed by default. [[GH-27728](https://github.com/hashicorp/vault/pull/27728)]
|
||||
|
||||
|
||||
## 1.15.12 Enterprise
|
||||
### July 10, 2024
|
||||
|
||||
CHANGES:
|
||||
|
||||
* core: Bump Go version to 1.22.5.
|
||||
* auth/jwt: Revert [GH-295](https://github.com/hashicorp/vault-plugin-auth-jwt/pull/295) which changed the way JWT `aud` claims were validated.
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* core (enterprise): Fix HTTP redirects in namespaces to use the correct path and (in the case of event subscriptions) the correct URI scheme. [[GH-27660](https://github.com/hashicorp/vault/pull/27660)]
|
||||
* core/config: fix issue when using `proxy_protocol_behavior` with `deny_unauthorized`,
|
||||
which causes the Vault TCP listener to close after receiving an untrusted upstream proxy connection. [[GH-27589](https://github.com/hashicorp/vault/pull/27589)]
|
||||
* core: Fixed an issue with performance standbys not being able to handle rotate root requests. [[GH-27631](https://github.com/hashicorp/vault/pull/27631)]
|
||||
* ui: Display an error and force a timeout when TOTP passcode is incorrect [[GH-27574](https://github.com/hashicorp/vault/pull/27574)]
|
||||
* ui: Ensure token expired banner displays when batch token expires [[GH-27479](https://github.com/hashicorp/vault/pull/27479)]
|
||||
|
||||
## 1.15.11 Enterprise
|
||||
### June 26, 2024
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* cli/debug: Fix resource leak in CLI debug command. [[GH-26167](https://github.com/hashicorp/vault/pull/26167)]
|
||||
* helper/pkcs7: Fix parsing certain messages containing only certificates [[GH-27435](https://github.com/hashicorp/vault/pull/27435)]
|
||||
* replication (enterprise): fix cache invalidation issue leading to namespace custom metadata not being shown correctly on performance secondaries
|
||||
* storage/raft (enterprise): Fix issue with namespace cache not getting cleared on snapshot restore, resulting in namespaces not found in the snapshot being inaccurately represented by API responses. [[GH-27474](https://github.com/hashicorp/vault/pull/27474)]
|
||||
|
||||
## 1.15.10 Enterprise
|
||||
### June 12, 2024
|
||||
|
||||
CHANGES:
|
||||
|
||||
* core: Bump Go version to 1.22.4.
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
* ui: Allow users to wrap inputted data again instead of resetting form [[GH-27289](https://github.com/hashicorp/vault/pull/27289)]
|
||||
* ui: Update language in Transit secret engine to reflect that not all keys are for encyryption [[GH-27346](https://github.com/hashicorp/vault/pull/27346)]
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* secrets/transform (enterprise): Fix a bug preventing the use of alternate schemas on PostgreSQL token stores.
|
||||
* storage/raft (enterprise): Fix a regression introduced in 1.15.8 that causes
|
||||
autopilot to fail to discover new server versions and so not trigger an upgrade. [[GH-27277](https://github.com/hashicorp/vault/pull/27277)]
|
||||
* ui: Do not show resultant-ACL banner when ancestor namespace grants wildcard access. [[GH-27263](https://github.com/hashicorp/vault/pull/27263)]
|
||||
* ui: Fix a bug where disabling TTL on the AWS credential form would still send TTL value [[GH-27366](https://github.com/hashicorp/vault/pull/27366)]
|
||||
|
||||
## 1.15.9 Enterprise
|
||||
### May 30, 2024
|
||||
|
||||
CHANGES:
|
||||
* auth/jwt: Update plugin to v0.17.3 [[GH-27063](https://github.com/hashicorp/vault/pull/27063)]
|
||||
* core: Bump Go version to 1.22.2.
|
||||
|
||||
IMPROVEMENTS:
|
||||
* secrets/pki (enterprise): Disable warnings about unknown parameters to the various CIEPS endpoints
|
||||
* website/docs: Add note about eventual consietency with the MongoDB Atlas database secrets engine [[GH-24152](https://github.com/hashicorp/vault/pull/24152)]
|
||||
|
||||
BUG FIXES:
|
||||
* activity (enterprise): fix read-only storage error on upgrades
|
||||
* core: Address a data race updating a seal's last seen healthy time attribute [[GH-27014](https://github.com/hashicorp/vault/pull/27014)]
|
||||
* pki: Fix error in cross-signing using ed25519 keys [[GH-27093](https://github.com/hashicorp/vault/pull/27093)]
|
||||
* replication (enterprise): fix "given mount path is not in the same namespace as the request" error that can occur when enabling replication for the first time on a secondary cluster
|
||||
* secrets/transit: Use 'hash_algorithm' parameter if present in HMAC verify requests. Otherwise fall back to deprecated 'algorithm' parameter. [[GH-27211](https://github.com/hashicorp/vault/pull/27211)]
|
||||
* ui: Fix KVv2 cursor jumping inside json editor after initial input. [[GH-27120](https://github.com/hashicorp/vault/pull/27120)]
|
||||
|
||||
## 1.15.8 Enterprise
|
||||
### April 24, 2024
|
||||
|
||||
|
|
@ -949,6 +1479,21 @@ sdk/ldaputil: use EscapeLDAPValue implementation from cap/ldap [[GH-22249](https
|
|||
* ui: fixes model defaults overwriting input value when user tries to clear form input [[GH-22458](https://github.com/hashicorp/vault/pull/22458)]
|
||||
* ui: fixes text readability issue in revoke token confirmation dialog [[GH-22390](https://github.com/hashicorp/vault/pull/22390)]
|
||||
|
||||
## 1.14.13 Enterprise
|
||||
### May 30, 2024
|
||||
CHANGES:
|
||||
* auth/jwt: Update plugin to v0.16.1 [[GH-27122](https://github.com/hashicorp/vault/pull/27122)]
|
||||
* core: Bump Go version to 1.22.2.
|
||||
|
||||
IMPROVEMENTS:
|
||||
* website/docs: Add note about eventual consietency with the MongoDB Atlas database secrets engine [[GH-24152](https://github.com/hashicorp/vault/pull/24152)]
|
||||
|
||||
BUG FIXES:
|
||||
* activity (enterprise): fix read-only storage error on upgrades
|
||||
* pki: Fix error in cross-signing using ed25519 keys [[GH-27093](https://github.com/hashicorp/vault/pull/27093)]
|
||||
* replication (enterprise): fix "given mount path is not in the same namespace as the request" error that can occur when enabling replication for the first time on a secondary cluster
|
||||
* secrets/transit: Use 'hash_algorithm' parameter if present in HMAC verify requests. Otherwise fall back to deprecated 'algorithm' parameter. [[GH-27211](https://github.com/hashicorp/vault/pull/27211)]
|
||||
|
||||
## 1.14.12 Enterprise
|
||||
### April 24, 2024
|
||||
|
||||
|
|
|
|||
10
Dockerfile
10
Dockerfile
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
## DOCKERHUB DOCKERFILE ##
|
||||
FROM alpine:3.18 as default
|
||||
FROM alpine:3 as default
|
||||
|
||||
ARG BIN_NAME
|
||||
# NAME and PRODUCT_VERSION are the name of the software in releases.hashicorp.com
|
||||
|
|
@ -24,7 +24,8 @@ LABEL name="Vault" \
|
|||
summary="Vault is a tool for securely accessing secrets." \
|
||||
description="Vault is a tool for securely accessing secrets. A secret is anything that you want to tightly control access to, such as API keys, passwords, certificates, and more. Vault provides a unified interface to any secret, while providing tight access control and recording a detailed audit log."
|
||||
|
||||
COPY LICENSE /licenses/mozilla.txt
|
||||
# Copy the license file as per Legal requirement
|
||||
COPY LICENSE /usr/share/doc/$NAME/LICENSE.txt
|
||||
|
||||
# Set ARGs as ENV so that they can be used in ENTRYPOINT/CMD
|
||||
ENV NAME=$NAME
|
||||
|
|
@ -74,7 +75,7 @@ CMD ["server", "-dev"]
|
|||
|
||||
|
||||
## UBI DOCKERFILE ##
|
||||
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9 as ubi
|
||||
FROM registry.access.redhat.com/ubi8/ubi-minimal as ubi
|
||||
|
||||
ARG BIN_NAME
|
||||
# PRODUCT_VERSION is the version built dist/$TARGETOS/$TARGETARCH/$BIN_NAME,
|
||||
|
|
@ -95,7 +96,8 @@ LABEL name="Vault" \
|
|||
summary="Vault is a tool for securely accessing secrets." \
|
||||
description="Vault is a tool for securely accessing secrets. A secret is anything that you want to tightly control access to, such as API keys, passwords, certificates, and more. Vault provides a unified interface to any secret, while providing tight access control and recording a detailed audit log."
|
||||
|
||||
COPY LICENSE /licenses/mozilla.txt
|
||||
# Copy the license file as per Legal requirement
|
||||
COPY LICENSE /usr/share/doc/$NAME/LICENSE.txt
|
||||
|
||||
# Set ARGs as ENV so that they can be used in ENTRYPOINT/CMD
|
||||
ENV NAME=$NAME
|
||||
|
|
|
|||
6
Makefile
6
Makefile
|
|
@ -22,6 +22,12 @@ ifneq ($(FDB_ENABLED), )
|
|||
BUILD_TAGS+=foundationdb
|
||||
endif
|
||||
|
||||
# Set BUILD_MINIMAL to a non-empty value to build a minimal version of Vault with only core features.
|
||||
BUILD_MINIMAL ?=
|
||||
ifneq ($(strip $(BUILD_MINIMAL)),)
|
||||
BUILD_TAGS+=minimal
|
||||
endif
|
||||
|
||||
default: dev
|
||||
|
||||
# bin generates the releasable binaries for Vault
|
||||
|
|
|
|||
25
README.md
25
README.md
|
|
@ -21,8 +21,7 @@ A modern system requires access to a multitude of secrets: database credentials,
|
|||
|
||||
The key features of Vault are:
|
||||
|
||||
* **Secure Secret Storage**: Arbitrary key/value secrets can be stored
|
||||
in Vault. Vault encrypts these secrets prior to writing them to persistent
|
||||
* **Secure Secret Storage**: Vault can store arbitrary key/value pairs. Vault encrypts data before writing it to persistent
|
||||
storage, so gaining access to the raw storage isn't enough to access
|
||||
your secrets. Vault can write to disk, [Consul](https://www.consul.io),
|
||||
and more.
|
||||
|
|
@ -39,8 +38,8 @@ The key features of Vault are:
|
|||
developers to store encrypted data in a location such as a SQL database without
|
||||
having to design their own encryption methods.
|
||||
|
||||
* **Leasing and Renewal**: All secrets in Vault have a _lease_ associated
|
||||
with them. At the end of the lease, Vault will automatically revoke that
|
||||
* **Leasing and Renewal**: Vault associates a **lease** with each secret.
|
||||
At the end of the lease, Vault automatically revokes the
|
||||
secret. Clients are able to renew leases via built-in renew APIs.
|
||||
|
||||
* **Revocation**: Vault has built-in support for secret revocation. Vault
|
||||
|
|
@ -73,9 +72,12 @@ If you wish to work on Vault itself or any of its built-in systems, you'll
|
|||
first need [Go](https://www.golang.org) installed on your machine.
|
||||
|
||||
For local dev first make sure Go is properly installed, including setting up a
|
||||
[GOPATH](https://golang.org/doc/code.html#GOPATH). Ensure that `$GOPATH/bin` is in
|
||||
your path as some distributions bundle the old version of build tools. Next, clone this
|
||||
repository. Vault uses [Go Modules](https://github.com/golang/go/wiki/Modules),
|
||||
[GOPATH](https://golang.org/doc/code.html#GOPATH), then setting the
|
||||
[GOBIN](https://pkg.go.dev/cmd/go#hdr-Environment_variables) variable to `$GOPATH/bin`.
|
||||
Ensure that `$GOPATH/bin` is in your path as some distributions bundle the old version
|
||||
of build tools.
|
||||
|
||||
Next, clone this repository. Vault uses [Go Modules](https://github.com/golang/go/wiki/Modules),
|
||||
so it is recommended that you clone the repository ***outside*** of the GOPATH.
|
||||
You can then download any required build tools by bootstrapping your environment:
|
||||
|
||||
|
|
@ -121,6 +123,15 @@ $ make test TEST=./vault
|
|||
...
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
If you encounter an error like `could not read Username for 'https://github.com'` you may need to adjust your git config like so:
|
||||
|
||||
```sh
|
||||
$ git config --global --add url."git@github.com:".insteadOf "https://github.com/"
|
||||
```
|
||||
|
||||
|
||||
### Importing Vault
|
||||
|
||||
This repository publishes two libraries that may be imported by other projects:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,28 @@
|
|||
module github.com/hashicorp/vault/api/auth/approle
|
||||
|
||||
go 1.16
|
||||
go 1.21
|
||||
|
||||
require github.com/hashicorp/vault/api v1.12.0
|
||||
toolchain go1.22.2
|
||||
|
||||
require github.com/hashicorp/vault/api v1.14.0
|
||||
|
||||
require (
|
||||
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
|
||||
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
|
||||
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/ryanuber/go-glob v1.0.0 // indirect
|
||||
golang.org/x/crypto v0.23.0 // indirect
|
||||
golang.org/x/net v0.25.0 // indirect
|
||||
golang.org/x/text v0.15.0 // indirect
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect
|
||||
)
|
||||
|
|
|
|||
|
|
@ -5,29 +5,27 @@ github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4r
|
|||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA=
|
||||
github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8=
|
||||
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
|
||||
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
|
||||
github.com/go-jose/go-jose/v4 v4.0.1 h1:QVEPDE3OluqXBQZDcnNvQrInro2h0e4eqNbnZSWqS6U=
|
||||
github.com/go-jose/go-jose/v4 v4.0.1/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY=
|
||||
github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw=
|
||||
github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
|
||||
github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs=
|
||||
github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
|
||||
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6 h1:HJunrbHTDDbBb/ay4kxa1n+dLmttUlnP3V9oNE4hmsM=
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 h1:om4Al8Oy7kCm/B86rLCLah4Dt5Aa0Fr5rYBG60OzwHQ=
|
||||
|
|
@ -39,17 +37,14 @@ github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0S
|
|||
github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hashicorp/vault/api v1.12.0 h1:meCpJSesvzQyao8FCOgk2fGdoADAnbDu2WPJN1lDLJ4=
|
||||
github.com/hashicorp/vault/api v1.12.0/go.mod h1:si+lJCYO7oGkIoNPAN8j3azBLTn9SjMGS+jFaHd1Cck=
|
||||
github.com/hashicorp/vault/api v1.14.0 h1:Ah3CFLixD5jmjusOgm8grfN9M0d+Y8fVR2SW0K6pJLU=
|
||||
github.com/hashicorp/vault/api v1.14.0/go.mod h1:pV9YLxBGSz+cItFDd8Ii4G17waWOQ32zVjMWHe/cOqk=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE=
|
||||
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
|
|
@ -64,73 +59,20 @@ github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFo
|
|||
github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=
|
||||
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
||||
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
|
||||
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
|
||||
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
|
||||
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 h1:NusfzzA6yGQ+ua51ck7E3omNUX/JuqbFSaRGqU8CcLI=
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
|
|
|
|||
|
|
@ -1,11 +1,40 @@
|
|||
module github.com/hashicorp/vault/api/auth/aws
|
||||
|
||||
go 1.16
|
||||
go 1.21
|
||||
|
||||
toolchain go1.22.2
|
||||
|
||||
require (
|
||||
github.com/aws/aws-sdk-go v1.49.22
|
||||
github.com/hashicorp/go-hclog v0.16.2
|
||||
github.com/hashicorp/go-hclog v1.6.3
|
||||
github.com/hashicorp/go-secure-stdlib/awsutil v0.1.6
|
||||
github.com/hashicorp/go-uuid v1.0.2
|
||||
github.com/hashicorp/vault/api v1.12.0
|
||||
github.com/hashicorp/vault/api v1.14.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
|
||||
github.com/fatih/color v1.16.0 // indirect
|
||||
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
|
||||
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/ryanuber/go-glob v1.0.0 // indirect
|
||||
golang.org/x/crypto v0.23.0 // indirect
|
||||
golang.org/x/net v0.25.0 // indirect
|
||||
golang.org/x/sys v0.20.0 // indirect
|
||||
golang.org/x/text v0.15.0 // indirect
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect
|
||||
)
|
||||
|
|
|
|||
|
|
@ -9,30 +9,30 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
|
|||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA=
|
||||
github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8=
|
||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
|
||||
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
|
||||
github.com/go-jose/go-jose/v4 v4.0.1 h1:QVEPDE3OluqXBQZDcnNvQrInro2h0e4eqNbnZSWqS6U=
|
||||
github.com/go-jose/go-jose/v4 v4.0.1/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY=
|
||||
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||
github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw=
|
||||
github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
|
||||
github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs=
|
||||
github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
|
||||
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6 h1:HJunrbHTDDbBb/ay4kxa1n+dLmttUlnP3V9oNE4hmsM=
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
|
||||
github.com/hashicorp/go-secure-stdlib/awsutil v0.1.6 h1:W9WN8p6moV1fjKLkeqEgkAMu5rauy9QeYDAmIaPuuiA=
|
||||
|
|
@ -48,8 +48,8 @@ github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2I
|
|||
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hashicorp/vault/api v1.12.0 h1:meCpJSesvzQyao8FCOgk2fGdoADAnbDu2WPJN1lDLJ4=
|
||||
github.com/hashicorp/vault/api v1.12.0/go.mod h1:si+lJCYO7oGkIoNPAN8j3azBLTn9SjMGS+jFaHd1Cck=
|
||||
github.com/hashicorp/vault/api v1.14.0 h1:Ah3CFLixD5jmjusOgm8grfN9M0d+Y8fVR2SW0K6pJLU=
|
||||
github.com/hashicorp/vault/api v1.14.0/go.mod h1:pV9YLxBGSz+cItFDd8Ii4G17waWOQ32zVjMWHe/cOqk=
|
||||
github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik=
|
||||
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
|
||||
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
|
||||
|
|
@ -62,13 +62,19 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
|||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE=
|
||||
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
|
|
@ -86,76 +92,37 @@ github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFo
|
|||
github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=
|
||||
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
||||
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
|
||||
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
|
||||
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
|
||||
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 h1:NusfzzA6yGQ+ua51ck7E3omNUX/JuqbFSaRGqU8CcLI=
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"time"
|
||||
|
|
@ -175,7 +175,7 @@ func (a *AzureAuth) getJWT() (string, error) {
|
|||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
responseBytes, err := ioutil.ReadAll(resp.Body)
|
||||
responseBytes, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("error reading response body from Azure token endpoint: %w", err)
|
||||
}
|
||||
|
|
@ -222,7 +222,7 @@ func getMetadata() (metadataJSON, error) {
|
|||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
responseBytes, err := ioutil.ReadAll(resp.Body)
|
||||
responseBytes, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return metadataJSON{}, fmt.Errorf("error reading response body from metadata endpoint: %w", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,28 @@
|
|||
module github.com/hashicorp/vault/api/auth/azure
|
||||
|
||||
go 1.16
|
||||
go 1.21
|
||||
|
||||
require github.com/hashicorp/vault/api v1.12.0
|
||||
toolchain go1.22.2
|
||||
|
||||
require github.com/hashicorp/vault/api v1.14.0
|
||||
|
||||
require (
|
||||
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
|
||||
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
|
||||
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/ryanuber/go-glob v1.0.0 // indirect
|
||||
golang.org/x/crypto v0.23.0 // indirect
|
||||
golang.org/x/net v0.25.0 // indirect
|
||||
golang.org/x/text v0.15.0 // indirect
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect
|
||||
)
|
||||
|
|
|
|||
|
|
@ -5,29 +5,27 @@ github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4r
|
|||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA=
|
||||
github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8=
|
||||
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
|
||||
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
|
||||
github.com/go-jose/go-jose/v4 v4.0.1 h1:QVEPDE3OluqXBQZDcnNvQrInro2h0e4eqNbnZSWqS6U=
|
||||
github.com/go-jose/go-jose/v4 v4.0.1/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY=
|
||||
github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw=
|
||||
github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
|
||||
github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs=
|
||||
github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
|
||||
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6 h1:HJunrbHTDDbBb/ay4kxa1n+dLmttUlnP3V9oNE4hmsM=
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 h1:om4Al8Oy7kCm/B86rLCLah4Dt5Aa0Fr5rYBG60OzwHQ=
|
||||
|
|
@ -39,17 +37,14 @@ github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0S
|
|||
github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hashicorp/vault/api v1.12.0 h1:meCpJSesvzQyao8FCOgk2fGdoADAnbDu2WPJN1lDLJ4=
|
||||
github.com/hashicorp/vault/api v1.12.0/go.mod h1:si+lJCYO7oGkIoNPAN8j3azBLTn9SjMGS+jFaHd1Cck=
|
||||
github.com/hashicorp/vault/api v1.14.0 h1:Ah3CFLixD5jmjusOgm8grfN9M0d+Y8fVR2SW0K6pJLU=
|
||||
github.com/hashicorp/vault/api v1.14.0/go.mod h1:pV9YLxBGSz+cItFDd8Ii4G17waWOQ32zVjMWHe/cOqk=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE=
|
||||
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
|
|
@ -64,73 +59,20 @@ github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFo
|
|||
github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=
|
||||
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
||||
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
|
||||
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
|
||||
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
|
||||
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 h1:NusfzzA6yGQ+ua51ck7E3omNUX/JuqbFSaRGqU8CcLI=
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"time"
|
||||
|
|
@ -181,7 +181,7 @@ func (a *GCPAuth) getJWTFromMetadataService(vaultAddress string) (string, error)
|
|||
defer resp.Body.Close()
|
||||
|
||||
// get jwt from response
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
jwt := string(body)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("error reading response from metadata service: %w", err)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,57 @@
|
|||
module github.com/hashicorp/vault/api/auth/gcp
|
||||
|
||||
go 1.16
|
||||
go 1.21
|
||||
|
||||
toolchain go1.22.2
|
||||
|
||||
require (
|
||||
cloud.google.com/go/compute/metadata v0.2.3
|
||||
cloud.google.com/go/iam v0.13.0
|
||||
github.com/hashicorp/vault/api v1.12.0
|
||||
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
|
||||
google.golang.org/grpc v1.56.3 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.3.0
|
||||
cloud.google.com/go/iam v1.1.8
|
||||
github.com/hashicorp/vault/api v1.14.0
|
||||
google.golang.org/genproto v0.0.0-20240604185151-ef581f913117
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go/auth v0.3.0 // indirect
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect
|
||||
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
|
||||
github.com/go-logr/logr v1.4.1 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/google/s2a-go v0.1.7 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.12.3 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
|
||||
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/ryanuber/go-glob v1.0.0 // indirect
|
||||
go.opencensus.io v0.24.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
|
||||
go.opentelemetry.io/otel v1.24.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.24.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.24.0 // indirect
|
||||
golang.org/x/crypto v0.23.0 // indirect
|
||||
golang.org/x/net v0.25.0 // indirect
|
||||
golang.org/x/oauth2 v0.19.0 // indirect
|
||||
golang.org/x/sync v0.7.0 // indirect
|
||||
golang.org/x/sys v0.20.0 // indirect
|
||||
golang.org/x/text v0.15.0 // indirect
|
||||
golang.org/x/time v0.5.0 // indirect
|
||||
google.golang.org/api v0.177.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
|
||||
google.golang.org/grpc v1.64.0 // indirect
|
||||
google.golang.org/protobuf v1.34.1 // indirect
|
||||
)
|
||||
|
|
|
|||
1558
api/auth/gcp/go.sum
1558
api/auth/gcp/go.sum
File diff suppressed because it is too large
Load diff
|
|
@ -1,5 +1,28 @@
|
|||
module github.com/hashicorp/vault/api/auth/kubernetes
|
||||
|
||||
go 1.16
|
||||
go 1.21
|
||||
|
||||
require github.com/hashicorp/vault/api v1.12.0
|
||||
toolchain go1.22.2
|
||||
|
||||
require github.com/hashicorp/vault/api v1.14.0
|
||||
|
||||
require (
|
||||
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
|
||||
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
|
||||
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/ryanuber/go-glob v1.0.0 // indirect
|
||||
golang.org/x/crypto v0.23.0 // indirect
|
||||
golang.org/x/net v0.25.0 // indirect
|
||||
golang.org/x/text v0.15.0 // indirect
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect
|
||||
)
|
||||
|
|
|
|||
|
|
@ -5,29 +5,27 @@ github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4r
|
|||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA=
|
||||
github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8=
|
||||
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
|
||||
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
|
||||
github.com/go-jose/go-jose/v4 v4.0.1 h1:QVEPDE3OluqXBQZDcnNvQrInro2h0e4eqNbnZSWqS6U=
|
||||
github.com/go-jose/go-jose/v4 v4.0.1/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY=
|
||||
github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw=
|
||||
github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
|
||||
github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs=
|
||||
github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
|
||||
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6 h1:HJunrbHTDDbBb/ay4kxa1n+dLmttUlnP3V9oNE4hmsM=
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 h1:om4Al8Oy7kCm/B86rLCLah4Dt5Aa0Fr5rYBG60OzwHQ=
|
||||
|
|
@ -39,17 +37,14 @@ github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0S
|
|||
github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hashicorp/vault/api v1.12.0 h1:meCpJSesvzQyao8FCOgk2fGdoADAnbDu2WPJN1lDLJ4=
|
||||
github.com/hashicorp/vault/api v1.12.0/go.mod h1:si+lJCYO7oGkIoNPAN8j3azBLTn9SjMGS+jFaHd1Cck=
|
||||
github.com/hashicorp/vault/api v1.14.0 h1:Ah3CFLixD5jmjusOgm8grfN9M0d+Y8fVR2SW0K6pJLU=
|
||||
github.com/hashicorp/vault/api v1.14.0/go.mod h1:pV9YLxBGSz+cItFDd8Ii4G17waWOQ32zVjMWHe/cOqk=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE=
|
||||
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
|
|
@ -64,73 +59,20 @@ github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFo
|
|||
github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=
|
||||
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
||||
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
|
||||
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
|
||||
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
|
||||
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 h1:NusfzzA6yGQ+ua51ck7E3omNUX/JuqbFSaRGqU8CcLI=
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
|
|
|
|||
|
|
@ -1,5 +1,28 @@
|
|||
module github.com/hashicorp/vault/api/auth/ldap
|
||||
|
||||
go 1.16
|
||||
go 1.21
|
||||
|
||||
require github.com/hashicorp/vault/api v1.12.0
|
||||
toolchain go1.22.2
|
||||
|
||||
require github.com/hashicorp/vault/api v1.14.0
|
||||
|
||||
require (
|
||||
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
|
||||
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
|
||||
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/ryanuber/go-glob v1.0.0 // indirect
|
||||
golang.org/x/crypto v0.23.0 // indirect
|
||||
golang.org/x/net v0.25.0 // indirect
|
||||
golang.org/x/text v0.15.0 // indirect
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect
|
||||
)
|
||||
|
|
|
|||
|
|
@ -5,29 +5,27 @@ github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4r
|
|||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA=
|
||||
github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8=
|
||||
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
|
||||
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
|
||||
github.com/go-jose/go-jose/v4 v4.0.1 h1:QVEPDE3OluqXBQZDcnNvQrInro2h0e4eqNbnZSWqS6U=
|
||||
github.com/go-jose/go-jose/v4 v4.0.1/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY=
|
||||
github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw=
|
||||
github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
|
||||
github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs=
|
||||
github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
|
||||
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6 h1:HJunrbHTDDbBb/ay4kxa1n+dLmttUlnP3V9oNE4hmsM=
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 h1:om4Al8Oy7kCm/B86rLCLah4Dt5Aa0Fr5rYBG60OzwHQ=
|
||||
|
|
@ -39,17 +37,14 @@ github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0S
|
|||
github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hashicorp/vault/api v1.12.0 h1:meCpJSesvzQyao8FCOgk2fGdoADAnbDu2WPJN1lDLJ4=
|
||||
github.com/hashicorp/vault/api v1.12.0/go.mod h1:si+lJCYO7oGkIoNPAN8j3azBLTn9SjMGS+jFaHd1Cck=
|
||||
github.com/hashicorp/vault/api v1.14.0 h1:Ah3CFLixD5jmjusOgm8grfN9M0d+Y8fVR2SW0K6pJLU=
|
||||
github.com/hashicorp/vault/api v1.14.0/go.mod h1:pV9YLxBGSz+cItFDd8Ii4G17waWOQ32zVjMWHe/cOqk=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE=
|
||||
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
|
|
@ -64,73 +59,20 @@ github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFo
|
|||
github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=
|
||||
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
||||
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
|
||||
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
|
||||
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
|
||||
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 h1:NusfzzA6yGQ+ua51ck7E3omNUX/JuqbFSaRGqU8CcLI=
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
|
|
|
|||
|
|
@ -1,5 +1,28 @@
|
|||
module github.com/hashicorp/vault/api/auth/userpass
|
||||
|
||||
go 1.16
|
||||
go 1.21
|
||||
|
||||
require github.com/hashicorp/vault/api v1.12.0
|
||||
toolchain go1.22.2
|
||||
|
||||
require github.com/hashicorp/vault/api v1.14.0
|
||||
|
||||
require (
|
||||
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
|
||||
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
|
||||
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/ryanuber/go-glob v1.0.0 // indirect
|
||||
golang.org/x/crypto v0.23.0 // indirect
|
||||
golang.org/x/net v0.25.0 // indirect
|
||||
golang.org/x/text v0.15.0 // indirect
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect
|
||||
)
|
||||
|
|
|
|||
|
|
@ -5,29 +5,27 @@ github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4r
|
|||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA=
|
||||
github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8=
|
||||
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
|
||||
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
|
||||
github.com/go-jose/go-jose/v4 v4.0.1 h1:QVEPDE3OluqXBQZDcnNvQrInro2h0e4eqNbnZSWqS6U=
|
||||
github.com/go-jose/go-jose/v4 v4.0.1/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY=
|
||||
github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw=
|
||||
github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
|
||||
github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs=
|
||||
github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
|
||||
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6 h1:HJunrbHTDDbBb/ay4kxa1n+dLmttUlnP3V9oNE4hmsM=
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 h1:om4Al8Oy7kCm/B86rLCLah4Dt5Aa0Fr5rYBG60OzwHQ=
|
||||
|
|
@ -39,17 +37,14 @@ github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0S
|
|||
github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hashicorp/vault/api v1.12.0 h1:meCpJSesvzQyao8FCOgk2fGdoADAnbDu2WPJN1lDLJ4=
|
||||
github.com/hashicorp/vault/api v1.12.0/go.mod h1:si+lJCYO7oGkIoNPAN8j3azBLTn9SjMGS+jFaHd1Cck=
|
||||
github.com/hashicorp/vault/api v1.14.0 h1:Ah3CFLixD5jmjusOgm8grfN9M0d+Y8fVR2SW0K6pJLU=
|
||||
github.com/hashicorp/vault/api v1.14.0/go.mod h1:pV9YLxBGSz+cItFDd8Ii4G17waWOQ32zVjMWHe/cOqk=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE=
|
||||
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
|
|
@ -64,73 +59,20 @@ github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFo
|
|||
github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=
|
||||
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
||||
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
|
||||
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
|
||||
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
|
||||
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 h1:NusfzzA6yGQ+ua51ck7E3omNUX/JuqbFSaRGqU8CcLI=
|
||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import (
|
|||
"crypto/tls"
|
||||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
|
|
@ -41,6 +42,7 @@ const (
|
|||
EnvVaultClientCert = "VAULT_CLIENT_CERT"
|
||||
EnvVaultClientKey = "VAULT_CLIENT_KEY"
|
||||
EnvVaultClientTimeout = "VAULT_CLIENT_TIMEOUT"
|
||||
EnvVaultHeaders = "VAULT_HEADERS"
|
||||
EnvVaultSRVLookup = "VAULT_SRV_LOOKUP"
|
||||
EnvVaultSkipVerify = "VAULT_SKIP_VERIFY"
|
||||
EnvVaultNamespace = "VAULT_NAMESPACE"
|
||||
|
|
@ -665,6 +667,30 @@ func NewClient(c *Config) (*Client, error) {
|
|||
client.setNamespace(namespace)
|
||||
}
|
||||
|
||||
if envHeaders := os.Getenv(EnvVaultHeaders); envHeaders != "" {
|
||||
var result map[string]any
|
||||
err := json.Unmarshal([]byte(envHeaders), &result)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not unmarshal environment-supplied headers")
|
||||
}
|
||||
var forbiddenHeaders []string
|
||||
for key, value := range result {
|
||||
if strings.HasPrefix(key, "X-Vault-") {
|
||||
forbiddenHeaders = append(forbiddenHeaders, key)
|
||||
continue
|
||||
}
|
||||
|
||||
value, ok := value.(string)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("environment-supplied headers include non-string values")
|
||||
}
|
||||
client.AddHeader(key, value)
|
||||
}
|
||||
if len(forbiddenHeaders) > 0 {
|
||||
return nil, fmt.Errorf("failed to setup Headers[%s]: Header starting by 'X-Vault-' are for internal usage only", strings.Join(forbiddenHeaders, ", "))
|
||||
}
|
||||
}
|
||||
|
||||
return client, nil
|
||||
}
|
||||
|
||||
|
|
@ -705,7 +731,7 @@ func (c *Client) SetAddress(addr string) error {
|
|||
|
||||
parsedAddr, err := c.config.ParseAddress(addr)
|
||||
if err != nil {
|
||||
return errwrap.Wrapf("failed to set address: {{err}}", err)
|
||||
return fmt.Errorf("failed to set address: %w", err)
|
||||
}
|
||||
|
||||
c.addr = parsedAddr
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import (
|
|||
"bytes"
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"io"
|
||||
|
|
@ -330,7 +329,7 @@ func TestDefaulRetryPolicy(t *testing.T) {
|
|||
},
|
||||
"don't retry connection failures": {
|
||||
err: &url.Error{
|
||||
Err: x509.UnknownAuthorityError{},
|
||||
Err: &tls.CertificateVerificationError{},
|
||||
},
|
||||
},
|
||||
"don't retry on 200": {
|
||||
|
|
@ -375,6 +374,61 @@ func TestDefaulRetryPolicy(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestClientEnvHeaders(t *testing.T) {
|
||||
oldHeaders := os.Getenv(EnvVaultHeaders)
|
||||
|
||||
defer func() {
|
||||
os.Setenv(EnvVaultHeaders, oldHeaders)
|
||||
}()
|
||||
|
||||
cases := []struct {
|
||||
Input string
|
||||
Valid bool
|
||||
}{
|
||||
{
|
||||
"{}",
|
||||
true,
|
||||
},
|
||||
{
|
||||
"{\"foo\": \"bar\"}",
|
||||
true,
|
||||
},
|
||||
{
|
||||
"{\"foo\": 1}", // Values must be strings
|
||||
false,
|
||||
},
|
||||
{
|
||||
"{\"X-Vault-Foo\": \"bar\"}", // X-Vault-* not allowed
|
||||
false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
os.Setenv(EnvVaultHeaders, tc.Input)
|
||||
config := DefaultConfig()
|
||||
config.ReadEnvironment()
|
||||
_, err := NewClient(config)
|
||||
if err != nil {
|
||||
if tc.Valid {
|
||||
t.Fatalf("unexpected error reading headers from environment: %v", err)
|
||||
}
|
||||
} else {
|
||||
if !tc.Valid {
|
||||
t.Fatal("no error reading headers from environment when error was expected")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
os.Setenv(EnvVaultHeaders, "{\"foo\": \"bar\"}")
|
||||
config := DefaultConfig()
|
||||
config.ReadEnvironment()
|
||||
cli, _ := NewClient(config)
|
||||
|
||||
if !reflect.DeepEqual(cli.Headers().Values("foo"), []string{"bar"}) {
|
||||
t.Error("Environment-supplied headers not set in CLI client")
|
||||
}
|
||||
}
|
||||
|
||||
func TestClientEnvSettings(t *testing.T) {
|
||||
cwd, _ := os.Getwd()
|
||||
|
||||
|
|
|
|||
|
|
@ -10,14 +10,14 @@ go 1.21
|
|||
toolchain go1.21.8
|
||||
|
||||
require (
|
||||
github.com/cenkalti/backoff/v3 v3.0.0
|
||||
github.com/cenkalti/backoff/v4 v4.3.0
|
||||
github.com/go-jose/go-jose/v4 v4.0.1
|
||||
github.com/go-test/deep v1.0.2
|
||||
github.com/hashicorp/errwrap v1.1.0
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2
|
||||
github.com/hashicorp/go-hclog v0.16.2
|
||||
github.com/hashicorp/go-hclog v1.6.3
|
||||
github.com/hashicorp/go-multierror v1.1.1
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7
|
||||
github.com/hashicorp/go-rootcerts v1.0.2
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2
|
||||
|
|
|
|||
31
api/go.sum
31
api/go.sum
|
|
@ -1,11 +1,12 @@
|
|||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/cenkalti/backoff/v3 v3.0.0 h1:ske+9nBpD9qZsTBoF41nW5L+AIuFBKMeze18XQ3eG1c=
|
||||
github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs=
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
|
||||
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
|
||||
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
|
||||
github.com/go-jose/go-jose/v4 v4.0.1 h1:QVEPDE3OluqXBQZDcnNvQrInro2h0e4eqNbnZSWqS6U=
|
||||
|
|
@ -17,17 +18,15 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
|
|||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
|
||||
github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs=
|
||||
github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
|
||||
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6 h1:HJunrbHTDDbBb/ay4kxa1n+dLmttUlnP3V9oNE4hmsM=
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 h1:om4Al8Oy7kCm/B86rLCLah4Dt5Aa0Fr5rYBG60OzwHQ=
|
||||
|
|
@ -40,12 +39,13 @@ github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjG
|
|||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
|
|
@ -65,8 +65,8 @@ github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFo
|
|||
github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=
|
||||
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
|
||||
|
|
@ -74,8 +74,11 @@ golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v
|
|||
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/cenkalti/backoff/v3"
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import (
|
|||
"bytes"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
|
|
@ -77,13 +76,13 @@ func (r *Request) ToHTTP() (*http.Request, error) {
|
|||
// No body
|
||||
|
||||
case r.BodyBytes != nil:
|
||||
req.Request.Body = ioutil.NopCloser(bytes.NewReader(r.BodyBytes))
|
||||
req.Request.Body = io.NopCloser(bytes.NewReader(r.BodyBytes))
|
||||
|
||||
default:
|
||||
if c, ok := r.Body.(io.ReadCloser); ok {
|
||||
req.Request.Body = c
|
||||
} else {
|
||||
req.Request.Body = ioutil.NopCloser(r.Body)
|
||||
req.Request.Body = io.NopCloser(r.Body)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
|
|
@ -44,7 +43,7 @@ func (r *Response) Error() error {
|
|||
}
|
||||
|
||||
r.Body.Close()
|
||||
r.Body = ioutil.NopCloser(bodyBuf)
|
||||
r.Body = io.NopCloser(bodyBuf)
|
||||
ns := r.Header.Get(NamespaceHeaderName)
|
||||
|
||||
// Build up the error object
|
||||
|
|
|
|||
|
|
@ -159,6 +159,10 @@ TOKEN_DONE:
|
|||
goto DONE
|
||||
}
|
||||
|
||||
if s.Data["identity_policies"] == nil {
|
||||
goto DONE
|
||||
}
|
||||
|
||||
sList, ok := s.Data["identity_policies"].([]string)
|
||||
if ok {
|
||||
identityPolicies = sList
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ var sudoPaths = map[string]*regexp.Regexp{
|
|||
"/sys/config/ui/headers": regexp.MustCompile(`^/sys/config/ui/headers/?$`),
|
||||
"/sys/config/ui/headers/{header}": regexp.MustCompile(`^/sys/config/ui/headers/.+$`),
|
||||
"/sys/internal/inspect/router/{tag}": regexp.MustCompile(`^/sys/internal/inspect/router/.+$`),
|
||||
"/sys/internal/counters/activity/export": regexp.MustCompile(`^/sys/internal/counters/activity/export$`),
|
||||
"/sys/leases": regexp.MustCompile(`^/sys/leases$`),
|
||||
// This entry is a bit wrong... sys/leases/lookup does NOT require sudo. But sys/leases/lookup/ with a trailing
|
||||
// slash DOES require sudo. But the part of the Vault CLI that uses this logic doesn't pass operation-appropriate
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ func (c *Sys) RaftSnapshotWithContext(ctx context.Context, snapWriter io.Writer)
|
|||
continue
|
||||
}
|
||||
var b []byte
|
||||
b, err = ioutil.ReadAll(t)
|
||||
b, err = io.ReadAll(t)
|
||||
if err != nil || len(b) == 0 {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import (
|
|||
|
||||
const (
|
||||
optionElideListResponses = "elide_list_responses"
|
||||
optionExclude = "exclude"
|
||||
optionFallback = "fallback"
|
||||
optionFilter = "filter"
|
||||
optionFormat = "format"
|
||||
|
|
@ -253,6 +254,7 @@ func HasInvalidOptions(options map[string]string) bool {
|
|||
// are only for use in the Enterprise version of Vault.
|
||||
func hasEnterpriseAuditOptions(options map[string]string) bool {
|
||||
enterpriseAuditOptions := []string{
|
||||
optionExclude,
|
||||
optionFallback,
|
||||
optionFilter,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ const (
|
|||
optionMode = "mode"
|
||||
)
|
||||
|
||||
var _ Backend = (*FileBackend)(nil)
|
||||
var _ Backend = (*fileBackend)(nil)
|
||||
|
||||
type FileBackend struct {
|
||||
type fileBackend struct {
|
||||
*backend
|
||||
}
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ func NewFileBackend(conf *BackendConfig, headersConfig HeaderFormatter) (be Back
|
|||
}
|
||||
|
||||
// newFileBackend creates a backend and configures all nodes including a file sink.
|
||||
func newFileBackend(conf *BackendConfig, headersConfig HeaderFormatter) (*FileBackend, error) {
|
||||
func newFileBackend(conf *BackendConfig, headersConfig HeaderFormatter) (*fileBackend, error) {
|
||||
if headersConfig == nil || reflect.ValueOf(headersConfig).IsNil() {
|
||||
return nil, fmt.Errorf("nil header formatter: %w", ErrInvalidParameter)
|
||||
}
|
||||
|
|
@ -60,7 +60,7 @@ func newFileBackend(conf *BackendConfig, headersConfig HeaderFormatter) (*FileBa
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b := &FileBackend{backend: bec}
|
||||
b := &fileBackend{backend: bec}
|
||||
|
||||
// normalize file path if configured for stdout
|
||||
if strings.EqualFold(filePath, stdout) {
|
||||
|
|
@ -76,12 +76,12 @@ func newFileBackend(conf *BackendConfig, headersConfig HeaderFormatter) (*FileBa
|
|||
return nil, err
|
||||
}
|
||||
|
||||
var opt []event.Option
|
||||
sinkOpts := []event.Option{event.WithLogger(conf.Logger)}
|
||||
if mode, ok := conf.Config[optionMode]; ok {
|
||||
opt = append(opt, event.WithFileMode(mode))
|
||||
sinkOpts = append(sinkOpts, event.WithFileMode(mode))
|
||||
}
|
||||
|
||||
err = b.configureSinkNode(conf.MountPath, filePath, cfg.requiredFormat, opt...)
|
||||
err = b.configureSinkNode(conf.MountPath, filePath, cfg.requiredFormat, sinkOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -89,9 +89,9 @@ func newFileBackend(conf *BackendConfig, headersConfig HeaderFormatter) (*FileBa
|
|||
return b, nil
|
||||
}
|
||||
|
||||
// configureSinkNode is used internally by FileBackend to create and configure the
|
||||
// configureSinkNode is used internally by fileBackend to create and configure the
|
||||
// sink node on the backend.
|
||||
func (b *FileBackend) configureSinkNode(name string, filePath string, format format, opt ...event.Option) error {
|
||||
func (b *fileBackend) configureSinkNode(name string, filePath string, format format, opt ...event.Option) error {
|
||||
name = strings.TrimSpace(name)
|
||||
if name == "" {
|
||||
return fmt.Errorf("name is required: %w", ErrExternalOptions)
|
||||
|
|
@ -143,7 +143,7 @@ func (b *FileBackend) configureSinkNode(name string, filePath string, format for
|
|||
}
|
||||
|
||||
// Reload will trigger the reload action on the sink node for this backend.
|
||||
func (b *FileBackend) Reload() error {
|
||||
func (b *fileBackend) Reload() error {
|
||||
for _, n := range b.nodeMap {
|
||||
if n.Type() == eventlogger.NodeTypeSink {
|
||||
return n.Reopen()
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import (
|
|||
)
|
||||
|
||||
// TestFileBackend_newFileBackend_fallback ensures that we get the correct errors
|
||||
// in CE when we try to enable a FileBackend with enterprise options like fallback
|
||||
// in CE when we try to enable a fileBackend with enterprise options like fallback
|
||||
// and filter.
|
||||
func TestFileBackend_newFileBackend_fallback(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
|
@ -62,7 +62,7 @@ func TestFileBackend_newFileBackend_fallback(t *testing.T) {
|
|||
name := name
|
||||
tc := tc
|
||||
t.Run(name, func(t *testing.T) {
|
||||
be, err := newFileBackend(tc.backendConfig, &NoopHeaderFormatter{})
|
||||
be, err := newFileBackend(tc.backendConfig, &noopHeaderFormatter{})
|
||||
|
||||
if tc.isErrorExpected {
|
||||
require.Error(t, err)
|
||||
|
|
@ -97,13 +97,13 @@ func TestFileBackend_newFileBackend_FilterFormatterSink(t *testing.T) {
|
|||
Logger: hclog.NewNullLogger(),
|
||||
}
|
||||
|
||||
b, err := newFileBackend(backendConfig, &NoopHeaderFormatter{})
|
||||
b, err := newFileBackend(backendConfig, &noopHeaderFormatter{})
|
||||
require.Error(t, err)
|
||||
require.EqualError(t, err, "enterprise-only options supplied: invalid configuration")
|
||||
|
||||
// Try without filter option
|
||||
delete(cfg, "filter")
|
||||
b, err = newFileBackend(backendConfig, &NoopHeaderFormatter{})
|
||||
b, err = newFileBackend(backendConfig, &noopHeaderFormatter{})
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Len(t, b.nodeIDList, 2)
|
||||
|
|
@ -133,14 +133,14 @@ func TestBackend_IsFallback(t *testing.T) {
|
|||
},
|
||||
}
|
||||
|
||||
be, err := newFileBackend(cfg, &NoopHeaderFormatter{})
|
||||
be, err := newFileBackend(cfg, &noopHeaderFormatter{})
|
||||
require.Error(t, err)
|
||||
require.EqualError(t, err, "enterprise-only options supplied: invalid configuration")
|
||||
|
||||
// Remove the option and try again
|
||||
delete(cfg.Config, "fallback")
|
||||
|
||||
be, err = newFileBackend(cfg, &NoopHeaderFormatter{})
|
||||
be, err = newFileBackend(cfg, &noopHeaderFormatter{})
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, be)
|
||||
require.Equal(t, false, be.IsFallback())
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ func TestAuditFile_fileModeNew(t *testing.T) {
|
|||
SaltView: &logical.InmemStorage{},
|
||||
Logger: hclog.NewNullLogger(),
|
||||
}
|
||||
_, err = newFileBackend(backendConfig, &NoopHeaderFormatter{})
|
||||
_, err = newFileBackend(backendConfig, &noopHeaderFormatter{})
|
||||
require.NoError(t, err)
|
||||
|
||||
info, err := os.Stat(file)
|
||||
|
|
@ -71,7 +71,7 @@ func TestAuditFile_fileModeExisting(t *testing.T) {
|
|||
Logger: hclog.NewNullLogger(),
|
||||
}
|
||||
|
||||
_, err = newFileBackend(backendConfig, &NoopHeaderFormatter{})
|
||||
_, err = newFileBackend(backendConfig, &noopHeaderFormatter{})
|
||||
require.NoError(t, err)
|
||||
|
||||
info, err := os.Stat(f.Name())
|
||||
|
|
@ -105,7 +105,7 @@ func TestAuditFile_fileMode0000(t *testing.T) {
|
|||
Logger: hclog.NewNullLogger(),
|
||||
}
|
||||
|
||||
_, err = newFileBackend(backendConfig, &NoopHeaderFormatter{})
|
||||
_, err = newFileBackend(backendConfig, &noopHeaderFormatter{})
|
||||
require.NoError(t, err)
|
||||
|
||||
info, err := os.Stat(f.Name())
|
||||
|
|
@ -134,7 +134,7 @@ func TestAuditFile_EventLogger_fileModeNew(t *testing.T) {
|
|||
Logger: hclog.NewNullLogger(),
|
||||
}
|
||||
|
||||
_, err = newFileBackend(backendConfig, &NoopHeaderFormatter{})
|
||||
_, err = newFileBackend(backendConfig, &noopHeaderFormatter{})
|
||||
require.NoError(t, err)
|
||||
|
||||
info, err := os.Stat(file)
|
||||
|
|
@ -267,7 +267,7 @@ func TestFileBackend_newFileBackend(t *testing.T) {
|
|||
},
|
||||
MountPath: tc.mountPath,
|
||||
}
|
||||
b, err := newFileBackend(cfg, &NoopHeaderFormatter{})
|
||||
b, err := newFileBackend(cfg, &noopHeaderFormatter{})
|
||||
|
||||
if tc.wantErr {
|
||||
require.Error(t, err)
|
||||
|
|
|
|||
|
|
@ -35,14 +35,17 @@ type noopWrapper struct {
|
|||
backend *NoopAudit
|
||||
}
|
||||
|
||||
// NoopAuditEventListener is a callback used by noopWrapper.Process() to notify
|
||||
// of each received audit event.
|
||||
type NoopAuditEventListener func(*AuditEvent)
|
||||
|
||||
func (n *NoopAudit) SetListener(listener NoopAuditEventListener) {
|
||||
// SetListener provides a callback func to the NoopAudit which can be invoked
|
||||
// during processing of the Event.
|
||||
//
|
||||
// Deprecated: SetListener should not be used in new tests.
|
||||
func (n *NoopAudit) SetListener(listener func(event *Event)) {
|
||||
n.listener = listener
|
||||
}
|
||||
|
||||
// NoopAudit only exists to allow legacy tests to continue working.
|
||||
//
|
||||
// Deprecated: NoopAudit should not be used in new tests.
|
||||
type NoopAudit struct {
|
||||
Config *BackendConfig
|
||||
|
||||
|
|
@ -68,16 +71,16 @@ type NoopAudit struct {
|
|||
nodeIDList []eventlogger.NodeID
|
||||
nodeMap map[eventlogger.NodeID]eventlogger.Node
|
||||
|
||||
listener NoopAuditEventListener
|
||||
listener func(event *Event)
|
||||
}
|
||||
|
||||
// NoopHeaderFormatter can be used within no-op audit devices to do nothing when
|
||||
// noopHeaderFormatter can be used within no-op audit devices to do nothing when
|
||||
// it comes to only allow configured headers to appear in the result.
|
||||
// Whatever is passed in will be returned (nil becomes an empty map) in lowercase.
|
||||
type NoopHeaderFormatter struct{}
|
||||
type noopHeaderFormatter struct{}
|
||||
|
||||
// ApplyConfig implements the relevant interface to make NoopHeaderFormatter an HeaderFormatter.
|
||||
func (f *NoopHeaderFormatter) ApplyConfig(_ context.Context, headers map[string][]string, _ Salter) (result map[string][]string, retErr error) {
|
||||
// ApplyConfig implements the relevant interface to make noopHeaderFormatter an HeaderFormatter.
|
||||
func (f *noopHeaderFormatter) ApplyConfig(_ context.Context, headers map[string][]string, _ Salter) (result map[string][]string, retErr error) {
|
||||
if len(headers) < 1 {
|
||||
return map[string][]string{}, nil
|
||||
}
|
||||
|
|
@ -95,6 +98,8 @@ func (f *NoopHeaderFormatter) ApplyConfig(_ context.Context, headers map[string]
|
|||
// NewNoopAudit should be used to create a NoopAudit as it handles creation of a
|
||||
// predictable salt and wraps eventlogger nodes so information can be retrieved on
|
||||
// what they've seen or formatted.
|
||||
//
|
||||
// Deprecated: NewNoopAudit only exists to allow legacy tests to continue working.
|
||||
func NewNoopAudit(config *BackendConfig) (*NoopAudit, error) {
|
||||
view := &logical.InmemStorage{}
|
||||
|
||||
|
|
@ -122,7 +127,7 @@ func NewNoopAudit(config *BackendConfig) (*NoopAudit, error) {
|
|||
nodeMap: make(map[eventlogger.NodeID]eventlogger.Node, 2),
|
||||
}
|
||||
|
||||
cfg, err := newFormatterConfig(&NoopHeaderFormatter{}, nil)
|
||||
cfg, err := newFormatterConfig(&noopHeaderFormatter{}, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -158,6 +163,8 @@ func NewNoopAudit(config *BackendConfig) (*NoopAudit, error) {
|
|||
// NoopAuditFactory should be used when the test needs a way to access bytes that
|
||||
// have been formatted by the pipeline during audit requests.
|
||||
// The records parameter will be repointed to the one used within the pipeline.
|
||||
//
|
||||
// Deprecated: NoopAuditFactory only exists to allow legacy tests to continue working.
|
||||
func NoopAuditFactory(records **[][]byte) Factory {
|
||||
return func(config *BackendConfig, _ HeaderFormatter) (Backend, error) {
|
||||
n, err := NewNoopAudit(config)
|
||||
|
|
@ -184,7 +191,7 @@ func (n *noopWrapper) Process(ctx context.Context, e *eventlogger.Event) (*event
|
|||
var err error
|
||||
|
||||
// We're expecting audit events since this is an audit device.
|
||||
a, ok := e.Payload.(*AuditEvent)
|
||||
a, ok := e.Payload.(*Event)
|
||||
if !ok {
|
||||
return nil, errors.New("cannot parse payload as an audit event")
|
||||
}
|
||||
|
|
@ -244,7 +251,7 @@ func (n *noopWrapper) Process(ctx context.Context, e *eventlogger.Event) (*event
|
|||
// formatted headers that would have made it to the logs via the sink node.
|
||||
// They only appear in requests.
|
||||
if a.Subtype == RequestType {
|
||||
reqEntry := &RequestEntry{}
|
||||
reqEntry := &entry{}
|
||||
err = json.Unmarshal(b, &reqEntry)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to parse formatted audit entry data: %w", err)
|
||||
|
|
@ -336,6 +343,7 @@ func (n *NoopAudit) IsFallback() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
// Deprecated: TestNoopAudit only exists to allow legacy tests to continue working.
|
||||
func TestNoopAudit(t *testing.T, path string, config map[string]string) *NoopAudit {
|
||||
cfg := &BackendConfig{
|
||||
Config: config,
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ const (
|
|||
optionWriteTimeout = "write_timeout"
|
||||
)
|
||||
|
||||
var _ Backend = (*SocketBackend)(nil)
|
||||
var _ Backend = (*socketBackend)(nil)
|
||||
|
||||
type SocketBackend struct {
|
||||
type socketBackend struct {
|
||||
*backend
|
||||
}
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ func NewSocketBackend(conf *BackendConfig, headersConfig HeaderFormatter) (be Ba
|
|||
}
|
||||
|
||||
// newSocketBackend creates a backend and configures all nodes including a socket sink.
|
||||
func newSocketBackend(conf *BackendConfig, headersConfig HeaderFormatter) (*SocketBackend, error) {
|
||||
func newSocketBackend(conf *BackendConfig, headersConfig HeaderFormatter) (*socketBackend, error) {
|
||||
if headersConfig == nil || reflect.ValueOf(headersConfig).IsNil() {
|
||||
return nil, fmt.Errorf("nil header formatter: %w", ErrInvalidParameter)
|
||||
}
|
||||
|
|
@ -70,6 +70,7 @@ func newSocketBackend(conf *BackendConfig, headersConfig HeaderFormatter) (*Sock
|
|||
sinkOpts := []event.Option{
|
||||
event.WithSocketType(socketType),
|
||||
event.WithMaxDuration(writeDeadline),
|
||||
event.WithLogger(conf.Logger),
|
||||
}
|
||||
|
||||
err = event.ValidateOptions(sinkOpts...)
|
||||
|
|
@ -77,7 +78,7 @@ func newSocketBackend(conf *BackendConfig, headersConfig HeaderFormatter) (*Sock
|
|||
return nil, err
|
||||
}
|
||||
|
||||
b := &SocketBackend{backend: bec}
|
||||
b := &socketBackend{backend: bec}
|
||||
|
||||
// Configure the sink.
|
||||
cfg, err := newFormatterConfig(headersConfig, conf.Config)
|
||||
|
|
@ -93,7 +94,7 @@ func newSocketBackend(conf *BackendConfig, headersConfig HeaderFormatter) (*Sock
|
|||
return b, nil
|
||||
}
|
||||
|
||||
func (b *SocketBackend) configureSinkNode(name string, address string, format format, opts ...event.Option) error {
|
||||
func (b *socketBackend) configureSinkNode(name string, address string, format format, opts ...event.Option) error {
|
||||
sinkNodeID, err := event.GenerateNodeID()
|
||||
if err != nil {
|
||||
return fmt.Errorf("error generating random NodeID for sink node: %w", err)
|
||||
|
|
@ -114,7 +115,7 @@ func (b *SocketBackend) configureSinkNode(name string, address string, format fo
|
|||
}
|
||||
|
||||
// Reload will trigger the reload action on the sink node for this backend.
|
||||
func (b *SocketBackend) Reload() error {
|
||||
func (b *socketBackend) Reload() error {
|
||||
for _, n := range b.nodeMap {
|
||||
if n.Type() == eventlogger.NodeTypeSink {
|
||||
return n.Reopen()
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ func TestSocketBackend_newSocketBackend(t *testing.T) {
|
|||
},
|
||||
MountPath: tc.mountPath,
|
||||
}
|
||||
b, err := newSocketBackend(cfg, &NoopHeaderFormatter{})
|
||||
b, err := newSocketBackend(cfg, &noopHeaderFormatter{})
|
||||
|
||||
if tc.wantErr {
|
||||
require.Error(t, err)
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@ const (
|
|||
optionTag = "tag"
|
||||
)
|
||||
|
||||
var _ Backend = (*SyslogBackend)(nil)
|
||||
var _ Backend = (*syslogBackend)(nil)
|
||||
|
||||
type SyslogBackend struct {
|
||||
type syslogBackend struct {
|
||||
*backend
|
||||
}
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ func NewSyslogBackend(conf *BackendConfig, headersConfig HeaderFormatter) (be Ba
|
|||
}
|
||||
|
||||
// newSyslogBackend creates a backend and configures all nodes including a socket sink.
|
||||
func newSyslogBackend(conf *BackendConfig, headersConfig HeaderFormatter) (*SyslogBackend, error) {
|
||||
func newSyslogBackend(conf *BackendConfig, headersConfig HeaderFormatter) (*syslogBackend, error) {
|
||||
if headersConfig == nil || reflect.ValueOf(headersConfig).IsNil() {
|
||||
return nil, fmt.Errorf("nil header formatter: %w", ErrInvalidParameter)
|
||||
}
|
||||
|
|
@ -60,6 +60,7 @@ func newSyslogBackend(conf *BackendConfig, headersConfig HeaderFormatter) (*Sysl
|
|||
sinkOpts := []event.Option{
|
||||
event.WithFacility(facility),
|
||||
event.WithTag(tag),
|
||||
event.WithLogger(conf.Logger),
|
||||
}
|
||||
|
||||
err = event.ValidateOptions(sinkOpts...)
|
||||
|
|
@ -67,7 +68,7 @@ func newSyslogBackend(conf *BackendConfig, headersConfig HeaderFormatter) (*Sysl
|
|||
return nil, err
|
||||
}
|
||||
|
||||
b := &SyslogBackend{backend: bec}
|
||||
b := &syslogBackend{backend: bec}
|
||||
|
||||
// Configure the sink.
|
||||
cfg, err := newFormatterConfig(headersConfig, conf.Config)
|
||||
|
|
@ -83,7 +84,7 @@ func newSyslogBackend(conf *BackendConfig, headersConfig HeaderFormatter) (*Sysl
|
|||
return b, nil
|
||||
}
|
||||
|
||||
func (b *SyslogBackend) configureSinkNode(name string, format format, opts ...event.Option) error {
|
||||
func (b *syslogBackend) configureSinkNode(name string, format format, opts ...event.Option) error {
|
||||
sinkNodeID, err := event.GenerateNodeID()
|
||||
if err != nil {
|
||||
return fmt.Errorf("error generating random NodeID for sink node: %w: %w", ErrInternal, err)
|
||||
|
|
@ -103,6 +104,6 @@ func (b *SyslogBackend) configureSinkNode(name string, format format, opts ...ev
|
|||
}
|
||||
|
||||
// Reload will trigger the reload action on the sink node for this backend.
|
||||
func (b *SyslogBackend) Reload() error {
|
||||
func (b *syslogBackend) Reload() error {
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ func TestSyslogBackend_newSyslogBackend(t *testing.T) {
|
|||
},
|
||||
MountPath: tc.mountPath,
|
||||
}
|
||||
b, err := newSyslogBackend(cfg, &NoopHeaderFormatter{})
|
||||
b, err := newSyslogBackend(cfg, &noopHeaderFormatter{})
|
||||
|
||||
if tc.wantErr {
|
||||
require.Error(t, err)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ func TestBackend_newFormatterConfig(t *testing.T) {
|
|||
}{
|
||||
"happy-path-json": {
|
||||
config: map[string]string{
|
||||
"format": JSONFormat.String(),
|
||||
"format": jsonFormat.String(),
|
||||
"hmac_accessor": "true",
|
||||
"log_raw": "true",
|
||||
"elide_list_responses": "true",
|
||||
|
|
@ -39,7 +39,7 @@ func TestBackend_newFormatterConfig(t *testing.T) {
|
|||
},
|
||||
"happy-path-jsonx": {
|
||||
config: map[string]string{
|
||||
"format": JSONxFormat.String(),
|
||||
"format": jsonxFormat.String(),
|
||||
"hmac_accessor": "true",
|
||||
"log_raw": "true",
|
||||
"elide_list_responses": "true",
|
||||
|
|
@ -65,7 +65,7 @@ func TestBackend_newFormatterConfig(t *testing.T) {
|
|||
},
|
||||
"invalid-hmac-accessor": {
|
||||
config: map[string]string{
|
||||
"format": JSONFormat.String(),
|
||||
"format": jsonFormat.String(),
|
||||
"hmac_accessor": "maybe",
|
||||
},
|
||||
want: formatterConfig{},
|
||||
|
|
@ -74,7 +74,7 @@ func TestBackend_newFormatterConfig(t *testing.T) {
|
|||
},
|
||||
"invalid-log-raw": {
|
||||
config: map[string]string{
|
||||
"format": JSONFormat.String(),
|
||||
"format": jsonFormat.String(),
|
||||
"hmac_accessor": "true",
|
||||
"log_raw": "maybe",
|
||||
},
|
||||
|
|
@ -84,7 +84,7 @@ func TestBackend_newFormatterConfig(t *testing.T) {
|
|||
},
|
||||
"invalid-elide-bool": {
|
||||
config: map[string]string{
|
||||
"format": JSONFormat.String(),
|
||||
"format": jsonFormat.String(),
|
||||
"hmac_accessor": "true",
|
||||
"log_raw": "true",
|
||||
"elide_list_responses": "maybe",
|
||||
|
|
@ -95,11 +95,11 @@ func TestBackend_newFormatterConfig(t *testing.T) {
|
|||
},
|
||||
"prefix": {
|
||||
config: map[string]string{
|
||||
"format": JSONFormat.String(),
|
||||
"format": jsonFormat.String(),
|
||||
"prefix": "foo",
|
||||
},
|
||||
want: formatterConfig{
|
||||
requiredFormat: JSONFormat,
|
||||
requiredFormat: jsonFormat,
|
||||
prefix: "foo",
|
||||
hmacAccessor: true,
|
||||
},
|
||||
|
|
@ -111,7 +111,7 @@ func TestBackend_newFormatterConfig(t *testing.T) {
|
|||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
got, err := newFormatterConfig(&NoopHeaderFormatter{}, tc.config)
|
||||
got, err := newFormatterConfig(&noopHeaderFormatter{}, tc.config)
|
||||
if tc.wantErr {
|
||||
require.Error(t, err)
|
||||
require.EqualError(t, err, tc.expectedMessage)
|
||||
|
|
@ -133,7 +133,7 @@ func TestBackend_newFormatterConfig(t *testing.T) {
|
|||
func TestBackend_configureFormatterNode(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
b, err := newBackend(&NoopHeaderFormatter{}, &BackendConfig{
|
||||
b, err := newBackend(&noopHeaderFormatter{}, &BackendConfig{
|
||||
MountPath: "foo",
|
||||
Logger: hclog.NewNullLogger(),
|
||||
})
|
||||
|
|
@ -188,6 +188,15 @@ func TestBackend_hasEnterpriseAuditOptions(t *testing.T) {
|
|||
},
|
||||
expected: true,
|
||||
},
|
||||
"ent-opt-exclude": {
|
||||
input: map[string]string{
|
||||
"exclude": `{
|
||||
"condition": "\"/request/mount_type\" == transit",
|
||||
"fields": [ "/request/data", "/response/data" ]
|
||||
}`,
|
||||
},
|
||||
expected: true,
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range tests {
|
||||
|
|
@ -241,6 +250,15 @@ func TestBackend_hasInvalidAuditOptions(t *testing.T) {
|
|||
},
|
||||
expected: !constants.IsEnterprise,
|
||||
},
|
||||
"ent-opt-exclude": {
|
||||
input: map[string]string{
|
||||
"exclude": `{
|
||||
"condition": "\"/request/mount_type\" == transit",
|
||||
"fields": [ "/request/data", "/response/data" ]
|
||||
}`,
|
||||
},
|
||||
expected: !constants.IsEnterprise,
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range tests {
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ import (
|
|||
"github.com/armon/go-metrics"
|
||||
"github.com/hashicorp/eventlogger"
|
||||
"github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"github.com/hashicorp/vault/helper/namespace"
|
||||
nshelper "github.com/hashicorp/vault/helper/namespace"
|
||||
"github.com/hashicorp/vault/internal/observability/event"
|
||||
"github.com/hashicorp/vault/sdk/logical"
|
||||
)
|
||||
|
|
@ -253,7 +252,7 @@ func (b *Broker) Deregister(ctx context.Context, name string) error {
|
|||
|
||||
// LogRequest is used to ensure all the audit backends have an opportunity to
|
||||
// log the given request and that *at least one* succeeds.
|
||||
func (b *Broker) LogRequest(ctx context.Context, in *logical.LogInput) (ret error) {
|
||||
func (b *Broker) LogRequest(ctx context.Context, in *logical.LogInput) (retErr error) {
|
||||
b.RLock()
|
||||
defer b.RUnlock()
|
||||
|
||||
|
|
@ -265,18 +264,15 @@ func (b *Broker) LogRequest(ctx context.Context, in *logical.LogInput) (ret erro
|
|||
defer metrics.MeasureSince([]string{"audit", "log_request"}, time.Now())
|
||||
defer func() {
|
||||
metricVal := float32(0.0)
|
||||
if ret != nil {
|
||||
if retErr != nil {
|
||||
metricVal = 1.0
|
||||
}
|
||||
metrics.IncrCounter([]string{"audit", "log_request_failure"}, metricVal)
|
||||
}()
|
||||
|
||||
var retErr *multierror.Error
|
||||
|
||||
e, err := NewEvent(RequestType)
|
||||
e, err := newEvent(RequestType)
|
||||
if err != nil {
|
||||
retErr = multierror.Append(retErr, err)
|
||||
return retErr.ErrorOrNil()
|
||||
return err
|
||||
}
|
||||
|
||||
e.Data = in
|
||||
|
|
@ -293,49 +289,54 @@ func (b *Broker) LogRequest(ctx context.Context, in *logical.LogInput) (ret erro
|
|||
// has taken up a lot of time handling the request before audit (request)
|
||||
// is triggered. Pipeline nodes and the eventlogger.Broker may check for a
|
||||
// cancelled context and refuse to process the nodes further.
|
||||
ns, err := namespace.FromContext(ctx)
|
||||
ns, err := nshelper.FromContext(ctx)
|
||||
if err != nil {
|
||||
retErr = multierror.Append(retErr, fmt.Errorf("namespace missing from context: %w", err))
|
||||
return retErr.ErrorOrNil()
|
||||
return fmt.Errorf("namespace missing from context: %w", err)
|
||||
}
|
||||
|
||||
tempContext, auditCancel := context.WithTimeout(context.Background(), timeout)
|
||||
defer auditCancel()
|
||||
auditContext = namespace.ContextWithNamespace(tempContext, ns)
|
||||
auditContext = nshelper.ContextWithNamespace(tempContext, ns)
|
||||
|
||||
b.logger.Trace("log request requires a derived context (original context was not viable)", "namespace ID", ns.ID, "namespace path", ns.Path, "timeout", timeout)
|
||||
}
|
||||
|
||||
var status eventlogger.Status
|
||||
if hasAuditPipelines(b.broker) {
|
||||
status, err = b.broker.Send(auditContext, event.AuditType.AsEventType(), e)
|
||||
if err != nil {
|
||||
retErr = multierror.Append(retErr, multierror.Append(err, status.Warnings...))
|
||||
return retErr.ErrorOrNil()
|
||||
return errors.Join(append([]error{err}, status.Warnings...)...)
|
||||
}
|
||||
}
|
||||
|
||||
// Audit event ended up in at least 1 sink.
|
||||
if len(status.CompleteSinks()) > 0 {
|
||||
return retErr.ErrorOrNil()
|
||||
// We should log warnings to the operational logs regardless of whether
|
||||
// we consider the overall auditing attempt to be successful.
|
||||
if len(status.Warnings) > 0 {
|
||||
b.logger.Error("log request underlying pipeline error(s)", "error", errors.Join(status.Warnings...))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// There were errors from inside the pipeline and we didn't write to a sink.
|
||||
if len(status.Warnings) > 0 {
|
||||
retErr = multierror.Append(retErr, multierror.Append(errors.New("error during audit pipeline processing"), status.Warnings...))
|
||||
return retErr.ErrorOrNil()
|
||||
return fmt.Errorf("error during audit pipeline processing: %w", errors.Join(status.Warnings...))
|
||||
}
|
||||
|
||||
// Handle any additional audit that is required (Enterprise/CE dependant).
|
||||
err = b.handleAdditionalAudit(auditContext, e)
|
||||
if err != nil {
|
||||
retErr = multierror.Append(retErr, err)
|
||||
return err
|
||||
}
|
||||
|
||||
return retErr.ErrorOrNil()
|
||||
return nil
|
||||
}
|
||||
|
||||
// LogResponse is used to ensure all the audit backends have an opportunity to
|
||||
// log the given response and that *at least one* succeeds.
|
||||
func (b *Broker) LogResponse(ctx context.Context, in *logical.LogInput) (ret error) {
|
||||
func (b *Broker) LogResponse(ctx context.Context, in *logical.LogInput) (retErr error) {
|
||||
b.RLock()
|
||||
defer b.RUnlock()
|
||||
|
||||
|
|
@ -347,18 +348,15 @@ func (b *Broker) LogResponse(ctx context.Context, in *logical.LogInput) (ret err
|
|||
defer metrics.MeasureSince([]string{"audit", "log_response"}, time.Now())
|
||||
defer func() {
|
||||
metricVal := float32(0.0)
|
||||
if ret != nil {
|
||||
if retErr != nil {
|
||||
metricVal = 1.0
|
||||
}
|
||||
metrics.IncrCounter([]string{"audit", "log_response_failure"}, metricVal)
|
||||
}()
|
||||
|
||||
var retErr *multierror.Error
|
||||
|
||||
e, err := NewEvent(ResponseType)
|
||||
e, err := newEvent(ResponseType)
|
||||
if err != nil {
|
||||
retErr = multierror.Append(retErr, err)
|
||||
return retErr.ErrorOrNil()
|
||||
return err
|
||||
}
|
||||
|
||||
e.Data = in
|
||||
|
|
@ -375,44 +373,49 @@ func (b *Broker) LogResponse(ctx context.Context, in *logical.LogInput) (ret err
|
|||
// has taken up a lot of time handling the request before audit (response)
|
||||
// is triggered. Pipeline nodes and the eventlogger.Broker may check for a
|
||||
// cancelled context and refuse to process the nodes further.
|
||||
ns, err := namespace.FromContext(ctx)
|
||||
ns, err := nshelper.FromContext(ctx)
|
||||
if err != nil {
|
||||
retErr = multierror.Append(retErr, fmt.Errorf("namespace missing from context: %w", err))
|
||||
return retErr.ErrorOrNil()
|
||||
return fmt.Errorf("namespace missing from context: %w", err)
|
||||
}
|
||||
|
||||
tempContext, auditCancel := context.WithTimeout(context.Background(), timeout)
|
||||
defer auditCancel()
|
||||
auditContext = namespace.ContextWithNamespace(tempContext, ns)
|
||||
auditContext = nshelper.ContextWithNamespace(tempContext, ns)
|
||||
|
||||
b.logger.Trace("log response requires a derived context (original context was not viable)", "namespace ID", ns.ID, "namespace path", ns.Path, "timeout", timeout)
|
||||
}
|
||||
|
||||
var status eventlogger.Status
|
||||
if hasAuditPipelines(b.broker) {
|
||||
status, err = b.broker.Send(auditContext, event.AuditType.AsEventType(), e)
|
||||
if err != nil {
|
||||
retErr = multierror.Append(retErr, multierror.Append(err, status.Warnings...))
|
||||
return retErr.ErrorOrNil()
|
||||
return errors.Join(append([]error{err}, status.Warnings...)...)
|
||||
}
|
||||
}
|
||||
|
||||
// Audit event ended up in at least 1 sink.
|
||||
if len(status.CompleteSinks()) > 0 {
|
||||
return retErr.ErrorOrNil()
|
||||
// We should log warnings to the operational logs regardless of whether
|
||||
// we consider the overall auditing attempt to be successful.
|
||||
if len(status.Warnings) > 0 {
|
||||
b.logger.Error("log response underlying pipeline error(s)", "error", errors.Join(status.Warnings...))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// There were errors from inside the pipeline and we didn't write to a sink.
|
||||
if len(status.Warnings) > 0 {
|
||||
retErr = multierror.Append(retErr, multierror.Append(errors.New("error during audit pipeline processing"), status.Warnings...))
|
||||
return retErr.ErrorOrNil()
|
||||
return fmt.Errorf("error during audit pipeline processing: %w", errors.Join(status.Warnings...))
|
||||
}
|
||||
|
||||
// Handle any additional audit that is required (Enterprise/CE dependant).
|
||||
err = b.handleAdditionalAudit(auditContext, e)
|
||||
if err != nil {
|
||||
retErr = multierror.Append(retErr, err)
|
||||
return err
|
||||
}
|
||||
|
||||
return retErr.ErrorOrNil()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *Broker) Invalidate(ctx context.Context, _ string) {
|
||||
|
|
@ -449,7 +452,7 @@ func (b *Broker) GetHash(ctx context.Context, name string, input string) (string
|
|||
return "", fmt.Errorf("unknown audit backend %q", name)
|
||||
}
|
||||
|
||||
return HashString(ctx, be.backend, input)
|
||||
return hashString(ctx, be.backend, input)
|
||||
}
|
||||
|
||||
// IsRegistered is used to check if a given audit backend is registered.
|
||||
|
|
@ -462,6 +465,8 @@ func (b *Broker) IsRegistered(name string) bool {
|
|||
|
||||
// isContextViable examines the supplied context to see if its own deadline would
|
||||
// occur later than a newly created context with a specific timeout.
|
||||
// Additionally, whether the supplied context is already cancelled, thus making it
|
||||
// unviable.
|
||||
// If the existing context is viable it can be used 'as-is', if not, the caller
|
||||
// should consider creating a new context with the relevant deadline and associated
|
||||
// context values (e.g. namespace) in order to reduce the likelihood that the
|
||||
|
|
@ -472,6 +477,12 @@ func isContextViable(ctx context.Context) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return false
|
||||
default:
|
||||
}
|
||||
|
||||
deadline, hasDeadline := ctx.Deadline()
|
||||
|
||||
// If there's no deadline on the context then we don't need to worry about
|
||||
|
|
|
|||
|
|
@ -44,6 +44,6 @@ func (b *Broker) requiredSuccessThresholdSinks() int {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (b *brokerEnt) handleAdditionalAudit(_ context.Context, _ *AuditEvent) error {
|
||||
func (b *brokerEnt) handleAdditionalAudit(_ context.Context, _ *Event) error {
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/vault/helper/namespace"
|
||||
nshelper "github.com/hashicorp/vault/helper/namespace"
|
||||
"github.com/hashicorp/vault/helper/testhelpers/corehelpers"
|
||||
"github.com/hashicorp/vault/sdk/helper/salt"
|
||||
"github.com/hashicorp/vault/sdk/logical"
|
||||
|
|
@ -23,7 +23,7 @@ func testAuditBackend(t *testing.T, path string, config map[string]string) Backe
|
|||
t.Helper()
|
||||
|
||||
headersCfg := &HeadersConfig{
|
||||
headerSettings: make(map[string]*HeaderSettings),
|
||||
headerSettings: make(map[string]*headerSettings),
|
||||
view: nil,
|
||||
}
|
||||
|
||||
|
|
@ -148,7 +148,7 @@ func BenchmarkAuditBroker_File_Request_DevNull(b *testing.B) {
|
|||
},
|
||||
}
|
||||
|
||||
ctx := namespace.RootContext(context.Background())
|
||||
ctx := nshelper.RootContext(context.Background())
|
||||
b.ResetTimer()
|
||||
b.RunParallel(func(pb *testing.PB) {
|
||||
for pb.Next() {
|
||||
|
|
@ -160,11 +160,14 @@ func BenchmarkAuditBroker_File_Request_DevNull(b *testing.B) {
|
|||
}
|
||||
|
||||
// TestBroker_isContextViable_basics checks the expected result of isContextViable
|
||||
// for basic inputs such as nil and a never-ending context.
|
||||
// for basic inputs such as nil, cancelled context and a never-ending context.
|
||||
func TestBroker_isContextViable_basics(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
require.False(t, isContextViable(nil))
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
cancel()
|
||||
require.False(t, isContextViable(ctx))
|
||||
require.True(t, isContextViable(context.Background()))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import (
|
|||
|
||||
"github.com/hashicorp/eventlogger"
|
||||
"github.com/hashicorp/go-bexpr"
|
||||
"github.com/hashicorp/vault/helper/namespace"
|
||||
nshelper "github.com/hashicorp/vault/helper/namespace"
|
||||
"github.com/hashicorp/vault/sdk/logical"
|
||||
)
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ func (f *entryFilter) Process(ctx context.Context, e *eventlogger.Event) (*event
|
|||
return nil, fmt.Errorf("event is nil: %w", ErrInvalidParameter)
|
||||
}
|
||||
|
||||
a, ok := e.Payload.(*AuditEvent)
|
||||
a, ok := e.Payload.(*Event)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("cannot parse event payload: %w", ErrInvalidParameter)
|
||||
}
|
||||
|
|
@ -81,7 +81,7 @@ func (f *entryFilter) Process(ctx context.Context, e *eventlogger.Event) (*event
|
|||
return nil, nil
|
||||
}
|
||||
|
||||
ns, err := namespace.FromContext(ctx)
|
||||
ns, err := nshelper.FromContext(ctx)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot obtain namespace: %w", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/hashicorp/eventlogger"
|
||||
"github.com/hashicorp/vault/helper/namespace"
|
||||
nshelper "github.com/hashicorp/vault/helper/namespace"
|
||||
"github.com/hashicorp/vault/internal/observability/event"
|
||||
"github.com/hashicorp/vault/sdk/logical"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
|
@ -117,7 +117,7 @@ func TestEntryFilter_Process_ContextDone(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
|
||||
// Fake audit event
|
||||
a, err := NewEvent(RequestType)
|
||||
a, err := newEvent(RequestType)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Fake event logger event
|
||||
|
|
@ -184,7 +184,7 @@ func TestEntryFilter_Process_NoAuditDataInPayload(t *testing.T) {
|
|||
l, err := newEntryFilter("operation == foo")
|
||||
require.NoError(t, err)
|
||||
|
||||
a, err := NewEvent(RequestType)
|
||||
a, err := newEvent(RequestType)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Ensure audit data is nil
|
||||
|
|
@ -212,7 +212,7 @@ func TestEntryFilter_Process_FilterSuccess(t *testing.T) {
|
|||
l, err := newEntryFilter("mount_type == juan")
|
||||
require.NoError(t, err)
|
||||
|
||||
a, err := NewEvent(RequestType)
|
||||
a, err := newEvent(RequestType)
|
||||
require.NoError(t, err)
|
||||
|
||||
a.Data = &logical.LogInput{
|
||||
|
|
@ -229,7 +229,7 @@ func TestEntryFilter_Process_FilterSuccess(t *testing.T) {
|
|||
Payload: a,
|
||||
}
|
||||
|
||||
ctx := namespace.ContextWithNamespace(context.Background(), namespace.RootNamespace)
|
||||
ctx := nshelper.ContextWithNamespace(context.Background(), nshelper.RootNamespace)
|
||||
|
||||
e2, err := l.Process(ctx, e)
|
||||
|
||||
|
|
@ -245,7 +245,7 @@ func TestEntryFilter_Process_FilterFail(t *testing.T) {
|
|||
l, err := newEntryFilter("mount_type == john and operation == create and namespace == root")
|
||||
require.NoError(t, err)
|
||||
|
||||
a, err := NewEvent(RequestType)
|
||||
a, err := newEvent(RequestType)
|
||||
require.NoError(t, err)
|
||||
|
||||
a.Data = &logical.LogInput{
|
||||
|
|
@ -262,7 +262,7 @@ func TestEntryFilter_Process_FilterFail(t *testing.T) {
|
|||
Payload: a,
|
||||
}
|
||||
|
||||
ctx := namespace.ContextWithNamespace(context.Background(), namespace.RootNamespace)
|
||||
ctx := nshelper.ContextWithNamespace(context.Background(), nshelper.RootNamespace)
|
||||
|
||||
e2, err := l.Process(ctx, e)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@ package audit
|
|||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"runtime/debug"
|
||||
|
|
@ -17,11 +15,12 @@ import (
|
|||
"github.com/hashicorp/eventlogger"
|
||||
"github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"github.com/hashicorp/vault/helper/namespace"
|
||||
nshelper "github.com/hashicorp/vault/helper/namespace"
|
||||
"github.com/hashicorp/vault/sdk/helper/jsonutil"
|
||||
"github.com/hashicorp/vault/sdk/helper/salt"
|
||||
"github.com/hashicorp/vault/sdk/logical"
|
||||
"github.com/jefferai/jsonx"
|
||||
"github.com/mitchellh/copystructure"
|
||||
)
|
||||
|
||||
var _ eventlogger.Node = (*entryFormatter)(nil)
|
||||
|
|
@ -78,7 +77,7 @@ func (*entryFormatter) Type() eventlogger.NodeType {
|
|||
}
|
||||
|
||||
// Process will attempt to parse the incoming event data into a corresponding
|
||||
// audit Request/Response which is serialized to JSON/JSONx and stored within the event.
|
||||
// audit request/response which is serialized to JSON/JSONx and stored within the event.
|
||||
func (f *entryFormatter) Process(ctx context.Context, e *eventlogger.Event) (_ *eventlogger.Event, retErr error) {
|
||||
// Return early if the context was cancelled, eventlogger will not carry on
|
||||
// asking nodes to process, so any sink node in the pipeline won't be called.
|
||||
|
|
@ -94,13 +93,13 @@ func (f *entryFormatter) Process(ctx context.Context, e *eventlogger.Event) (_ *
|
|||
return nil, fmt.Errorf("event is nil: %w", ErrInvalidParameter)
|
||||
}
|
||||
|
||||
a, ok := e.Payload.(*AuditEvent)
|
||||
a, ok := e.Payload.(*Event)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("cannot parse event payload: %w", ErrInvalidParameter)
|
||||
}
|
||||
|
||||
if a.Data == nil {
|
||||
return nil, fmt.Errorf("cannot audit event (%s) with no data: %w", a.Subtype, ErrInvalidParameter)
|
||||
return nil, fmt.Errorf("cannot audit a '%s' event with no data: %w", a.Subtype, ErrInvalidParameter)
|
||||
}
|
||||
|
||||
// Handle panics
|
||||
|
|
@ -110,8 +109,13 @@ func (f *entryFormatter) Process(ctx context.Context, e *eventlogger.Event) (_ *
|
|||
return
|
||||
}
|
||||
|
||||
path := "unknown"
|
||||
if a.Data.Request != nil {
|
||||
path = a.Data.Request.Path
|
||||
}
|
||||
|
||||
f.logger.Error("panic during logging",
|
||||
"request_path", a.Data.Request.Path,
|
||||
"request_path", path,
|
||||
"audit_device_path", f.name,
|
||||
"error", r,
|
||||
"stacktrace", string(debug.Stack()))
|
||||
|
|
@ -120,46 +124,23 @@ func (f *entryFormatter) Process(ctx context.Context, e *eventlogger.Event) (_ *
|
|||
retErr = multierror.Append(retErr, fmt.Errorf("panic generating audit log: %q", f.name)).ErrorOrNil()
|
||||
}()
|
||||
|
||||
// Take a copy of the event data before we modify anything.
|
||||
data, err := a.Data.Clone()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to clone audit event data: %w", err)
|
||||
}
|
||||
|
||||
// If the request is present in the input data, apply header configuration
|
||||
// regardless. We shouldn't be in a situation where the header formatter isn't
|
||||
// present as it's required.
|
||||
if data.Request != nil {
|
||||
// Ensure that any headers in the request, are formatted as required, and are
|
||||
// only present if they have been configured to appear in the audit log.
|
||||
// e.g. via: /sys/config/auditing/request-headers/:name
|
||||
data.Request.Headers, err = f.config.headerFormatter.ApplyConfig(ctx, data.Request.Headers, f.salter)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to transform headers for auditing: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// If the request contains a Server-Side Consistency Token (SSCT), and we
|
||||
// have an auth response, overwrite the existing client token with the SSCT,
|
||||
// so that the SSCT appears in the audit log for this entry.
|
||||
if data.Request != nil && data.Request.InboundSSCToken != "" && data.Auth != nil {
|
||||
data.Auth.ClientToken = data.Request.InboundSSCToken
|
||||
}
|
||||
|
||||
// Using 'any' as we have two different types that we can get back from either
|
||||
// formatRequest or formatResponse, but the JSON encoder doesn't care about types.
|
||||
// Using 'any' to make exclusion easier, the JSON encoder doesn't care about types.
|
||||
var entry any
|
||||
|
||||
switch a.Subtype {
|
||||
case RequestType:
|
||||
entry, err = f.formatRequest(ctx, data, a)
|
||||
case ResponseType:
|
||||
entry, err = f.formatResponse(ctx, data, a)
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown audit event subtype: %q", a.Subtype)
|
||||
}
|
||||
var err error
|
||||
entry, err = f.createEntry(ctx, a)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to parse %s from audit event: %w", a.Subtype, err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// If this pipeline has been configured with (Enterprise-only) exclusions then
|
||||
// attempt to exclude the fields from the audit entry.
|
||||
if f.shouldExclude() {
|
||||
m, err := f.excludeFields(entry)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to exclude %s audit data from %q: %w", a.Subtype, f.name, err)
|
||||
}
|
||||
|
||||
entry = m
|
||||
}
|
||||
|
||||
result, err := jsonutil.EncodeJSON(entry)
|
||||
|
|
@ -167,7 +148,7 @@ func (f *entryFormatter) Process(ctx context.Context, e *eventlogger.Event) (_ *
|
|||
return nil, fmt.Errorf("unable to format %s: %w", a.Subtype, err)
|
||||
}
|
||||
|
||||
if f.config.requiredFormat == JSONxFormat {
|
||||
if f.config.requiredFormat == jsonxFormat {
|
||||
var err error
|
||||
result, err = jsonx.EncodeJSONBytes(result)
|
||||
if err != nil {
|
||||
|
|
@ -186,21 +167,12 @@ func (f *entryFormatter) Process(ctx context.Context, e *eventlogger.Event) (_ *
|
|||
result = append([]byte(f.config.prefix), result...)
|
||||
}
|
||||
|
||||
// Copy some properties from the event (and audit event) and store the
|
||||
// format for the next (sink) node to Process.
|
||||
a2 := &AuditEvent{
|
||||
ID: a.ID,
|
||||
Version: a.Version,
|
||||
Subtype: a.Subtype,
|
||||
Timestamp: a.Timestamp,
|
||||
Data: data, // Use the cloned data here rather than a pointer to the original.
|
||||
}
|
||||
|
||||
// Create a new event, so we can store our formatted data without conflict.
|
||||
e2 := &eventlogger.Event{
|
||||
Type: e.Type,
|
||||
CreatedAt: e.CreatedAt,
|
||||
Formatted: make(map[string][]byte), // we are about to set this ourselves.
|
||||
Payload: a2,
|
||||
Payload: a,
|
||||
}
|
||||
|
||||
e2.FormattedAs(f.config.requiredFormat.String(), result)
|
||||
|
|
@ -208,377 +180,31 @@ func (f *entryFormatter) Process(ctx context.Context, e *eventlogger.Event) (_ *
|
|||
return e2, nil
|
||||
}
|
||||
|
||||
// formatRequest attempts to format the specified logical.LogInput into a RequestEntry.
|
||||
func (f *entryFormatter) formatRequest(ctx context.Context, in *logical.LogInput, provider timeProvider) (*RequestEntry, error) {
|
||||
switch {
|
||||
case in == nil || in.Request == nil:
|
||||
return nil, errors.New("request to request-audit a nil request")
|
||||
case f.salter == nil:
|
||||
return nil, errors.New("salt func not configured")
|
||||
}
|
||||
|
||||
// Set these to the input values at first
|
||||
auth := in.Auth
|
||||
req := in.Request
|
||||
var connState *tls.ConnectionState
|
||||
if auth == nil {
|
||||
auth = new(logical.Auth)
|
||||
}
|
||||
|
||||
if in.Request.Connection != nil && in.Request.Connection.ConnState != nil {
|
||||
connState = in.Request.Connection.ConnState
|
||||
}
|
||||
|
||||
if !f.config.raw {
|
||||
var err error
|
||||
auth, err = HashAuth(ctx, f.salter, auth, f.config.hmacAccessor)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req, err = HashRequest(ctx, f.salter, req, f.config.hmacAccessor, in.NonHMACReqDataKeys)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
var errString string
|
||||
if in.OuterErr != nil {
|
||||
errString = in.OuterErr.Error()
|
||||
}
|
||||
|
||||
ns, err := namespace.FromContext(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
reqType := in.Type
|
||||
if reqType == "" {
|
||||
reqType = "request"
|
||||
}
|
||||
reqEntry := &RequestEntry{
|
||||
Type: reqType,
|
||||
Error: errString,
|
||||
ForwardedFrom: req.ForwardedFrom,
|
||||
Auth: &Auth{
|
||||
ClientToken: auth.ClientToken,
|
||||
Accessor: auth.Accessor,
|
||||
DisplayName: auth.DisplayName,
|
||||
Policies: auth.Policies,
|
||||
TokenPolicies: auth.TokenPolicies,
|
||||
IdentityPolicies: auth.IdentityPolicies,
|
||||
ExternalNamespacePolicies: auth.ExternalNamespacePolicies,
|
||||
NoDefaultPolicy: auth.NoDefaultPolicy,
|
||||
Metadata: auth.Metadata,
|
||||
EntityID: auth.EntityID,
|
||||
RemainingUses: req.ClientTokenRemainingUses,
|
||||
TokenType: auth.TokenType.String(),
|
||||
TokenTTL: int64(auth.TTL.Seconds()),
|
||||
},
|
||||
|
||||
Request: &Request{
|
||||
ID: req.ID,
|
||||
ClientID: req.ClientID,
|
||||
ClientToken: req.ClientToken,
|
||||
ClientTokenAccessor: req.ClientTokenAccessor,
|
||||
Operation: req.Operation,
|
||||
MountPoint: req.MountPoint,
|
||||
MountType: req.MountType,
|
||||
MountAccessor: req.MountAccessor,
|
||||
MountRunningVersion: req.MountRunningVersion(),
|
||||
MountRunningSha256: req.MountRunningSha256(),
|
||||
MountIsExternalPlugin: req.MountIsExternalPlugin(),
|
||||
MountClass: req.MountClass(),
|
||||
Namespace: &Namespace{
|
||||
ID: ns.ID,
|
||||
Path: ns.Path,
|
||||
},
|
||||
Path: req.Path,
|
||||
Data: req.Data,
|
||||
PolicyOverride: req.PolicyOverride,
|
||||
RemoteAddr: getRemoteAddr(req),
|
||||
RemotePort: getRemotePort(req),
|
||||
ReplicationCluster: req.ReplicationCluster,
|
||||
Headers: req.Headers,
|
||||
ClientCertificateSerialNumber: getClientCertificateSerialNumber(connState),
|
||||
},
|
||||
}
|
||||
|
||||
if req.HTTPRequest != nil && req.HTTPRequest.RequestURI != req.Path {
|
||||
reqEntry.Request.RequestURI = req.HTTPRequest.RequestURI
|
||||
}
|
||||
|
||||
if !auth.IssueTime.IsZero() {
|
||||
reqEntry.Auth.TokenIssueTime = auth.IssueTime.Format(time.RFC3339)
|
||||
}
|
||||
|
||||
if auth.PolicyResults != nil {
|
||||
reqEntry.Auth.PolicyResults = &PolicyResults{
|
||||
Allowed: auth.PolicyResults.Allowed,
|
||||
}
|
||||
|
||||
for _, p := range auth.PolicyResults.GrantingPolicies {
|
||||
reqEntry.Auth.PolicyResults.GrantingPolicies = append(reqEntry.Auth.PolicyResults.GrantingPolicies, PolicyInfo{
|
||||
Name: p.Name,
|
||||
NamespaceId: p.NamespaceId,
|
||||
NamespacePath: p.NamespacePath,
|
||||
Type: p.Type,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if req.WrapInfo != nil {
|
||||
reqEntry.Request.WrapTTL = int(req.WrapInfo.TTL / time.Second)
|
||||
}
|
||||
|
||||
if !f.config.omitTime {
|
||||
// Use the time provider to supply the time for this entry.
|
||||
reqEntry.Time = provider.formattedTime()
|
||||
}
|
||||
|
||||
return reqEntry, nil
|
||||
}
|
||||
|
||||
// formatResponse attempts to format the specified logical.LogInput into a ResponseEntry.
|
||||
func (f *entryFormatter) formatResponse(ctx context.Context, in *logical.LogInput, provider timeProvider) (*ResponseEntry, error) {
|
||||
switch {
|
||||
case f == nil:
|
||||
return nil, errors.New("formatter is nil")
|
||||
case in == nil || in.Request == nil:
|
||||
return nil, errors.New("request to response-audit a nil request")
|
||||
case f.salter == nil:
|
||||
return nil, errors.New("salt func not configured")
|
||||
}
|
||||
|
||||
// Set these to the input values at first
|
||||
auth, req, resp := in.Auth, in.Request, in.Response
|
||||
if auth == nil {
|
||||
auth = new(logical.Auth)
|
||||
}
|
||||
if resp == nil {
|
||||
resp = new(logical.Response)
|
||||
}
|
||||
var connState *tls.ConnectionState
|
||||
|
||||
if in.Request.Connection != nil && in.Request.Connection.ConnState != nil {
|
||||
connState = in.Request.Connection.ConnState
|
||||
}
|
||||
|
||||
elideListResponseData := f.config.elideListResponses && req.Operation == logical.ListOperation
|
||||
|
||||
var respData map[string]interface{}
|
||||
if f.config.raw {
|
||||
// In the non-raw case, elision of list response data occurs inside HashResponse, to avoid redundant deep
|
||||
// copies and hashing of data only to elide it later. In the raw case, we need to do it here.
|
||||
if elideListResponseData && resp.Data != nil {
|
||||
// Copy the data map before making changes, but we only need to go one level deep in this case
|
||||
respData = make(map[string]interface{}, len(resp.Data))
|
||||
for k, v := range resp.Data {
|
||||
respData[k] = v
|
||||
}
|
||||
|
||||
doElideListResponseData(respData)
|
||||
} else {
|
||||
respData = resp.Data
|
||||
}
|
||||
} else {
|
||||
var err error
|
||||
auth, err = HashAuth(ctx, f.salter, auth, f.config.hmacAccessor)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req, err = HashRequest(ctx, f.salter, req, f.config.hmacAccessor, in.NonHMACReqDataKeys)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
resp, err = HashResponse(ctx, f.salter, resp, f.config.hmacAccessor, in.NonHMACRespDataKeys, elideListResponseData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
respData = resp.Data
|
||||
}
|
||||
|
||||
var errString string
|
||||
if in.OuterErr != nil {
|
||||
errString = in.OuterErr.Error()
|
||||
}
|
||||
|
||||
ns, err := namespace.FromContext(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var respAuth *Auth
|
||||
if resp.Auth != nil {
|
||||
respAuth = &Auth{
|
||||
ClientToken: resp.Auth.ClientToken,
|
||||
Accessor: resp.Auth.Accessor,
|
||||
DisplayName: resp.Auth.DisplayName,
|
||||
Policies: resp.Auth.Policies,
|
||||
TokenPolicies: resp.Auth.TokenPolicies,
|
||||
IdentityPolicies: resp.Auth.IdentityPolicies,
|
||||
ExternalNamespacePolicies: resp.Auth.ExternalNamespacePolicies,
|
||||
NoDefaultPolicy: resp.Auth.NoDefaultPolicy,
|
||||
Metadata: resp.Auth.Metadata,
|
||||
NumUses: resp.Auth.NumUses,
|
||||
EntityID: resp.Auth.EntityID,
|
||||
TokenType: resp.Auth.TokenType.String(),
|
||||
TokenTTL: int64(resp.Auth.TTL.Seconds()),
|
||||
}
|
||||
if !resp.Auth.IssueTime.IsZero() {
|
||||
respAuth.TokenIssueTime = resp.Auth.IssueTime.Format(time.RFC3339)
|
||||
}
|
||||
}
|
||||
|
||||
var respSecret *Secret
|
||||
if resp.Secret != nil {
|
||||
respSecret = &Secret{
|
||||
LeaseID: resp.Secret.LeaseID,
|
||||
}
|
||||
}
|
||||
|
||||
var respWrapInfo *ResponseWrapInfo
|
||||
if resp.WrapInfo != nil {
|
||||
token := resp.WrapInfo.Token
|
||||
if jwtToken := parseVaultTokenFromJWT(token); jwtToken != nil {
|
||||
token = *jwtToken
|
||||
}
|
||||
respWrapInfo = &ResponseWrapInfo{
|
||||
TTL: int(resp.WrapInfo.TTL / time.Second),
|
||||
Token: token,
|
||||
Accessor: resp.WrapInfo.Accessor,
|
||||
CreationTime: resp.WrapInfo.CreationTime.UTC().Format(time.RFC3339Nano),
|
||||
CreationPath: resp.WrapInfo.CreationPath,
|
||||
WrappedAccessor: resp.WrapInfo.WrappedAccessor,
|
||||
}
|
||||
}
|
||||
|
||||
respType := in.Type
|
||||
if respType == "" {
|
||||
respType = "response"
|
||||
}
|
||||
respEntry := &ResponseEntry{
|
||||
Type: respType,
|
||||
Error: errString,
|
||||
Forwarded: req.ForwardedFrom != "",
|
||||
Auth: &Auth{
|
||||
ClientToken: auth.ClientToken,
|
||||
Accessor: auth.Accessor,
|
||||
DisplayName: auth.DisplayName,
|
||||
Policies: auth.Policies,
|
||||
TokenPolicies: auth.TokenPolicies,
|
||||
IdentityPolicies: auth.IdentityPolicies,
|
||||
ExternalNamespacePolicies: auth.ExternalNamespacePolicies,
|
||||
NoDefaultPolicy: auth.NoDefaultPolicy,
|
||||
Metadata: auth.Metadata,
|
||||
RemainingUses: req.ClientTokenRemainingUses,
|
||||
EntityID: auth.EntityID,
|
||||
EntityCreated: auth.EntityCreated,
|
||||
TokenType: auth.TokenType.String(),
|
||||
TokenTTL: int64(auth.TTL.Seconds()),
|
||||
},
|
||||
|
||||
Request: &Request{
|
||||
ID: req.ID,
|
||||
ClientToken: req.ClientToken,
|
||||
ClientTokenAccessor: req.ClientTokenAccessor,
|
||||
ClientID: req.ClientID,
|
||||
Operation: req.Operation,
|
||||
MountPoint: req.MountPoint,
|
||||
MountType: req.MountType,
|
||||
MountAccessor: req.MountAccessor,
|
||||
MountRunningVersion: req.MountRunningVersion(),
|
||||
MountRunningSha256: req.MountRunningSha256(),
|
||||
MountIsExternalPlugin: req.MountIsExternalPlugin(),
|
||||
MountClass: req.MountClass(),
|
||||
Namespace: &Namespace{
|
||||
ID: ns.ID,
|
||||
Path: ns.Path,
|
||||
},
|
||||
Path: req.Path,
|
||||
Data: req.Data,
|
||||
PolicyOverride: req.PolicyOverride,
|
||||
RemoteAddr: getRemoteAddr(req),
|
||||
RemotePort: getRemotePort(req),
|
||||
ClientCertificateSerialNumber: getClientCertificateSerialNumber(connState),
|
||||
ReplicationCluster: req.ReplicationCluster,
|
||||
Headers: req.Headers,
|
||||
},
|
||||
|
||||
Response: &Response{
|
||||
MountPoint: req.MountPoint,
|
||||
MountType: req.MountType,
|
||||
MountAccessor: req.MountAccessor,
|
||||
MountRunningVersion: req.MountRunningVersion(),
|
||||
MountRunningSha256: req.MountRunningSha256(),
|
||||
MountIsExternalPlugin: req.MountIsExternalPlugin(),
|
||||
MountClass: req.MountClass(),
|
||||
Auth: respAuth,
|
||||
Secret: respSecret,
|
||||
Data: respData,
|
||||
Warnings: resp.Warnings,
|
||||
Redirect: resp.Redirect,
|
||||
WrapInfo: respWrapInfo,
|
||||
Headers: resp.Headers,
|
||||
},
|
||||
}
|
||||
|
||||
if req.HTTPRequest != nil && req.HTTPRequest.RequestURI != req.Path {
|
||||
respEntry.Request.RequestURI = req.HTTPRequest.RequestURI
|
||||
}
|
||||
|
||||
if auth.PolicyResults != nil {
|
||||
respEntry.Auth.PolicyResults = &PolicyResults{
|
||||
Allowed: auth.PolicyResults.Allowed,
|
||||
}
|
||||
|
||||
for _, p := range auth.PolicyResults.GrantingPolicies {
|
||||
respEntry.Auth.PolicyResults.GrantingPolicies = append(respEntry.Auth.PolicyResults.GrantingPolicies, PolicyInfo{
|
||||
Name: p.Name,
|
||||
NamespaceId: p.NamespaceId,
|
||||
NamespacePath: p.NamespacePath,
|
||||
Type: p.Type,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if !auth.IssueTime.IsZero() {
|
||||
respEntry.Auth.TokenIssueTime = auth.IssueTime.Format(time.RFC3339)
|
||||
}
|
||||
if req.WrapInfo != nil {
|
||||
respEntry.Request.WrapTTL = int(req.WrapInfo.TTL / time.Second)
|
||||
}
|
||||
|
||||
if !f.config.omitTime {
|
||||
// Use the time provider to supply the time for this entry.
|
||||
respEntry.Time = provider.formattedTime()
|
||||
}
|
||||
|
||||
return respEntry, nil
|
||||
}
|
||||
|
||||
// getRemoteAddr safely gets the remote address avoiding a nil pointer
|
||||
func getRemoteAddr(req *logical.Request) string {
|
||||
// remoteAddr safely gets the remote address avoiding a nil pointer.
|
||||
func remoteAddr(req *logical.Request) string {
|
||||
if req != nil && req.Connection != nil {
|
||||
return req.Connection.RemoteAddr
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// getRemotePort safely gets the remote port avoiding a nil pointer
|
||||
func getRemotePort(req *logical.Request) int {
|
||||
// remotePort safely gets the remote port avoiding a nil pointer.
|
||||
func remotePort(req *logical.Request) int {
|
||||
if req != nil && req.Connection != nil {
|
||||
return req.Connection.RemotePort
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// getClientCertificateSerialNumber attempts the retrieve the serial number of
|
||||
// the peer certificate from the specified tls.ConnectionState.
|
||||
func getClientCertificateSerialNumber(connState *tls.ConnectionState) string {
|
||||
// clientCertSerialNumber attempts the retrieve the serial number of the peer
|
||||
// certificate from the specified tls.ConnectionState.
|
||||
func clientCertSerialNumber(req *logical.Request) string {
|
||||
if req == nil || req.Connection == nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
connState := req.Connection.ConnState
|
||||
|
||||
if connState == nil || len(connState.VerifiedChains) == 0 || len(connState.VerifiedChains[0]) == 0 {
|
||||
return ""
|
||||
}
|
||||
|
|
@ -606,25 +232,6 @@ func parseVaultTokenFromJWT(token string) *string {
|
|||
return &claims.ID
|
||||
}
|
||||
|
||||
// doElideListResponseData performs the actual elision of list operation response data, once surrounding code has
|
||||
// determined it should apply to a particular request. The data map that is passed in must be a copy that is safe to
|
||||
// modify in place, but need not be a full recursive deep copy, as only top-level keys are changed.
|
||||
//
|
||||
// See the documentation of the controlling option in formatterConfig for more information on the purpose.
|
||||
func doElideListResponseData(data map[string]interface{}) {
|
||||
for k, v := range data {
|
||||
if k == "keys" {
|
||||
if vSlice, ok := v.([]string); ok {
|
||||
data[k] = len(vSlice)
|
||||
}
|
||||
} else if k == "key_info" {
|
||||
if vMap, ok := v.(map[string]interface{}); ok {
|
||||
data[k] = len(vMap)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// newTemporaryEntryFormatter creates a cloned entryFormatter instance with a non-persistent Salter.
|
||||
func newTemporaryEntryFormatter(n *entryFormatter) *entryFormatter {
|
||||
return &entryFormatter{
|
||||
|
|
@ -637,3 +244,373 @@ func newTemporaryEntryFormatter(n *entryFormatter) *entryFormatter {
|
|||
func (s *nonPersistentSalt) Salt(_ context.Context) (*salt.Salt, error) {
|
||||
return salt.NewNonpersistentSalt(), nil
|
||||
}
|
||||
|
||||
// clone can be used to deep clone the specified type.
|
||||
func clone[V any](s V) (V, error) {
|
||||
s2, err := copystructure.Copy(s)
|
||||
|
||||
return s2.(V), err
|
||||
}
|
||||
|
||||
// newAuth takes a logical.Auth and the number of remaining client token uses
|
||||
// (which should be supplied from the logical.Request's client token), and creates
|
||||
// an audit auth.
|
||||
// tokenRemainingUses should be the client token remaining uses to include in auth.
|
||||
// This usually can be found in logical.Request.ClientTokenRemainingUses.
|
||||
// NOTE: supplying a nil value for auth will result in a nil return value and
|
||||
// (nil) error. The caller should check the return value before attempting to use it.
|
||||
// ignore-nil-nil-function-check.
|
||||
func newAuth(input *logical.Auth, tokenRemainingUses int) (*auth, error) {
|
||||
if input == nil {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
extNSPolicies, err := clone(input.ExternalNamespacePolicies)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to clone logical auth: external namespace policies: %w", err)
|
||||
}
|
||||
|
||||
identityPolicies, err := clone(input.IdentityPolicies)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to clone logical auth: identity policies: %w", err)
|
||||
}
|
||||
|
||||
metadata, err := clone(input.Metadata)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to clone logical auth: metadata: %w", err)
|
||||
}
|
||||
|
||||
policies, err := clone(input.Policies)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to clone logical auth: policies: %w", err)
|
||||
}
|
||||
|
||||
var polRes *policyResults
|
||||
if input.PolicyResults != nil {
|
||||
polRes = &policyResults{
|
||||
Allowed: input.PolicyResults.Allowed,
|
||||
GrantingPolicies: make([]policyInfo, len(input.PolicyResults.GrantingPolicies)),
|
||||
}
|
||||
|
||||
for _, p := range input.PolicyResults.GrantingPolicies {
|
||||
polRes.GrantingPolicies = append(polRes.GrantingPolicies, policyInfo{
|
||||
Name: p.Name,
|
||||
NamespaceId: p.NamespaceId,
|
||||
NamespacePath: p.NamespacePath,
|
||||
Type: p.Type,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
tokenPolicies, err := clone(input.TokenPolicies)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to clone logical auth: token policies: %w", err)
|
||||
}
|
||||
|
||||
var tokenIssueTime string
|
||||
if !input.IssueTime.IsZero() {
|
||||
tokenIssueTime = input.IssueTime.Format(time.RFC3339)
|
||||
}
|
||||
|
||||
return &auth{
|
||||
Accessor: input.Accessor,
|
||||
ClientToken: input.ClientToken,
|
||||
DisplayName: input.DisplayName,
|
||||
EntityCreated: input.EntityCreated,
|
||||
EntityID: input.EntityID,
|
||||
ExternalNamespacePolicies: extNSPolicies,
|
||||
IdentityPolicies: identityPolicies,
|
||||
Metadata: metadata,
|
||||
NoDefaultPolicy: input.NoDefaultPolicy,
|
||||
NumUses: input.NumUses,
|
||||
Policies: policies,
|
||||
PolicyResults: polRes,
|
||||
RemainingUses: tokenRemainingUses,
|
||||
TokenPolicies: tokenPolicies,
|
||||
TokenIssueTime: tokenIssueTime,
|
||||
TokenTTL: int64(input.TTL.Seconds()),
|
||||
TokenType: input.TokenType.String(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// newRequest takes a logical.Request and namespace.Namespace, transforms and
|
||||
// aggregates them into an audit request.
|
||||
func newRequest(req *logical.Request, ns *nshelper.Namespace) (*request, error) {
|
||||
if req == nil {
|
||||
return nil, fmt.Errorf("request cannot be nil")
|
||||
}
|
||||
|
||||
remoteAddr := remoteAddr(req)
|
||||
remotePort := remotePort(req)
|
||||
clientCertSerial := clientCertSerialNumber(req)
|
||||
|
||||
data, err := clone(req.Data)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to clone logical request: data: %w", err)
|
||||
}
|
||||
|
||||
headers, err := clone(req.Headers)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to clone logical request: headers: %w", err)
|
||||
}
|
||||
|
||||
var reqURI string
|
||||
if req.HTTPRequest != nil && req.HTTPRequest.RequestURI != req.Path {
|
||||
reqURI = req.HTTPRequest.RequestURI
|
||||
}
|
||||
var wrapTTL int
|
||||
if req.WrapInfo != nil {
|
||||
wrapTTL = int(req.WrapInfo.TTL / time.Second)
|
||||
}
|
||||
|
||||
return &request{
|
||||
ClientCertificateSerialNumber: clientCertSerial,
|
||||
ClientID: req.ClientID,
|
||||
ClientToken: req.ClientToken,
|
||||
ClientTokenAccessor: req.ClientTokenAccessor,
|
||||
Data: data,
|
||||
Headers: headers,
|
||||
ID: req.ID,
|
||||
MountAccessor: req.MountAccessor,
|
||||
MountClass: req.MountClass(),
|
||||
MountIsExternalPlugin: req.MountIsExternalPlugin(),
|
||||
MountPoint: req.MountPoint,
|
||||
MountRunningSha256: req.MountRunningSha256(),
|
||||
MountRunningVersion: req.MountRunningVersion(),
|
||||
MountType: req.MountType,
|
||||
Namespace: &namespace{
|
||||
ID: ns.ID,
|
||||
Path: ns.Path,
|
||||
},
|
||||
Operation: req.Operation,
|
||||
Path: req.Path,
|
||||
PolicyOverride: req.PolicyOverride,
|
||||
RemoteAddr: remoteAddr,
|
||||
RemotePort: remotePort,
|
||||
ReplicationCluster: req.ReplicationCluster,
|
||||
RequestURI: reqURI,
|
||||
WrapTTL: wrapTTL,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// newResponse takes a logical.Response and logical.Request, transforms and
|
||||
// aggregates them into an audit response.
|
||||
// isElisionRequired is used to indicate that response 'Data' should be elided.
|
||||
// NOTE: supplying a nil value for response will result in a nil return value and
|
||||
// (nil) error. The caller should check the return value before attempting to use it.
|
||||
// ignore-nil-nil-function-check.
|
||||
func newResponse(resp *logical.Response, req *logical.Request, isElisionRequired bool) (*response, error) {
|
||||
if resp == nil {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
if req == nil {
|
||||
// Request should never be nil, even for a response.
|
||||
return nil, fmt.Errorf("request cannot be nil")
|
||||
}
|
||||
|
||||
auth, err := newAuth(resp.Auth, req.ClientTokenRemainingUses)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to convert logical auth response: %w", err)
|
||||
}
|
||||
|
||||
var data map[string]any
|
||||
if resp.Data != nil {
|
||||
data = make(map[string]any, len(resp.Data))
|
||||
|
||||
if isElisionRequired {
|
||||
// Performs the actual elision (ideally for list operations) of response data,
|
||||
// once surrounding code has determined it should apply to a particular request.
|
||||
// If the value for a key should not be elided, then it will be cloned.
|
||||
for k, v := range resp.Data {
|
||||
isCloneRequired := true
|
||||
switch k {
|
||||
case "keys":
|
||||
if vSlice, ok := v.([]string); ok {
|
||||
data[k] = len(vSlice)
|
||||
isCloneRequired = false
|
||||
}
|
||||
case "key_info":
|
||||
if vMap, ok := v.(map[string]any); ok {
|
||||
data[k] = len(vMap)
|
||||
isCloneRequired = false
|
||||
}
|
||||
}
|
||||
|
||||
// Clone values if they weren't legitimate keys or key_info.
|
||||
if isCloneRequired {
|
||||
v2, err := clone(v)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to clone response data while eliding: %w", err)
|
||||
}
|
||||
data[k] = v2
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Deep clone all values, no shortcuts here.
|
||||
data, err = clone(resp.Data)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to clone response data: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
headers, err := clone(resp.Headers)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to clone logical response: headers: %w", err)
|
||||
}
|
||||
|
||||
var s *secret
|
||||
if resp.Secret != nil {
|
||||
s = &secret{LeaseID: resp.Secret.LeaseID}
|
||||
}
|
||||
|
||||
var wrapInfo *responseWrapInfo
|
||||
if resp.WrapInfo != nil {
|
||||
token := resp.WrapInfo.Token
|
||||
if jwtToken := parseVaultTokenFromJWT(token); jwtToken != nil {
|
||||
token = *jwtToken
|
||||
}
|
||||
|
||||
ttl := int(resp.WrapInfo.TTL / time.Second)
|
||||
wrapInfo = &responseWrapInfo{
|
||||
TTL: ttl,
|
||||
Token: token,
|
||||
Accessor: resp.WrapInfo.Accessor,
|
||||
CreationTime: resp.WrapInfo.CreationTime.UTC().Format(time.RFC3339Nano),
|
||||
CreationPath: resp.WrapInfo.CreationPath,
|
||||
WrappedAccessor: resp.WrapInfo.WrappedAccessor,
|
||||
}
|
||||
}
|
||||
|
||||
warnings, err := clone(resp.Warnings)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to clone logical response: warnings: %w", err)
|
||||
}
|
||||
|
||||
return &response{
|
||||
Auth: auth,
|
||||
Data: data,
|
||||
Headers: headers,
|
||||
MountAccessor: req.MountAccessor,
|
||||
MountClass: req.MountClass(),
|
||||
MountIsExternalPlugin: req.MountIsExternalPlugin(),
|
||||
MountPoint: req.MountPoint,
|
||||
MountRunningSha256: req.MountRunningSha256(),
|
||||
MountRunningVersion: req.MountRunningVersion(),
|
||||
MountType: req.MountType,
|
||||
Redirect: resp.Redirect,
|
||||
Secret: s,
|
||||
WrapInfo: wrapInfo,
|
||||
Warnings: warnings,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// createEntry takes the AuditEvent and builds an audit entry.
|
||||
// The entry will be HMAC'd and elided where required.
|
||||
func (f *entryFormatter) createEntry(ctx context.Context, a *Event) (*entry, error) {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return nil, ctx.Err()
|
||||
default:
|
||||
|
||||
}
|
||||
|
||||
data := a.Data
|
||||
|
||||
if data.Request == nil {
|
||||
// Request should never be nil, even for a response.
|
||||
return nil, fmt.Errorf("unable to parse request from '%s' audit event: request cannot be nil", a.Subtype)
|
||||
}
|
||||
|
||||
ns, err := nshelper.FromContext(ctx)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to retrieve namespace from context: %w", err)
|
||||
}
|
||||
|
||||
auth, err := newAuth(data.Auth, data.Request.ClientTokenRemainingUses)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot convert auth: %w", err)
|
||||
}
|
||||
|
||||
req, err := newRequest(data.Request, ns)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot convert request: %w", err)
|
||||
}
|
||||
|
||||
var resp *response
|
||||
if a.Subtype == ResponseType {
|
||||
shouldElide := f.config.elideListResponses && req.Operation == logical.ListOperation
|
||||
resp, err = newResponse(data.Response, data.Request, shouldElide)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot convert response: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
var outerErr string
|
||||
if data.OuterErr != nil {
|
||||
outerErr = data.OuterErr.Error()
|
||||
}
|
||||
|
||||
entryType := data.Type
|
||||
if entryType == "" {
|
||||
entryType = a.Subtype.String()
|
||||
}
|
||||
|
||||
entry := &entry{
|
||||
Auth: auth,
|
||||
Error: outerErr,
|
||||
Forwarded: false,
|
||||
ForwardedFrom: data.Request.ForwardedFrom,
|
||||
Request: req,
|
||||
Response: resp,
|
||||
Type: entryType,
|
||||
}
|
||||
|
||||
if !f.config.omitTime {
|
||||
// Use the time provider to supply the time for this entry.
|
||||
entry.Time = a.timeProvider().formattedTime()
|
||||
}
|
||||
|
||||
// If the request is present in the input data, apply header configuration
|
||||
// regardless. We shouldn't be in a situation where the header formatter isn't
|
||||
// present as it's required.
|
||||
if entry.Request != nil {
|
||||
// Ensure that any headers in the request, are formatted as required, and are
|
||||
// only present if they have been configured to appear in the audit log.
|
||||
// e.g. via: /sys/config/auditing/request-headers/:name
|
||||
entry.Request.Headers, err = f.config.headerFormatter.ApplyConfig(ctx, entry.Request.Headers, f.salter)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to transform headers for auditing: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// If the request contains a Server-Side Consistency Token (SSCT), and we
|
||||
// have an auth response, overwrite the existing client token with the SSCT,
|
||||
// so that the SSCT appears in the audit log for this entry.
|
||||
if data.Request != nil && data.Request.InboundSSCToken != "" && entry.Auth != nil {
|
||||
entry.Auth.ClientToken = data.Request.InboundSSCToken
|
||||
}
|
||||
|
||||
// Hash the entry if we aren't expecting raw output.
|
||||
if !f.config.raw {
|
||||
// Requests and responses have auth and request.
|
||||
err = hashAuth(ctx, f.salter, entry.Auth, f.config.hmacAccessor)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = hashRequest(ctx, f.salter, entry.Request, f.config.hmacAccessor, data.NonHMACReqDataKeys)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if a.Subtype == ResponseType {
|
||||
if err = hashResponse(ctx, f.salter, entry.Response, f.config.hmacAccessor, data.NonHMACRespDataKeys); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return entry, nil
|
||||
}
|
||||
|
|
|
|||
18
audit/entry_formatter_ce.go
Normal file
18
audit/entry_formatter_ce.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
//go:build !enterprise
|
||||
|
||||
package audit
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
func (f *entryFormatter) shouldExclude() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (f *entryFormatter) excludeFields(entry any) (map[string]any, error) {
|
||||
return nil, errors.New("enterprise-only feature: audit exclusion")
|
||||
}
|
||||
37
audit/entry_formatter_ce_test.go
Normal file
37
audit/entry_formatter_ce_test.go
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
//go:build !enterprise
|
||||
|
||||
package audit
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/go-hclog"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// TestEntryFormatter_excludeFields tests that we can exclude data based on the
|
||||
// pre-configured conditions/fields of the EntryFormatter. It covers some scenarios
|
||||
// where we expect errors due to invalid input, which is unlikely to happen in reality.
|
||||
func TestEntryFormatter_excludeFields(t *testing.T) {
|
||||
// Create the formatter node.
|
||||
cfg, err := newFormatterConfig(&testHeaderFormatter{}, nil)
|
||||
require.NoError(t, err)
|
||||
ss := newStaticSalt(t)
|
||||
|
||||
// We intentionally create the EntryFormatter manually, as we wouldn't be
|
||||
// able to set exclusions via NewEntryFormatter WithExclusions option.
|
||||
formatter := &entryFormatter{
|
||||
config: cfg,
|
||||
salter: ss,
|
||||
logger: hclog.NewNullLogger(),
|
||||
name: "juan",
|
||||
}
|
||||
|
||||
res, err := formatter.excludeFields(nil)
|
||||
require.Error(t, err)
|
||||
require.EqualError(t, err, "enterprise-only feature: audit exclusion")
|
||||
require.Nil(t, res)
|
||||
}
|
||||
|
|
@ -12,6 +12,8 @@ import (
|
|||
// formatterConfig is used to provide basic configuration to a formatter.
|
||||
// Use newFormatterConfig to initialize the formatterConfig struct.
|
||||
type formatterConfig struct {
|
||||
formatterConfigEnt
|
||||
|
||||
raw bool
|
||||
hmacAccessor bool
|
||||
|
||||
|
|
@ -40,7 +42,7 @@ type formatterConfig struct {
|
|||
// This should only ever be used in a testing context
|
||||
omitTime bool
|
||||
|
||||
// The required/target format for the event (supported: JSONFormat and JSONxFormat).
|
||||
// The required/target format for the event (supported: jsonFormat and jsonxFormat).
|
||||
requiredFormat format
|
||||
|
||||
// headerFormatter specifies the formatter used for headers that existing in any incoming audit request.
|
||||
|
|
@ -56,14 +58,14 @@ func newFormatterConfig(headerFormatter HeaderFormatter, config map[string]strin
|
|||
return formatterConfig{}, fmt.Errorf("header formatter is required: %w", ErrInvalidParameter)
|
||||
}
|
||||
|
||||
var opt []Option
|
||||
var opt []option
|
||||
|
||||
if format, ok := config[optionFormat]; ok {
|
||||
if !IsValidFormat(format) {
|
||||
if !isValidFormat(format) {
|
||||
return formatterConfig{}, fmt.Errorf("unsupported %q: %w", optionFormat, ErrExternalOptions)
|
||||
}
|
||||
|
||||
opt = append(opt, WithFormat(format))
|
||||
opt = append(opt, withFormat(format))
|
||||
}
|
||||
|
||||
// Check if hashing of accessor is disabled
|
||||
|
|
@ -72,7 +74,7 @@ func newFormatterConfig(headerFormatter HeaderFormatter, config map[string]strin
|
|||
if err != nil {
|
||||
return formatterConfig{}, fmt.Errorf("unable to parse %q: %w", optionHMACAccessor, ErrExternalOptions)
|
||||
}
|
||||
opt = append(opt, WithHMACAccessor(v))
|
||||
opt = append(opt, withHMACAccessor(v))
|
||||
}
|
||||
|
||||
// Check if raw logging is enabled
|
||||
|
|
@ -81,7 +83,7 @@ func newFormatterConfig(headerFormatter HeaderFormatter, config map[string]strin
|
|||
if err != nil {
|
||||
return formatterConfig{}, fmt.Errorf("unable to parse %q: %w", optionLogRaw, ErrExternalOptions)
|
||||
}
|
||||
opt = append(opt, WithRaw(v))
|
||||
opt = append(opt, withRaw(v))
|
||||
}
|
||||
|
||||
if elideListResponsesRaw, ok := config[optionElideListResponses]; ok {
|
||||
|
|
@ -89,11 +91,11 @@ func newFormatterConfig(headerFormatter HeaderFormatter, config map[string]strin
|
|||
if err != nil {
|
||||
return formatterConfig{}, fmt.Errorf("unable to parse %q: %w", optionElideListResponses, ErrExternalOptions)
|
||||
}
|
||||
opt = append(opt, WithElision(v))
|
||||
opt = append(opt, withElision(v))
|
||||
}
|
||||
|
||||
if prefix, ok := config[optionPrefix]; ok {
|
||||
opt = append(opt, WithPrefix(prefix))
|
||||
opt = append(opt, withPrefix(prefix))
|
||||
}
|
||||
|
||||
opts, err := getOpts(opt...)
|
||||
|
|
@ -101,7 +103,13 @@ func newFormatterConfig(headerFormatter HeaderFormatter, config map[string]strin
|
|||
return formatterConfig{}, err
|
||||
}
|
||||
|
||||
fmtCfgEnt, err := newFormatterConfigEnt(config)
|
||||
if err != nil {
|
||||
return formatterConfig{}, err
|
||||
}
|
||||
|
||||
return formatterConfig{
|
||||
formatterConfigEnt: fmtCfgEnt,
|
||||
headerFormatter: headerFormatter,
|
||||
elideListResponses: opts.withElision,
|
||||
hmacAccessor: opts.withHMACAccessor,
|
||||
|
|
|
|||
16
audit/entry_formatter_config_ce.go
Normal file
16
audit/entry_formatter_config_ce.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
//go:build !enterprise
|
||||
|
||||
package audit
|
||||
|
||||
// formatterConfigEnt provides extensions to a formatterConfig which behave differently
|
||||
// for Enterprise and community edition.
|
||||
// NOTE: Use newFormatterConfigEnt to initialize the formatterConfigEnt struct.
|
||||
type formatterConfigEnt struct{}
|
||||
|
||||
// newFormatterConfigEnt should be used to create formatterConfigEnt.
|
||||
func newFormatterConfigEnt(config map[string]string) (formatterConfigEnt, error) {
|
||||
return formatterConfigEnt{}, nil
|
||||
}
|
||||
|
|
@ -15,7 +15,8 @@ import (
|
|||
"github.com/hashicorp/eventlogger"
|
||||
"github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/go-sockaddr"
|
||||
"github.com/hashicorp/vault/helper/namespace"
|
||||
nshelper "github.com/hashicorp/vault/helper/namespace"
|
||||
"github.com/hashicorp/vault/helper/testhelpers/corehelpers"
|
||||
"github.com/hashicorp/vault/internal/observability/event"
|
||||
"github.com/hashicorp/vault/sdk/helper/jsonutil"
|
||||
"github.com/hashicorp/vault/sdk/helper/salt"
|
||||
|
|
@ -131,14 +132,14 @@ func TestNewEntryFormatter(t *testing.T) {
|
|||
Options: map[string]string{
|
||||
"format": "json",
|
||||
},
|
||||
ExpectedFormat: JSONFormat,
|
||||
ExpectedFormat: jsonFormat,
|
||||
},
|
||||
"default": {
|
||||
Name: "juan",
|
||||
UseStaticSalt: true,
|
||||
Logger: hclog.NewNullLogger(),
|
||||
IsErrorExpected: false,
|
||||
ExpectedFormat: JSONFormat,
|
||||
ExpectedFormat: jsonFormat,
|
||||
},
|
||||
"config-json": {
|
||||
Name: "juan",
|
||||
|
|
@ -148,7 +149,7 @@ func TestNewEntryFormatter(t *testing.T) {
|
|||
"format": "json",
|
||||
},
|
||||
IsErrorExpected: false,
|
||||
ExpectedFormat: JSONFormat,
|
||||
ExpectedFormat: jsonFormat,
|
||||
},
|
||||
"config-jsonx": {
|
||||
Name: "juan",
|
||||
|
|
@ -158,7 +159,7 @@ func TestNewEntryFormatter(t *testing.T) {
|
|||
"format": "jsonx",
|
||||
},
|
||||
IsErrorExpected: false,
|
||||
ExpectedFormat: JSONxFormat,
|
||||
ExpectedFormat: jsonxFormat,
|
||||
},
|
||||
"config-json-prefix": {
|
||||
Name: "juan",
|
||||
|
|
@ -169,7 +170,7 @@ func TestNewEntryFormatter(t *testing.T) {
|
|||
"format": "json",
|
||||
},
|
||||
IsErrorExpected: false,
|
||||
ExpectedFormat: JSONFormat,
|
||||
ExpectedFormat: jsonFormat,
|
||||
ExpectedPrefix: "foo",
|
||||
},
|
||||
"config-jsonx-prefix": {
|
||||
|
|
@ -181,7 +182,7 @@ func TestNewEntryFormatter(t *testing.T) {
|
|||
"format": "jsonx",
|
||||
},
|
||||
IsErrorExpected: false,
|
||||
ExpectedFormat: JSONxFormat,
|
||||
ExpectedFormat: jsonxFormat,
|
||||
ExpectedPrefix: "foo",
|
||||
},
|
||||
}
|
||||
|
|
@ -244,7 +245,7 @@ func TestEntryFormatter_Type(t *testing.T) {
|
|||
}
|
||||
|
||||
// TestEntryFormatter_Process attempts to run the Process method to convert the
|
||||
// logical.LogInput within an audit event to JSON and JSONx (RequestEntry or ResponseEntry).
|
||||
// logical.LogInput within an audit event to JSON and JSONx (entry),
|
||||
func TestEntryFormatter_Process(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
|
@ -258,115 +259,134 @@ func TestEntryFormatter_Process(t *testing.T) {
|
|||
}{
|
||||
"json-request-no-data": {
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "cannot audit event (request) with no data: invalid internal parameter",
|
||||
ExpectedErrorMessage: "cannot audit a 'request' event with no data: invalid internal parameter",
|
||||
Subtype: RequestType,
|
||||
RequiredFormat: JSONFormat,
|
||||
RequiredFormat: jsonFormat,
|
||||
Data: nil,
|
||||
},
|
||||
"json-response-no-data": {
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "cannot audit event (response) with no data: invalid internal parameter",
|
||||
ExpectedErrorMessage: "cannot audit a 'response' event with no data: invalid internal parameter",
|
||||
Subtype: ResponseType,
|
||||
RequiredFormat: JSONFormat,
|
||||
RequiredFormat: jsonFormat,
|
||||
Data: nil,
|
||||
},
|
||||
"json-request-basic-input": {
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "unable to parse request from audit event: request to request-audit a nil request",
|
||||
ExpectedErrorMessage: "unable to parse request from 'request' audit event: request cannot be nil",
|
||||
Subtype: RequestType,
|
||||
RequiredFormat: JSONFormat,
|
||||
RequiredFormat: jsonFormat,
|
||||
Data: &logical.LogInput{Type: "magic"},
|
||||
RootNamespace: true,
|
||||
},
|
||||
"json-response-basic-input": {
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "unable to parse response from audit event: request to response-audit a nil request",
|
||||
ExpectedErrorMessage: "unable to parse request from 'response' audit event: request cannot be nil",
|
||||
Subtype: ResponseType,
|
||||
RequiredFormat: JSONFormat,
|
||||
RequiredFormat: jsonFormat,
|
||||
Data: &logical.LogInput{Type: "magic"},
|
||||
},
|
||||
"json-request-basic-input-and-request-no-ns": {
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "unable to parse request from audit event: no namespace",
|
||||
ExpectedErrorMessage: "unable to retrieve namespace from context: no namespace",
|
||||
Subtype: RequestType,
|
||||
RequiredFormat: JSONFormat,
|
||||
RequiredFormat: jsonFormat,
|
||||
Data: &logical.LogInput{Request: &logical.Request{ID: "123"}},
|
||||
},
|
||||
"json-response-basic-input-and-request-no-ns": {
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "unable to parse response from audit event: no namespace",
|
||||
ExpectedErrorMessage: "unable to retrieve namespace from context: no namespace",
|
||||
Subtype: ResponseType,
|
||||
RequiredFormat: JSONFormat,
|
||||
RequiredFormat: jsonFormat,
|
||||
Data: &logical.LogInput{Request: &logical.Request{ID: "123"}},
|
||||
},
|
||||
"json-request-basic-input-and-request-with-ns": {
|
||||
IsErrorExpected: false,
|
||||
Subtype: RequestType,
|
||||
RequiredFormat: JSONFormat,
|
||||
RequiredFormat: jsonFormat,
|
||||
Data: &logical.LogInput{Request: &logical.Request{ID: "123"}},
|
||||
RootNamespace: true,
|
||||
},
|
||||
"json-response-basic-input-and-request-with-ns": {
|
||||
IsErrorExpected: false,
|
||||
Subtype: ResponseType,
|
||||
RequiredFormat: JSONFormat,
|
||||
Data: &logical.LogInput{Request: &logical.Request{ID: "123"}},
|
||||
RootNamespace: true,
|
||||
RequiredFormat: jsonFormat,
|
||||
Data: &logical.LogInput{
|
||||
Request: &logical.Request{ID: "123"},
|
||||
Response: &logical.Response{},
|
||||
},
|
||||
RootNamespace: true,
|
||||
},
|
||||
"jsonx-request-no-data": {
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "cannot audit event (request) with no data: invalid internal parameter",
|
||||
ExpectedErrorMessage: "cannot audit a 'request' event with no data: invalid internal parameter",
|
||||
Subtype: RequestType,
|
||||
RequiredFormat: JSONxFormat,
|
||||
RequiredFormat: jsonxFormat,
|
||||
Data: nil,
|
||||
},
|
||||
"jsonx-response-no-data": {
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "cannot audit event (response) with no data: invalid internal parameter",
|
||||
ExpectedErrorMessage: "cannot audit a 'response' event with no data: invalid internal parameter",
|
||||
Subtype: ResponseType,
|
||||
RequiredFormat: JSONxFormat,
|
||||
RequiredFormat: jsonxFormat,
|
||||
Data: nil,
|
||||
},
|
||||
"jsonx-request-basic-input": {
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "unable to parse request from audit event: request to request-audit a nil request",
|
||||
ExpectedErrorMessage: "unable to parse request from 'request' audit event: request cannot be nil",
|
||||
Subtype: RequestType,
|
||||
RequiredFormat: JSONxFormat,
|
||||
RequiredFormat: jsonxFormat,
|
||||
Data: &logical.LogInput{Type: "magic"},
|
||||
RootNamespace: true,
|
||||
},
|
||||
"jsonx-response-basic-input": {
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "unable to parse response from audit event: request to response-audit a nil request",
|
||||
ExpectedErrorMessage: "unable to parse request from 'response' audit event: request cannot be nil",
|
||||
Subtype: ResponseType,
|
||||
RequiredFormat: JSONxFormat,
|
||||
RequiredFormat: jsonxFormat,
|
||||
Data: &logical.LogInput{Type: "magic"},
|
||||
RootNamespace: true,
|
||||
},
|
||||
"jsonx-request-basic-input-and-request-no-ns": {
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "unable to parse request from audit event: no namespace",
|
||||
ExpectedErrorMessage: "unable to retrieve namespace from context: no namespace",
|
||||
Subtype: RequestType,
|
||||
RequiredFormat: JSONxFormat,
|
||||
RequiredFormat: jsonxFormat,
|
||||
Data: &logical.LogInput{Request: &logical.Request{ID: "123"}},
|
||||
},
|
||||
"jsonx-response-basic-input-and-request-no-ns": {
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "unable to parse response from audit event: no namespace",
|
||||
ExpectedErrorMessage: "unable to retrieve namespace from context: no namespace",
|
||||
Subtype: ResponseType,
|
||||
RequiredFormat: JSONxFormat,
|
||||
RequiredFormat: jsonxFormat,
|
||||
Data: &logical.LogInput{Request: &logical.Request{ID: "123"}},
|
||||
},
|
||||
"jsonx-request-basic-input-and-request-with-ns": {
|
||||
IsErrorExpected: false,
|
||||
Subtype: RequestType,
|
||||
RequiredFormat: JSONxFormat,
|
||||
RequiredFormat: jsonxFormat,
|
||||
Data: &logical.LogInput{Request: &logical.Request{ID: "123"}},
|
||||
RootNamespace: true,
|
||||
},
|
||||
"jsonx-response-basic-input-and-request-with-ns": {
|
||||
IsErrorExpected: false,
|
||||
Subtype: ResponseType,
|
||||
RequiredFormat: JSONxFormat,
|
||||
Data: &logical.LogInput{Request: &logical.Request{ID: "123"}},
|
||||
RootNamespace: true,
|
||||
RequiredFormat: jsonxFormat,
|
||||
Data: &logical.LogInput{
|
||||
Request: &logical.Request{ID: "123"},
|
||||
Response: &logical.Response{},
|
||||
},
|
||||
RootNamespace: true,
|
||||
},
|
||||
"no-request": {
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "unable to parse request from 'response' audit event: request cannot be nil",
|
||||
Subtype: ResponseType,
|
||||
RequiredFormat: jsonxFormat,
|
||||
Data: &logical.LogInput{
|
||||
Auth: &logical.Auth{},
|
||||
},
|
||||
RootNamespace: true,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -382,14 +402,14 @@ func TestEntryFormatter_Process(t *testing.T) {
|
|||
cfg, err := newFormatterConfig(&testHeaderFormatter{}, map[string]string{"format": tc.RequiredFormat.String()})
|
||||
require.NoError(t, err)
|
||||
|
||||
f, err := newEntryFormatter("juan", cfg, ss, hclog.NewNullLogger())
|
||||
f, err := newEntryFormatter("juan", cfg, ss, corehelpers.NewTestLogger(t))
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, f)
|
||||
|
||||
var ctx context.Context
|
||||
switch {
|
||||
case tc.RootNamespace:
|
||||
ctx = namespace.RootContext(context.Background())
|
||||
ctx = nshelper.RootContext(context.Background())
|
||||
default:
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
|
@ -441,7 +461,7 @@ func BenchmarkAuditFileSink_Process(b *testing.B) {
|
|||
},
|
||||
}
|
||||
|
||||
ctx := namespace.RootContext(context.Background())
|
||||
ctx := nshelper.RootContext(context.Background())
|
||||
|
||||
// Create the formatter node.
|
||||
cfg, err := newFormatterConfig(&testHeaderFormatter{}, nil)
|
||||
|
|
@ -452,7 +472,7 @@ func BenchmarkAuditFileSink_Process(b *testing.B) {
|
|||
require.NotNil(b, formatter)
|
||||
|
||||
// Create the sink node.
|
||||
sink, err := event.NewFileSink("/dev/null", JSONFormat.String())
|
||||
sink, err := event.NewFileSink("/dev/null", jsonFormat.String())
|
||||
require.NoError(b, err)
|
||||
require.NotNil(b, sink)
|
||||
|
||||
|
|
@ -475,9 +495,9 @@ func BenchmarkAuditFileSink_Process(b *testing.B) {
|
|||
})
|
||||
}
|
||||
|
||||
// TestEntryFormatter_FormatRequest exercises entryFormatter.formatRequest with
|
||||
// varying inputs.
|
||||
func TestEntryFormatter_FormatRequest(t *testing.T) {
|
||||
// TestEntryFormatter_Process_Request exercises entryFormatter process an event
|
||||
// with varying inputs.
|
||||
func TestEntryFormatter_Process_Request(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
tests := map[string]struct {
|
||||
|
|
@ -490,17 +510,17 @@ func TestEntryFormatter_FormatRequest(t *testing.T) {
|
|||
"nil": {
|
||||
Input: nil,
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "request to request-audit a nil request",
|
||||
ExpectedErrorMessage: "cannot audit a 'request' event with no data: invalid internal parameter",
|
||||
},
|
||||
"basic-input": {
|
||||
Input: &logical.LogInput{},
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "request to request-audit a nil request",
|
||||
ExpectedErrorMessage: "unable to parse request from 'request' audit event: request cannot be nil",
|
||||
},
|
||||
"input-and-request-no-ns": {
|
||||
Input: &logical.LogInput{Request: &logical.Request{ID: "123"}},
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "no namespace",
|
||||
ExpectedErrorMessage: "unable to retrieve namespace from context: no namespace",
|
||||
RootNamespace: false,
|
||||
},
|
||||
"input-and-request-with-ns": {
|
||||
|
|
@ -531,25 +551,46 @@ func TestEntryFormatter_FormatRequest(t *testing.T) {
|
|||
var ctx context.Context
|
||||
switch {
|
||||
case tc.RootNamespace:
|
||||
ctx = namespace.RootContext(context.Background())
|
||||
ctx = nshelper.RootContext(context.Background())
|
||||
default:
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
entry, err := f.formatRequest(ctx, tc.Input, &testTimeProvider{})
|
||||
auditEvent, err := newEvent(RequestType)
|
||||
auditEvent.setTimeProvider(&testTimeProvider{})
|
||||
require.NoError(t, err)
|
||||
auditEvent.Data = tc.Input
|
||||
|
||||
e := &eventlogger.Event{
|
||||
Type: event.AuditType.AsEventType(),
|
||||
CreatedAt: time.Now(),
|
||||
Formatted: make(map[string][]byte),
|
||||
Payload: auditEvent,
|
||||
}
|
||||
|
||||
e2, err := f.Process(ctx, e)
|
||||
switch {
|
||||
case tc.IsErrorExpected:
|
||||
require.Error(t, err)
|
||||
require.EqualError(t, err, tc.ExpectedErrorMessage)
|
||||
require.Nil(t, entry)
|
||||
require.Nil(t, e2)
|
||||
case tc.ShouldOmitTime:
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, entry)
|
||||
require.NotNil(t, e2)
|
||||
b, ok := e2.Format(jsonFormat.String())
|
||||
require.True(t, ok)
|
||||
var entry *entry
|
||||
err = json.Unmarshal(b, &entry)
|
||||
require.NoError(t, err)
|
||||
require.Zero(t, entry.Time)
|
||||
default:
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, entry)
|
||||
require.NotNil(t, e2)
|
||||
b, ok := e2.Format(jsonFormat.String())
|
||||
require.True(t, ok)
|
||||
var entry *entry
|
||||
err = json.Unmarshal(b, &entry)
|
||||
require.NoError(t, err)
|
||||
require.NotZero(t, entry.Time)
|
||||
require.Equal(t, "2024-03-22T10:00:05.00000001Z", entry.Time)
|
||||
}
|
||||
|
|
@ -557,9 +598,9 @@ func TestEntryFormatter_FormatRequest(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TestEntryFormatter_FormatResponse exercises entryFormatter.formatResponse with
|
||||
// varying inputs.
|
||||
func TestEntryFormatter_FormatResponse(t *testing.T) {
|
||||
// TestEntryFormatter_Process_ResponseType exercises entryFormatter
|
||||
// with varying inputs also checking if the time can be omitted.
|
||||
func TestEntryFormatter_Process_ResponseType(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
tests := map[string]struct {
|
||||
|
|
@ -572,26 +613,32 @@ func TestEntryFormatter_FormatResponse(t *testing.T) {
|
|||
"nil": {
|
||||
Input: nil,
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "request to response-audit a nil request",
|
||||
ExpectedErrorMessage: "cannot audit a 'response' event with no data: invalid internal parameter",
|
||||
},
|
||||
"basic-input": {
|
||||
Input: &logical.LogInput{},
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "request to response-audit a nil request",
|
||||
ExpectedErrorMessage: "unable to parse request from 'response' audit event: request cannot be nil",
|
||||
},
|
||||
"input-and-request-no-ns": {
|
||||
Input: &logical.LogInput{Request: &logical.Request{ID: "123"}},
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "no namespace",
|
||||
ExpectedErrorMessage: "unable to retrieve namespace from context: no namespace",
|
||||
RootNamespace: false,
|
||||
},
|
||||
"input-and-request-with-ns": {
|
||||
Input: &logical.LogInput{Request: &logical.Request{ID: "123"}},
|
||||
Input: &logical.LogInput{
|
||||
Request: &logical.Request{ID: "123"},
|
||||
Response: &logical.Response{},
|
||||
},
|
||||
IsErrorExpected: false,
|
||||
RootNamespace: true,
|
||||
},
|
||||
"omit-time": {
|
||||
Input: &logical.LogInput{Request: &logical.Request{ID: "123"}},
|
||||
Input: &logical.LogInput{
|
||||
Request: &logical.Request{ID: "123"},
|
||||
Response: &logical.Response{},
|
||||
},
|
||||
ShouldOmitTime: true,
|
||||
IsErrorExpected: false,
|
||||
RootNamespace: true,
|
||||
|
|
@ -614,25 +661,47 @@ func TestEntryFormatter_FormatResponse(t *testing.T) {
|
|||
var ctx context.Context
|
||||
switch {
|
||||
case tc.RootNamespace:
|
||||
ctx = namespace.RootContext(context.Background())
|
||||
ctx = nshelper.RootContext(context.Background())
|
||||
default:
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
entry, err := f.formatResponse(ctx, tc.Input, &testTimeProvider{})
|
||||
auditEvent, err := newEvent(ResponseType)
|
||||
auditEvent.setTimeProvider(&testTimeProvider{})
|
||||
require.NoError(t, err)
|
||||
auditEvent.Data = tc.Input
|
||||
|
||||
e := &eventlogger.Event{
|
||||
Type: event.AuditType.AsEventType(),
|
||||
CreatedAt: time.Now(),
|
||||
Formatted: make(map[string][]byte),
|
||||
Payload: auditEvent,
|
||||
}
|
||||
|
||||
e2, err := f.Process(ctx, e)
|
||||
|
||||
switch {
|
||||
case tc.IsErrorExpected:
|
||||
require.Error(t, err)
|
||||
require.EqualError(t, err, tc.ExpectedErrorMessage)
|
||||
require.Nil(t, entry)
|
||||
require.Nil(t, e2)
|
||||
case tc.ShouldOmitTime:
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, entry)
|
||||
require.NotNil(t, e2)
|
||||
b, ok := e2.Format(jsonFormat.String())
|
||||
require.True(t, ok)
|
||||
var entry *entry
|
||||
err = json.Unmarshal(b, &entry)
|
||||
require.NoError(t, err)
|
||||
require.Zero(t, entry.Time)
|
||||
default:
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, entry)
|
||||
require.NotNil(t, e2)
|
||||
b, ok := e2.Format(jsonFormat.String())
|
||||
require.True(t, ok)
|
||||
var entry *entry
|
||||
err = json.Unmarshal(b, &entry)
|
||||
require.NoError(t, err)
|
||||
require.NotZero(t, entry.Time)
|
||||
require.Equal(t, "2024-03-22T10:00:05.00000001Z", entry.Time)
|
||||
}
|
||||
|
|
@ -738,7 +807,7 @@ func TestEntryFormatter_Process_JSON(t *testing.T) {
|
|||
|
||||
// Create an audit event and more generic eventlogger.event to allow us
|
||||
// to process (format).
|
||||
auditEvent, err := NewEvent(RequestType)
|
||||
auditEvent, err := newEvent(RequestType)
|
||||
require.NoError(t, err)
|
||||
auditEvent.Data = in
|
||||
|
||||
|
|
@ -749,10 +818,10 @@ func TestEntryFormatter_Process_JSON(t *testing.T) {
|
|||
Payload: auditEvent,
|
||||
}
|
||||
|
||||
e2, err := formatter.Process(namespace.RootContext(nil), e)
|
||||
e2, err := formatter.Process(nshelper.RootContext(nil), e)
|
||||
require.NoErrorf(t, err, "bad: %s\nerr: %s", name, err)
|
||||
|
||||
jsonBytes, ok := e2.Format(JSONFormat.String())
|
||||
jsonBytes, ok := e2.Format(jsonFormat.String())
|
||||
require.True(t, ok)
|
||||
require.Positive(t, len(jsonBytes))
|
||||
|
||||
|
|
@ -760,14 +829,14 @@ func TestEntryFormatter_Process_JSON(t *testing.T) {
|
|||
t.Fatalf("no prefix: %s \n log: %s\nprefix: %s", name, expectedResultStr, tc.Prefix)
|
||||
}
|
||||
|
||||
expectedJSON := new(RequestEntry)
|
||||
expectedJSON := new(entry)
|
||||
|
||||
if err := jsonutil.DecodeJSON([]byte(expectedResultStr), &expectedJSON); err != nil {
|
||||
t.Fatalf("bad json: %s", err)
|
||||
}
|
||||
expectedJSON.Request.Namespace = &Namespace{ID: "root"}
|
||||
expectedJSON.Request.Namespace = &namespace{ID: "root"}
|
||||
|
||||
actualJSON := new(RequestEntry)
|
||||
actualJSON := new(entry)
|
||||
if err := jsonutil.DecodeJSON(jsonBytes[len(tc.Prefix):], &actualJSON); err != nil {
|
||||
t.Fatalf("bad json: %s", err)
|
||||
}
|
||||
|
|
@ -903,7 +972,7 @@ func TestEntryFormatter_Process_JSONx(t *testing.T) {
|
|||
|
||||
// Create an audit event and more generic eventlogger.event to allow us
|
||||
// to process (format).
|
||||
auditEvent, err := NewEvent(RequestType)
|
||||
auditEvent, err := newEvent(RequestType)
|
||||
require.NoError(t, err)
|
||||
auditEvent.Data = in
|
||||
|
||||
|
|
@ -914,10 +983,10 @@ func TestEntryFormatter_Process_JSONx(t *testing.T) {
|
|||
Payload: auditEvent,
|
||||
}
|
||||
|
||||
e2, err := formatter.Process(namespace.RootContext(nil), e)
|
||||
e2, err := formatter.Process(nshelper.RootContext(nil), e)
|
||||
require.NoErrorf(t, err, "bad: %s\nerr: %s", name, err)
|
||||
|
||||
jsonxBytes, ok := e2.Format(JSONxFormat.String())
|
||||
jsonxBytes, ok := e2.Format(jsonxFormat.String())
|
||||
require.True(t, ok)
|
||||
require.Positive(t, len(jsonxBytes))
|
||||
|
||||
|
|
@ -933,9 +1002,9 @@ func TestEntryFormatter_Process_JSONx(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TestEntryFormatter_FormatResponse_ElideListResponses ensures that we correctly
|
||||
// elide data in responses to LIST operations.
|
||||
func TestEntryFormatter_FormatResponse_ElideListResponses(t *testing.T) {
|
||||
// TestEntryFormatter_ElideListResponses ensures that we correctly elide data in
|
||||
// responses to LIST operations.
|
||||
func TestEntryFormatter_ElideListResponses(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
tests := map[string]struct {
|
||||
|
|
@ -1002,11 +1071,11 @@ func TestEntryFormatter_FormatResponse_ElideListResponses(t *testing.T) {
|
|||
oneInterestingTestCase := tests["Enhanced list (has key_info)"]
|
||||
|
||||
ss := newStaticSalt(t)
|
||||
ctx := namespace.RootContext(context.Background())
|
||||
ctx := nshelper.RootContext(context.Background())
|
||||
var formatter *entryFormatter
|
||||
var err error
|
||||
|
||||
format := func(t *testing.T, config formatterConfig, operation logical.Operation, inputData map[string]any) *ResponseEntry {
|
||||
format := func(t *testing.T, config formatterConfig, operation logical.Operation, inputData map[string]any) *entry {
|
||||
formatter, err = newEntryFormatter("juan", config, ss, hclog.NewNullLogger())
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, formatter)
|
||||
|
|
@ -1016,10 +1085,15 @@ func TestEntryFormatter_FormatResponse_ElideListResponses(t *testing.T) {
|
|||
Response: &logical.Response{Data: inputData},
|
||||
}
|
||||
|
||||
resp, err := formatter.formatResponse(ctx, in, &testTimeProvider{})
|
||||
auditEvent, err := newEvent(ResponseType)
|
||||
require.NoError(t, err)
|
||||
auditEvent.Data = in
|
||||
|
||||
return resp
|
||||
entry, err := formatter.createEntry(ctx, auditEvent)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, entry)
|
||||
|
||||
return entry
|
||||
}
|
||||
|
||||
t.Run("Default case", func(t *testing.T) {
|
||||
|
|
@ -1040,7 +1114,8 @@ func TestEntryFormatter_FormatResponse_ElideListResponses(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
tc := oneInterestingTestCase
|
||||
entry := format(t, config, logical.ReadOperation, tc.inputData)
|
||||
assert.Equal(t, formatter.hashExpectedValueForComparison(tc.inputData), entry.Response.Data)
|
||||
hashedExpected := formatter.hashExpectedValueForComparison(tc.inputData)
|
||||
assert.Equal(t, hashedExpected, entry.Response.Data)
|
||||
})
|
||||
|
||||
t.Run("When elideListResponses is false, eliding does not happen", func(t *testing.T) {
|
||||
|
|
@ -1107,23 +1182,12 @@ func TestEntryFormatter_Process_NoMutation(t *testing.T) {
|
|||
|
||||
e := fakeEvent(t, RequestType, in)
|
||||
|
||||
e2, err := formatter.Process(namespace.RootContext(nil), e)
|
||||
e2, err := formatter.Process(nshelper.RootContext(nil), e)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, e2)
|
||||
|
||||
// Ensure the pointers are different.
|
||||
require.NotEqual(t, e2, e)
|
||||
|
||||
// Do the same for the audit event in the payload.
|
||||
a, ok := e.Payload.(*AuditEvent)
|
||||
require.True(t, ok)
|
||||
require.NotNil(t, a)
|
||||
|
||||
a2, ok := e2.Payload.(*AuditEvent)
|
||||
require.True(t, ok)
|
||||
require.NotNil(t, a2)
|
||||
|
||||
require.NotEqual(t, a2, a)
|
||||
}
|
||||
|
||||
// TestEntryFormatter_Process_Panic tries to send data into the entryFormatter
|
||||
|
|
@ -1170,6 +1234,7 @@ func TestEntryFormatter_Process_Panic(t *testing.T) {
|
|||
Data: map[string]interface{}{},
|
||||
},
|
||||
Response: &logical.Response{
|
||||
Auth: &logical.Auth{},
|
||||
Data: map[string]any{
|
||||
"token_bound_cidrs": []*sockaddr.SockAddrMarshaler{
|
||||
{SockAddr: badAddr},
|
||||
|
|
@ -1180,7 +1245,7 @@ func TestEntryFormatter_Process_Panic(t *testing.T) {
|
|||
|
||||
e := fakeEvent(t, ResponseType, in)
|
||||
|
||||
e2, err := formatter.Process(namespace.RootContext(nil), e)
|
||||
e2, err := formatter.Process(nshelper.RootContext(nil), e)
|
||||
require.Error(t, err)
|
||||
require.Contains(t, err.Error(), "panic generating audit log: \"juan\"")
|
||||
require.Nil(t, e2)
|
||||
|
|
@ -1217,13 +1282,13 @@ func TestEntryFormatter_Process_NeverLeaksHeaders(t *testing.T) {
|
|||
e := fakeEvent(t, RequestType, input)
|
||||
|
||||
// Process the node.
|
||||
ctx := namespace.RootContext(context.Background())
|
||||
ctx := nshelper.RootContext(context.Background())
|
||||
e2, err := formatter.Process(ctx, e)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, e2)
|
||||
|
||||
// Now check we can retrieve the formatted JSON.
|
||||
jsonFormatted, b2 := e2.Format(JSONFormat.String())
|
||||
jsonFormatted, b2 := e2.Format(jsonFormat.String())
|
||||
require.True(t, b2)
|
||||
require.NotNil(t, jsonFormatted)
|
||||
var input2 *logical.LogInput
|
||||
|
|
@ -1263,9 +1328,9 @@ func fakeEvent(tb testing.TB, subtype subtype, input *logical.LogInput) *eventlo
|
|||
|
||||
date := time.Date(2023, time.July, 11, 15, 49, 10, 0o0, time.Local)
|
||||
|
||||
auditEvent, err := NewEvent(subtype,
|
||||
WithID("123"),
|
||||
WithNow(date),
|
||||
auditEvent, err := newEvent(subtype,
|
||||
withID("123"),
|
||||
withNow(date),
|
||||
)
|
||||
require.NoError(tb, err)
|
||||
require.NotNil(tb, auditEvent)
|
||||
|
|
@ -1275,6 +1340,7 @@ func fakeEvent(tb testing.TB, subtype subtype, input *logical.LogInput) *eventlo
|
|||
require.Equal(tb, date, auditEvent.Timestamp)
|
||||
|
||||
auditEvent.Data = input
|
||||
auditEvent.setTimeProvider(&testTimeProvider{})
|
||||
|
||||
e := &eventlogger.Event{
|
||||
Type: eventlogger.EventType(event.AuditType),
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ var (
|
|||
ErrExternalOptions = errors.New("invalid configuration")
|
||||
)
|
||||
|
||||
// ConvertToExternalError handles converting an error that was generated in Vault
|
||||
// and should appear as-is in the server logs, to an error that can be returned to
|
||||
// calling clients (via the API/CLI).
|
||||
// ConvertToExternalError handles converting an audit related error that was generated
|
||||
// in Vault and should appear as-is in the server logs, to an error that can be
|
||||
// returned to calling clients (via the API/CLI).
|
||||
func ConvertToExternalError(err error) error {
|
||||
// If the error is an internal error, the contents will have been logged, and
|
||||
// we should probably shield the caller from the details.
|
||||
|
|
|
|||
|
|
@ -23,20 +23,37 @@ const (
|
|||
|
||||
// Audit formats.
|
||||
const (
|
||||
JSONFormat format = "json"
|
||||
JSONxFormat format = "jsonx"
|
||||
jsonFormat format = "json"
|
||||
jsonxFormat format = "jsonx"
|
||||
)
|
||||
|
||||
// Check AuditEvent implements the timeProvider at compile time.
|
||||
var _ timeProvider = (*AuditEvent)(nil)
|
||||
var _ timeProvider = (*Event)(nil)
|
||||
|
||||
// AuditEvent is the audit event.
|
||||
type AuditEvent struct {
|
||||
// Event is the audit event.
|
||||
type Event struct {
|
||||
ID string `json:"id"`
|
||||
Version string `json:"version"`
|
||||
Subtype subtype `json:"subtype"` // the subtype of the audit event.
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
Data *logical.LogInput `json:"data"`
|
||||
prov timeProvider
|
||||
}
|
||||
|
||||
// setTimeProvider can be used to set a specific time provider which is used when
|
||||
// creating an entry.
|
||||
// NOTE: This is primarily used for testing to supply a known time value.
|
||||
func (a *Event) setTimeProvider(t timeProvider) {
|
||||
a.prov = t
|
||||
}
|
||||
|
||||
// timeProvider returns a configured time provider, or the default if not set.
|
||||
func (a *Event) timeProvider() timeProvider {
|
||||
if a.prov == nil {
|
||||
return a
|
||||
}
|
||||
|
||||
return a.prov
|
||||
}
|
||||
|
||||
// format defines types of format audit events support.
|
||||
|
|
@ -45,10 +62,10 @@ type format string
|
|||
// subtype defines the type of audit event.
|
||||
type subtype string
|
||||
|
||||
// NewEvent should be used to create an audit event. The subtype field is needed
|
||||
// newEvent should be used to create an audit event. The subtype field is needed
|
||||
// for audit events. It will generate an ID if no ID is supplied. Supported
|
||||
// options: WithID, WithNow.
|
||||
func NewEvent(s subtype, opt ...Option) (*AuditEvent, error) {
|
||||
// options: withID, withNow.
|
||||
func newEvent(s subtype, opt ...option) (*Event, error) {
|
||||
// Get the default options
|
||||
opts, err := getOpts(opt...)
|
||||
if err != nil {
|
||||
|
|
@ -64,7 +81,7 @@ func NewEvent(s subtype, opt ...Option) (*AuditEvent, error) {
|
|||
}
|
||||
}
|
||||
|
||||
audit := &AuditEvent{
|
||||
audit := &Event{
|
||||
ID: opts.withID,
|
||||
Timestamp: opts.withNow,
|
||||
Version: version,
|
||||
|
|
@ -78,7 +95,7 @@ func NewEvent(s subtype, opt ...Option) (*AuditEvent, error) {
|
|||
}
|
||||
|
||||
// validate attempts to ensure the audit event in its present state is valid.
|
||||
func (a *AuditEvent) validate() error {
|
||||
func (a *Event) validate() error {
|
||||
if a == nil {
|
||||
return fmt.Errorf("event is nil: %w", ErrInvalidParameter)
|
||||
}
|
||||
|
|
@ -116,7 +133,7 @@ func (t subtype) validate() error {
|
|||
// validate ensures that format is one of the set of allowed event formats.
|
||||
func (f format) validate() error {
|
||||
switch f {
|
||||
case JSONFormat, JSONxFormat:
|
||||
case jsonFormat, jsonxFormat:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("invalid format %q: %w", f, ErrInvalidParameter)
|
||||
|
|
@ -155,13 +172,13 @@ func (t subtype) String() string {
|
|||
|
||||
// formattedTime returns the UTC time the AuditEvent was created in the RFC3339Nano
|
||||
// format (which removes trailing zeros from the seconds field).
|
||||
func (a *AuditEvent) formattedTime() string {
|
||||
func (a *Event) formattedTime() string {
|
||||
return a.Timestamp.UTC().Format(time.RFC3339Nano)
|
||||
}
|
||||
|
||||
// IsValidFormat provides a means to validate whether the supplied format is valid.
|
||||
// isValidFormat provides a means to validate whether the supplied format is valid.
|
||||
// Examples of valid formats are JSON and JSONx.
|
||||
func IsValidFormat(v string) bool {
|
||||
func isValidFormat(v string) bool {
|
||||
err := format(strings.TrimSpace(strings.ToLower(v))).validate()
|
||||
return err == nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ func TestAuditEvent_new(t *testing.T) {
|
|||
t.Parallel()
|
||||
|
||||
tests := map[string]struct {
|
||||
Options []Option
|
||||
Options []option
|
||||
Subtype subtype
|
||||
Format format
|
||||
IsErrorExpected bool
|
||||
|
|
@ -33,47 +33,47 @@ func TestAuditEvent_new(t *testing.T) {
|
|||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "invalid event subtype \"\": invalid internal parameter",
|
||||
},
|
||||
"empty-Option": {
|
||||
Options: []Option{},
|
||||
"empty-option": {
|
||||
Options: []option{},
|
||||
Subtype: subtype(""),
|
||||
Format: format(""),
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "invalid event subtype \"\": invalid internal parameter",
|
||||
},
|
||||
"bad-id": {
|
||||
Options: []Option{WithID("")},
|
||||
Options: []option{withID("")},
|
||||
Subtype: ResponseType,
|
||||
Format: JSONFormat,
|
||||
Format: jsonFormat,
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "id cannot be empty",
|
||||
},
|
||||
"good": {
|
||||
Options: []Option{
|
||||
WithID("audit_123"),
|
||||
WithFormat(string(JSONFormat)),
|
||||
WithSubtype(string(ResponseType)),
|
||||
WithNow(time.Date(2023, time.July, 4, 12, 3, 0, 0, time.Local)),
|
||||
Options: []option{
|
||||
withID("audit_123"),
|
||||
withFormat(string(jsonFormat)),
|
||||
withSubtype(string(ResponseType)),
|
||||
withNow(time.Date(2023, time.July, 4, 12, 3, 0, 0, time.Local)),
|
||||
},
|
||||
Subtype: RequestType,
|
||||
Format: JSONxFormat,
|
||||
Format: jsonxFormat,
|
||||
IsErrorExpected: false,
|
||||
ExpectedID: "audit_123",
|
||||
ExpectedTimestamp: time.Date(2023, time.July, 4, 12, 3, 0, 0, time.Local),
|
||||
ExpectedSubtype: RequestType,
|
||||
ExpectedFormat: JSONxFormat,
|
||||
ExpectedFormat: jsonxFormat,
|
||||
},
|
||||
"good-no-time": {
|
||||
Options: []Option{
|
||||
WithID("audit_123"),
|
||||
WithFormat(string(JSONFormat)),
|
||||
WithSubtype(string(ResponseType)),
|
||||
Options: []option{
|
||||
withID("audit_123"),
|
||||
withFormat(string(jsonFormat)),
|
||||
withSubtype(string(ResponseType)),
|
||||
},
|
||||
Subtype: RequestType,
|
||||
Format: JSONxFormat,
|
||||
Format: jsonxFormat,
|
||||
IsErrorExpected: false,
|
||||
ExpectedID: "audit_123",
|
||||
ExpectedSubtype: RequestType,
|
||||
ExpectedFormat: JSONxFormat,
|
||||
ExpectedFormat: jsonxFormat,
|
||||
IsNowExpected: true,
|
||||
},
|
||||
}
|
||||
|
|
@ -84,7 +84,7 @@ func TestAuditEvent_new(t *testing.T) {
|
|||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
audit, err := NewEvent(tc.Subtype, tc.Options...)
|
||||
audit, err := newEvent(tc.Subtype, tc.Options...)
|
||||
switch {
|
||||
case tc.IsErrorExpected:
|
||||
require.Error(t, err)
|
||||
|
|
@ -112,7 +112,7 @@ func TestAuditEvent_Validate(t *testing.T) {
|
|||
t.Parallel()
|
||||
|
||||
tests := map[string]struct {
|
||||
Value *AuditEvent
|
||||
Value *Event
|
||||
IsErrorExpected bool
|
||||
ExpectedErrorMessage string
|
||||
}{
|
||||
|
|
@ -122,12 +122,12 @@ func TestAuditEvent_Validate(t *testing.T) {
|
|||
ExpectedErrorMessage: "event is nil: invalid internal parameter",
|
||||
},
|
||||
"default": {
|
||||
Value: &AuditEvent{},
|
||||
Value: &Event{},
|
||||
IsErrorExpected: true,
|
||||
ExpectedErrorMessage: "missing ID: invalid internal parameter",
|
||||
},
|
||||
"id-empty": {
|
||||
Value: &AuditEvent{
|
||||
Value: &Event{
|
||||
ID: "",
|
||||
Version: version,
|
||||
Subtype: RequestType,
|
||||
|
|
@ -138,7 +138,7 @@ func TestAuditEvent_Validate(t *testing.T) {
|
|||
ExpectedErrorMessage: "missing ID: invalid internal parameter",
|
||||
},
|
||||
"version-fiddled": {
|
||||
Value: &AuditEvent{
|
||||
Value: &Event{
|
||||
ID: "audit_123",
|
||||
Version: "magic-v2",
|
||||
Subtype: RequestType,
|
||||
|
|
@ -149,7 +149,7 @@ func TestAuditEvent_Validate(t *testing.T) {
|
|||
ExpectedErrorMessage: "event version unsupported: invalid internal parameter",
|
||||
},
|
||||
"subtype-fiddled": {
|
||||
Value: &AuditEvent{
|
||||
Value: &Event{
|
||||
ID: "audit_123",
|
||||
Version: version,
|
||||
Subtype: subtype("moon"),
|
||||
|
|
@ -160,7 +160,7 @@ func TestAuditEvent_Validate(t *testing.T) {
|
|||
ExpectedErrorMessage: "invalid event subtype \"moon\": invalid internal parameter",
|
||||
},
|
||||
"default-time": {
|
||||
Value: &AuditEvent{
|
||||
Value: &Event{
|
||||
ID: "audit_123",
|
||||
Version: version,
|
||||
Subtype: ResponseType,
|
||||
|
|
@ -171,7 +171,7 @@ func TestAuditEvent_Validate(t *testing.T) {
|
|||
ExpectedErrorMessage: "event timestamp cannot be the zero time instant: invalid internal parameter",
|
||||
},
|
||||
"valid": {
|
||||
Value: &AuditEvent{
|
||||
Value: &Event{
|
||||
ID: "audit_123",
|
||||
Version: version,
|
||||
Subtype: ResponseType,
|
||||
|
|
@ -373,7 +373,7 @@ func TestAuditEvent_Subtype_String(t *testing.T) {
|
|||
// method returns the correct format.
|
||||
func TestAuditEvent_formattedTime(t *testing.T) {
|
||||
theTime := time.Date(2024, time.March, 22, 10, 0o0, 5, 10, time.UTC)
|
||||
a, err := NewEvent(ResponseType, WithNow(theTime))
|
||||
a, err := newEvent(ResponseType, withNow(theTime))
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, a)
|
||||
require.Equal(t, "2024-03-22T10:00:05.00000001Z", a.formattedTime())
|
||||
|
|
@ -439,7 +439,7 @@ func TestEvent_IsValidFormat(t *testing.T) {
|
|||
tc := tc
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
res := IsValidFormat(tc.input)
|
||||
res := isValidFormat(tc.input)
|
||||
require.Equal(t, tc.expected, res)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,14 +11,12 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/hashicorp/go-secure-stdlib/strutil"
|
||||
"github.com/hashicorp/vault/sdk/helper/wrapping"
|
||||
"github.com/hashicorp/vault/sdk/logical"
|
||||
"github.com/mitchellh/copystructure"
|
||||
"github.com/mitchellh/reflectwalk"
|
||||
)
|
||||
|
||||
// HashString hashes the given opaque string and returns it
|
||||
func HashString(ctx context.Context, salter Salter, data string) (string, error) {
|
||||
// hashString uses the Salter to hash the supplied opaque string and returns it.
|
||||
func hashString(ctx context.Context, salter Salter, data string) (string, error) {
|
||||
salt, err := salter.Salt(ctx)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
@ -27,79 +25,68 @@ func HashString(ctx context.Context, salter Salter, data string) (string, error)
|
|||
return salt.GetIdentifiedHMAC(data), nil
|
||||
}
|
||||
|
||||
// HashAuth returns a hashed copy of the logical.Auth input.
|
||||
func HashAuth(ctx context.Context, salter Salter, in *logical.Auth, HMACAccessor bool) (*logical.Auth, error) {
|
||||
if in == nil {
|
||||
return nil, nil
|
||||
// hashAuth uses the Salter to hash the supplied auth (modifying it).
|
||||
// hmacAccessor is used to indicate whether the accessor should also be HMAC'd
|
||||
// when present.
|
||||
func hashAuth(ctx context.Context, salter Salter, auth *auth, hmacAccessor bool) error {
|
||||
if auth == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
salt, err := salter.Salt(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
|
||||
fn := salt.GetIdentifiedHMAC
|
||||
auth := *in
|
||||
|
||||
if auth.ClientToken != "" {
|
||||
auth.ClientToken = fn(auth.ClientToken)
|
||||
}
|
||||
if HMACAccessor && auth.Accessor != "" {
|
||||
if hmacAccessor && auth.Accessor != "" {
|
||||
auth.Accessor = fn(auth.Accessor)
|
||||
}
|
||||
return &auth, nil
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// HashRequest returns a hashed copy of the logical.Request input.
|
||||
func HashRequest(ctx context.Context, salter Salter, in *logical.Request, HMACAccessor bool, nonHMACDataKeys []string) (*logical.Request, error) {
|
||||
if in == nil {
|
||||
return nil, nil
|
||||
// hashRequest uses the Salter to hash the supplied request (modifying it).
|
||||
// nonHMACDataKeys is used when hashing any 'Data' field within the request which
|
||||
// prevents those specific keys from HMAC'd.
|
||||
// hmacAccessor is used to indicate whether some accessors should also be HMAC'd
|
||||
// when present.
|
||||
// nonHMACDataKeys is used when hashing any 'Data' field within the request which
|
||||
// prevents those specific keys from HMAC'd.
|
||||
func hashRequest(ctx context.Context, salter Salter, req *request, hmacAccessor bool, nonHMACDataKeys []string) error {
|
||||
if req == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
salt, err := salter.Salt(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
|
||||
fn := salt.GetIdentifiedHMAC
|
||||
req := *in
|
||||
|
||||
if req.Auth != nil {
|
||||
cp, err := copystructure.Copy(req.Auth)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req.Auth, err = HashAuth(ctx, salter, cp.(*logical.Auth), HMACAccessor)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if req.ClientToken != "" {
|
||||
req.ClientToken = fn(req.ClientToken)
|
||||
}
|
||||
if HMACAccessor && req.ClientTokenAccessor != "" {
|
||||
if hmacAccessor && req.ClientTokenAccessor != "" {
|
||||
req.ClientTokenAccessor = fn(req.ClientTokenAccessor)
|
||||
}
|
||||
|
||||
if req.Data != nil {
|
||||
copy, err := copystructure.Copy(req.Data)
|
||||
err = hashMap(fn, req.Data, nonHMACDataKeys)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
|
||||
err = hashMap(fn, copy.(map[string]interface{}), nonHMACDataKeys)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req.Data = copy.(map[string]interface{})
|
||||
}
|
||||
|
||||
return &req, nil
|
||||
return nil
|
||||
}
|
||||
|
||||
func hashMap(hashFunc HashCallback, data map[string]interface{}, nonHMACDataKeys []string) error {
|
||||
func hashMap(hashFunc hashCallback, data map[string]interface{}, nonHMACDataKeys []string) error {
|
||||
for k, v := range data {
|
||||
if o, ok := v.(logical.OptMarshaler); ok {
|
||||
marshaled, err := o.MarshalJSONWithOptions(&logical.MarshalOptions{
|
||||
|
|
@ -112,104 +99,82 @@ func hashMap(hashFunc HashCallback, data map[string]interface{}, nonHMACDataKeys
|
|||
}
|
||||
}
|
||||
|
||||
return HashStructure(data, hashFunc, nonHMACDataKeys)
|
||||
return hashStructure(data, hashFunc, nonHMACDataKeys)
|
||||
}
|
||||
|
||||
// HashResponse returns a hashed copy of the logical.Request input.
|
||||
func HashResponse(ctx context.Context, salter Salter, in *logical.Response, HMACAccessor bool, nonHMACDataKeys []string, elideListResponseData bool) (*logical.Response, error) {
|
||||
if in == nil {
|
||||
return nil, nil
|
||||
// hashResponse uses the Salter to hash the supplied response (modifying it).
|
||||
// hmacAccessor is used to indicate whether some accessors should also be HMAC'd
|
||||
// when present.
|
||||
// nonHMACDataKeys is used when hashing any 'Data' field within the response which
|
||||
// prevents those specific keys from HMAC'd.
|
||||
// See: /vault/docs/audit#eliding-list-response-bodies
|
||||
func hashResponse(ctx context.Context, salter Salter, resp *response, hmacAccessor bool, nonHMACDataKeys []string) error {
|
||||
if resp == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
salt, err := salter.Salt(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
|
||||
fn := salt.GetIdentifiedHMAC
|
||||
resp := *in
|
||||
|
||||
if resp.Auth != nil {
|
||||
cp, err := copystructure.Copy(resp.Auth)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
resp.Auth, err = HashAuth(ctx, salter, cp.(*logical.Auth), HMACAccessor)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if resp.Data != nil {
|
||||
copy, err := copystructure.Copy(resp.Data)
|
||||
if b, ok := resp.Data[logical.HTTPRawBody].([]byte); ok {
|
||||
resp.Data[logical.HTTPRawBody] = string(b)
|
||||
}
|
||||
|
||||
err = hashMap(fn, resp.Data, nonHMACDataKeys)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
|
||||
mapCopy := copy.(map[string]interface{})
|
||||
if b, ok := mapCopy[logical.HTTPRawBody].([]byte); ok {
|
||||
mapCopy[logical.HTTPRawBody] = string(b)
|
||||
}
|
||||
|
||||
// Processing list response data elision takes place at this point in the code for performance reasons:
|
||||
// - take advantage of the deep copy of resp.Data that was going to be done anyway for hashing
|
||||
// - but elide data before potentially spending time hashing it
|
||||
if elideListResponseData {
|
||||
doElideListResponseData(mapCopy)
|
||||
}
|
||||
|
||||
err = hashMap(fn, mapCopy, nonHMACDataKeys)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.Data = mapCopy
|
||||
}
|
||||
|
||||
if resp.WrapInfo != nil {
|
||||
var err error
|
||||
resp.WrapInfo, err = hashWrapInfo(fn, resp.WrapInfo, HMACAccessor)
|
||||
err = hashWrapInfo(fn, resp.WrapInfo, hmacAccessor)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return &resp, nil
|
||||
return nil
|
||||
}
|
||||
|
||||
// hashWrapInfo returns a hashed copy of the wrapping.ResponseWrapInfo input.
|
||||
func hashWrapInfo(hashFunc HashCallback, in *wrapping.ResponseWrapInfo, HMACAccessor bool) (*wrapping.ResponseWrapInfo, error) {
|
||||
if in == nil {
|
||||
return nil, nil
|
||||
// hashWrapInfo uses the supplied hashing function to hash responseWrapInfo (modifying it).
|
||||
// hmacAccessor is used to indicate whether some accessors should also be HMAC'd
|
||||
// when present.
|
||||
func hashWrapInfo(hashFunc hashCallback, wrapInfo *responseWrapInfo, hmacAccessor bool) error {
|
||||
if wrapInfo == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
wrapinfo := *in
|
||||
wrapInfo.Token = hashFunc(wrapInfo.Token)
|
||||
|
||||
wrapinfo.Token = hashFunc(wrapinfo.Token)
|
||||
if hmacAccessor {
|
||||
wrapInfo.Accessor = hashFunc(wrapInfo.Accessor)
|
||||
|
||||
if HMACAccessor {
|
||||
wrapinfo.Accessor = hashFunc(wrapinfo.Accessor)
|
||||
|
||||
if wrapinfo.WrappedAccessor != "" {
|
||||
wrapinfo.WrappedAccessor = hashFunc(wrapinfo.WrappedAccessor)
|
||||
if wrapInfo.WrappedAccessor != "" {
|
||||
wrapInfo.WrappedAccessor = hashFunc(wrapInfo.WrappedAccessor)
|
||||
}
|
||||
}
|
||||
|
||||
return &wrapinfo, nil
|
||||
return nil
|
||||
}
|
||||
|
||||
// HashStructure takes an interface and hashes all the values within
|
||||
// hashStructure takes an interface and hashes all the values within
|
||||
// the structure. Only _values_ are hashed: keys of objects are not.
|
||||
//
|
||||
// For the HashCallback, see the built-in HashCallbacks below.
|
||||
func HashStructure(s interface{}, cb HashCallback, ignoredKeys []string) error {
|
||||
// For the hashCallback, see the built-in HashCallbacks below.
|
||||
func hashStructure(s interface{}, cb hashCallback, ignoredKeys []string) error {
|
||||
walker := &hashWalker{Callback: cb, IgnoredKeys: ignoredKeys}
|
||||
return reflectwalk.Walk(s, walker)
|
||||
}
|
||||
|
||||
// HashCallback is the callback called for HashStructure to hash
|
||||
// hashCallback is the callback called for hashStructure to hash
|
||||
// a value.
|
||||
type HashCallback func(string) string
|
||||
type hashCallback func(string) string
|
||||
|
||||
// hashWalker implements interfaces for the reflectwalk package
|
||||
// (github.com/mitchellh/reflectwalk) that can be used to automatically
|
||||
|
|
@ -218,21 +183,27 @@ type hashWalker struct {
|
|||
// Callback is the function to call with the primitive that is
|
||||
// to be hashed. If there is an error, walking will be halted
|
||||
// immediately and the error returned.
|
||||
Callback HashCallback
|
||||
// IgnoreKeys are the keys that wont have the HashCallback applied
|
||||
Callback hashCallback
|
||||
|
||||
// IgnoreKeys are the keys that won't have the hashCallback applied
|
||||
IgnoredKeys []string
|
||||
|
||||
// MapElem appends the key itself (not the reflect.Value) to key.
|
||||
// The last element in key is the most recently entered map key.
|
||||
// Since Exit pops the last element of key, only nesting to another
|
||||
// structure increases the size of this slice.
|
||||
key []string
|
||||
key []string
|
||||
|
||||
lastValue reflect.Value
|
||||
|
||||
// Enter appends to loc and exit pops loc. The last element of loc is thus
|
||||
// the current location.
|
||||
loc []reflectwalk.Location
|
||||
|
||||
// Map and Slice append to cs, Exit pops the last element off cs.
|
||||
// The last element in cs is the most recently entered map or slice.
|
||||
cs []reflect.Value
|
||||
|
||||
// MapElem and SliceElem append to csKey. The last element in csKey is the
|
||||
// most recently entered map key or slice index. Since Exit pops the last
|
||||
// element of csKey, only nesting to another structure increases the size of
|
||||
|
|
|
|||
|
|
@ -7,17 +7,17 @@ import (
|
|||
"context"
|
||||
"crypto/sha256"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/go-test/deep"
|
||||
nshelper "github.com/hashicorp/vault/helper/namespace"
|
||||
"github.com/hashicorp/vault/sdk/helper/certutil"
|
||||
"github.com/hashicorp/vault/sdk/helper/salt"
|
||||
"github.com/hashicorp/vault/sdk/helper/wrapping"
|
||||
"github.com/hashicorp/vault/sdk/logical"
|
||||
"github.com/mitchellh/copystructure"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestCopy_auth(t *testing.T) {
|
||||
|
|
@ -97,18 +97,21 @@ func TestCopy_response(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TestSalter is a structure that implements the Salter interface in a trivial
|
||||
// testSalter is a structure that implements the Salter interface in a trivial
|
||||
// manner.
|
||||
type TestSalter struct{}
|
||||
type testSalter struct{}
|
||||
|
||||
// Salt returns a salt.Salt pointer based on dummy data stored in an in-memory
|
||||
// storage instance.
|
||||
func (*TestSalter) Salt(ctx context.Context) (*salt.Salt, error) {
|
||||
func (*testSalter) Salt(ctx context.Context) (*salt.Salt, error) {
|
||||
inmemStorage := &logical.InmemStorage{}
|
||||
inmemStorage.Put(context.Background(), &logical.StorageEntry{
|
||||
err := inmemStorage.Put(context.Background(), &logical.StorageEntry{
|
||||
Key: "salt",
|
||||
Value: []byte("foo"),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return salt.NewSalt(context.Background(), inmemStorage, &salt.Config{
|
||||
HMAC: sha256.New,
|
||||
|
|
@ -117,62 +120,74 @@ func (*TestSalter) Salt(ctx context.Context) (*salt.Salt, error) {
|
|||
}
|
||||
|
||||
func TestHashString(t *testing.T) {
|
||||
salter := &TestSalter{}
|
||||
salter := &testSalter{}
|
||||
|
||||
out, err := HashString(context.Background(), salter, "foo")
|
||||
out, err := hashString(context.Background(), salter, "foo")
|
||||
if err != nil {
|
||||
t.Fatalf("Error instantiating salt: %s", err)
|
||||
}
|
||||
if out != "hmac-sha256:08ba357e274f528065766c770a639abf6809b39ccfd37c2a3157c7f51954da0a" {
|
||||
t.Fatalf("err: HashString output did not match expected")
|
||||
t.Fatalf("err: hashString output did not match expected")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHashAuth(t *testing.T) {
|
||||
cases := []struct {
|
||||
cases := map[string]struct {
|
||||
Input *logical.Auth
|
||||
Output *logical.Auth
|
||||
Output *auth
|
||||
HMACAccessor bool
|
||||
}{
|
||||
{
|
||||
&logical.Auth{ClientToken: "foo"},
|
||||
&logical.Auth{ClientToken: "hmac-sha256:08ba357e274f528065766c770a639abf6809b39ccfd37c2a3157c7f51954da0a"},
|
||||
"no-accessor-hmac": {
|
||||
&logical.Auth{
|
||||
ClientToken: "foo",
|
||||
Accessor: "very-accessible",
|
||||
LeaseOptions: logical.LeaseOptions{
|
||||
TTL: 1 * time.Hour,
|
||||
},
|
||||
TokenType: logical.TokenTypeService,
|
||||
},
|
||||
&auth{
|
||||
ClientToken: "hmac-sha256:08ba357e274f528065766c770a639abf6809b39ccfd37c2a3157c7f51954da0a",
|
||||
Accessor: "very-accessible",
|
||||
TokenTTL: 3600,
|
||||
TokenType: "service",
|
||||
RemainingUses: 5,
|
||||
},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"accessor-hmac": {
|
||||
&logical.Auth{
|
||||
LeaseOptions: logical.LeaseOptions{
|
||||
TTL: 1 * time.Hour,
|
||||
},
|
||||
|
||||
Accessor: "very-accessible",
|
||||
ClientToken: "foo",
|
||||
},
|
||||
&logical.Auth{
|
||||
LeaseOptions: logical.LeaseOptions{
|
||||
TTL: 1 * time.Hour,
|
||||
},
|
||||
|
||||
ClientToken: "hmac-sha256:08ba357e274f528065766c770a639abf6809b39ccfd37c2a3157c7f51954da0a",
|
||||
TokenType: logical.TokenTypeBatch,
|
||||
},
|
||||
false,
|
||||
&auth{
|
||||
ClientToken: "hmac-sha256:08ba357e274f528065766c770a639abf6809b39ccfd37c2a3157c7f51954da0a",
|
||||
Accessor: "hmac-sha256:5d6d7c8da5b699ace193ea453bbf77082a8aaca42a474436509487d646a7c0af",
|
||||
TokenTTL: 3600,
|
||||
TokenType: "batch",
|
||||
RemainingUses: 5,
|
||||
},
|
||||
true,
|
||||
},
|
||||
}
|
||||
|
||||
inmemStorage := &logical.InmemStorage{}
|
||||
inmemStorage.Put(context.Background(), &logical.StorageEntry{
|
||||
err := inmemStorage.Put(context.Background(), &logical.StorageEntry{
|
||||
Key: "salt",
|
||||
Value: []byte("foo"),
|
||||
})
|
||||
salter := &TestSalter{}
|
||||
require.NoError(t, err)
|
||||
salter := &testSalter{}
|
||||
for _, tc := range cases {
|
||||
input := fmt.Sprintf("%#v", tc.Input)
|
||||
out, err := HashAuth(context.Background(), salter, tc.Input, tc.HMACAccessor)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s\n\n%s", err, input)
|
||||
}
|
||||
if !reflect.DeepEqual(out, tc.Output) {
|
||||
t.Fatalf("bad:\nInput:\n%s\nOutput:\n%#v\nExpected output:\n%#v", input, out, tc.Output)
|
||||
}
|
||||
auditAuth, err := newAuth(tc.Input, 5)
|
||||
require.NoError(t, err)
|
||||
err = hashAuth(context.Background(), salter, auditAuth, tc.HMACAccessor)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, tc.Output, auditAuth)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -190,7 +205,7 @@ var _ logical.OptMarshaler = &testOptMarshaler{}
|
|||
func TestHashRequest(t *testing.T) {
|
||||
cases := []struct {
|
||||
Input *logical.Request
|
||||
Output *logical.Request
|
||||
Output *request
|
||||
NonHMACDataKeys []string
|
||||
HMACAccessor bool
|
||||
}{
|
||||
|
|
@ -203,13 +218,17 @@ func TestHashRequest(t *testing.T) {
|
|||
"om": &testOptMarshaler{S: "bar", I: 1},
|
||||
},
|
||||
},
|
||||
&logical.Request{
|
||||
&request{
|
||||
Data: map[string]interface{}{
|
||||
"foo": "hmac-sha256:f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317",
|
||||
"baz": "foobar",
|
||||
"private_key_type": "hmac-sha256:995230dca56fffd310ff591aa404aab52b2abb41703c787cfa829eceb4595bf1",
|
||||
"om": json.RawMessage(`{"S":"hmac-sha256:f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317","I":1}`),
|
||||
},
|
||||
Namespace: &namespace{
|
||||
ID: nshelper.RootNamespace.ID,
|
||||
Path: nshelper.RootNamespace.Path,
|
||||
},
|
||||
},
|
||||
[]string{"baz"},
|
||||
false,
|
||||
|
|
@ -217,86 +236,82 @@ func TestHashRequest(t *testing.T) {
|
|||
}
|
||||
|
||||
inmemStorage := &logical.InmemStorage{}
|
||||
inmemStorage.Put(context.Background(), &logical.StorageEntry{
|
||||
err := inmemStorage.Put(context.Background(), &logical.StorageEntry{
|
||||
Key: "salt",
|
||||
Value: []byte("foo"),
|
||||
})
|
||||
salter := &TestSalter{}
|
||||
require.NoError(t, err)
|
||||
salter := &testSalter{}
|
||||
for _, tc := range cases {
|
||||
input := fmt.Sprintf("%#v", tc.Input)
|
||||
out, err := HashRequest(context.Background(), salter, tc.Input, tc.HMACAccessor, tc.NonHMACDataKeys)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s\n\n%s", err, input)
|
||||
}
|
||||
if diff := deep.Equal(out, tc.Output); len(diff) > 0 {
|
||||
t.Fatalf("bad:\nInput:\n%s\nDiff:\n%#v", input, diff)
|
||||
}
|
||||
auditReq, err := newRequest(tc.Input, nshelper.RootNamespace)
|
||||
require.NoError(t, err)
|
||||
err = hashRequest(context.Background(), salter, auditReq, tc.HMACAccessor, tc.NonHMACDataKeys)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, tc.Output, auditReq)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHashResponse(t *testing.T) {
|
||||
now := time.Now()
|
||||
|
||||
cases := []struct {
|
||||
Input *logical.Response
|
||||
Output *logical.Response
|
||||
NonHMACDataKeys []string
|
||||
HMACAccessor bool
|
||||
}{
|
||||
{
|
||||
&logical.Response{
|
||||
Data: map[string]interface{}{
|
||||
"foo": "bar",
|
||||
"baz": "foobar",
|
||||
// Responses can contain time values, so test that with
|
||||
// a known fixed value.
|
||||
"bar": now,
|
||||
"om": &testOptMarshaler{S: "bar", I: 1},
|
||||
},
|
||||
WrapInfo: &wrapping.ResponseWrapInfo{
|
||||
TTL: 60,
|
||||
Token: "bar",
|
||||
Accessor: "flimflam",
|
||||
CreationTime: now,
|
||||
WrappedAccessor: "bar",
|
||||
},
|
||||
},
|
||||
&logical.Response{
|
||||
Data: map[string]interface{}{
|
||||
"foo": "hmac-sha256:f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317",
|
||||
"baz": "foobar",
|
||||
"bar": now.Format(time.RFC3339Nano),
|
||||
"om": json.RawMessage(`{"S":"hmac-sha256:f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317","I":1}`),
|
||||
},
|
||||
WrapInfo: &wrapping.ResponseWrapInfo{
|
||||
TTL: 60,
|
||||
Token: "hmac-sha256:f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317",
|
||||
Accessor: "hmac-sha256:7c9c6fe666d0af73b3ebcfbfabe6885015558213208e6635ba104047b22f6390",
|
||||
CreationTime: now,
|
||||
WrappedAccessor: "hmac-sha256:f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317",
|
||||
},
|
||||
},
|
||||
[]string{"baz"},
|
||||
true,
|
||||
resp := &logical.Response{
|
||||
Data: map[string]interface{}{
|
||||
"foo": "bar",
|
||||
"baz": "foobar",
|
||||
// Responses can contain time values, so test that with a known fixed value.
|
||||
"bar": now,
|
||||
"om": &testOptMarshaler{S: "bar", I: 1},
|
||||
},
|
||||
WrapInfo: &wrapping.ResponseWrapInfo{
|
||||
TTL: 1 * time.Minute,
|
||||
Token: "bar",
|
||||
Accessor: "flimflam",
|
||||
CreationTime: now,
|
||||
WrappedAccessor: "bar",
|
||||
},
|
||||
}
|
||||
|
||||
req := &logical.Request{MountPoint: "/foo/bar"}
|
||||
req.SetMountClass("kv")
|
||||
req.SetMountIsExternalPlugin(true)
|
||||
req.SetMountRunningVersion("123")
|
||||
req.SetMountRunningSha256("256-256!")
|
||||
|
||||
nonHMACDataKeys := []string{"baz"}
|
||||
|
||||
expected := &response{
|
||||
Data: map[string]interface{}{
|
||||
"foo": "hmac-sha256:f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317",
|
||||
"baz": "foobar",
|
||||
"bar": now.Format(time.RFC3339Nano),
|
||||
"om": json.RawMessage(`{"S":"hmac-sha256:f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317","I":1}`),
|
||||
},
|
||||
WrapInfo: &responseWrapInfo{
|
||||
TTL: 60,
|
||||
Token: "hmac-sha256:f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317",
|
||||
Accessor: "hmac-sha256:7c9c6fe666d0af73b3ebcfbfabe6885015558213208e6635ba104047b22f6390",
|
||||
CreationTime: now.UTC().Format(time.RFC3339Nano),
|
||||
WrappedAccessor: "hmac-sha256:f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317",
|
||||
},
|
||||
MountClass: "kv",
|
||||
MountIsExternalPlugin: true,
|
||||
MountPoint: "/foo/bar",
|
||||
MountRunningVersion: "123",
|
||||
MountRunningSha256: "256-256!",
|
||||
}
|
||||
|
||||
inmemStorage := &logical.InmemStorage{}
|
||||
inmemStorage.Put(context.Background(), &logical.StorageEntry{
|
||||
err := inmemStorage.Put(context.Background(), &logical.StorageEntry{
|
||||
Key: "salt",
|
||||
Value: []byte("foo"),
|
||||
})
|
||||
salter := &TestSalter{}
|
||||
for _, tc := range cases {
|
||||
input := fmt.Sprintf("%#v", tc.Input)
|
||||
out, err := HashResponse(context.Background(), salter, tc.Input, tc.HMACAccessor, tc.NonHMACDataKeys, false)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s\n\n%s", err, input)
|
||||
}
|
||||
if diff := deep.Equal(out, tc.Output); len(diff) > 0 {
|
||||
t.Fatalf("bad:\nInput:\n%s\nDiff:\n%#v", input, diff)
|
||||
}
|
||||
}
|
||||
require.NoError(t, err)
|
||||
salter := &testSalter{}
|
||||
auditResp, err := newResponse(resp, req, false)
|
||||
require.NoError(t, err)
|
||||
err = hashResponse(context.Background(), salter, auditResp, true, nonHMACDataKeys)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, expected, auditResp)
|
||||
}
|
||||
|
||||
func TestHashWalker(t *testing.T) {
|
||||
|
|
@ -326,7 +341,7 @@ func TestHashWalker(t *testing.T) {
|
|||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
err := HashStructure(tc.Input, func(string) string {
|
||||
err := hashStructure(tc.Input, func(string) string {
|
||||
return replaceText
|
||||
}, nil)
|
||||
if err != nil {
|
||||
|
|
@ -380,7 +395,7 @@ func TestHashWalker_TimeStructs(t *testing.T) {
|
|||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
err := HashStructure(tc.Input, func(s string) string {
|
||||
err := hashStructure(tc.Input, func(s string) string {
|
||||
return s + replaceText
|
||||
}, nil)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ func AuditedHeadersKey() string {
|
|||
return AuditedHeadersSubPath + auditedHeadersEntry
|
||||
}
|
||||
|
||||
type HeaderSettings struct {
|
||||
type headerSettings struct {
|
||||
// HMAC is used to indicate whether the value of the header should be HMAC'd.
|
||||
HMAC bool `json:"hmac"`
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@ type HeaderSettings struct {
|
|||
// headers to the audit logs. It uses a BarrierView to persist the settings.
|
||||
type HeadersConfig struct {
|
||||
// headerSettings stores the current headers that should be audited, and their settings.
|
||||
headerSettings map[string]*HeaderSettings
|
||||
headerSettings map[string]*headerSettings
|
||||
|
||||
// view is the barrier view which should be used to access underlying audit header config data.
|
||||
view durableStorer
|
||||
|
|
@ -69,18 +69,18 @@ func NewHeadersConfig(view durableStorer) (*HeadersConfig, error) {
|
|||
// Store the view so that we can reload headers when we 'Invalidate'.
|
||||
return &HeadersConfig{
|
||||
view: view,
|
||||
headerSettings: make(map[string]*HeaderSettings),
|
||||
headerSettings: make(map[string]*headerSettings),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Header attempts to retrieve a copy of the settings associated with the specified header.
|
||||
// The second boolean return parameter indicates whether the header existed in configuration,
|
||||
// it should be checked as when 'false' the returned settings will have the default values.
|
||||
func (a *HeadersConfig) Header(name string) (HeaderSettings, bool) {
|
||||
func (a *HeadersConfig) Header(name string) (headerSettings, bool) {
|
||||
a.RLock()
|
||||
defer a.RUnlock()
|
||||
|
||||
var s HeaderSettings
|
||||
var s headerSettings
|
||||
v, ok := a.headerSettings[strings.ToLower(name)]
|
||||
|
||||
if ok {
|
||||
|
|
@ -91,16 +91,16 @@ func (a *HeadersConfig) Header(name string) (HeaderSettings, bool) {
|
|||
}
|
||||
|
||||
// Headers returns all existing headers along with a copy of their current settings.
|
||||
func (a *HeadersConfig) Headers() map[string]HeaderSettings {
|
||||
func (a *HeadersConfig) Headers() map[string]headerSettings {
|
||||
a.RLock()
|
||||
defer a.RUnlock()
|
||||
|
||||
// We know how many entries the map should have.
|
||||
headers := make(map[string]HeaderSettings, len(a.headerSettings))
|
||||
headers := make(map[string]headerSettings, len(a.headerSettings))
|
||||
|
||||
// Clone the headers
|
||||
for name, setting := range a.headerSettings {
|
||||
headers[name] = HeaderSettings{HMAC: setting.HMAC}
|
||||
headers[name] = headerSettings{HMAC: setting.HMAC}
|
||||
}
|
||||
|
||||
return headers
|
||||
|
|
@ -118,10 +118,10 @@ func (a *HeadersConfig) Add(ctx context.Context, header string, hmac bool) error
|
|||
defer a.Unlock()
|
||||
|
||||
if a.headerSettings == nil {
|
||||
a.headerSettings = make(map[string]*HeaderSettings, 1)
|
||||
a.headerSettings = make(map[string]*headerSettings, 1)
|
||||
}
|
||||
|
||||
a.headerSettings[strings.ToLower(header)] = &HeaderSettings{hmac}
|
||||
a.headerSettings[strings.ToLower(header)] = &headerSettings{hmac}
|
||||
entry, err := logical.StorageEntryJSON(auditedHeadersEntry, a.headerSettings)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to persist audited headers config: %w", err)
|
||||
|
|
@ -167,12 +167,12 @@ func (a *HeadersConfig) Remove(ctx context.Context, header string) error {
|
|||
// added to HeadersConfig in order to allow them to appear in audit logs in a raw
|
||||
// format. If the Vault Operator adds their own setting for any of the defaults,
|
||||
// their setting will be honored.
|
||||
func (a *HeadersConfig) DefaultHeaders() map[string]*HeaderSettings {
|
||||
func (a *HeadersConfig) DefaultHeaders() map[string]*headerSettings {
|
||||
// Support deprecated 'x-' prefix (https://datatracker.ietf.org/doc/html/rfc6648)
|
||||
const correlationID = "correlation-id"
|
||||
xCorrelationID := fmt.Sprintf("x-%s", correlationID)
|
||||
|
||||
return map[string]*HeaderSettings{
|
||||
return map[string]*headerSettings{
|
||||
correlationID: {},
|
||||
xCorrelationID: {},
|
||||
}
|
||||
|
|
@ -192,7 +192,7 @@ func (a *HeadersConfig) Invalidate(ctx context.Context) error {
|
|||
|
||||
// If we cannot update the stored 'new' headers, we will clear the existing
|
||||
// ones as part of invalidation.
|
||||
headers := make(map[string]*HeaderSettings)
|
||||
headers := make(map[string]*headerSettings)
|
||||
if out != nil {
|
||||
err = out.DecodeJSON(&headers)
|
||||
if err != nil {
|
||||
|
|
@ -202,7 +202,7 @@ func (a *HeadersConfig) Invalidate(ctx context.Context) error {
|
|||
|
||||
// Ensure that we are able to case-sensitively access the headers;
|
||||
// necessary for the upgrade case
|
||||
lowerHeaders := make(map[string]*HeaderSettings, len(headers))
|
||||
lowerHeaders := make(map[string]*headerSettings, len(headers))
|
||||
for k, v := range headers {
|
||||
lowerHeaders[strings.ToLower(k)] = v
|
||||
}
|
||||
|
|
@ -248,7 +248,7 @@ func (a *HeadersConfig) ApplyConfig(ctx context.Context, headers map[string][]st
|
|||
// Optionally hmac the values
|
||||
if settings.HMAC {
|
||||
for i, el := range hVals {
|
||||
hVal, err := HashString(ctx, salter, el)
|
||||
hVal, err := hashString(ctx, salter, el)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ func newMockStorage(t *testing.T) *mockStorage {
|
|||
|
||||
func mockAuditedHeadersConfig(t *testing.T) *HeadersConfig {
|
||||
return &HeadersConfig{
|
||||
headerSettings: make(map[string]*HeaderSettings),
|
||||
headerSettings: make(map[string]*headerSettings),
|
||||
view: newMockStorage(t),
|
||||
}
|
||||
}
|
||||
|
|
@ -110,13 +110,13 @@ func testAddHeaders(t *testing.T, conf *HeadersConfig) {
|
|||
t.Fatal("nil value")
|
||||
}
|
||||
|
||||
headers := make(map[string]*HeaderSettings)
|
||||
headers := make(map[string]*headerSettings)
|
||||
err = out.DecodeJSON(&headers)
|
||||
if err != nil {
|
||||
t.Fatalf("Error decoding header view: %s", err)
|
||||
}
|
||||
|
||||
expected := map[string]*HeaderSettings{
|
||||
expected := map[string]*headerSettings{
|
||||
"x-test-header": {
|
||||
HMAC: false,
|
||||
},
|
||||
|
|
@ -148,13 +148,13 @@ func testAddHeaders(t *testing.T, conf *HeadersConfig) {
|
|||
t.Fatal("nil value")
|
||||
}
|
||||
|
||||
headers = make(map[string]*HeaderSettings)
|
||||
headers = make(map[string]*headerSettings)
|
||||
err = out.DecodeJSON(&headers)
|
||||
if err != nil {
|
||||
t.Fatalf("Error decoding header view: %s", err)
|
||||
}
|
||||
|
||||
expected["x-vault-header"] = &HeaderSettings{
|
||||
expected["x-vault-header"] = &headerSettings{
|
||||
HMAC: true,
|
||||
}
|
||||
|
||||
|
|
@ -184,13 +184,13 @@ func testRemoveHeaders(t *testing.T, conf *HeadersConfig) {
|
|||
t.Fatal("nil value")
|
||||
}
|
||||
|
||||
headers := make(map[string]*HeaderSettings)
|
||||
headers := make(map[string]*headerSettings)
|
||||
err = out.DecodeJSON(&headers)
|
||||
if err != nil {
|
||||
t.Fatalf("Error decoding header view: %s", err)
|
||||
}
|
||||
|
||||
expected := map[string]*HeaderSettings{
|
||||
expected := map[string]*headerSettings{
|
||||
"x-vault-header": {
|
||||
HMAC: true,
|
||||
},
|
||||
|
|
@ -218,13 +218,13 @@ func testRemoveHeaders(t *testing.T, conf *HeadersConfig) {
|
|||
t.Fatal("nil value")
|
||||
}
|
||||
|
||||
headers = make(map[string]*HeaderSettings)
|
||||
headers = make(map[string]*headerSettings)
|
||||
err = out.DecodeJSON(&headers)
|
||||
if err != nil {
|
||||
t.Fatalf("Error decoding header view: %s", err)
|
||||
}
|
||||
|
||||
expected = make(map[string]*HeaderSettings)
|
||||
expected = make(map[string]*headerSettings)
|
||||
|
||||
if !reflect.DeepEqual(headers, expected) {
|
||||
t.Fatalf("Expected config didn't match actual. Expected: %#v, Got: %#v", expected, headers)
|
||||
|
|
@ -247,7 +247,7 @@ func TestAuditedHeadersConfig_ApplyConfig(t *testing.T) {
|
|||
"Content-Type": {"json"},
|
||||
}
|
||||
|
||||
salter := &TestSalter{}
|
||||
salter := &testSalter{}
|
||||
|
||||
result, err := conf.ApplyConfig(context.Background(), reqHeaders, salter)
|
||||
if err != nil {
|
||||
|
|
@ -307,7 +307,7 @@ func TestAuditedHeadersConfig_ApplyConfig_NoRequestHeaders(t *testing.T) {
|
|||
err = conf.Add(context.Background(), "X-Vault-HeAdEr", true)
|
||||
require.NoError(t, err)
|
||||
|
||||
salter := &TestSalter{}
|
||||
salter := &testSalter{}
|
||||
|
||||
// Test sending in nil headers first.
|
||||
result, err := conf.ApplyConfig(context.Background(), nil, salter)
|
||||
|
|
@ -331,7 +331,7 @@ func TestAuditedHeadersConfig_ApplyConfig_NoConfiguredHeaders(t *testing.T) {
|
|||
"Content-Type": {"json"},
|
||||
}
|
||||
|
||||
salter := &TestSalter{}
|
||||
salter := &testSalter{}
|
||||
|
||||
result, err := conf.ApplyConfig(context.Background(), reqHeaders, salter)
|
||||
if err != nil {
|
||||
|
|
@ -364,7 +364,7 @@ func (s *FailingSalter) Salt(context.Context) (*salt.Salt, error) {
|
|||
}
|
||||
|
||||
// TestAuditedHeadersConfig_ApplyConfig_HashStringError tests the case where
|
||||
// an error is returned from HashString instead of a map of headers.
|
||||
// an error is returned from hashString instead of a map of headers.
|
||||
func TestAuditedHeadersConfig_ApplyConfig_HashStringError(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
|
@ -391,11 +391,11 @@ func TestAuditedHeadersConfig_ApplyConfig_HashStringError(t *testing.T) {
|
|||
|
||||
func BenchmarkAuditedHeaderConfig_ApplyConfig(b *testing.B) {
|
||||
conf := &HeadersConfig{
|
||||
headerSettings: make(map[string]*HeaderSettings),
|
||||
headerSettings: make(map[string]*headerSettings),
|
||||
view: nil,
|
||||
}
|
||||
|
||||
conf.headerSettings = map[string]*HeaderSettings{
|
||||
conf.headerSettings = map[string]*headerSettings{
|
||||
"X-Test-Header": {false},
|
||||
"X-Vault-Header": {true},
|
||||
}
|
||||
|
|
@ -406,7 +406,7 @@ func BenchmarkAuditedHeaderConfig_ApplyConfig(b *testing.B) {
|
|||
"Content-Type": {"json"},
|
||||
}
|
||||
|
||||
salter := &TestSalter{}
|
||||
salter := &testSalter{}
|
||||
|
||||
// Reset the timer since we did a lot above
|
||||
b.ResetTimer()
|
||||
|
|
@ -449,7 +449,7 @@ func TestAuditedHeaders_invalidate(t *testing.T) {
|
|||
require.Len(t, ahc.headerSettings, 0)
|
||||
|
||||
// Store some data using the view.
|
||||
fakeHeaders1 := map[string]*HeaderSettings{"x-magic-header": {}}
|
||||
fakeHeaders1 := map[string]*headerSettings{"x-magic-header": {}}
|
||||
fakeBytes1, err := json.Marshal(fakeHeaders1)
|
||||
require.NoError(t, err)
|
||||
err = view.Put(context.Background(), &logical.StorageEntry{Key: auditedHeadersEntry, Value: fakeBytes1})
|
||||
|
|
@ -463,7 +463,7 @@ func TestAuditedHeaders_invalidate(t *testing.T) {
|
|||
require.True(t, ok)
|
||||
|
||||
// Do it again with more headers and random casing.
|
||||
fakeHeaders2 := map[string]*HeaderSettings{
|
||||
fakeHeaders2 := map[string]*headerSettings{
|
||||
"x-magic-header": {},
|
||||
"x-even-MORE-magic-header": {},
|
||||
}
|
||||
|
|
@ -493,7 +493,7 @@ func TestAuditedHeaders_invalidate_nil_view(t *testing.T) {
|
|||
require.Len(t, ahc.headerSettings, 0)
|
||||
|
||||
// Store some data using the view.
|
||||
fakeHeaders1 := map[string]*HeaderSettings{"x-magic-header": {}}
|
||||
fakeHeaders1 := map[string]*headerSettings{"x-magic-header": {}}
|
||||
fakeBytes1, err := json.Marshal(fakeHeaders1)
|
||||
require.NoError(t, err)
|
||||
err = view.Put(context.Background(), &logical.StorageEntry{Key: auditedHeadersEntry, Value: fakeBytes1})
|
||||
|
|
@ -597,7 +597,7 @@ func TestAuditedHeaders_invalidate_defaults(t *testing.T) {
|
|||
require.Len(t, ahc.headerSettings, 0)
|
||||
|
||||
// Store some data using the view.
|
||||
fakeHeaders1 := map[string]*HeaderSettings{"x-magic-header": {}}
|
||||
fakeHeaders1 := map[string]*headerSettings{"x-magic-header": {}}
|
||||
fakeBytes1, err := json.Marshal(fakeHeaders1)
|
||||
require.NoError(t, err)
|
||||
err = view.Put(context.Background(), &logical.StorageEntry{Key: auditedHeadersEntry, Value: fakeBytes1})
|
||||
|
|
@ -614,7 +614,7 @@ func TestAuditedHeaders_invalidate_defaults(t *testing.T) {
|
|||
require.False(t, s.HMAC)
|
||||
|
||||
// Add correlation ID specifically with HMAC and make sure it doesn't get blasted away.
|
||||
fakeHeaders1 = map[string]*HeaderSettings{"x-magic-header": {}, "X-Correlation-ID": {HMAC: true}}
|
||||
fakeHeaders1 = map[string]*headerSettings{"x-magic-header": {}, "X-Correlation-ID": {HMAC: true}}
|
||||
fakeBytes1, err = json.Marshal(fakeHeaders1)
|
||||
require.NoError(t, err)
|
||||
err = view.Put(context.Background(), &logical.StorageEntry{Key: auditedHeadersEntry, Value: fakeBytes1})
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ func processManual(ctx context.Context, data *logical.LogInput, ids []eventlogge
|
|||
}
|
||||
|
||||
// Create an audit event.
|
||||
a, err := NewEvent(RequestType)
|
||||
a, err := newEvent(RequestType)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import (
|
|||
|
||||
"github.com/hashicorp/eventlogger"
|
||||
"github.com/hashicorp/go-uuid"
|
||||
"github.com/hashicorp/vault/helper/namespace"
|
||||
nshelper "github.com/hashicorp/vault/helper/namespace"
|
||||
"github.com/hashicorp/vault/internal/observability/event"
|
||||
"github.com/hashicorp/vault/sdk/logical"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
|
@ -32,7 +32,7 @@ func TestProcessManual_NilData(t *testing.T) {
|
|||
ids = append(ids, sinkId)
|
||||
nodes[sinkId] = sinkNode
|
||||
|
||||
err := processManual(namespace.RootContext(context.Background()), nil, ids, nodes)
|
||||
err := processManual(nshelper.RootContext(context.Background()), nil, ids, nodes)
|
||||
require.Error(t, err)
|
||||
require.EqualError(t, err, "data cannot be nil")
|
||||
}
|
||||
|
|
@ -76,7 +76,7 @@ func TestProcessManual_BadIDs(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
data := newData(requestId)
|
||||
|
||||
err = processManual(namespace.RootContext(context.Background()), data, tc.IDs, nodes)
|
||||
err = processManual(nshelper.RootContext(context.Background()), data, tc.IDs, nodes)
|
||||
require.Error(t, err)
|
||||
require.EqualError(t, err, tc.ExpectedErrorMessage)
|
||||
})
|
||||
|
|
@ -103,7 +103,7 @@ func TestProcessManual_NoNodes(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
data := newData(requestId)
|
||||
|
||||
err = processManual(namespace.RootContext(context.Background()), data, ids, nodes)
|
||||
err = processManual(nshelper.RootContext(context.Background()), data, ids, nodes)
|
||||
require.Error(t, err)
|
||||
require.EqualError(t, err, "nodes are required")
|
||||
}
|
||||
|
|
@ -130,7 +130,7 @@ func TestProcessManual_IdNodeMismatch(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
data := newData(requestId)
|
||||
|
||||
err = processManual(namespace.RootContext(context.Background()), data, ids, nodes)
|
||||
err = processManual(nshelper.RootContext(context.Background()), data, ids, nodes)
|
||||
require.Error(t, err)
|
||||
require.ErrorContains(t, err, "node not found: ")
|
||||
}
|
||||
|
|
@ -153,7 +153,7 @@ func TestProcessManual_NotEnoughNodes(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
data := newData(requestId)
|
||||
|
||||
err = processManual(namespace.RootContext(context.Background()), data, ids, nodes)
|
||||
err = processManual(nshelper.RootContext(context.Background()), data, ids, nodes)
|
||||
require.Error(t, err)
|
||||
require.EqualError(t, err, "minimum of 2 ids are required")
|
||||
}
|
||||
|
|
@ -181,7 +181,7 @@ func TestProcessManual_LastNodeNotSink(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
data := newData(requestId)
|
||||
|
||||
err = processManual(namespace.RootContext(context.Background()), data, ids, nodes)
|
||||
err = processManual(nshelper.RootContext(context.Background()), data, ids, nodes)
|
||||
require.Error(t, err)
|
||||
require.EqualError(t, err, "last node must be a filter or sink")
|
||||
}
|
||||
|
|
@ -210,7 +210,7 @@ func TestProcessManualEndWithSink(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
data := newData(requestId)
|
||||
|
||||
err = processManual(namespace.RootContext(context.Background()), data, ids, nodes)
|
||||
err = processManual(nshelper.RootContext(context.Background()), data, ids, nodes)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
|
|
@ -243,7 +243,7 @@ func TestProcessManual_EndWithFilter(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
data := newData(requestId)
|
||||
|
||||
err = processManual(namespace.RootContext(context.Background()), data, ids, nodes)
|
||||
err = processManual(nshelper.RootContext(context.Background()), data, ids, nodes)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
// Option is how options are passed as arguments.
|
||||
type Option func(*options) error
|
||||
// option is how options are passed as arguments.
|
||||
type option func(*options) error
|
||||
|
||||
// options are used to represent configuration for a audit related nodes.
|
||||
type options struct {
|
||||
|
|
@ -29,15 +29,15 @@ type options struct {
|
|||
func getDefaultOptions() options {
|
||||
return options{
|
||||
withNow: time.Now(),
|
||||
withFormat: JSONFormat,
|
||||
withFormat: jsonFormat,
|
||||
withHMACAccessor: true,
|
||||
}
|
||||
}
|
||||
|
||||
// getOpts applies each supplied Option and returns the fully configured options.
|
||||
// Each Option is applied in the order it appears in the argument list, so it is
|
||||
// possible to supply the same Option numerous times and the 'last write wins'.
|
||||
func getOpts(opt ...Option) (options, error) {
|
||||
// getOpts applies each supplied option and returns the fully configured options.
|
||||
// Each option is applied in the order it appears in the argument list, so it is
|
||||
// possible to supply the same option numerous times and the 'last write wins'.
|
||||
func getOpts(opt ...option) (options, error) {
|
||||
opts := getDefaultOptions()
|
||||
for _, o := range opt {
|
||||
if o == nil {
|
||||
|
|
@ -50,8 +50,8 @@ func getOpts(opt ...Option) (options, error) {
|
|||
return opts, nil
|
||||
}
|
||||
|
||||
// WithID provides an optional ID.
|
||||
func WithID(id string) Option {
|
||||
// withID provides an optional ID.
|
||||
func withID(id string) option {
|
||||
return func(o *options) error {
|
||||
var err error
|
||||
|
||||
|
|
@ -67,8 +67,8 @@ func WithID(id string) Option {
|
|||
}
|
||||
}
|
||||
|
||||
// WithNow provides an Option to represent 'now'.
|
||||
func WithNow(now time.Time) Option {
|
||||
// withNow provides an option to represent 'now'.
|
||||
func withNow(now time.Time) option {
|
||||
return func(o *options) error {
|
||||
var err error
|
||||
|
||||
|
|
@ -83,8 +83,8 @@ func WithNow(now time.Time) Option {
|
|||
}
|
||||
}
|
||||
|
||||
// WithSubtype provides an Option to represent the event subtype.
|
||||
func WithSubtype(s string) Option {
|
||||
// withSubtype provides an option to represent the event subtype.
|
||||
func withSubtype(s string) option {
|
||||
return func(o *options) error {
|
||||
s := strings.TrimSpace(s)
|
||||
if s == "" {
|
||||
|
|
@ -101,8 +101,8 @@ func WithSubtype(s string) Option {
|
|||
}
|
||||
}
|
||||
|
||||
// WithFormat provides an Option to represent event format.
|
||||
func WithFormat(f string) Option {
|
||||
// withFormat provides an option to represent event format.
|
||||
func withFormat(f string) option {
|
||||
return func(o *options) error {
|
||||
f := strings.TrimSpace(strings.ToLower(f))
|
||||
if f == "" {
|
||||
|
|
@ -121,8 +121,8 @@ func WithFormat(f string) Option {
|
|||
}
|
||||
}
|
||||
|
||||
// WithPrefix provides an Option to represent a prefix for a file sink.
|
||||
func WithPrefix(prefix string) Option {
|
||||
// withPrefix provides an option to represent a prefix for a file sink.
|
||||
func withPrefix(prefix string) option {
|
||||
return func(o *options) error {
|
||||
o.withPrefix = prefix
|
||||
|
||||
|
|
@ -130,32 +130,32 @@ func WithPrefix(prefix string) Option {
|
|||
}
|
||||
}
|
||||
|
||||
// WithRaw provides an Option to represent whether 'raw' is required.
|
||||
func WithRaw(r bool) Option {
|
||||
// withRaw provides an option to represent whether 'raw' is required.
|
||||
func withRaw(r bool) option {
|
||||
return func(o *options) error {
|
||||
o.withRaw = r
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithElision provides an Option to represent whether elision (...) is required.
|
||||
func WithElision(e bool) Option {
|
||||
// withElision provides an option to represent whether elision (...) is required.
|
||||
func withElision(e bool) option {
|
||||
return func(o *options) error {
|
||||
o.withElision = e
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithOmitTime provides an Option to represent whether to omit time.
|
||||
func WithOmitTime(t bool) Option {
|
||||
// withOmitTime provides an option to represent whether to omit time.
|
||||
func withOmitTime(t bool) option {
|
||||
return func(o *options) error {
|
||||
o.withOmitTime = t
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithHMACAccessor provides an Option to represent whether an HMAC accessor is applicable.
|
||||
func WithHMACAccessor(h bool) Option {
|
||||
// withHMACAccessor provides an option to represent whether an HMAC accessor is applicable.
|
||||
func withHMACAccessor(h bool) option {
|
||||
return func(o *options) error {
|
||||
o.withHMACAccessor = h
|
||||
return nil
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue