14 Commits
Author SHA1 Message Date
Marco Dinis 9fdb5effb6 Fix Azure/GCP IMDS tests when HTTP_PROXY is set (#66996) 2026-05-27 15:42:17 +00:00
Tiago SilvaandNic Klaassen e54bfb9ab7 enforce region validation on all AWS config loading (#64893)
* enforce region validation on all AWS config loading

Replace direct uses of `github.com/aws/aws-sdk-go-v2/config.LoadDefaultConfig`
with the internal `lib/cloud/aws/config.LoadDefaultConfig` wrapper, which
validates any explicitly requested AWS region before use. Enforces this via a
new forbidigo linter rule.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>

* Apply suggestions from code review

Co-authored-by: Nic Klaassen <nic@nicklaassen.ca>

* fix unit tests

* include underscores and uppercase letters

* add ConfigureRegion

---------

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
Co-authored-by: Nic Klaassen <nic@nicklaassen.ca>
2026-04-07 08:48:47 +00:00
Marco Dinis 2c002898e0 Disable http_proxy for IMDS/metadata services (#64158)
* disable http proxy for azure and gcp imds clients

* add tests
2026-03-12 10:29:08 +00:00
Krzysztof Skrzętnicki 9e3b4ccb3c fix: add availability checks for instance metadata methods (#62457)
* fix: add availability checks for instance metadata methods

* clarify comment

* ensure no race conditions occur
2026-01-02 09:30:55 +00:00
Zac Bergquist 6dbcf9b5d3 Modernize lib/backend, lib/cache, lib/cloud, and integration (#55921) 2025-06-21 15:05:11 +00:00
Andrew Burke 217d014a95 Import Oracle Cloud tags (#52283)
This change adds the ability to import tags when running on an
Oracle Cloud compute instance.
2025-02-24 18:51:41 +00:00
rosstimothy 2cced62805 Fix violations of non-constant format strings linter (#51812)
Depends on https://github.com/gravitational/teleport.e/pull/6006.
Now that we are compliant, the ignore rule was removed from the
golangci-lint config to prevent future regressions.
2025-02-04 16:43:35 +00:00
Marco DinisandAlan Parra eed43cffa9 Auto Discover GCP GCE: add project id label (#45737)
* Auto Discover GCP GCE: add project id label

This PR adds a new label when auto configuring the teleport.yaml for a
VM in GCP.
This new label has the project id.
We already had the project id, but it was in a protected/internal only
label and so the users couldn't see it in the WebUI.

* Update api/types/constants.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Update api/types/constants.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Update lib/srv/server/installer/autodiscover_test.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* fix var name and remove godoc from not implemented methods

---------

Co-authored-by: Alan Parra <alan.parra@goteleport.com>
2024-08-26 08:26:23 +00:00
rosstimothy 8410d1e4fb Refactor imds/gcp to no longer depend on lib/cloud/gcp (#43122)
The imds pacakges are inteneded to be very lightweight
and consumable by client tools without any additional
cloud specific dependencies. By inverting dependencies
such that lib/cloud/gcp depends on lib/cloud/imds/gcp
client tools no longer transatively import the very
large `cloud.google.com/go/compute/apiv1`.

The depguard rules were also updated to prevent any
accidental regressions.
2024-06-18 00:02:18 +00:00
Marco Dinis 5f0786ce7f Azure IMDS: add location, vmid, subscription and group (#42857)
* Azure IMDS: add location, vmid, subscription and group

This PR adds a new method to fetch instance metada information.
It will include the instance/metadata endpoint to retrieve them.

* fix test

* improve error assertion
2024-06-17 08:07:50 +00:00
Andrew Burke 86c6e9e49a Fix GCP metadata errors crashing Teleport (#42696) 2024-06-12 17:45:09 +00:00
Andrew Burke b5f46c5b05 Fix converting from GCP gRPC errors (#41970) 2024-05-23 20:36:20 +00:00
Andrew Burke c965b4397f Automatically import GCP labels (#41246)
This change adds the ability for Teleport to automatically import
labels and tags from the GCP instance it's running on.
2024-05-17 19:56:44 +00:00
rosstimothy 1b5e0b0082 Reduce exposure of lib/cloud/gcp (#41678)
* Move imds related code into their own packages

Separating imds from cloud vm, kubernetes, etc. prevents the
dependency tree expanding to include extra cloud related things
for callers that only require an imds client.

* Move cloud constructors for types.KubeCluster out of lib/services

lib/services is meant to be a relatively dependency free package
that provides basic interfaces and functions for dealing with
types. NewKubeClusterFromGCPGKE, NewKubeClusterFromAWSEKS, NewKubeClusterFromAzureAKS
caused a slew of cloud related dependencies to be imported in
lib/services which increases binary sizes of client tools.

They have all been moved into lib/srv/discovery/common since
they were only consumed by other code in lib/srv/discovery.

* Decouple servicecfg and lib/auth/keystore

This was the last remaining way for lib/cloud/gcp to slip
into client tools that aren't importing lib/auth directly.

```
goda tree "reach(github.com/gravitational/teleport/tool/tctl...:all, cloud.google.com/go/compute/apiv1)"
├ github.com/gravitational/teleport/tool/tctl
    └ github.com/gravitational/teleport/tool/tctl/common
      ├ github.com/gravitational/teleport/lib/config
        ├ github.com/gravitational/teleport/lib/pam
          └ github.com/gravitational/teleport/lib/service/servicecfg
            └ github.com/gravitational/teleport/lib/auth/keystore
              └ github.com/gravitational/teleport/lib/cloud
                └ github.com/gravitational/teleport/lib/cloud/gcp
                  └ cloud.google.com/go/compute/apiv1
        └ github.com/gravitational/teleport/lib/service/servicecfg ~
      ├ github.com/gravitational/teleport/lib/service/servicecfg ~
      ├ github.com/gravitational/teleport/tool/tctl/common/accessmonitoring
        └ github.com/gravitational/teleport/lib/service/servicecfg ~
      ├ github.com/gravitational/teleport/tool/tctl/common/loginrule
        └ github.com/gravitational/teleport/lib/service/servicecfg ~
      ├ github.com/gravitational/teleport/tool/tctl/sso/configure
        ├ github.com/gravitational/teleport/lib/service/servicecfg ~
        └ github.com/gravitational/teleport/tool/tctl/sso/tester
          └ github.com/gravitational/teleport/lib/service/servicecfg ~
      └ github.com/gravitational/teleport/tool/tctl/sso/tester ~
```

* fix lints

* tidy integrations/event-handler

* fix license

* fix: only populate cloud clients if aws kms configured
2024-05-17 10:29:02 +00:00