Commit Graph
213 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
Marco Dinis 9115a54ec2 Add support for enrolling uniform Azure VM Scale Sets (#66631) 2026-05-20 16:08:33 +00:00
Jake Altiandrosstimothy a6b3b78259 Stop loading host AWS config in mock provider (#66606)
* Stop loading host AWS config in mock provider

* Update lib/cloud/mocks/aws_config.go

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>

---------

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
2026-05-11 15:21:18 +00:00
Gavin Frazar 9addfb0c0d Timeout Azure discovery install command (#66496)
* Timeout Azure discovery install command

* Pad the Azure installation context timeout
2026-05-07 21:42:45 +00:00
Trent Clarke ef74b08b28 [AWSIC] Add iam:CreateSAMLProvider to Identity Center Policy (#66420)
Adds the required `iam:CreateSAMLProvider` permission to the Teleport-generated
Identity Center policy statement. This permission is required when provisioning
the first Account Assignment to a new AWS Account in order to create a SAML provider
tying the AWS Account to the Identity Center instance's auth system.
2026-05-06 05:22:41 +00:00
Cam HutchisonandCam Hutchison 432428fc57 fips: Rename IsBoringBinary to IsFIPSBuild throughout (#66346)
* fips: Rename IsBoringBinary to IsFIPSBuild throughout

Rename the function and method `IsBoringBinary` to `IsFIPSBuild`
throughout the code base and change references to boringcrypto to
fips140 or similar. This is part of removing boringcrypto from the
build, replacing it with Go-native FIPS140.

There are still some references to "boring":
* The PingResponse message has a field IsBoring in authservice.proto.
  This cannot be changed without breaking source compatibility in api/
* The example in examples/teleport-usage has an explicit check for the
  boring package to set an AWS FIPS option. This will be changed when
  the actual change to Go-native FIPS is done.
* Rust references to boringsys - this is still used in Rust and will not
  be changed when using Go-native FIPS.
* The actual import of boring to use it. This will be changed when using
  Go-Native FIPS.

This rename is separate from the Go-native FIPS implementation so it can
be backported to keep the branches close, to avoid unnecessary
conflicts.

* fips: Add "crypto/tls/fipsonly" import for boring builds

Import the "crypto/tls/fipsonly" package when building in fips mode.
This import is also done in the Enterprise repo with some rename magic
so that the file the import is in only exists for fips builds. This was
necessary when boringcrypto was only available in a special branch of
the Go toolchain, but has not been necessary since Go 1.19 when
boringcrypto was brought into the proper toolchain.

Moving this here makes the enterprise makefile and fips build simpler.
There is no need to split this now.

The import causes TLS negotiation to reject non-FIPS140 ciphers.

---------

Co-authored-by: Cam Hutchison <camh@xdna.net>
2026-05-02 10:58:23 +00:00
charlestp aabc4b601c Support region wildcard in discovery EKS matchers. (#66036) 2026-04-24 18:14:50 +00:00
Krzysztof Skrzętnicki edc5635471 Add audit events for Azure VM auto-discovery installations (#65875)
* Add audit events for Azure VM auto-discovery installations

* `make audit-event-reference`

* fix flaky test; comment on `Watcher.Run()` design issue

* address the review feedback

* expand test coverage

* fix wrong sign

* remove zero values from struct init
2026-04-23 12:02:03 +00:00
rosstimothy 5870768c88 Stop using text/template and html/template to enable DCE (#65401)
All existing template usage was converted to make use of
github.com/DataDog/datadog-agent/pkg/template. The DataDog package
is a fork of the stdlib template packages with method calling
removed so that reflect.MethodByName does not prevent DCE.

There were a handful of method calls in our templates that were trivially
changed to use custom functions defined via FuncMaps or specifying the
calculated value to the template instead of calling a function in the template.

A future change will add linter rules to prevent new text/template or
html/imports from landing. They have not been included here so as
to not to break enterprise code while it is migrated.
2026-04-22 15:54:43 +00:00
306b6a9db0 Set Teleport version in SSH clients (#65004)
* Set Teleport version in SSH clients.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Add more tests. Fix lint.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Fix import. Fix lint exclude.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Fix lint - come on!

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Fix race by making a defensive copy.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Use ErrorIs.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Deep clone client conf. Early return for err. Make consistent.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Return new conf if nil. Add trace.Wrap to missing.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Add IsSSHFeatureSupported. Switch from api to api_test for test pack. Make prefix exported const.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Revert accidental commit.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Return sentinel error for older clients or non-teleport clients to improve downstream handling.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Clean up.

Co-authored-by: Chris Thach <chris.thach@protonmail.com>

* Apply suggestions from code review

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@gmail.com>

* Remove defensive check.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Change from trace.BadParam to reg error.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Use strings.Cut and improve readability.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Use error struct.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Add test that errors if ssh.ClientConfig changes.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Move to subpackage.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Use static assertion instead.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Return error if config is nil.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Allow clients to override client version via config.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Fix test because I forgot to update it.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Move assert to test file.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Remove error return val.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Relax parser to allow for more.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Fix lint.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* WIP take on a tracessh wrapper. Will fail CI.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Add tests and polish new package.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Revert changes to tracessh. Add lint config.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Revert changes to use tracessh.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Delete extra s.

Co-authored-by: Chris Thach <chris.thach@protonmail.com>

* Apply suggestions from code review.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Add IsEmpty helper methods.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* First pass of refactoring.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Second pass refactor.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Third pass refactor.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Fix nil panic.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Fix missing user value.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Fix missing User value.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Remove Get from name. Polish.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Fix incorrect signers for clients. Make changes consistent.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Allow ClientConfig to be empty in proxy config.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Fix eager signers regression in generateClientConfig.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Add edge case for space after prefix.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Fix issues from code review.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Drop suffix. Update comments.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Update ClientConfig docs.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Add warning about using the Teleport version.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Teleport version is mandatory.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Revert timeout to make Claude/Codex happy.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Remove alias in places that didn't need it. Revert lib/cloud/gcp/alloydb.go.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Add wrapper for tracessh.Client.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Add tests for generate client config.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Drop config from field name to shorten.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Fix lint issues.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

---------

Signed-off-by: Chris Thach <chris.thach@goteleport.com>
Co-authored-by: Edoardo Spadolini <edoardo.spadolini@gmail.com>
2026-04-07 18:06:00 +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
Tiago Silva a144a42380 lib/cloud/awsconfig: validate AWS region before fetching config (#64699)
* lib/cloud/awsconfig: validate AWS region before fetching config

Add region validation to both `Cache.GetConfig` and `ProviderFunc.GetConfig`
using the existing `apiutilsaws.IsValidRegion` helper. Returns a bad parameter
error early if a non-empty region is invalid, preventing unnecessary downstream
calls with a bad region and upstream validations.

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

* fix unit tests

---------

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
2026-03-20 13:43:51 +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
Chris Thach c26680a73c Lint to enforce using t.Context() instead of context.TODO() 👮🏾 (#63596)
* Update linter to restrict using context.TODO() in Go tests.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Revert changes to testlib package.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

---------

Signed-off-by: Chris Thach <chris.thach@goteleport.com>
2026-02-06 19:42:33 +00:00
Tiago Silva b6e9a50eaf Adds AWS Bedrock IAM integration for session summaries (#62883)
* Adds AWS Bedrock IAM integration for session summaries

Introduces support for configuring IAM permissions to allow Teleport's session summaries feature to invoke AWS Bedrock models.

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

* handle code review comments

* handle code review comments

---------

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
2026-01-26 11:25:43 +00:00
Marco Dinis 08a29a80ec AWS OIDC set up script: handle LimitExceededError (#63056)
During AWS OIDC integration set up, the user receives a script that they
must run in order to set up the integration in AWS side.

This script, among other things, creates the AWS IAM Identity Provider
(OIDC type), which then teleport uses to access the AWS APIs.

During the IdP creation, some errors can occur.
One of them is when the IdP already exists, in this case the script
ignores the step and continues to the next ones.

We were wrongly parsing the AWS errors into 'already exists' error type.
When AWS returns code 409, we always assume it is an EntityAlreadyExists
error type.
However, we might also get a 409 code with LimitExceeded.
In this case, the script must stop and return the error to the user.

You can see the full list of errors here:
https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateOpenIDConnectProvider.html#API_CreateOpenIDConnectProvider_Errors
2026-01-22 17:55:57 +00:00
Marco Dinis c467a87e88 IAM Joins by organization with support for integration credentials (#62405) 2026-01-15 18:51:55 +00:00
Krzysztof SkrzętnickiandNoah Stride 4d61a6af53 Azure VM discovery: stats, refactor, add test coverage (#62513)
* Azure VM discovery stats: proto changes

* Azure VM discovery: stats, refactor, add test coverage

* refactor: update Azure VM enrollment to return detailed failure information, change constant names for clarity.

* update test

* Update lib/srv/server/azure_installer.go

Co-authored-by: Noah Stride <noah.stride@goteleport.com>

* flip if/else to decrease depth.

* refactor: cache static fetchers in Azure server discovery

---------

Co-authored-by: Noah Stride <noah.stride@goteleport.com>
2026-01-09 13:11:50 +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
Marco Dinis f6ff4984f1 EC2 Auto Discover: add new required permission account:ListRegions (#61967) 2025-12-04 09:40:10 +00:00
Marco Dinis 14706fed9b AWS EC2 Discovery: discover in all enabled regions (#61337)
* AWS EC2 Discovery: discover in all enabled regions

* use wildcard

* require at least one region

* downgrade discovery service for old clients

* move region x type check to runtime

* add test back

* fix expected version
2025-12-02 13:12:12 +00:00
Krzysztof Skrzętnicki e52ebcbf1f Further refactoring of Azure and GCP cloud clients (#61808)
* Further refactoring of Azure and GCP cloud clients

* drop redundant GCP/Azure qualifiers from method names, remove unused fields

* rename methods in consumer interfaces
2025-11-28 09:55:23 +00:00
Krzysztof Skrzętnicki 9b888a3fe5 OIDC auth support to Azure auto-discovery (#61494)
* feat: add support for Azure OIDC integration auth for discovery service

* docs: improve documentation for getAzureClients function

* feat: add integration field to Azure fetcher configurations

* update expected test result

* update another expected test result; update said test to use EventuallyWithT for improved error reporting

* lint fix
2025-11-26 17:23:13 +00:00
Krzysztof Skrzętnicki 7d2704953f split cloud.Clients interface into smaller, cloud-specific types (#61478)
* split `cloud.Clients` interface into smaller, cloud-specific types

* rename types, package

* remove InstanceMetadataClient and related types

* fix imports

* close GCP clients in TLSServer close method

* close GCP clients in Server Stop method

* add TODO to close GCP clients when no longer in use
2025-11-20 08:28:54 +00:00
Cam Hutchison da3d763d25 accessgraph sync: Add AWS IAM role for EKS audit logs (#61364)
* accessgraph sync: Add AWS IAM role for EKS audit logs

Update the `teleport configure integration acces-graph aws-iam` command
to add a permission to access EKS audit logs via CloudWatch Logs if the
`--eks-audit-logs` flag is passed. This is necessary so that an
integration can pull the EKS audit logs if so configured in a discovery
access graph matcher.

* web: Add web eksAuditLogs to integration configure endpoint

Extend the web endpoint for the webscript for integrations configure
access-graph-cloud-sync-iam.sh to add the `eksAuditLogs` query param to
configure with EKS audit logs enabled. Add tests for this endpoint as
there were none.
2025-11-17 22:51:56 +00:00
Marco Dinis 0a2ad083cf Server discovery: use a single installation script for all clouds (#60592)
* Server discovery: use a single installation script for all clouds

When doing Server Auto Discovery we were using slightly different
scripts for installing teleport into the target instances/VMs.

This meant duplicated effort for new features and tests.

This PR reduces the number of places we generate a script, by moving
everything to a single method.

It also fixes a bug where we might not be able to use dynamic matchers
(aka DiscoveryConfig resource) for GCP and Azure.
If GCP and Azure matchers in a DiscoveryConfig, do not have the
ProxyAddr configure, we would generate an invalid script.

Now, if absent, we will fetch it from the cache. Just like we do for the
AWS EC2 flow.

* escape token name

* add test case for azure client id
2025-11-05 11:41:51 +00:00
Marco Dinis a961d9491f Add env param to SSM Doc used for EC2 auto discovery (#59047)
This PR adds a new param, `env` which will be used to inject environment
variables into the script.

This will be useful for injecting the TELEPORT_INSTALL_SUFFIX and
TELEPORT_UPDATE_GROUP used by `teleport-update` and, soon, `teleport
install autodiscover-node` command.
2025-09-22 16:45:15 +00:00
rosstimothy ad08e94b4c chore: Bump Go to 1.25.1 (#58875)
* chore: Bump Go to 1.25.1

Update all Go modules to use Go 1.25.1.

* Use stable synctest API introduced in Go 1.25

All existing tests that used synctest have had their build
constraints removed and have been updated to use synctest.Test
instead of synctest.Run. There are still tests in teleport.e that
needs to be updated before we can remove GOEXPERIMENT=synctest
and retire the synctest build tag.

* Remove coverage from go test invocations

This is a temporary workaround to https://github.com/golang/go/issues/75031.
When the buildboxes have Go 1.25 installed globally this should no
longer be an issue and coverage can be restored.

* Lazily unmount cgroups

Adds the MNT_DETACH flag to the cgroups unmount call to workaround
issues stemming from a behavior chagne in Go 1.25 to support
automatically setting GOMAXPROCS. In doing so the Go runtime
interacts with cgroups to determine what limits should be applied
which interferes with our ability to clean up.

Fixes https://github.com/gravitational/teleport/issues/58879.

* Fix syntest bug with waitgroups

```
=== Failed
=== FAIL: lib/srv/discovery TestDiscoveryServerEKS (unknown)
fatal error: sync: WaitGroup.Add called from multiple synctest bubbles
```

The failure stems from a bug in Go 1.25 and is a result of loading
aws configs which internally use a sync.WaitGroup. This can be worked
around in the short term by mocking out the aws.Config since the test
is configured to use a mock eks client anyway. Other tests may still
run into this issue until Go 1.25.2 - though our relatively small number
of synctest usage at this point may limit our exposure to said bug.
2025-09-15 21:49:53 +00:00
Gavin Frazar f08b02b62b Add ElastiCache Serverless discovery (#58336) 2025-08-28 18:00:57 +00:00
86852353ed GCP AlloyDB support (#56078)
* Proto changes

* Types changes

* Configuration changes

* Cloud client, `go.mod`

* Add method to fetch AlloyDB token

* Engine changes

* `make -C integrations/operator crd`

* lint fix

* `make -C integrations/terraform docs`

* change GCPCloudSQL comment in proto

* Update lib/srv/db/postgres/alloydb.go

Co-authored-by: Marco Dinis <marco.dinis@goteleport.com>

* Update lib/srv/db/common/auth.go

Co-authored-by: Marco Dinis <marco.dinis@goteleport.com>

* address review comments

* lint fix

* Rename `is_alloy_db` to `is_alloydb`

* Clarify comments for AlloyDB database fields in DatabaseGCP struct

* Nudge user towards proper permissions

* Update lib/srv/db/postgres/alloydb.go

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>

* remove todo in favor of longer comment

* reduce indentation

* suggest custom IAM role with minimal required scope

* Major implementation update:
- new URI format `alloydb://<connection uri>`
- removed some configuration fields; added `gcp.alloydb.endpoint` instead
- added connection URI resolution against configured endpoint type
- made query cancellation and health checks aware of AlloyDB needs
- unified query cancellation logic to use the `connector` type

* Revert description changes for flags; these are redundant for AlloyDB

* Enhance error handling in ParseAlloyDBConnectionURI function and add comprehensive test cases for invalid URIs

* split `endpoint` into `endpoint_type` and `endpoint_override`

* Remove indentation from custom error messages

* Log resolved database address

* fix serialization test

* explain the logic in `getGCPType`

* use string instead of enum for endpoint type

* add missing cast

---------

Co-authored-by: Marco Dinis <marco.dinis@goteleport.com>
Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
2025-08-20 15:04:12 +00:00
Julia Ogris 565947d136 access-graph: Add AWS KMS key discovery to access graph (#56874)
* access-graph: Add KMS resource protos

Add the `AWSKMSKeyV1` protobuf messages to support importing KMS key
into the access graph.

This new type is added to the `AWSResource` oneof.

The Go bindings were regenerated using `make grpc`.

* access-graph: Add AWS KMS key discovery to access graph

Implement AWS KMS keys discovery and ingest into access graph. The
fetcher discovers keys across all specified regions.

For each KMS key, the fetcher retrieves the following details:

* Key metadata, including ARN, creation date, and HSM cluster ID
* Resource tags
* Key aliases
* The key policy document

Add a mock KMS client  to support comprehensive unit testing of the new
fetcher, covering various key configurations and error cases.

The new KMS key resource is integrated into the existing discovery framework,
including the merge, deduplication, and reconciliation steps.

The required IAM policy for access graph discovery is updated to include the
necessary `kms:` permissions.

Correct typo in the `GlueTableName` field name.

* Address review feedback

* Address second set of review feedback

* Regenerate go-bindings for proto

* Fix golden files with new AWS KMS actions
2025-08-08 00:29:41 +00:00
Andrew Burke 30c09df403 Add assume role for EC2 discovery (#55897)
This change allows Teleport to assume a role while performing EC2
auto-discovery.
2025-07-07 23:45:38 +00:00
Tiago Silva 9639298a40 iac: fix incorrect s3:GetObject permission (#56311)
This PR fixes an incorrect AWS IAM permission that didn't set the
wildcard for the `s3:GetObject` permission. This caused the download to
fail because AWS requires the file wildcard to be present.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
2025-07-01 16:29:33 +00:00
Marco Dinis bbe259d31f AWS IAM Roles Anywhere: one-off script for integration set up (#54630)
* New teleport configure command: AWS Roles Anywhere set up

This PR adds a new teleport configuration command which performs the AWS
IAM Roles Anywhere Integration set up.

It does the following:
- creates a new Roles Anywhere Trust Anchor using the certificate received
- creates a new IAM Role which allows the required APIs for sync, and is
  usable by the Roles Anywhere service, filtered by the created Trust
  Anchor
- creates a new Roles Anywhere Profile which can use the IAM Role above

This is part of the new AWS IAM Roles Anywhere integration required set
up.

* clarify placeholder usage + tests

* fix godoc
2025-06-23 17:08:25 +00:00
Marco Dinis 54d4fd1efd AWS IAM Roles Anywhere: add support for Web/Console Access (#54594)
* AWS Web/Console Access using IAM Roles Anywhere Integration

This PR adds support for AWS Web/Console Access using the IAM Roles
Anywhere Integration.

When trying to access an AWS App which has an associated:
- integration of AWS RA kind
- Roles Anywhere metadata: profile ARN
- IAM Role

There is a new flow which generates credentials using the:
- trust anchor present in the integration metadata
- profile arn present in the AppServer metadata
- target IAM Role
- and a X.509 certificate generated from the AWS Roles Anywhere CA

Those credentials are then used to generate the signing URL using the
federation service.

* move assume role details to helper func

* remove dead code, fix comment and error message
2025-06-23 14:56:46 +00:00
Zac Bergquist 6dbcf9b5d3 Modernize lib/backend, lib/cache, lib/cloud, and integration (#55921) 2025-06-21 15:05:11 +00:00
Tiago Silva 81ceee26bc feat: add SQS, S3, and KMS support for AWS Access Graph integration (#55300)
- Updated configuration to acept SQSQueueURL, CloudTrailBucket, and KMSKeyARNs.
- Updated integration commands to accept new parameters for SQS and S3.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
2025-06-03 09:06:37 +00:00
STeve (Xin) Huang 0ae4ca0fa8 Fix an issue database discovery fails when there are more than 5 OpenSearch domains (#55024) 2025-05-21 19:50:37 +00:00
Marco Dinis 2cea8b1fd8 Move AWS tags helper methods to their own package (#54850)
No functional change, just prep work for the AWS IAM Roles Anywhere
integration requirements.
2025-05-20 07:56:15 +00:00
Gavin Frazar b8ea423c50 Add database health checks and routing (#54474)
* database service runs health checks on MongoDB, PostgreSQL, and MySQL
  databases
* proxy service routes database user connections based on health status
2025-05-07 23:27:53 +00:00
rosstimothy 52816e8427 Bump golangci-lint to v2 (#54410)
* Bump golangci-lint to v2

* fix lints

* update e

* fix: delete removed cli option
2025-05-07 22:14:51 +00:00
Edoardo Spadolini 91741f1abf Tweak api/version.go generation (#54257)
* Delete audit stream version check for v13

* Remove string parsing for bpf min kernel version

* Remove string parsing for min etcd version

* Remove version string parsing for route not found

* Remove string parsing for min mariadb version

* Remove string parsing for min mongodb custom data version

* Remove string parsing for min openat2 kernel version

* Use consts in api/version.go

* Generate api/version.go with a go command

* Avoid using a global variable SemVersion

* Keep but deprecate SemVersion in api

* fix-license
2025-04-24 12:58:05 +00:00
rosstimothy f49dd87579 Support GKE DNS endpoints (#54177)
If the new DNS endpoints are enabled the CA should be omitted from
the TLS configuration. The endpoints are signed by a different CA
than the cluster and are publicly trusted so a custom CA does not
need to be configured.

Closes https://github.com/gravitational/teleport/issues/54143
2025-04-22 20:32:09 +00:00
rosstimothy d002d1e43a Require that FnCache keys are comparable (#53565)
Adds an additional type constraint go FnCacheGet and FnCacheGetWithTTL
to enforce that all keys are comparable. This should allow the
removal of various compile time hashability checks that are in
place for existing keys of custom types.
2025-03-29 14:40:32 +00:00
Gabriel Corado 7abd39703a Migrate app access to AWS SDK V2 (#52264)
* refactor: migrate app access to AWS SDK v2

* refactor: code review suggestions

* refactor: avoid using cache provide for AWS console signed request

* refactor: add option to provide the base config to GetConfig (awsconfig)

* test: use credential provider mock

* fix(app): correct logger init order

* refactor: rename option to WithBaseCredentialsProvider

* test(app): enforce base config credentials
2025-03-07 12:29:23 +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
Gabriel Corado 66c019c361 Support resolving Azure identities from VM scale set for SQL Server connections (#51671)
* feat(sqlserver): support resolving identity for scale set VMs

* fix: update mocks signature

* refactor: rework fetch scale set vms

* chore(imds): remove unused metadata attribute

* chore: add comments clarifying the flow

* refactor: code review suggestions
2025-02-14 02:44:34 +00:00
Alan Parra 7f0c4e93bd feat: Allow non-FIPS endpoints on FIPS binaries (#51924)
* Add the dynamodbutils and stsutils packages

* Use stsutils.NewFromConfig()

* Use stsutils.NewV1()

* Use dynamodbutils.IsFIPSEnabled()

* Add forbidigo rules

* Appease linter
2025-02-11 22:45:04 +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
Gavin Frazar ee119ea6d6 Remove remaining db and discovery AWS SDK imports (#51628)
This eliminates all remaining references to AWS SDK v1 in the
lib/srv/db/... and lib/srv/discovery/... packages.
Most of the changes are simply to remove dead code.
2025-01-30 23:06:09 +00:00