Commit graph

12 commits

Author SHA1 Message Date
Trent Clarke 6cfcd24283
Updates distroless Dockerfile to handle fips realeases (#25449) 2023-05-02 03:29:03 +00:00
Vitor Enes 6a1d1aedc3
Emit new AgentMetadataEvent (#22068)
* Emit new `AgentMetadataEvent`

Part of https://github.com/gravitational/cloud/issues/3550.

This commits adds a new `UpstreamInventoryAgentMetadata` that is sent
from a Teleport agent to an auth server.
Once received, it is transformed into an `AgentMetadataEvent` and sent
to PreHog.

Most `UpstreamInventoryAgentMetadata` fields are intentionally kept as
empty in this PR. Follow up PRs will be opened with the mechanisms
required to fill them (as described in #21337).

* server_id -> host_id

* compute OS and host architecture

* Compute OS version and container runtime

* Close stream if agent receives an agent metadata message

* cmd -> exec ; file -> read

* implement fetchOSVersion for linux

* Remove unused import

* Add note about `agentMetadataCh`

* Allow commands with args

* Remove parseFun abstraction

* fetch glibc version

* fetch container orchestrator

* Fix lint

* Fix TODO

* Add note about glibc version

* cmd -> command

* fetch cloud environment

* fetch install methods

* GLibCVersion -> GlibcVersion

* Use `http.NewRequestWithContext`

* Add missing comment

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

* GLibCVersion -> GlibcVersion

* Fix lint

* Fix helm unit tests

* Add missing comments

* 5 second timeout on http requests

* Spawn gorountine that fetches metadata on each new stream

* Use `defaults.HTTPClient()`

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

* Add missing import

* Handle error

* Revert "Spawn gorountine that fetches metadata on each new stream"

This reverts commit fe4f2790be.

* Send agent metadata to auth server once per stream

* Improve note about agentMetadataDone

* Don't process command output & file content on the agent

Since agents cannot be trusted, regex validation and sanitization should
happen in PreHog anyways. So this commit removes such logic in favor of
moving it to PreHog.

* Fix lint

* Trim space

* Move handling of `AgentMetadataEvent` to `handleControlStream`

* Use cached hello message

* Move metadata files to lib/inventory/metadata

* make sending of agent metadata more self contained

* Minimize diff

* Send all system roles to PreHog

* Remove unused import

* Add parsing of command output / file content back

* Usage reporter refactor

* Usage reporter refactor

* Add missing handling of inventory agent metadata msg

* Fix ICS usage reporter

* Improve comments

* Add cached `metadata.Get*` methods

* Use systemctl status instead of is-active

* Add `Metadata` struct

* return pointer in `FetchMetadata`

* Pass context to `GetMetadata`

* metadataFetchConfig -> fetchConfig

* GetMetadata -> Get

* Add note about `Get` result

* Ensure install methods are non-nil

* Exit `metadata.Get` if context is closed

* Replace sync.Once with atomic.Bool.Swap

* Initialize channel

* Fix lint

* Fix lint

* Make `metadata.Get` return an error instead of bool

* Allow multiple true/false values for env vars

* Use `strings.Cut`

* Use /etc/os-release ID instead of NAME

* Improve `autoEmitMetadata`

* Use `gnu_get_libc_version`

* Ubuntu -> ubuntu

* Use GOARCH

* gofmt

* Move import C up

* Variables may include quotes

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

* Default values for ID and VERSION_ID

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

* Blank lines are permitted

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

* Anonymize host id

---------

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
2023-03-10 12:45:29 +00:00
Trent Clarke a992e6fded
Distroless dockerfile and smoke tests for same (#21860)
* Distroless dockerfile and smoke tests for same

This patch adds a Dockerfile to `build.assets/charts` that will construct
a docker image for teleport based on the Distroless Debian images
published by Google. The actual workflows used to construct and publish
these images are defined in `teleport.e` for security reasons.

The Smoke Testing framework exists to make some quick assertions about
the resulting images: will Teleport even start in this context, etc. See
the included README for more details.

* Update README.md

* Linter appeasement

* Revert spurious submodule update

* Rename release component var

* Smoke test docs

* Smoke test docs

* Revert spurious subrepo update
2023-03-02 09:51:28 +00:00
fheinecke 1472e9cf9e
Added multiarch build support for Teleport (#17597) 2022-10-31 18:00:55 +00:00
Noah Stride b433cdbace
Bundle tbot into the built docker images (#14308)
Bundle tbot into the built docker images
2022-07-14 12:35:49 +00:00
fheinecke 6045b6922d
Added debugging packages to Docker images (#13124) 2022-06-03 09:47:36 -05:00
Gus Luxton 458b6e5348 docker: Add libelf1 as a dependency for building Teleport container images 2021-07-14 15:02:40 -07:00
Gus Luxton 3034a59c6e
Change to Ubuntu 20.04 base and improve apt cleanup (#4004)
* Change to Ubuntu 20.04 base and improve apt cleanup
* Update e ref
2020-07-10 17:07:56 -03:00
Gus Luxton b08034a908
Add FIPS Docker build support (#3046) 2019-10-16 13:31:46 -03:00
Russell Jones c0dea43d70 Fix Docker image. 2019-01-10 17:23:56 -08:00
Kevin Nisbet 830bc74073 Use ubuntu as the base image for a clean clair security scan 2018-10-04 10:08:16 -07:00
Sasha Klizhentas cece4be212 Initial implementation of Kubernetes support
This issue updates #1986.

This is intial, experimental implementation that will
be updated with tests and edge cases prior to production 2.7.0 release.

Teleport proxy adds support for Kubernetes API protocol.
Auth server uses Kubernetes API to receive certificates
issued by Kubernetes CA.

Proxy intercepts and forwards API requests to the Kubernetes
API server and captures live session traffic, making
recordings available in the audit log.

Tsh login now updates kubeconfig configuration to use
Teleport as a proxy server.
2018-06-03 12:55:13 -07:00