Hashicorp Vault plugin for authenticating Trusted Execution Environments (TEE) like SGX enclaves
Find a file
renovate[bot] 89641f1b9e
chore(deps): update trufflesecurity/trufflehog action to v3.63.3 (#24)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[trufflesecurity/trufflehog](https://togithub.com/trufflesecurity/trufflehog)
| action | patch | `v3.63.2` -> `v3.63.3` |

---

### Release Notes

<details>
<summary>trufflesecurity/trufflehog
(trufflesecurity/trufflehog)</summary>

###
[`v3.63.3`](https://togithub.com/trufflesecurity/trufflehog/releases/tag/v3.63.3)

[Compare
Source](https://togithub.com/trufflesecurity/trufflehog/compare/v3.63.2...v3.63.3)

#### What's Changed

- Use forked sevenzip by
[@&#8203;bill-rich](https://togithub.com/bill-rich) in
[https://github.com/trufflesecurity/trufflehog/pull/2180](https://togithub.com/trufflesecurity/trufflehog/pull/2180)
- fixing how to rotate URL by
[@&#8203;dylanTruffle](https://togithub.com/dylanTruffle) in
[https://github.com/trufflesecurity/trufflehog/pull/2183](https://togithub.com/trufflesecurity/trufflehog/pull/2183)
- \[fixup] - Skip trying to determine MIME type for directories by
[@&#8203;ahrav](https://togithub.com/ahrav) in
[https://github.com/trufflesecurity/trufflehog/pull/2178](https://togithub.com/trufflesecurity/trufflehog/pull/2178)
- \[feat] - Remove go-git dependency by
[@&#8203;ahrav](https://togithub.com/ahrav) in
[https://github.com/trufflesecurity/trufflehog/pull/2174](https://togithub.com/trufflesecurity/trufflehog/pull/2174)
- remove unnecessary Git cmd check by
[@&#8203;ahrav](https://togithub.com/ahrav) in
[https://github.com/trufflesecurity/trufflehog/pull/2175](https://togithub.com/trufflesecurity/trufflehog/pull/2175)
- \[chore] - use https for verification endpoints by
[@&#8203;ahrav](https://togithub.com/ahrav) in
[https://github.com/trufflesecurity/trufflehog/pull/2185](https://togithub.com/trufflesecurity/trufflehog/pull/2185)
- allow targets for the source manager by
[@&#8203;ahrav](https://togithub.com/ahrav) in
[https://github.com/trufflesecurity/trufflehog/pull/2182](https://togithub.com/trufflesecurity/trufflehog/pull/2182)
- Deprecate some detectors by
[@&#8203;dustin-decker](https://togithub.com/dustin-decker) in
[https://github.com/trufflesecurity/trufflehog/pull/2186](https://togithub.com/trufflesecurity/trufflehog/pull/2186)
- \[chore] - update regex by [@&#8203;ahrav](https://togithub.com/ahrav)
in
[https://github.com/trufflesecurity/trufflehog/pull/2184](https://togithub.com/trufflesecurity/trufflehog/pull/2184)
- \[chore] - Compile regex once by
[@&#8203;ahrav](https://togithub.com/ahrav) in
[https://github.com/trufflesecurity/trufflehog/pull/2176](https://togithub.com/trufflesecurity/trufflehog/pull/2176)
- Remove Java archives from ignored extensions by
[@&#8203;rosecodym](https://togithub.com/rosecodym) in
[https://github.com/trufflesecurity/trufflehog/pull/2188](https://togithub.com/trufflesecurity/trufflehog/pull/2188)
- \[chore] - Refactor common code into a separate function by
[@&#8203;ahrav](https://togithub.com/ahrav) in
[https://github.com/trufflesecurity/trufflehog/pull/2179](https://togithub.com/trufflesecurity/trufflehog/pull/2179)
- \[feat] - add metrics for gitlab by
[@&#8203;ahrav](https://togithub.com/ahrav) in
[https://github.com/trufflesecurity/trufflehog/pull/2190](https://togithub.com/trufflesecurity/trufflehog/pull/2190)
- \[bug] - move logic to main Chunks method by
[@&#8203;ahrav](https://togithub.com/ahrav) in
[https://github.com/trufflesecurity/trufflehog/pull/2194](https://togithub.com/trufflesecurity/trufflehog/pull/2194)
- \[fixup] - skip files in the archive handler by
[@&#8203;ahrav](https://togithub.com/ahrav) in
[https://github.com/trufflesecurity/trufflehog/pull/2195](https://togithub.com/trufflesecurity/trufflehog/pull/2195)
- Check private keys concurrently by
[@&#8203;rgmz](https://togithub.com/rgmz) in
[https://github.com/trufflesecurity/trufflehog/pull/2139](https://togithub.com/trufflesecurity/trufflehog/pull/2139)
- Propagate TruffleHog context to handlers by
[@&#8203;rgmz](https://togithub.com/rgmz) in
[https://github.com/trufflesecurity/trufflehog/pull/2191](https://togithub.com/trufflesecurity/trufflehog/pull/2191)
- \[bug] - close file after reading by
[@&#8203;ahrav](https://togithub.com/ahrav) in
[https://github.com/trufflesecurity/trufflehog/pull/2203](https://togithub.com/trufflesecurity/trufflehog/pull/2203)
- Use bad json in slackwebhooks by
[@&#8203;rosecodym](https://togithub.com/rosecodym) in
[https://github.com/trufflesecurity/trufflehog/pull/2193](https://togithub.com/trufflesecurity/trufflehog/pull/2193)
- Add disk buffer tempfile cleanup by
[@&#8203;codevbus](https://togithub.com/codevbus) in
[https://github.com/trufflesecurity/trufflehog/pull/2130](https://togithub.com/trufflesecurity/trufflehog/pull/2130)
- \[chore] Remove omitempty tags on JobProgressMetrics and UnitMetrics
by [@&#8203;mcastorina](https://togithub.com/mcastorina) in
[https://github.com/trufflesecurity/trufflehog/pull/2204](https://togithub.com/trufflesecurity/trufflehog/pull/2204)
- Fix azurestorage detector by [@&#8203;0x1](https://togithub.com/0x1)
in
[https://github.com/trufflesecurity/trufflehog/pull/2207](https://togithub.com/trufflesecurity/trufflehog/pull/2207)
- fix and refactor browserstack detector by
[@&#8203;0x1](https://togithub.com/0x1) in
[https://github.com/trufflesecurity/trufflehog/pull/2208](https://togithub.com/trufflesecurity/trufflehog/pull/2208)
- \[chore] Remove unnecessary string conversion in tefter detector by
[@&#8203;mcastorina](https://togithub.com/mcastorina) in
[https://github.com/trufflesecurity/trufflehog/pull/2209](https://togithub.com/trufflesecurity/trufflehog/pull/2209)
- Update metabase verification to check for a valid JSON response by
[@&#8203;mcastorina](https://togithub.com/mcastorina) in
[https://github.com/trufflesecurity/trufflehog/pull/2210](https://togithub.com/trufflesecurity/trufflehog/pull/2210)

**Full Changelog**:
https://github.com/trufflesecurity/trufflehog/compare/v3.63.2...v3.63.3

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/matter-labs/vault-auth-tee).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44Ny4yIiwidXBkYXRlZEluVmVyIjoiMzcuODcuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-14 14:20:29 +01:00
.github chore(deps): update trufflesecurity/trufflehog action to v3.63.3 (#24) 2023-12-14 14:20:29 +01:00
ratee feat: initial commit 2023-10-26 14:15:52 +02:00
tee feat: initial commit 2023-10-26 14:15:52 +02:00
version feat: initial commit 2023-10-26 14:15:52 +02:00
.gitignore feat: initial commit 2023-10-26 14:15:52 +02:00
CONTRIBUTING.md feat: initial commit 2023-10-26 14:15:52 +02:00
Dockerfile feat: initial commit 2023-10-26 14:15:52 +02:00
flake.nix feat: initial commit 2023-10-26 14:15:52 +02:00
go.mod fix(deps): update module golang.org/x/crypto to v0.16.0 (#19) 2023-11-28 04:44:33 +01:00
go.sum fix(deps): update module golang.org/x/crypto to v0.16.0 (#19) 2023-11-28 04:44:33 +01:00
LICENSE feat: initial commit 2023-10-26 14:15:52 +02:00
main.go feat: initial commit 2023-10-26 14:15:52 +02:00
README.md feat: initial commit 2023-10-26 14:15:52 +02:00
renovate.json feat: initial commit 2023-10-26 14:15:52 +02:00
SECURITY.md feat: initial commit 2023-10-26 14:15:52 +02:00

vault-auth-tee

TEE remote attestation plugin for Hashicorp Vault

⚠️☢️☣️ WARNING: not yet for production use ☣️☢️⚠️

License

All of the code is licensed under the Mozilla Public License 2.0 unless otherwise specified. Most of the vault plugin code is based on the vault builtin/credential/cert plugin.

Build Setup

$ wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
$ sudo bash -c 'echo "deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu focal main" > /etc/apt/sources.list.d/intel-sgx.list'
$ sudo apt update
$ sudo apt install -y --no-install-recommends \
    libsgx-headers \
    libsgx-enclave-common \
    libsgx-urts \
    libsgx-dcap-quote-verify \
    libsgx-dcap-quote-verify-dev

Configuration

Create or Update via the ${plugin}/tees/$name endpoint

{
    "name": "TEE_role_name",
    "token_policies": "policy1,policy2,...",
    "types": "sgx",
    "sgx_mrsigner": "298037d88782e022e019b3020745b78aa40ed95c77da4bf7f3253d3a44c4fd7e",
    "sgx_mrenclave": "18946b3547d3ca036f4df7b516857e28fd512d69fed3411dc660537912faabf8",
    "sgx_isv_prodid": 0,
    "sgx_min_isv_svn": 0,
    "sgx_allowed_tcb_levels": "Ok,ConfigNeeded,OutOfDate,OutOfDateConfigNeeded,SwHardeningNeeded,ConfigAndSwHardeningNeeded"
}
  • At least one of sgx_mrsigner or sgx_mrenclave must be set. If both are set, both are used for matching.
  • sgx_isv_prodid is optional and defaults to 0.
  • sgx_min_isv_svn is optional and defaults to 0.
  • sgx_allowed_tcb_levels is optional and defaults to Ok.

Authentication

  • Client TEE generates a self-signed TLS client certificate
  • Client TEE generates an attestation report, which includes the hash of the public key of the client certificate (in case of SGX, a sha256 sum of the public key)
  • Client TEE fetches all collateral material via e.g. Intel DCAP (tee_qv_get_collateral)
  • Client TEE sends POST request with a TLS connection using the client certificate to Vault via the ${plugin}/login endpoint with the name, attestation report and the attestation collateral material
  • An optional challenge can be included in the POST request, which is then included in the attestation report of the vault response
{
    "name": "The name of the TEE role to authenticate against.",
    "quote": "The quote Base64 encoded.",
    "collateral": "The collateral Json string encoded.",
    "challenge": "An optional challenge hex encoded."
}

The response contains the Vault token and, if a challenge was included, the vault attestation report, which must contain the challenge bytes in the report_data of the quote.

{
    "auth": {
        "client_token": "The Vault token.",
        "....": "...."
    },
    "data": {
        "quote": "The vault quote Base64 encoded.",
        "collateral": "The vault collateral Json string encoded."
    }
}

Collateral Json encoding

See sgx_ql_lib_common.h

{
    "major_version": uint16,
    "minor_version": uint16,
    "tee_type": uint32,
    "pck_crl_issuer_chain": []byte,
    "root_ca_crl": []byte,
    "pck_crl": []byte,
    "tcb_info_issuer_chain": []byte,
    "tcb_info": []byte,
    "qe_identity_issuer_chain": []byte,
    "qe_identity": []byte
}