Commit graph

472 commits

Author SHA1 Message Date
Jakub Nyckowski 19dfedb65f
Update buildbox version to v12 (#18503)
* Update buildbox version to v12

* Update .drone.yml
2022-11-16 19:22:07 +00:00
Roman Tkachenko d9bc3371c5
Install latest git to buildbox (#18498)
Signed-off-by: Roman Tkachenko <roman@goteleport.com>
Co-authored-by: Victor Sokolov <gzigzigzeo@gmail.com>
2022-11-15 19:44:12 -05:00
Grzegorz Zdunek 1ab74c1130
Update Node.js to 16.18.1 (#18354) 2022-11-10 20:41:40 +00:00
Trent Clarke 0b3403978c
Tcsc/v12 versioned windows builder (#18339)
Adds a drone node selector so builds will be routed to the correct buildbox

Also:
1.  changes the version of Visual Studio expected by npm to vs 2022 to match buildbox installation

2. Removes the concurrency limit for window push builds. As there are separate builders for v10, v11
    and v12. Given that the concurrency limits are enforced across all builds with the same name, they
    serialise builds from different teleport versions. it seems wasteful to have a builder for v10 sit idle
    while waiting a v11 build completes.

    The concurrent limits have been left for tag builds, as there are flow-on concurrency concern due to artifact
    uploading, etc.
2022-11-10 12:43:38 +00:00
Jakub Nyckowski bea2e89df5
Run GCI as make fix-imports (#17956)
Co-authored-by: Alan Parra <alan.parra@goteleport.com>
2022-11-04 15:46:46 +00:00
Alan Parra 315bc0997a
Bump shellcheck to v0.8.0 (#18014)
Bump shellcheck to the more recent version, pulling from GitHub instead of apt.

See https://github.com/koalaman/shellcheck/tree/v0.8.0#installing (pre-compiled
binaries).
2022-11-03 16:16:50 +00:00
Alan Parra ba54636f9e
Bump OpenSSL to 1.1.1s (#18009)
Bump OpenSSL from 1.1.1r to 1.1.1s, which fixes a regression in 1.1.1r. Fixed an
improper array expansion in build-fido2-macos.sh as well.

Release notes: https://github.com/openssl/openssl/blob/OpenSSL_1_1_1s/CHANGES.
2022-11-01 18:49:39 +00:00
Reed Loden 1a2ec9a3e4
Update CentOS 7 build to pull OpenSSL from GitHub instead of openssl.org (#17992)
Instead of using `git://git.openssl.org/openssl.git`, swap to the official
GitHub mirror at `https://github.com/openssl/openssl.git`. git:// is inheritly
insecure, and while we have additional protections in place as far as commit
hash checking, best to always pull dependencies from https:// wherever possible.
2022-11-01 16:20:26 +00:00
Alan Parra 80addec0ca
Bump OpenSSL to 1.1.1r (#17927)
Bump the OpenSSL version used by libfido2, add a HEAD check to
build-fido2-macos.sh and fix trap usage.

Release notes: https://github.com/openssl/openssl/blob/OpenSSL_1_1_1r/CHANGES.
2022-11-01 14:44:34 +00:00
fheinecke 1472e9cf9e
Added multiarch build support for Teleport (#17597) 2022-10-31 18:00:55 +00:00
Jakub Nyckowski 0ee91f6c37
Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
Noah Stride 2be72955be
Correct "bookwork" -> "bookworm" for debian 12 release name (#17722) 2022-10-28 12:39:10 +00:00
Alan Parra 02315f50d3
Bump Go tooling (#17721)
Updates:

* Buf: 1.8.0 -> 1.9.0
* golangci-lint: 1.50.0 -> 1.50.1

Release notes:
* https://github.com/bufbuild/buf/releases/tag/v1.9.0
* https://github.com/golangci/golangci-lint/releases/tag/v1.50.1

Additionally, add a fixed version for googleapi protos (noop change) and
reformat protos using the new Buf version.
2022-10-25 17:05:38 +00:00
Brian Joerger 9725c405a5
Make PIV builds opt-in for Mac and Windows (#17767) 2022-10-25 16:35:34 +00:00
Zac Bergquist d5b8f94d8b
Disable desktop access for 32-bit ARM and 386 architectures (#17537)
Devices running these architectures are likely not powerful enough
to handle desktop sessions. This will also reduce the binary size
for these builds, making them slightly more convenient for smaller
resource-constrained devices.
2022-10-20 22:39:58 +00:00
fheinecke 633b9582e7
Added multiarch build support for teleport-operator (#16688)
* Added multiarch build support for teleport oss, ent, and fips

* Exported image/imageTag types

* Resigned dronegen

* Removed remainder of testing changes

* Removed changes to submodules

* Reverted dockerfile-fips change

* FIxed docs wording

* Un-exported most constants

* Removed teleport.e makefile deb call

* Moved "sed | cut magic" to files

* Re-added `mkdir -pv /go/cache` to push.go

* Command deterministic order fix

* Added staging-only tag pipeline

* Moved PR to teleport operator to minimize potential issue impact

* Updated promote to pull and push without build

* Made cron triggers not affect canonical tags

* Added check for pre-existing tags on immutable CRs

* Added immutability check to manifests

* Updated staging ecr to only apply $TIMESTAMP tag on cron triggers

* Updated triggerinfo struct to use a triggerflag struct

* Fixed makefile after git mistake

* Makefile fix

* PR fixes

* Moved internal tools Go version to constant

* Separated container images gofile into multiple files

* Moved testing comment

* Added licenses

* Reorganized and added docs for container images

* Moved const to correct file

* Tag trigger logic test

* Testing specific fix

* Moved testing to v10.3.2

* Make semver dirs

* Refactored local registry name/socket

* Merged previous dockerfile changes

* Added TARGETOS TARGETARCH args

* Updatd tag to testing tag

* Promotion logic test

* Promotion fixes

* Testing specific fix

* Removed prerelease check for testing

* Added staging login commands to promote

* Fixed missing credentials on promotion pull

* Rerun tag test with new "full" semver

* Made staging builds only publish full semver

* Added semver logging command

* Empty commit to trigger Drone

* Promotion test

* Fixed preceeding v on promote pull

* Empty commit to trigger Drone

* Re-enabled verify not prerelease step on promote

* Cron trigger test

* Testing fix

* Testing fix 2

* Added sleep timer on docker buildx build

* Testing cleanup
2022-10-19 02:31:22 +00:00
Alan Parra b289295f93
Move away from deprecated protoc-gen-go plugin (#17267)
Moves from github.com/golang/protobuf protoc-gen-go plugin to google.golang.org/
plugins.

This change was a long-time coming, but is now possible to do since our
dependencies are up-to-date.

* Move away from deprecated protoc-gen-go plugin
* Embed unimplemented server in handler.Handler
* Embed unimplemented server in multiplexer_test.go
* Update generated protos
2022-10-13 14:01:44 +00:00
Alan Parra 8a25dc9755
Add Device Trust protobuf definitions (#17302)
Add definitions for Device Trust RPCs.

DeviceTrustService is fairly isolated from other services, so it is generated
using plain `protoc-gen-go` instead of Gogo.

teleport.e#514

* Add Device Trust proto definitions
* Allow proto generation without gogo
* Drop Gogo from lib/multiplexer protos
* Update generated protos
* Tidy modules
2022-10-11 22:21:38 +00:00
Hugo Shaka 2ef2de956a
Use Teleport's standard buildbox (#17122)
* Use Teleport's standard buildbox

This commit edits the teleport-operator container image build process to
rely on Teleport's standard buildbox. This will make sure we are using a
single go version at all time.

This also removed unused environment variables from
`operator/Makefile`.

* Extract BUILDBOX variables out of build.assets/Makefile
* Put `teleport-operator` bin out of the Teleport source volume
2022-10-11 15:19:38 +00:00
Alan Parra f9f0ca339e
Bump grpc-related dependencies (#17265)
Bumps:

* protoc to v3.20.3
* protoc-gen-go to v1.5.2 (github.com/google/protobuf version, Teleterm only)
* google.golang.org/grpc to v1.50.0
* google.golang.org/grpc/examples
2022-10-11 14:29:01 +00:00
Walt acbf575230
Refactor Drone Pipelines to use AWS role assumption (#17201)
This PR updates our various Drone pipelines to use AWS roles for publishing.

Our AWS FTR requires that we do not use any long lived credentials in our AWS accounts and instead use roles. This means we need to move from attaching policies directly to users to attaching policies to roles and having policyless users assume those roles.

https://aws.amazon.com/partners/foundational-technical-review/

Contributes to https://github.com/gravitational/SecOps/issues/213
2022-10-10 20:32:43 +00:00
Jakub Nyckowski 7ab605a4af
Update Go to 1.19.2 (#17020) 2022-10-04 22:26:34 +00:00
Walt Della 0bd1d1b3d5 Fix OS package repo promotion issue
Without these changes, the promote step will always fail because of a
mismatch between where the repo is cloned and where it is referenced:

  /go/src/.../teleport.git
vs
  /go/src/.../teleport

(cherry picked from commit b209b98f0d)
2022-10-04 14:38:15 -07:00
Alan Parra 2b44e5f23e
Bump golangci-lint to 1.50.0 (#16966)
Update golangci-lint to v1.50.0 and fix a few linter issues.
2022-10-04 17:28:23 +00:00
Brian Joerger ce20b20753
PIV login enforcement (#15874)
Add private key policy enforcement.

  - Add private key policy cert extensions and enforcement.

  - Add private key policy settings and attestation logic.

  - Wire attestation request through login endpoints.

  - Store attestation data for reissue requests.

  - Add private key policy discovery and logic.

  - Relogin on hardware key policy errors.

  - Include integration with Teleport Connect.
2022-09-30 23:27:48 +00:00
rosstimothy b09e6a5fcb
Update Rust to 1.64.0 (#16833) 2022-09-29 19:51:15 +00:00
Alan Parra 9b99a4831c
Update libfido2 to 1.12.0 (#16732)
Update libfido2 to the latest release.

Centos7 builds require a newer toolchain: [-Wimplicit-fallthrough][1] is the
first hurdle for the old toolchain, but there are more after it.

Release notes: https://developers.yubico.com/libfido2/Release_Notes.html.

[1]: 659a02679f/CMakeLists.txt (L281)
2022-09-28 14:13:25 +00:00
Brian Joerger 7d2bd715c4
Add piv build dependencies (#16424)
* Add piv build dependencies.

  - Add LIBPCSCLITE build tag.

  - Add libpcsclite static linking using gravitational/pcsc fork.

  - Enable use of dynamic pcsc library with LIBPCSCLITE=dynamic.

  - Refactor CGOFLAG in Makefile.

  - Update Centos7 Dockerfile and drone.

* Refactor RELEASE_MESSAGE for readability. Now produces message like: "RELEASE_MESSAGE=Building with GOOS=linux GOARCH=amd64 REPRODUCIBLE= and with PIV support and without PAM support, FIPS support, BPF support, Windows RDP client, libfido2, Touch ID."

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
2022-09-22 23:16:51 +00:00
Alan Parra 8040f091fb
Update OpenSSL to 1.1.1q (#16573)
libcrypto is required by libfido2.

All other libfido2 dependencies, including the lib itself, are up-to-date.

Release notes for OpenSSL:
https://github.com/openssl/openssl/blob/OpenSSL_1_1_1q/CHANGES.
2022-09-21 17:16:58 +00:00
Justinas Stankevičius c4153b937e
Register Windows native artifacts in release API (#16197)
* Register Windows native artifacts in release API

* Update relcli
2022-09-20 13:42:04 +03:00
Roman Tkachenko d3cdc45ab2
Fix lint warnings (#16532) 2022-09-20 01:43:36 +00:00
Alan Parra a75fcc21d8
Update golangci-lint to 1.49.0 (#16507)
Update metalinter, fix a few lint warnings and replace deprecated linters.

`deadcode`, `structcheck` and `varcheck` are abandoned and now replaced by [`unused`][1].

Since 1.19, `go fmt` reformats godocs according to https://go.dev/doc/comment. I've done a bulk-reformatting of the codebase to keep the linter happy. Backporting is mostly harmless (the exception being `lib/services/role_test.go`, that for some reason breaks the _old_ linter using the new format).

[1]: https://golangci-lint.run/usage/linters/

* Bump golangci-lint version
* Replace abandoned linters
* Fix bodyclose on lib/auth/github.com
* Fix bodyclose on lib/kube/proxy/streamproto/proto_test.go
* Fix bodyclose on lib/srv/alpnproxy/proxy_test.go
* Fix bodyclose on lib/web/conn_upgrade_test.go
* Silence staticcheck on lib/kube/proxy/forwarder_test.go
* Silence staticcheck on lib/utils/certs_test.go
* Address BuildNameToCertificate deprecation warnings
* Run `go fmt ./...`
* Run `go fmt ./...` on api/
* Ignore formatting in role_test.go
* Remove redundant initializers in lib/srv/uacc/
* Update e/
2022-09-19 22:38:59 +00:00
rosstimothy 739e4e12b4
Update buf version (#16499) 2022-09-19 21:41:24 +00:00
Alan Parra 9bb0255a07
Update toolchain to Go 1.19 (#16479)
Update Go toolchain, allowing for a possible go.mod bump to 1.19.

Since Go 1.19 BoringCrypto is no longer a separate branch, but instead it's
enabled by a [GOEXPERIMENT][1].

Release notes: https://tip.golang.org/doc/go1.19.

[1]: https://cs.opensource.google/go/go/+/refs/tags/go1.19.1:src/internal/goexperiment/exp_boringcrypto_on.go;l=3

* Update Go in build.assets/
* Update Go in Drone
* Appease .sh linter
* Update FIPS images
* Update e/
* Simplify Centos7 FIPS image
2022-09-19 17:31:51 +00:00
Roman Tkachenko e8974ffbda
Bump Go to 1.18.6 (#16248) 2022-09-08 21:11:30 +00:00
Isaiah Becker-Mayer a67f5c3eb4
bumps rust to 1.63.0, fixes linting errors (#16056) 2022-09-06 13:17:31 +02:00
Trent Clarke 758c968748
Adds libpcsclite to buildbox & release image for PIV integration (#16083)
Adds libpcsclite to buildbox for PIV integration

See-Also: #15335
2022-09-05 21:40:47 +10:00
Alan Parra 0baf1d38d3
Drop libudev-dev from buildbox dependencies (#16099)
We use a manually-built libudev-zero, so that dependency is not required.
2022-09-02 15:54:06 +00:00
Trent Clarke e076f7835c
Adds slack channel alert to Teleport Connect build (#15937)
WARNING: Due to issues with the windows drone executor's poor escaping when it echoes commands, I have moved the error message functionality into the PS build functions in build.assets/windows/build.ps1. This means that any failures that occur during the code checkout step will not be reported.

I'm not sure that this is the correct tradeoff, but it may well suffice for now.
2022-08-31 11:32:31 +10:00
Alan Parra d5e57f8cd1
Apply linters to legacy protos (#15879)
Applies linters to legacy protos and adds a few additional Makefile targets to
make it easier to manage protos locally.

Proto linters now run in CI.

#15187

* Apply linters to legacy protos
* Handle new folders in genproto.sh, reset gen/proto if exists
* Lint and format lib/teleterm as part of protos/all
2022-08-29 20:54:32 +00:00
Alan Parra 49e3c0d6d0
Use Buf linters and formatter on lib/teleterm protos (#15877)
Similarly to #15856, moves lib/teleterm fully to Buf.

#15187

* Fix buf lint warnings on lib/teleterm
* Enable buf build and lint for lib/teleterm
* Use buildbox Buf in Connect, enable build/lint/format
* Reformat protos
* Update generated protos
2022-08-29 19:45:03 +00:00
Trent Clarke 1f58333531
Build Teleport Connect for Windows (#15292)
Uses Drone to build Teleport Connect for Windows on a Native 
Windows builder.

This PR adds 2 pipelines to the Drone YAML:

1. `push-build-native-windows-amd64`: Invoked on a push to master, 
   branch/v*, etc., and asserts that Teleport Connect can be built, and
   
2. `build-native-windows-amd64`: Invoked when a branch tag is 
   committed to the teleport Repo. Builds Teleport Connect and uploads 
   it to dronestorage
   
These builds are run on a native windows builder (as opposed to tsh, 
which is built in a linux environment and cross-compiled for Windows)
2022-08-29 16:56:55 +10:00
Alan Parra 0b76b44973
Use to Buf to lint, format and generate api/ protos (#15856)
Change the proto layout of `api/` to a more standard setup, allowing the use of
modern tools (like Buf) to format/lint (and maybe, one day, generate sources).

The new layout looks like this:

``` api/ proto/       <- root of protos and proto imports teleport/  <- base
package for Teleport protos (akin to "google/" or "gogoproto/") legacy/  <- root
of "legacy" protos (most linters disabled) client/ proto/ types/ events/
webauthn/ wrappers/ ```

Non-legacy `api/` protos are expected to follow this layout:

``` api/ proto/ teleport/ mynewpackage/  <- package name v1/          <- protos
explicitly versioned gen/      proto/  <- root for generated sources
(multi-language possible, separate from hand-written code) go/ mynewpackage/ v1
<- generate Go sources go here. ```

Some outstanding issues, like lack of `go_package` declarations and non-standard
import paths (`import "github.com/gravitational/teleport/.../some.proto"`) are
fixed.

Legacy protos still have irregular package declarations. It's possible to fix
that, but it's a bit harder to reason about, as generated sources change in
possibly-meaningful ways.

Future iterations could change legacy packages to match the directory structure
and apply a similar change to protos within lib/ packages, but this seems
sufficient for a first step.

* Add Buf to buildbox
* Unify API protos under Buf
* Fix proto generation
* Reformat protos
* Update generated protos
* Generate protos using Buf
* Appease linter
* Review: make sure gogo protobuf versions are in sync
* Clean leftovers from previous attempts
* Fix operator/Makefile
* Rename internal make gRPC targets to `*/host`
* Sort `make fix-license` targets (nit)
2022-08-26 18:11:38 +00:00
Rafał Cieślak b4c94ebf9b
Add drone pipeline for building Connect with signed tsh.app (#15763)
* Add proof of concept of Connect pipeline

The proof of concept includes a lot of copy-pasted lines which will get
cleared up in subsequent commits.

* Extract copying artifacts into separate functions

The tag pipeline no longer needs to worry about Connect artifacts.

* Reuse steps to install & cleanup toolchains

* Share toolchain configuration commands between pipelines

* Share build commands among different pipelines

* Download webapps only if a pipeline builds Connect

As seen by the changes to .drone.yml, this removes unnecessary webapps
clones from these tag pipelines: build-darwin-amd64, build-darwin-amd64-pkg,
build-darwin-amd64-pkg-tsh. None of them needs webapps to function anymore
and the pkg pipelines never needed webapps in the first place.
2022-08-24 16:38:42 +02:00
Zac Bergquist ac4d7fe651
Build Teleport Connect for Linux (#15509)
In order to do so, we add a new make target:

    make teleterm

This (temporarily) assumes that the gravitational/webapps repo is
cloned at the right version as a sibling to the teleport repo.
(We'll be able to get rid of this when we merge webapps into Teleport)

Additionally, update dronegen to include the name of the calling
function that generated the snippet instead of the line number.
This gets rid of lots of superfluous diffs in the generated
.drone.yml file.

Lastly, rewrite the Go program for getting the right webapps version
in bash, because Go is not available at this step of the drone pipeline.

Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>
2022-08-23 13:57:22 -06:00
Trent Clarke a72d1c7285
Adds CI hooks for GLibc compatibility check (#15547)
Adds the GCB build yaml for controlling the build, and updates the test script
to work in both the GCB environment and on a local dev machine.

Also changes the centos buildbox to leave the default user as root. When
GCB mounts the workspace into the container, the source code is owned
by root, and there is no way to change this. This means that the build will
fail when the non-root user specified in the build image attempt to write files
into the workspace. Setting the root user fixes this.

See-Also: #15186
2022-08-23 10:02:35 +10:00
Logan Davis 830794a9cf
Replace quay.io with amazon ECR where appropriate (#15382) 2022-08-19 10:24:15 -05:00
Logan Davis 76606fc18b
Update buildbox to push to ECR (#15058) 2022-08-16 21:07:07 +00:00
Logan Davis 1f0b4a744b
Update fpm images to use amazon ECR (#15274) 2022-08-15 23:28:34 +00:00
Zac Bergquist 17eee19bd5
Simplify webassets script (#15100)
Now that we have automation in place for updating the webassets
repo, this script no longer needs to build webassets. Instead,
it just updates the webassets submodule to point at the tip of
whatever branch is specified and opens the Teleport PR.
2022-08-03 20:26:59 +00:00
fheinecke b022fea56b
Added YUM implementation of OS package build tool (#14203)
* Added YUM implementation of OS package build tool

* Addressed PR comments

* Added YUM migrations

* Added curl to YUM dependencies

* Changed pipelines to use golang:1.18.4-bullseye for Go

* Implemented proper repo downloading logic

* Fixed other merge conflicts

* Added artifacts cleanup

* Removed delete on s3 sync

* Added RPM migrations

* v8 migrations

* Partial v8 migration

* Migration remainder

* Reduced requested resources

* Updated resource limits per step

* Added k8s stage resource limits to drone

* Fixed format issue

* Removed resource requests

* Added `depends_on` support to dronegen

* v8.3 migrations

* Fixed parallelism

* Removed migration parallelism

* Fixed RPM base arch lookup

* v6 and v7 YUM migration

* Fixed missing ISA

* Updated repo file path

* Added logging

* Removed vars from repo file

* v8.3 migration first batch

* v8.3 migration second batch

* v9.0 migration

* v9.1 migration

* v9.2 migration

* v9.3 first migration

* v9.3 second migration

* v10.0 migration

* Removed migrations

* Disabled shell linting non-issues

* Fixed linter problem

* More linter fixes
2022-08-02 21:32:59 +00:00
Alan Parra 0f386f273b
Make tsh installer non relocatable and drop version from app (#15018)
This is a twofold change with the aim of reducing possible pains with the tsh
installer.

- Dropping the version number from "tsh.app" makes it more alike other apps
  (including Connect)
- Making the installer non-relocatable makes it easy to reason about (and
  ensures our postinstall script is correct!)

A relocatable installer will look for the app in places other the specified
install path, according to the bundle ID. This means that if the user moves or
renames the app, the installer will overwrite it no matter where it is. It also
means our path assumptions can be wrong.

Note that the installer itself is still numbered, so it won't break Houston or
change the downloads page.
2022-07-29 11:18:27 -03:00
Jakub Nyckowski cb7194092a
Add binary compatibility checking script (#14539)
Co-authored-by: Marek Smoliński <marek@goteleport.com>
2022-07-26 21:31:35 +00:00
Logan Davis b6c2598473
Add old cron job file for v8 (#14666) 2022-07-20 16:56:51 +00:00
Trent Clarke 1686a71c8a
Remove centralised port allocation for tests (#13658)
Ports used by the unit tests have been allocated by pulling them out of a list, with no guarantee that the port is not actually in use. This central allocation point also means that tests cannot be split into separate packages to be run in parallel, as the ports allocated between the various packages will be allocated multiple times and end up intermittently clashing.

There is also no guarantee, even when the tests are run serially, that the ports will not clash with services already running on the machine.

This patch (largely) replaces the use of this centralised port allocation with pre-created listeners injected into the test via the file descriptor import mechanism use by Teleport to pass open ports to child processes.

There are still some cases where the old port allocation system is still in use. I felt this was already getting beyond the bounds of sensibly reviewable, so I have left those for a further PR after this.

See-Also: #12421
See-Also: #14408
2022-07-20 12:04:54 +10:00
Edoardo Spadolini 0985151b02
Build-time cbindgen (#14177) 2022-07-19 20:10:27 +00:00
Noah Stride 704009f4de
Add tbot to nightly build (#14630) 2022-07-19 14:09:16 +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
Jakub Nyckowski c3dde989cc
Update protoc to v3.20.1 (#14097)
Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
2022-07-07 23:21:32 +00:00
Trent Clarke e3ced072b7
Trims the buildbox (#14036)
- Enables the docker BuildKit in an attempt to speed up builds
 - Trims slightly under 2GB off image size
 - Break more dependencies out into separate build stages
 - Adds some simple supply-chain protections for dependencies sourced
   via git. The Docker build now checks that the commit SHAs are what
   we expect, and not just assume that the tags haven't changed.
 - Moves the `cbindgen` build to a stage to avoid pulling in extra
   dependencies not needed for the Teleport build
 - Combines the `gcloud` and firestore emulator install into one step to
   reduce the layer count.
 - Ports some of the above the Centos7 Dockerfile.
2022-07-07 12:28:35 +10:00
Jakub Nyckowski d03f8db0ca
Use CentOS 7 for building release binaries (#14062)
Switch to CenOS 7 as a base for Teleport releases.

Co-authored-by: Roman Tkachenko <roman@goteleport.com>
2022-07-02 02:11:37 +00:00
Alan Parra c206824be1
Drop v from macOS tsh installer version number (#13896)
Drop the `v` from the tsh installer version number, which was inadvertently
changed by #12751. Makes the installer reappear as a download option in Houston.

Note that the final .app name still has the `v`. Ie:

* tsh-10.0.0-dev.pkg (installer)
* tsh-10.0.0-dev.pkg.sha256 (installer hash)
* tsh-v10.0.0-dev.app (Application package)
2022-06-28 14:21:30 +00:00
Zac Bergquist 61463166c1
Remove tctl roletester (#13863)
This code was unmaintained, created issues with our build system,
and didn't actually match the behavior of Teleport's RBAC engine.

We will revisit this functionality in the future when we investigate
"acess policies as code."
2022-06-25 04:01:21 +00:00
Roman Tkachenko 423c005c7d
Fix tsh package build (#13813) 2022-06-25 00:16:46 +00:00
Alan Parra 1552e1a826
Use .json extension for Gon config file (#13667)
Gon configuration files need a proper extension, otherwise it errors.
2022-06-21 20:03:32 +00:00
Alan Parra 97a2dd2a5d
Rebuild FIDO2 dependencies on failure (#13410)
Attempt to detect builder environment inconsistencies by compiling a toy FIDO2
program - if this fails, then clear the cache and try again.

Builders are sometimes getting into inconsistent states, this should help
avoiding manual intervention in order to fix them.
2022-06-21 18:30:54 +00:00
Jakub Nyckowski 8470e473fa
Remove Clang from CentOS 7 Docker buildbox (#13614) 2022-06-17 22:14:34 +00:00
Zac Bergquist 8c7eb94c4b
Fix CentOS 7 builds after upgrading prost (#13579)
Recent Rust dependency upgrades include a newer version of prost.
This new version no longer ships embedded protoc binaries, and
instead tries to build protoc from source. This would require us
to install cmake on our buildboxes. We want to avoid this and
instead leverage the version of protoc already installed.

This change was made to the standard buildbox, but the CentOS 7
buildbox was missed.

Additionally, I noticed that Rust was installed in
Dockerfile-centos7-fips, but not in Dockerfile-fips, which means
the FIPS binaries have different functionality depending on which
version you use. To correct this, I removed Rust from the CentOS 7
FIPS builds (since the Rust features are not FIPS compliant anyway).
2022-06-17 15:05:39 +00:00
Zac Bergquist 895ed4d5dc
⬇️ downgrade Rust to 1.58.1 (#13544)
Newer versions of Rust increase our minimum GLIBC requirement,
which is not acceptable at this time.
2022-06-16 19:49:26 +00:00
Roman Tkachenko 683d11d23e
Update versions to 11 (#13528) 2022-06-15 23:28:08 +00:00
Alan Parra 29d3f80261
Use make release-windows on Drone, make it similar to make release (#13532)
Switch from `make release-amd64` to make release-windows in Drone builds, making
release builds similar to "regular" builds (that already use
`make release-windows-unsigned`).

Fixes current woes caused by FIDO2=yes in Windows release builds. (Note that
ARCH is implied by the build.)

* Use `make release-windows` on Drone, make it similar to `make release`
* Update .drone.yaml
2022-06-15 19:59:34 +00:00
Jakub Nyckowski c9277ab8f0
Add libbpf and Clang to Centos 7 image (#13261)
Enable BPF for CentOS 7 builds.

Co-authored-by: Alan Parra <alan.parra@goteleport.com>
2022-06-15 18:54:02 +00:00
Joel 3b394ae431
fix master CD by pointing prost at protoc (#13461) 2022-06-14 10:53:33 +00:00
Alex McGrath 5ef7270111
Add sudo to the Dockerfile (#13334) 2022-06-09 14:57:47 +00:00
Jakub Nyckowski b5ccc21aba
Update libbpf to 0.7.0-teleport (#13201) 2022-06-06 23:41:57 +00:00
Rafał Cieślak fabdabb2d7
Dockerfile-teleterm: Fix NODE_URL & NODE_PATH (#13192)
After recent changes in #12257, Dockerfile-teleterm was made to accept
NODE_VERSION passed from a build arg.

The problem is that NODE_VERSION used to follow the format of `vX.Y.Z`,
while NODE_VERSION in build.assets/Makefile follows the `X.Y.Z` format.

This commit adds the missing `v`s to NODE_URL and NODE_PATH.
2022-06-06 15:40:48 +00:00
Alan Parra c865e7ea92
Add icon to macOS tsh.app (#13022)
Icons file generated using a 512x512 base image and `makeicns`.

#9160
2022-06-03 21:12:00 +00:00
fheinecke 6a693b9ce7
RFD 58: Package Distribution (#10746)
* Wrote RFD and implementation for APT repos.
2022-06-03 14:36:56 -05:00
fheinecke 6045b6922d
Added debugging packages to Docker images (#13124) 2022-06-03 09:47:36 -05:00
Zac Bergquist 86f3a3d618
Build Teleport Connect on darwin/amd64 (#12257)
This commit updates drone to build Teleport Connect by:

* cloning `gravitational/webapps` as a sibling directory to
  gravitational/teleport
* checkout out the right version of webapps by running a simple
  Go program (this step is only necessary until we move webapps
  into the teleport repo)
* Running the Teleport Connect build and copying artifacts

Code signing should run on tag builds automatically as part the
electron build, assuming the Apple Account credentials are
properly loaded into the keychain.

Notarization will also happen automatically if both 
`$APPLE_USERNAME` and `$APPLE_PASSWORD` are set.

In order to make the above happen, this patch also includes:

* Installing and removing a per-build Node instance in the 
  toolchain directory on Darwin
* Moving the toolchain temporary directory out of ~/ and into /tmp.

Drone usually sets `$HOME` to a temporary directory for each build,
but unfortunately we need it to point to the actual build user's 
home directory in order for the notarisation tooling to find the
right keychain. Having $HOME point to a long-lived directory risks
both pollution from build detritus and builds stomping on one another.

In an in an attempt to isolate the builds from each other and protect
`~build` as best we can, as much of the build state as possible 
(including ephemeral toolchains) has been moved under `/tmp`.

Co-authored-by: Trent Clarke <trent@goteleport.com>
2022-06-03 12:19:42 +10:00
Zac Bergquist ff4c307453
Update to Go 1.18.3 (#13103) 2022-06-02 16:10:57 +00:00
Alan Parra 8b104d1860
Consistently set macOS min version (#13070)
Set the macOS deployment target, ensuring that statically linked libfido2 `tsh`
builds run correctly on older macOS versions.

#9160

* Consistently set macOS min version
* Bump min macOS version to 10.13
2022-06-02 15:13:24 +00:00
Zac Bergquist 1286528748
Update Rust to 1.61.0 (#12779) 2022-06-01 22:24:21 +00:00
Alan Parra 1af3c11acf
Make sure LIB_CACHE exists before creating temp dir inside it (#13035)
Fixes Drone breakage.

#9160
2022-05-31 19:22:17 +00:00
Alan Parra 8302d467d1
Improved touch ID availability and diagnostics (#12963)
Since #12794 we now build `tsh` binaries with touch ID capabilities. This calls
for a more sophisticated mechanism to determine if touch ID functions should be
enabled, as compile-time support only is not enough.

I've added the following checks, on top of compile-time / `touchid` build tag:

Binary is signed
Binary has entitlements
Machine is touch ID capable
Machine has a Secure Enclave
Put together this give us a much better proxy on whether to enable touch ID.

I've also added the `tsh touchid diag` command, mentioned in the Passwordless
macOS RFD (see
https://github.com/gravitational/teleport/blob/master/rfd/0054-passwordless-macos.md#tsh-support-commands).

#9160

* Improved touch ID availability and diagnostics
* Add the `tsh touchid diag` command
* Set min macOS version to 10.12 (macOS Sierra)
2022-05-31 17:10:06 +00:00
Alan Parra 7567c5502d
Build tsh with static libfido2 for macOS (#13001)
Add a script to build libfido2 (and its dependencies) on macOS and enable FIDO2
static builds.

I decided to build all dependencies instead of pulling from Homebrew for a few
reasons:

1. There is no libcbor.a in a brew package
2. This captures library versions within the Teleport source code, allowing us
   to build binaries against different versions of libfido2 (and its
   dependencies).

I've also bumped libfido2 to 1.11.0. I've been running it locally and we are
still pre-release, so it seems like a good time to do it.
(See https://developers.yubico.com/libfido2/Release_Notes.html.)

#9160

* Build libfido2 and dependencies for macOS
* Build tsh with static fido2 on Drone
* Bump libfido2 versions in all builds
* Attempt to appease linters
* Use temp dirs inside LIB_CACHE
* Move LIB_CACHE outside of HOME

HOME is reassigned in macOS builders, but we want a "stable" cache
directory. /tmp is used by build-package.sh and build-pkg-tsh.sh.

* Rename script to build-fido2-macos.sh
* Regenerate Drone files
2022-05-31 14:50:56 +00:00
Alan Parra 99ad5c59a4
Build macOS installer for tsh.app (#12751)
Changes how `make pkg-tsh` works so instead of building an installer for the
`tsh` binary, placed under `/usr/local/bin`, we install an app to
`/Applications/tsh-vXXX.app` and link its `tsh` binary to `/usr/local/bin`.

The app shell is necessary to distribute a provisioning profile along with the
signed/entitled/notarized binary. All of that is required for Touch ID to work.
Naked `tsh` binaries are unable to use Touch ID, even if built with the correct
build tags.

I've elected to split the logic from `build-package.sh` into a separate script -
it already does too much as-is. `build-pkg-tsh.sh` is more idiomatic, clears
additional `shellcheck` rules and is easier to dry-run.

#9160

* Build macOS installer for tsh.app
* Add resources to build the tshdev app
Moved from e/

* Add resources to build the tsh app (prod)
* Use production values
* Remove 'tsh' mode from build-package.tsh
* Appease buildbox linter
* Clarify one-time setup
2022-05-23 20:56:21 +00:00
Zac Bergquist a7ab44f15b
Fix linter after Go 1.18 upgrade (#12585)
* Update golangci-lint

To accomodate the recent Go 1.18 upgrade

* Fix new lint warnings as a result of linter upgrade

* Set golangci-lint to Go 1.18 mode

golangci-lint will automatically skip linters that don't have support
for Go 1.18.

See: https://github.com/golangci/golangci-lint/issues/2649
2022-05-11 21:53:37 +00:00
Zac Bergquist f0bb6b4fef
Update to Go 1.18 (#12578)
And update e ref to pick up gravitational/teleport.e#424
2022-05-11 11:23:50 -06:00
Alan Parra af3488211c
Reinstate FIDO2 builds for amd64/Centos7 and use pkg-config (#12093)
Reinstates Linux/amd64 and Centos7/amd64 builds using libfido2, now hidden
behind an explicit FIDO2 flag (similarly to FIPS).

This PR pulls in gravitational/go-libfido2#4 and adds the required pkg-config
setup so we can perform both dynamic (mostly testing) and static (tsh) builds.
Additionally, pkg-config is now the gateway for whether we run libfido2-related
tests (which should always happen in CI).

#9160

* Re-enable libfido2 builds for amd64 and Centos7
* Use pkg-config to build tsh with libfido2
* Install Centos7 libudev-zero to /usr/local/lib64
* Update gravitational/go-libfido2
* Remove /usr/local/lib from Centos PKG_CONFIG_PATH
2022-04-28 16:32:02 +00:00
Gus Luxton 8852a3e01d
docker: Add lint-helm to build.assets Makefile (#12178) 2022-04-26 12:01:01 +00:00
Alex McGrath c40d6dc701
Add enter-root to makefile (#12141) 2022-04-22 10:50:24 +00:00
Gus Luxton 6090379bce
docs: Don't lint external links when running in CI (#12058)
Original behaviour did not take effect in CI due to a different entrypoint.

This restores the original behaviour (which will link external links when using make -C build.assets test-docs) but disables the external linting in CI for reliability.

Updates #11940
2022-04-19 16:00:17 +00:00
Alan Parra 4534d97a95
Keep root as the default buildbox user (#12032)
Fixes breakages on GCB and Drone.

* Keep root as the default buildbox user
* Disable static tsh+fido2 builds
2022-04-18 18:06:59 +00:00
Alan Parra 9c89c00806
Build tsh with static libfido2 in buildbox and Centos7 (#11849)
Build `tsh` with static `libfido2`, `libcbor`,`libcrypto` and `libudev-zero`.

Dockerfiles for buildbox and Centos7 changed. FIPS and macOS to be addressed at
a later date.

Add the `tsh fido2 diag` hidden command for ease of testing.

#9160

* Update go-libfido2 and tidy modules
* Add a fido2 diagnostic command to tsh
* Add a few build artifacts to .gitignore
* Build tsh with static libfido2 in buildbox
* Build tsh with static libfido2 in centos7
* Add a few relevant cmake flags
* Use illiliti/libudev-zero
* Do multi-stage build on centos7, image tweaks
* Add `make enter/centos7`
* s/OFf/OFF/g
2022-04-18 14:07:10 +00:00
Gus Luxton 0dac87080c
docs: Don't lint external links (#11940)
These tests are regularly registering false failures, likely due to rate limiting on the web hosts which are serving the external links.
2022-04-15 04:48:03 +00:00
Roman Tkachenko 715dbb8a5d
Bump Go to 1.17.9 (#11931) 2022-04-14 02:35:00 +00:00
Edoardo Spadolini a35b5c1959
Display elapsed time in render-tests output (#11828) 2022-04-12 14:25:09 +00:00
Rafał Cieślak 6fb9f871a3 Add grpc-teleterm Makefile target
The grpc-tools package is needed to generate gRPC files for JavaScript.
However, at the moment it can't be installed on M1 MacBooks because of
missing prebuilt binaries for arm64. [1]

One of them, protoc, is already installed in our buildbox. We still need
to compile grpc_node_plugin from source though. This adds significant
overhead as we need to pull in cmake, build-essential and then about
300 MB of git repos from protocolbuffers/protobuf.

Initially, those Teleterm gRPC were generated within `make grpc` with other
files. M1 users who don't work on Teleterm would not be happy about incurring
that additional overhead, hence I extracted everything into separate target
and Dockerfile.

Teleterm proto files don't depend on any other proto files. Once grpc-tools
adds support for arm64, we'll be able to essentially almost revert this
commit and generate Teleterm gRPC files within `make grpc`.

[1] https://github.com/grpc/grpc-node/issues/1405
2022-04-01 13:02:56 +02:00
Alexey Kontsevoy 4d0c0b2c84 teleterm (alpha) 2022-04-01 13:02:56 +02:00
Alan Parra 0d9354a424
Run tests and lint libfido2 code on buildbox (#11547)
- Lint libfido2 (and other) Go build tags
- `make test-go` exercises the libfido2 build tag, as long as `libfido2` is present in the system
- Install `libfido2` (and dependencies) in the teleport-buildbox image

Libraries are installed from source, instead of apt or ppas, so we can guarantee deterministic (and current!) versions.
(Binary releases are not available.)

At the present moment, `librdp_client` and `libfido2` can't be used together. This is because `librdp_client` embeds
openssl/`libcrypto`, which is also a dependency for `libfido2`, causing duplicate symbol errors. In practice both
libraries never coexist in the same binary, so it's easy to sidestep the issue (`librdp_client` links to `teleport`,
while FIDO2 code is only used by `tsh`). I may be able to make them coexist, but not without changes to how go-libfido2
builds.

This change is only for linting/testing libfido2 code, I'll address `tsh` releases in a future PR.

#9160

* Install libfido2 in buildbox

libfido2 and libcbor are installed from source to make sure we get
deterministic versions (apt is outdated and ppas are likely to move
forward with time).

* Run libfido2 tests on test-go
* Lint libfido2 Go build tag
* Lint other Go build tags
* Comment build tags that break the linter
* Tidy modules
* Re-enable roletester linter
* Pass tags conditionally to golangci-lint
* Clarify and improve libfido2 wildcard
* Drop `:$LD_LIBRARY_PATH` from variable
* Replace LD_LIBRARY_PATH with `ldconfig`
* Test for ARM homebrew location too
2022-03-30 17:52:29 +00:00
Edoardo Spadolini fb4ae0f280
Fix 32-bit arm deb and 64-bit arm rpm packages (#11318) 2022-03-29 16:46:55 +00:00
fheinecke 1daf7d2302
[master forward-port] Fixed RPMs using artifacts compiled against a too-new version of glibc (#11026)
* Fixed RPMs using artifacts compiled against a too-new version of glibc

* Fixed RPM naming issue

* Apply suggestions from code review

Co-authored-by: Gus Luxton <gus@goteleport.com>

Co-authored-by: Gus Luxton <gus@goteleport.com>
2022-03-25 20:55:31 +00:00
Zac Bergquist 3c74adf218
Add Helm unit tests (#11062)
* POC for Helm unit tests

This uses https://github.com/vbehar/helm3-unittest to define
expectations of our helm templates

* Test that enterprise is configured correctly

* Added tests for teleport-cluster

* Added tests for teleport-kube-agent

* Removed tests for teleport chart

* Add tests for teleport-cluster Deployment

* Run shorter tests first

* Fix Docker plugin installation and add update-helm-snapshots target

* Add README

* Fix lint syntax error and add some missing linters

* Add missing ImagePullPolicy to Deployment and StatefulSet

* Add Deployment tests for teleport-kube-agent

* Fix replicaCount logic

* Add clarification to values

* Add StatefulSet suite for teleport-kube-agent

* Update snapshots after merge with master

* Helm tests are quicker than bash tests

* Add tests for extraEnv

* Random space

* Tidy up formatting of multiple tests

* [debug] List helm plugins and directories

* Special case Helm linting when running in CI

* Make trailing line breaks consistent

* Special case Helm linting when running in CI

* Add contribution guidelines for Helm charts

* Add contribution guidelines to READMEs

* Deprecate old charts

* Typo

* Spacing

* Clarification

* Update examples/chart/CONTRIBUTING.md

* Don't erroneously set extraEnv for initContainers

* Rename update-helm-snapshots -> test-helm-update-snapshots for clarity

Co-authored-by: Gus Luxton <gus@goteleport.com>
Co-authored-by: Roman Tkachenko <roman@goteleport.com>
2022-03-20 19:01:58 +00:00
Gus Luxton 0d257c4e0b
ci: Add helm3-unittest into CI Dockerfile (#11187)
Required for #11062 to work
2022-03-17 15:10:39 +11:00
Brian Joerger 3fc479c146
Update gomod path for beta/alpha pre-releases. (#10866) 2022-03-10 01:44:24 +00:00
Walt eae66c0ed3
Do not block apt publishing if there is a more current pre-release (#10804)
We do not publish pre-releases to apt repos, but we do publish them to
github.  That means we need to filter them out when considering if an
apt release should be published.  We don't want v8.3.3 to be blocked by
v9.0.0-dev.1, only by v9.0.0.

Honestly, this is a bit of a mess, but it only needs to hold out a bit
longer until https://github.com/gravitational/teleport/pull/10746 lands.

Contributes to https://github.com/gravitational/teleport/issues/10800
2022-03-04 06:46:27 +00:00
Tim Buckley 6d83fed8d7
Include tbot binary in Teleport packages and installs (#10646)
* Include tbot binary in Teleport packages and installs

This includes the tbot binary in .rpm, .deb, and .pkg distributions,
and ensures the binary is installed using the `install` script in
.tar.gz packages.

* Remove tbot from macOS client-only builds
2022-03-03 03:25:23 +00:00
Trent Clarke 3beb29832f
Upgrade buildbox to go 1.17.7 & tag as teleport10 (#10611)
Prior to this patch the teleport buildbox version has been tagged with the Go version for the current release. This bit us during the Teleport 9 development cycle, as both Teleport 8 and 9 use the same version of Go but require different versions of Rust, and we were unable to distinguish between the 2 buildbox versions.

At the time, Teleport 8 was individually patched to create a new `teleport8` buildbox tag, decoupling the buildbox version from the Go version. This was never ported into master and now we find the teleport 9 branch sharing the same buildbox tag as master.

This patch forward-ports all the changes made to `branch/v8` and updates them for master, creating a new `teleport10` buildbox tag. The idea is that we will create a new tag for teleport11 at the same time the release branch for Teleport 10 is mad at some point in the future.

Once this is merged, Drone will create and push new buildbox images, which will become available for CI. A subsequent patch will update the CI scripts to use the new `teleport10` buildbox images.
2022-03-01 15:31:46 +11:00
Alan Parra 69c67fd0bf
Read API_IMPORT_PATH from api/go.mod in make grpc (#10478)
API_IMPORT_PATH is consistently being resolved as an empty string, breaking
proto generation.

Since the path is fixed, it seems simpler to read api/go.mod and do away with
the Go program.

* Explicitly set API_IMPORT_PATH
* Delete the print-import-path program
* Read api module from api/go.mod, push variables to target
2022-02-22 19:39:35 +00:00
Jakub Nyckowski 7c19757d28
Install gcloud in /opt, so it can be accessed by non root (#10400) 2022-02-17 06:25:48 +00:00
Walt Della 7df4d77f47 Add a command to query the latest release
This gives us a robust way to find the latest published release for a
Major or Major.Minor version.  This logic is useful for our automation
that publishes up-to-date teleport:X docker images

Contributes to https://github.com/gravitational/teleport/issues/9494
2022-02-16 17:19:17 -08:00
Walt Della e5b9df2e89 Switch to testify
This saves us a couple lines of code and is a consistent review
recommendation. Better to learn it myself than keep pushing back. :)
2022-02-16 17:19:17 -08:00
Walt Della cf3109862f Exclude draft releases from latest version logic
These should not be factored in when checking for the latest release
when we decide if we should release apt packages.

This also fixes a bug in sorting logic, where we were sorting
lexigraphically instead of by semver.
2022-02-16 17:19:17 -08:00
Walt Della adcaf7bca7 Fix release sorting
9 was comparing greater than 10, due to use of lexographic sorting

This would cause us to fail to publish apt packages when we roll over to
a patch release > 9.
2022-02-16 17:19:17 -08:00
Walt Della d74ecdf86a Add an lexicographic test case
We are failing to sort properly when "9" is compared to "10".
2022-02-16 17:19:17 -08:00
Walt Della f49feacb24 Integrate version-check into build.assets/tooling
This is a unified home as suggested by Trent here:

  https://github.com/gravitational/teleport/pull/10295#discussion_r807499882

Furthermore, I've split cmd code from lib code, in preparation for a new
command that will reuse the library code.
2022-02-16 17:19:17 -08:00
Zac Bergquist eb487ce360 Remove CentOS 6 builds for Teleport 9 2022-02-15 18:40:48 -07:00
Zac Bergquist b2ffe8cc61
Update the PR description for auto webassets udpates (#10212)
The script for updating webassets uses the commit message from
webapps as the commit message for the PR to teleport.

This commit message is almost always a merged PR, which has the format:

    do some awesome thing (#123)

Where '#123' is the number of the **webapps** PR that was merged.

The problem with this is, when the teleport PR is created, it interprets
the #123 as the number of a **teleport** PR. And since the Teleport repo
has a lot more issues/PRs than webapps, Github ends up linking to an old
and completely unrelated PR.

Fix this by replacing (#123) with (gravitational/webapps#123), which
Github correctly renders as a link to the webapps PR in question.
2022-02-08 19:10:47 +00:00
rosstimothy 896261acaf
Add more lint coverage (#10049)
* Add more lint coverage

golanglint-ci doesn't pick up subdirectories with their own go.mod
which left certain directories unlinted. To get around this we can
run golanglint-ci directly against those submodules.
2022-02-07 12:03:10 -05:00
Brian Joerger d33f51d17f
x11 forwarding (#9897) 2022-02-04 23:47:03 +00:00
Brian Joerger 5d9a4033ef
Add xauth binary to buildbox for X11 forwarding. (#10164) 2022-02-04 20:36:15 +00:00
Jakub Nyckowski c974f2781a
Use SDK Cloud script to install gcloud (#9941)
* Use SDK Cloud script to install gcloud in buildbox Docker container

* Add missing gcloud components and dependencies.
2022-01-28 23:18:50 +00:00
Zac Bergquist 2aba666dc9
Update to Rust 1.58.1 (#9985)
In Rust 1.58, deriving Debug no longer counts as using a struct's
fields, so we need to allow dead_code for our structs that implement
RDP protocols. (Just because we don't use the fields doesn't mean
we shoudln't decode them)
2022-01-28 02:34:45 +00:00
Brian Joerger eb40cdc73e
make protoc generation compatible with api v2+ (#9673)
Starting with the Teleport 9 release, we will be versioning the
API module. This change ensures that the generated protobuf code
imports the correct version of the API by:

- introducing a small new command to print the correct version
- adding import rewrite rules to the protoc invocation
2022-01-24 19:16:05 +00:00
Jakub Nyckowski 538fcaa980
Remove devbox - build box now supports AMR64. (#9847) 2022-01-20 01:05:25 +00:00
Walt 854053326a
Conditionally publish deb packages (#9496)
This patch makes a couple changes:

  1. deb archives are not published to apt if they're not the latest
     release ever
  2. both rpm and deb archives are no longer published to yum / apt if
     they contain any pre-release indicator or build metadata
  3. nothing is published if the commit isn't tagged.

Contributes to https://github.com/gravitational/teleport/issues/8166
2022-01-14 03:52:15 +00:00
Edoardo Spadolini c7797fcb1f
Don't shell out to go list when not needed (#9776) 2022-01-13 11:00:33 -05:00
Zac Bergquist d0eb86191d Remove vendor
- Remove the vendor directory
- Update bot to stop accounting for vendor
- Update linter config
- Remove update-vendor make target
2022-01-07 02:15:11 -07:00
Trent Clarke 4ba0248769
Restrores CI lint for non-go files (#9663)
Linting for non-go files was accidentally dropped in the transition to
GCB (sorry!). This patch restores linting for non-go files and fixes
any lint failures that have crept in during the interim.
2022-01-06 22:20:56 +11:00
Trent Clarke ea176c2b3c
Attempts to make CI integration test logs more useful (#9626)
Actually tracking down the cause of a failure in the integration tests can 
be hard:

* It's hard to get an overall summary of what failed
* The tests sometimes emit no output before timing out, meaning any 
  diagnostic info is lost
* The emitted logs are too voluminous for a human to parse
* The emitted logs can present information out of order
* It's often hard to tell where the output from one test ends 
  and the next one begins

This patch attempts to address these concerns without attempting to rewrite 
any of the underlying teleport logging.

 * It improves the render-tests script to (optionally) report progress per-
   test, rather than on a per-package basis. My working hypothesis on the
   tests that time out with no output is that go test ./integration is
   waiting for the entire set of integration tests tests to be complete
   before reporting success or failure. Reporting on a per-test cycle gives
   faster feedback and means that any timed-out builds should give at least
   some idea of where they are stuck.

 * Adds the render-tests filter to the integration and integration-root make
   targets. This will show an overall summary of test results, as well as
    - Discarding log output from passing tests to increase signal-to-noise 
      ratio, and
    - Strongly delimiting the output from each failed test, making failures 
      easier to find.

 * Removes the notion of a failure-only logger in favour of post-processing
   the log events with render-tests. The failure-only logger catches log
   output from the tests and only forwards it to the console if the test 
   fails. Unfortunately, not all log output is guaranteed to pass through
   this logger (some teleport packages do not honour the configured logger,
   and reports from the go race detector certainly don't), meaning some 
   output is presented at the time it happens, and other output is batched
   and displayed at the end of the test. This makes working out what 
   happened where harder than it need be.

In addition, this patch also promotes the render-tests script into a fully-
fledged program, with appropriate makefile targets, make clean support, etc. 
It is now also more robust in the face on non-JSON output from go test 
(which happens if a package fails to compile).
2022-01-05 10:42:07 +11:00
Jakub Nyckowski e9450e32a3
Add ARM64 support for buildbox docker image (#9572)
* Update buildbox to use Python3.
* Remove non default rust targets from arm64 image.
* Add ETCD_UNSUPPORTED_ARCH for arm64 to etcd script to allow running etcd on arm64.
2021-12-29 03:33:22 +00:00
Joel a3ad9ca917
Fix devbox on AMD64 (#9462) 2021-12-16 23:26:19 +00:00
Edoardo Spadolini d027173547
Clean up make grpc and .pb.go generation (#9432)
* Ensure that slice.pb.go is generated by `make grpc`

* Clean up `make grpc`

* Disable the test target rules in Makefile when running inside the devbox
2021-12-16 22:20:53 +00:00
Joel 7951de5728
Split dev tools into a seperate docker container (#9410) 2021-12-15 20:11:52 +00:00
Zac Bergquist e2a0225c7c
Fix make grpc (#9252)
- Ensure that the protoc include directory is readable by all users
- Switch back to the root user by default

Either of these changes would have fixed the issue on their own,
but I decided to include both as GRPC should be readable by non-root
users, and I wanted to preserve the original behavior of running
as root unless the $(NOROOT) flags are specified.

Additionally: clarify comments on the make targets, which are
confusingly named, and stop installing goimports since it seems
it was never used.
2021-12-07 07:46:08 -08:00
Zac Bergquist 6808d6acb4 Create separate builds for CentOS7 (+fips)
Add new buildboxes for centos7 and centos7-fips.

For now, we will continue to support both CentOS 6 and 7.
Eventually we will drop support for CentOS 6, and the only
supported CentOS builds will be these new CentOS 7 builds.

Fixes #9028
2021-12-02 10:30:03 -07:00
Joel 074dbe7f5d
Fix the buildbox (again) (#8892)
* remove toolchain

* don't force env

* Revert "don't force env"

This reverts commit 1e216365f3.

* linter fix and update bindings

* spec toolchain version

* resolve perms
2021-11-08 14:54:07 -07:00
Joel ea64d9db29
Fix Rust buildbox (#8881) 2021-11-05 14:05:19 -07:00
Joel a833907647
Rust & Desktop Access fixes (#8822)
* update deps in manifest and lockfile

* fixes and updates to docker and profiles

* lint rust

* fix typo

* resolve clippy lints

* fix typo

* mark risk functions unsafe

* fmt + clean up the last lints#

* verify lockfile up to date

* disable lto since it doesn't work with two rust libs

* merge lock check and lint

* Add missing license header to Rust files

And update Makefile to ensure they are checked

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2021-11-05 12:35:20 -07:00
Brian Joerger 20da22ca35
API release automation with go script (#8484) 2021-10-28 10:15:47 -07:00
Trent Clarke 5463c799ea
Fix race condition in PipeNetCon (#8643)
The race condition detector is being tripped by a concurrent `Write` and
`Close` in the `PipeNetCon` in several integration tests. This is a naive
fix to serialize the write and close operations to resolve the race
condition.

The affected tests were also not handling asynchronous error reporting
correctly (i.e. it's not legal to call `require.XYZ()` from a goroutine
other than the one executing the test function.). This patch introduces
some plumbing to marshal asynchronous errors back into the main test
routine before failing the test.
2021-10-28 09:38:51 +11:00
Zac Bergquist cdf053eba7 Stop linking lcrypto and lssl
The Rust code now uses vendored mode [1] to statically link openssl,
so we no longer need dynamic linking for these libraries.

This also resolves an issue where extra flags were needed to build
locally on macOS.

[1]: https://docs.rs/openssl/0.10.36/openssl/#vendored
2021-10-27 10:51:43 -06:00
Zac Bergquist edf9b927f4 Add Rust to buildbox
- Ensure Rust is installed in the buildbox image
- Install Rust toolchains for each arch we support
- Use openssl's vendor feature to ensure we always link a static lib
- Automatically include RDP client if Rust is detected
2021-10-27 10:51:43 -06:00
Trent Clarke eca9603376
Include package-level failures in formatted test output (#8698)
In some cases, it's possible for a package to be marked as a test
failure even if no tests inside it have failed. The motivating example
for this change is a timeout: a test overshooting the allotted timeout
is considered by go test to be a package-level failure, even if no
tests inside the package are considered failures.

This led to cases where the user would see an "All tests passed"
message from the go test filter, but still mysteriously fail the make
step.

To address this, the test renderer now:

  * treats package-level pass/fail/skip events as first-class citizens
    and includes them in its event count,
  * tracks the cached test output at both a package and individual test
    level, and
  * displays the whole package output if a package is marked as failed,
    but only if there is no obvious failed test top account for the
    package-level failure.

This patch also removes the json files created by the unit tests, as
they are not yet needed for anything.
2021-10-27 11:14:27 +11:00
Russell Jones 78b2c1e8b0 Fixed CentOS 6 builds.
Fixed issue that prevented Teleport 8 from being built on CentOS 6.
2021-10-25 10:52:55 -07:00
Russell Jones 675be8fc21 Updated Go to 1.17.2. 2021-10-22 14:01:25 -07:00
rosstimothy c730778960
Replace golint with revive (#8613) 2021-10-19 14:00:24 -04:00
Trent Clarke ad2ec86ab1
Revert "Adds Rust 1.55.0 to CI buildbox (#8606)" (#8652)
This reverts commit 179d7f975b.
2021-10-19 12:51:07 +11:00
Russell Jones 073f50ccd4 Remove webassets before Enterprise images.
Call "clean" target to remove webassets before building images.
2021-10-18 17:29:37 -07:00