diff --git a/.drone.yml b/.drone.yml
index ea133d76a74f8..88088b6cb1309 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -831,8 +831,8 @@ steps:
- set -u
- export PATH=/Users/build/.cargo/bin:$PATH
- mkdir -p ~/build-$DRONE_BUILD_NUMBER-$DRONE_BUILD_CREATED-toolchains
- - export RUST_VERSION=$(grep RUST_VERSION $WORKSPACE_DIR/go/src/github.com/gravitational/teleport/build.assets/Dockerfile
- | cut -d= -f2)
+ - export RUST_VERSION=$(make -C $WORKSPACE_DIR/go/src/github.com/gravitational/teleport/build.assets
+ print-rust-version)
- export CARGO_HOME=~/build-$DRONE_BUILD_NUMBER-$DRONE_BUILD_CREATED-toolchains
- export RUST_HOME=$CARGO_HOME
- rustup toolchain install $RUST_VERSION
@@ -841,8 +841,8 @@ steps:
- name: Build Mac artifacts
commands:
- set -u
- - export RUST_VERSION=$(grep RUST_VERSION $WORKSPACE_DIR/go/src/github.com/gravitational/teleport/build.assets/Dockerfile
- | cut -d= -f2)
+ - export RUST_VERSION=$(make -C $WORKSPACE_DIR/go/src/github.com/gravitational/teleport/build.assets
+ print-rust-version)
- export CARGO_HOME=~/build-$DRONE_BUILD_NUMBER-$DRONE_BUILD_CREATED-toolchains
- export RUST_HOME=$CARGO_HOME
- export PATH=~/build-$DRONE_BUILD_NUMBER-$DRONE_BUILD_CREATED-toolchains/go/bin:$CARGO_HOME/bin:/Users/build/.cargo/bin:$PATH
@@ -861,8 +861,8 @@ steps:
- export PATH=/Users/build/.cargo/bin:$PATH
- export CARGO_HOME=~/build-$DRONE_BUILD_NUMBER-$DRONE_BUILD_CREATED-toolchains
- export RUST_HOME=$CARGO_HOME
- - export RUST_VERSION=$(grep RUST_VERSION $WORKSPACE_DIR/go/src/github.com/gravitational/teleport/build.assets/Dockerfile
- | cut -d= -f2)
+ - export RUST_VERSION=$(make -C $WORKSPACE_DIR/go/src/github.com/gravitational/teleport/build.assets
+ print-rust-version)
- cd $WORKSPACE_DIR/go/src/github.com/gravitational/teleport
- rustup override unset
- rustup toolchain uninstall $RUST_VERSION
@@ -1363,7 +1363,220 @@ steps:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:221
+# Generated at dronegen/tag.go:233
+################################################
+
+kind: pipeline
+type: kubernetes
+name: build-linux-amd64-centos7
+environment:
+ RUNTIME: go1.17.3
+trigger:
+ event:
+ include:
+ - tag
+ ref:
+ include:
+ - refs/tags/v*
+ repo:
+ include:
+ - gravitational/*
+workspace:
+ path: /go
+clone:
+ disable: true
+steps:
+- name: Check out code
+ image: docker:git
+ commands:
+ - mkdir -p /go/src/github.com/gravitational/teleport
+ - cd /go/src/github.com/gravitational/teleport
+ - git clone https://github.com/gravitational/${DRONE_REPO_NAME}.git .
+ - git checkout ${DRONE_TAG:-$DRONE_COMMIT}
+ - mkdir -m 0700 /root/.ssh && echo -n "$GITHUB_PRIVATE_KEY" > /root/.ssh/id_rsa
+ && chmod 600 /root/.ssh/id_rsa
+ - ssh-keyscan -H github.com > /root/.ssh/known_hosts 2>/dev/null && chmod 600 /root/.ssh/known_hosts
+ - git submodule update --init e
+ - git submodule update --init --recursive webassets || true
+ - rm -f /root/.ssh/id_rsa
+ - mkdir -p /go/cache /go/artifacts
+ - if [[ "${DRONE_TAG}" != "" ]]; then echo "${DRONE_TAG##v}" > /go/.version.txt;
+ else egrep ^VERSION Makefile | cut -d= -f2 > /go/.version.txt; fi; cat /go/.version.txt
+ environment:
+ GITHUB_PRIVATE_KEY:
+ from_secret: GITHUB_PRIVATE_KEY
+- name: Wait for docker
+ image: docker
+ commands:
+ - timeout 30s /bin/sh -c 'while [ ! -S /var/run/docker.sock ]; do sleep 1; done'
+ volumes:
+ - name: dockersock
+ path: /var/run
+- name: Build artifacts
+ image: docker
+ commands:
+ - apk add --no-cache make
+ - chown -R $UID:$GID /go
+ - cd /go/src/github.com/gravitational/teleport
+ - make -C build.assets release-amd64-centos7
+ environment:
+ ARCH: amd64
+ GID: "1000"
+ GOCACHE: /go/cache
+ GOPATH: /go
+ OS: linux
+ UID: "1000"
+ volumes:
+ - name: dockersock
+ path: /var/run
+- name: Copy artifacts
+ image: docker
+ commands:
+ - cd /go/src/github.com/gravitational/teleport
+ - find . -maxdepth 1 -iname "teleport*.tar.gz" -print -exec cp {} /go/artifacts
+ \;
+ - find e/ -maxdepth 1 -iname "teleport*.tar.gz" -print -exec cp {} /go/artifacts
+ \;
+ - export VERSION=$(cat /go/.version.txt)
+ - mv /go/artifacts/teleport-v$${VERSION}-linux-amd64-bin.tar.gz /go/artifacts/teleport-v$${VERSION}-linux-amd64-centos7-bin.tar.gz
+ - mv /go/artifacts/teleport-ent-v$${VERSION}-linux-amd64-bin.tar.gz /go/artifacts/teleport-ent-v$${VERSION}-linux-amd64-centos7-bin.tar.gz
+ - cd /go/artifacts && for FILE in teleport*.tar.gz; do sha256sum $FILE > $FILE.sha256;
+ done && ls -l
+- name: Upload to S3
+ image: plugins/s3
+ settings:
+ access_key:
+ from_secret: AWS_ACCESS_KEY_ID
+ bucket:
+ from_secret: AWS_S3_BUCKET
+ region: us-west-2
+ secret_key:
+ from_secret: AWS_SECRET_ACCESS_KEY
+ source: /go/artifacts/*
+ strip_prefix: /go/artifacts/
+ target: teleport/tag/${DRONE_TAG##v}
+services:
+- name: Start Docker
+ image: docker:dind
+ privileged: true
+ volumes:
+ - name: dockersock
+ path: /var/run
+volumes:
+- name: dockersock
+ temp: {}
+
+---
+################################################
+# Generated using dronegen, do not edit by hand!
+# Use 'make dronegen' to update.
+# Generated at dronegen/tag.go:233
+################################################
+
+kind: pipeline
+type: kubernetes
+name: build-linux-amd64-centos7-fips
+environment:
+ RUNTIME: go1.17.3
+trigger:
+ event:
+ include:
+ - tag
+ ref:
+ include:
+ - refs/tags/v*
+ repo:
+ include:
+ - gravitational/*
+workspace:
+ path: /go
+clone:
+ disable: true
+steps:
+- name: Check out code
+ image: docker:git
+ commands:
+ - mkdir -p /go/src/github.com/gravitational/teleport
+ - cd /go/src/github.com/gravitational/teleport
+ - git clone https://github.com/gravitational/${DRONE_REPO_NAME}.git .
+ - git checkout ${DRONE_TAG:-$DRONE_COMMIT}
+ - mkdir -m 0700 /root/.ssh && echo -n "$GITHUB_PRIVATE_KEY" > /root/.ssh/id_rsa
+ && chmod 600 /root/.ssh/id_rsa
+ - ssh-keyscan -H github.com > /root/.ssh/known_hosts 2>/dev/null && chmod 600 /root/.ssh/known_hosts
+ - git submodule update --init e
+ - git submodule update --init --recursive webassets || true
+ - rm -f /root/.ssh/id_rsa
+ - mkdir -p /go/cache /go/artifacts
+ - if [[ "${DRONE_TAG}" != "" ]]; then echo "${DRONE_TAG##v}" > /go/.version.txt;
+ else egrep ^VERSION Makefile | cut -d= -f2 > /go/.version.txt; fi; cat /go/.version.txt
+ environment:
+ GITHUB_PRIVATE_KEY:
+ from_secret: GITHUB_PRIVATE_KEY
+- name: Wait for docker
+ image: docker
+ commands:
+ - timeout 30s /bin/sh -c 'while [ ! -S /var/run/docker.sock ]; do sleep 1; done'
+ volumes:
+ - name: dockersock
+ path: /var/run
+- name: Build artifacts
+ image: docker
+ commands:
+ - apk add --no-cache make
+ - chown -R $UID:$GID /go
+ - cd /go/src/github.com/gravitational/teleport
+ - export VERSION=$(cat /go/.version.txt)
+ - make -C build.assets release-amd64-centos7-fips
+ environment:
+ ARCH: amd64
+ FIPS: "yes"
+ GID: "1000"
+ GOCACHE: /go/cache
+ GOPATH: /go
+ OS: linux
+ UID: "1000"
+ volumes:
+ - name: dockersock
+ path: /var/run
+- name: Copy artifacts
+ image: docker
+ commands:
+ - cd /go/src/github.com/gravitational/teleport
+ - find e/ -maxdepth 1 -iname "teleport*.tar.gz" -print -exec cp {} /go/artifacts
+ \;
+ - export VERSION=$(cat /go/.version.txt)
+ - mv /go/artifacts/teleport-ent-v$${VERSION}-linux-amd64-fips-bin.tar.gz /go/artifacts/teleport-ent-v$${VERSION}-linux-amd64-centos7-fips-bin.tar.gz
+ - cd /go/artifacts && for FILE in teleport*.tar.gz; do sha256sum $FILE > $FILE.sha256;
+ done && ls -l
+- name: Upload to S3
+ image: plugins/s3
+ settings:
+ access_key:
+ from_secret: AWS_ACCESS_KEY_ID
+ bucket:
+ from_secret: AWS_S3_BUCKET
+ region: us-west-2
+ secret_key:
+ from_secret: AWS_SECRET_ACCESS_KEY
+ source: /go/artifacts/*
+ strip_prefix: /go/artifacts/
+ target: teleport/tag/${DRONE_TAG##v}
+services:
+- name: Start Docker
+ image: docker:dind
+ privileged: true
+ volumes:
+ - name: dockersock
+ path: /var/run
+volumes:
+- name: dockersock
+ temp: {}
+
+---
+################################################
+# Generated using dronegen, do not edit by hand!
+# Use 'make dronegen' to update.
+# Generated at dronegen/tag.go:233
################################################
kind: pipeline
@@ -1467,7 +1680,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:221
+# Generated at dronegen/tag.go:233
################################################
kind: pipeline
@@ -1571,7 +1784,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:221
+# Generated at dronegen/tag.go:233
################################################
kind: pipeline
@@ -1678,7 +1891,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:363
+# Generated at dronegen/tag.go:375
################################################
kind: pipeline
@@ -1810,7 +2023,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:363
+# Generated at dronegen/tag.go:375
################################################
kind: pipeline
@@ -1939,7 +2152,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:363
+# Generated at dronegen/tag.go:375
################################################
kind: pipeline
@@ -2057,7 +2270,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:363
+# Generated at dronegen/tag.go:375
################################################
kind: pipeline
@@ -2172,7 +2385,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:221
+# Generated at dronegen/tag.go:233
################################################
kind: pipeline
@@ -2276,7 +2489,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:363
+# Generated at dronegen/tag.go:375
################################################
kind: pipeline
@@ -2408,7 +2621,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:363
+# Generated at dronegen/tag.go:375
################################################
kind: pipeline
@@ -2598,8 +2811,8 @@ steps:
- set -u
- export PATH=/Users/build/.cargo/bin:$PATH
- mkdir -p ~/build-$DRONE_BUILD_NUMBER-$DRONE_BUILD_CREATED-toolchains
- - export RUST_VERSION=$(grep RUST_VERSION $WORKSPACE_DIR/go/src/github.com/gravitational/teleport/build.assets/Dockerfile
- | cut -d= -f2)
+ - export RUST_VERSION=$(make -C $WORKSPACE_DIR/go/src/github.com/gravitational/teleport/build.assets
+ print-rust-version)
- export CARGO_HOME=~/build-$DRONE_BUILD_NUMBER-$DRONE_BUILD_CREATED-toolchains
- export RUST_HOME=$CARGO_HOME
- rustup toolchain install $RUST_VERSION
@@ -2608,8 +2821,8 @@ steps:
- name: Build Mac release artifacts
commands:
- set -u
- - export RUST_VERSION=$(grep RUST_VERSION $WORKSPACE_DIR/go/src/github.com/gravitational/teleport/build.assets/Dockerfile
- | cut -d= -f2)
+ - export RUST_VERSION=$(make -C $WORKSPACE_DIR/go/src/github.com/gravitational/teleport/build.assets
+ print-rust-version)
- export CARGO_HOME=~/build-$DRONE_BUILD_NUMBER-$DRONE_BUILD_CREATED-toolchains
- export RUST_HOME=$CARGO_HOME
- export PATH=~/build-$DRONE_BUILD_NUMBER-$DRONE_BUILD_CREATED-toolchains/go/bin:$CARGO_HOME/bin:/Users/build/.cargo/bin:$PATH
@@ -2652,8 +2865,8 @@ steps:
- export PATH=/Users/build/.cargo/bin:$PATH
- export CARGO_HOME=~/build-$DRONE_BUILD_NUMBER-$DRONE_BUILD_CREATED-toolchains
- export RUST_HOME=$CARGO_HOME
- - export RUST_VERSION=$(grep RUST_VERSION $WORKSPACE_DIR/go/src/github.com/gravitational/teleport/build.assets/Dockerfile
- | cut -d= -f2)
+ - export RUST_VERSION=$(make -C $WORKSPACE_DIR/go/src/github.com/gravitational/teleport/build.assets
+ print-rust-version)
- cd $WORKSPACE_DIR/go/src/github.com/gravitational/teleport
- rustup override unset
- rustup toolchain uninstall $RUST_VERSION
@@ -2950,7 +3163,7 @@ steps:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:221
+# Generated at dronegen/tag.go:233
################################################
kind: pipeline
@@ -3054,7 +3267,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:221
+# Generated at dronegen/tag.go:233
################################################
kind: pipeline
@@ -3158,7 +3371,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:363
+# Generated at dronegen/tag.go:375
################################################
kind: pipeline
@@ -3276,7 +3489,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:363
+# Generated at dronegen/tag.go:375
################################################
kind: pipeline
@@ -3394,7 +3607,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:363
+# Generated at dronegen/tag.go:375
################################################
kind: pipeline
@@ -3526,7 +3739,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:363
+# Generated at dronegen/tag.go:375
################################################
kind: pipeline
@@ -3658,7 +3871,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
-# Generated at dronegen/tag.go:221
+# Generated at dronegen/tag.go:233
################################################
kind: pipeline
@@ -4543,6 +4756,6 @@ volumes:
name: drone-s3-debrepo-pvc
---
kind: signature
-hmac: 44e486f592ccf4d39b496be361bc2592045f7759d9dc07f9cbe85b89ce43024d
+hmac: 0b4670e1eb0d589bac096a2458c18d25d57439928442e5a4253e1e336e7f08c1
...
diff --git a/api/types/desktop.go b/api/types/desktop.go
index 97ee6ea7d20b3..f86870bf48131 100644
--- a/api/types/desktop.go
+++ b/api/types/desktop.go
@@ -150,3 +150,13 @@ func (d *WindowsDesktopV3) LabelsString() string {
func (d *WindowsDesktopV3) GetDomain() string {
return d.Spec.Domain
}
+
+// Origin returns the origin value of the resource.
+func (d *WindowsDesktopV3) Origin() string {
+ return d.Metadata.Labels[OriginLabel]
+}
+
+// SetOrigin sets the origin value of the resource.
+func (d *WindowsDesktopV3) SetOrigin(o string) {
+ d.Metadata.Labels[OriginLabel] = o
+}
diff --git a/build.assets/Dockerfile b/build.assets/Dockerfile
index 41e0745486fff..714bac16b18c4 100644
--- a/build.assets/Dockerfile
+++ b/build.assets/Dockerfile
@@ -68,36 +68,6 @@ ARG GID
RUN (groupadd ci --gid=$GID -o && useradd ci --uid=$UID --gid=$GID --create-home --shell=/bin/sh && \
mkdir -p -m0700 /var/lib/teleport && chown -R ci /var/lib/teleport)
-# Install Rust
-#
-# Rust installation based on official rust image Dockerfile here:
-# https://github.com/rust-lang/docker-rust/blob/master/1.56.0/bullseye/Dockerfile
-#
-# The original Rust docker image uses a script to install `rustup`, and from
-# there rustc and associated tools.
-#
-# Rather than execute an arbitrary `rustup` installation script, we are cherry-
-# picking the appropriate files off the official docker image and then installing
-# the extra tooling/targets we need.
-
- ENV RUSTUP_HOME=/usr/local/rustup \
- CARGO_HOME=/usr/local/cargo \
- PATH=/usr/local/cargo/bin:$PATH \
- RUST_VERSION=1.56.1
-
-COPY --from=rust:1.56.1 /usr/local/rustup /usr/local/rustup
-COPY --from=rust:1.56.1 /usr/local/cargo /usr/local/cargo
-RUN set -eux \
- rustup --version; \
- cargo --version; \
- rustup component add --toolchain 1.56.1-x86_64-unknown-linux-gnu rustfmt clippy; \
- chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
- rustup target add i686-unknown-linux-gnu; \
- rustup target add arm-unknown-linux-gnueabihf; \
- rustup target add aarch64-unknown-linux-gnu; \
- rustup target list | grep installed; \
- rustc --version;
-
# Install etcd.
RUN (curl -L https://github.com/coreos/etcd/releases/download/v3.3.9/etcd-v3.3.9-linux-amd64.tar.gz | tar -xz && \
cp etcd-v3.3.9-linux-amd64/etcd* /bin/)
@@ -163,5 +133,26 @@ RUN make -C /opt/pam_teleport install
ENV SOFTHSM2_PATH "/usr/lib/softhsm/libsofthsm2.so"
+# Install Rust
+ARG RUST_VERSION
+ENV RUSTUP_HOME=/usr/local/rustup \
+ CARGO_HOME=/usr/local/cargo \
+ PATH=/usr/local/cargo/bin:$PATH \
+ RUST_VERSION=$RUST_VERSION
+
+RUN mkdir -p $RUSTUP_HOME && chmod a+w $RUSTUP_HOME && \
+ mkdir -p $CARGO_HOME/registry && chmod -R a+w $CARGO_HOME
+
+USER ci
+RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain $RUST_VERSION && \
+ rustup --version && \
+ cargo --version && \
+ rustc --version && \
+ rustup component add --toolchain $RUST_VERSION-x86_64-unknown-linux-gnu rustfmt clippy && \
+ rustup target add i686-unknown-linux-gnu && \
+ rustup target add arm-unknown-linux-gnueabihf && \
+ rustup target add aarch64-unknown-linux-gnu && \
+ cargo install cbindgen
+
VOLUME ["/go/src/github.com/gravitational/teleport"]
EXPOSE 6600 2379 2380
diff --git a/build.assets/Dockerfile-arm b/build.assets/Dockerfile-arm
index ea4c723e198a1..d98262a06a9a1 100644
--- a/build.assets/Dockerfile-arm
+++ b/build.assets/Dockerfile-arm
@@ -1,6 +1,8 @@
ARG RUNTIME
FROM quay.io/gravitational/teleport-buildbox:$RUNTIME
+USER root
+
RUN apt-get -y update && \
apt-get -y install gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu && \
apt-get -y autoclean && apt-get -y clean
diff --git a/build.assets/Dockerfile-centos7 b/build.assets/Dockerfile-centos7
new file mode 100644
index 0000000000000..5311dd53a99cd
--- /dev/null
+++ b/build.assets/Dockerfile-centos7
@@ -0,0 +1,60 @@
+FROM centos:7
+
+ENV LANGUAGE=en_US.UTF-8 \
+ LANG=en_US.UTF-8 \
+ LC_ALL=en_US.UTF-8 \
+ LC_CTYPE=en_US.UTF-8
+
+ARG RUNTIME
+ARG RUST_VERSION
+
+ARG UID
+ARG GID
+RUN (groupadd ci --gid=$GID -o && useradd ci --uid=$UID --gid=$GID --create-home --shell=/bin/sh && \
+ mkdir -p -m0700 /var/lib/teleport && chown -R ci /var/lib/teleport)
+
+# Install dev tools (make, etc) and a Perl package needed to build OpenSSL.
+RUN yum groupinstall -y "Development Tools"
+RUN yum install -y pam-devel net-tools tree git zip libatomic perl-IPC-Cmd && \
+ yum clean all
+
+# Install etcd.
+RUN (curl -L https://github.com/coreos/etcd/releases/download/v3.3.9/etcd-v3.3.9-linux-amd64.tar.gz | tar -xz && \
+ cp etcd-v3.3.9-linux-amd64/etcd* /bin/)
+
+# Install Go.
+RUN mkdir -p /opt && cd /opt && curl https://storage.googleapis.com/golang/$RUNTIME.linux-amd64.tar.gz | tar xz && \
+ mkdir -p /go/src/github.com/gravitational/teleport && \
+ chmod a+w /go && \
+ chmod a+w /var/lib && \
+ /opt/go/bin/go version
+
+# Install PAM module and policies for testing.
+COPY pam/ /opt/pam_teleport/
+RUN make -C /opt/pam_teleport install
+
+# Install Rust.
+ENV RUSTUP_HOME=/usr/local/rustup \
+ CARGO_HOME=/usr/local/cargo \
+ PATH=/usr/local/cargo/bin:$PATH \
+ RUST_VERSION=$RUST_VERSION
+
+RUN mkdir -p $RUSTUP_HOME && chmod a+w $RUSTUP_HOME && \
+ mkdir -p $CARGO_HOME/registry && chmod -R a+w $CARGO_HOME
+
+RUN chmod a-w /
+
+USER ci
+RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain $RUST_VERSION && \
+ rustup --version && \
+ cargo --version && \
+ rustc --version && \
+ rustup component add --toolchain $RUST_VERSION-x86_64-unknown-linux-gnu rustfmt clippy && \
+ cargo install cbindgen
+
+ENV GOPATH="/go" \
+ GOROOT="/opt/go" \
+ PATH="/opt/bin:$PATH:/opt/go/bin:/go/bin:/go/src/github.com/gravitational/teleport/build"
+
+VOLUME ["/go/src/github.com/gravitational/teleport"]
+EXPOSE 6600 2379 2380
diff --git a/build.assets/Dockerfile-centos7-fips b/build.assets/Dockerfile-centos7-fips
new file mode 100644
index 0000000000000..9c44974b6631c
--- /dev/null
+++ b/build.assets/Dockerfile-centos7-fips
@@ -0,0 +1,69 @@
+FROM centos:7
+
+ENV LANGUAGE=en_US.UTF-8 \
+ LANG=en_US.UTF-8 \
+ LC_ALL=en_US.UTF-8 \
+ LC_CTYPE=en_US.UTF-8
+
+ARG RUST_VERSION
+ARG BORINGCRYPTO_RUNTIME
+ARG GO_BOOTSTRAP_RUNTIME=go1.9.7
+
+ARG UID
+ARG GID
+RUN (groupadd ci --gid=$GID -o && useradd ci --uid=$UID --gid=$GID --create-home --shell=/bin/sh && \
+ mkdir -p -m0700 /var/lib/teleport && chown -R ci /var/lib/teleport)
+
+# Install dev tools (make, etc) and a Perl package needed to build OpenSSL.
+RUN yum groupinstall -y "Development Tools"
+RUN yum install -y pam-devel net-tools tree git zip libatomic perl-IPC-Cmd && \
+ yum clean all
+
+# Install etcd.
+RUN (curl -L https://github.com/coreos/etcd/releases/download/v3.3.9/etcd-v3.3.9-linux-amd64.tar.gz | tar -xz && \
+ cp etcd-v3.3.9-linux-amd64/etcd* /bin/)
+
+# BoringCrypto (unlike regular Go) requires glibc 2.14, so we have to build from source.
+# 1) Install older binary Go runtime for bootstrapping
+# 2) Get source for the correct Go boringcrypto runtime and compile it with Go bootstrap runtime
+# 3) Erase Go bootstrap runtime and create build directories
+# 4) Print compiled Go version
+RUN mkdir -p /go-bootstrap && cd /go-bootstrap && curl https://dl.google.com/go/${GO_BOOTSTRAP_RUNTIME}.linux-amd64.tar.gz | tar xz && \
+ mkdir -p /opt && cd /opt && curl https://go-boringcrypto.storage.googleapis.com/${BORINGCRYPTO_RUNTIME}.src.tar.gz | tar xz && \
+ cd /opt/go/src && GOROOT_BOOTSTRAP=/go-bootstrap/go ./make.bash && \
+ rm -rf /go-bootstrap && \
+ mkdir -p /go/src/github.com/gravitational/teleport && \
+ chmod a+w /go && \
+ chmod a+w /var/lib && \
+ chmod a-w / && \
+ /opt/go/bin/go version
+
+# Install PAM module and policies for testing.
+COPY pam/ /opt/pam_teleport/
+RUN make -C /opt/pam_teleport install
+
+# Install Rust.
+ENV RUSTUP_HOME=/usr/local/rustup \
+ CARGO_HOME=/usr/local/cargo \
+ PATH=/usr/local/cargo/bin:$PATH \
+ RUST_VERSION=$RUST_VERSION
+
+RUN mkdir -p $RUSTUP_HOME && chmod a+w $RUSTUP_HOME && \
+ mkdir -p $CARGO_HOME/registry && chmod -R a+w $CARGO_HOME
+
+RUN chmod a-w /
+
+USER ci
+RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain $RUST_VERSION && \
+ rustup --version && \
+ cargo --version && \
+ rustc --version && \
+ rustup component add --toolchain $RUST_VERSION-x86_64-unknown-linux-gnu rustfmt clippy && \
+ cargo install cbindgen
+
+ENV GOPATH="/go" \
+ GOROOT="/opt/go" \
+ PATH="/opt/bin:$PATH:/opt/go/bin:/go/bin:/go/src/github.com/gravitational/teleport/build"
+
+VOLUME ["/go/src/github.com/gravitational/teleport"]
+EXPOSE 6600 2379 2380
diff --git a/build.assets/Makefile b/build.assets/Makefile
index 24e8316c83326..1204350d45322 100644
--- a/build.assets/Makefile
+++ b/build.assets/Makefile
@@ -17,6 +17,7 @@ TEST_KUBE ?=
OS ?= linux
ARCH ?= amd64
RUNTIME ?= go1.17.3
+RUST_VERSION ?= 1.56.1
BORINGCRYPTO_RUNTIME=$(RUNTIME)b7
LIBBPF_VERSION ?= 0.3.1
@@ -30,6 +31,8 @@ GOGO_PROTO_TAG ?= v1.3.2
BUILDBOX=quay.io/gravitational/teleport-buildbox:$(RUNTIME)
BUILDBOX_FIPS=quay.io/gravitational/teleport-buildbox-fips:$(RUNTIME)
BUILDBOX_CENTOS6=quay.io/gravitational/teleport-buildbox-centos6:$(RUNTIME)
+BUILDBOX_CENTOS7=quay.io/gravitational/teleport-buildbox-centos7:$(RUNTIME)
+BUILDBOX_CENTOS7_FIPS=quay.io/gravitational/teleport-buildbox-centos7-fips:$(RUNTIME)
BUILDBOX_ARM=quay.io/gravitational/teleport-buildbox-arm:$(RUNTIME)
BUILDBOX_ARM_FIPS=quay.io/gravitational/teleport-buildbox-arm-fips:$(RUNTIME)
@@ -107,6 +110,7 @@ buildbox:
--build-arg UID=$(UID) \
--build-arg GID=$(GID) \
--build-arg RUNTIME=$(RUNTIME) \
+ --build-arg RUST_VERSION=$(RUST_VERSION) \
--build-arg PROTOC_VER=$(PROTOC_VER) \
--build-arg GOGO_PROTO_TAG=$(GOGO_PROTO_TAG) \
--build-arg PROTOC_PLATFORM=$(PROTOC_PLATFORM) \
@@ -147,6 +151,34 @@ buildbox-centos6:
# CentOS 6 FIPS builds were removed in Teleport 7.0
# https://github.com/gravitational/teleport/issues/7207
+#
+# Builds a Docker buildbox for CentOS 7 builds
+#
+.PHONY:buildbox-centos7
+buildbox-centos7:
+ @if [[ $${DRONE} == "true" ]] && ! docker inspect --type=image $(BUILDBOX_CENTOS7) 2>&1 >/dev/null; then docker pull $(BUILDBOX_CENTOS7) || true; fi;
+ docker build \
+ --build-arg UID=$(UID) \
+ --build-arg GID=$(GID) \
+ --build-arg RUNTIME=$(RUNTIME) \
+ --build-arg RUST_VERSION=$(RUST_VERSION) \
+ --cache-from $(BUILDBOX_CENTOS7) \
+ --tag $(BUILDBOX_CENTOS7) -f Dockerfile-centos7 .
+
+#
+# Builds a Docker buildbox for CentOS 7 FIPS builds
+#
+.PHONY:buildbox-centos7-fips
+buildbox-centos7-fips:
+ @if [[ $${DRONE} == "true" ]] && ! docker inspect --type=image $(BUILDBOX_CENTOS7_FIPS) 2>&1 >/dev/null; then docker pull $(BUILDBOX_CENTOS7_FIPS) || true; fi;
+ docker build \
+ --build-arg UID=$(UID) \
+ --build-arg GID=$(GID) \
+ --build-arg BORINGCRYPTO_RUNTIME=$(BORINGCRYPTO_RUNTIME) \
+ --build-arg RUST_VERSION=$(RUST_VERSION) \
+ --cache-from $(BUILDBOX_CENTOS7_FIPS) \
+ --tag $(BUILDBOX_CENTOS7_FIPS) -f Dockerfile-centos7-fips .
+
#
# Builds a Docker buildbox for ARMv7/ARM64 builds
# ARM buildboxes use a regular Teleport buildbox as a base which already has a user
@@ -287,6 +319,14 @@ release-arm64: buildbox-arm
release-amd64-centos6: buildbox-centos6
$(MAKE) release-centos6 ARCH=amd64
+.PHONY: release-amd64-centos7
+release-amd64-centos7: buildbox-centos7
+ $(MAKE) release-centos7 ARCH=amd64
+
+.PHONY: release-amd64-centos7-fips
+release-amd64-centos7-fips: buildbox-centos7-fips
+ $(MAKE) release-centos7-fips ARCH=amd64 FIPS=yes
+
#
# Create a Teleport FIPS package using the build container.
# This is a special case because it only builds and packages the Enterprise FIPS binaries, no OSS.
@@ -300,12 +340,30 @@ release-fips: buildbox-fips
#
# Create a Teleport package for CentOS 6 using the build container.
+# DELETE IN 9.0 (zmb3)
#
.PHONY:release-centos6
release-centos6: buildbox-centos6
docker run $(DOCKERFLAGS) -i $(NOROOT) $(BUILDBOX_CENTOS6) \
/usr/bin/make release -e ADDFLAGS="$(ADDFLAGS)" OS=$(OS) ARCH=$(ARCH) RUNTIME=$(RUNTIME) REPRODUCIBLE=no
+#
+# Create a Teleport package for CentOS 7 using the build container.
+#
+.PHONY:release-centos7
+release-centos7: buildbox-centos7
+ docker run $(DOCKERFLAGS) -i $(NOROOT) $(BUILDBOX_CENTOS7) \
+ /usr/bin/make release -e ADDFLAGS="$(ADDFLAGS)" OS=$(OS) ARCH=$(ARCH) RUNTIME=$(RUNTIME) REPRODUCIBLE=no
+
+#
+# Create a Teleport FIPS package for CentOS 7 using the build container.
+# This only builds and packages enterprise FIPS binaries, no OSS.
+#
+.PHONY:release-centos7-fips
+release-centos7-fips:
+ docker run $(DOCKERFLAGS) -i $(NOROOT) $(BUILDBOX_CENTOS7_FIPS) \
+ /usr/bin/make -C e release -e ADDFLAGS="$(ADDFLAGS)" OS=$(OS) ARCH=$(ARCH) RUNTIME=$(RUNTIME) FIPS=yes VERSION=$(VERSION) GITTAG=v$(VERSION) REPRODUCIBLE=no
+
#
# Create a Windows Teleport package using the build container.
#
@@ -325,18 +383,33 @@ release-windows-unsigned: buildbox
#
# Run docs tester to detect problems.
#
-.PHONY: docsbox
+.PHONY:docsbox
docsbox:
if ! docker inspect --type=image $(DOCSBOX) 2>&1 >/dev/null; then docker pull $(DOCSBOX) || true; fi
-.PHONY: test-docs
-test-docs: DOCS_VERSION := $(shell grep -E ^VERSION $(MAKEFILE_ROOT_DIR)/Makefile | cut -d= -f2 | cut -d. -f1-2)
+.PHONY:test-docs
test-docs: docsbox
- docker run -i $(NOROOT) -v $$(pwd)/..:/src/content/$(DOCS_VERSION) $(DOCSBOX) \
+ docker run --platform=linux/amd64 -i $(NOROOT) -v $$(pwd)/..:/src/content $(DOCSBOX) \
/bin/sh -c "yarn markdown-lint-external-links"
-# build-centos6-assets builds assets needed by CentOS 6 in a container.
-.PHONY: build-centos6-assets
+#
+# Builds assets needed by CentOS 6 in a container.
+#
+.PHONY:build-centos6-assets
build-centos6-assets:
docker build -t buildbox-centos6-assets -f Dockerfile-centos6-assets .
docker run -v $$(pwd):/centos6.assets -it buildbox-centos6-assets cp /centos6-assets.tar.gz /centos6.assets
+
+#
+# Print the Go version used to build Teleport.
+#
+.PHONY:print-go-version
+print-go-version:
+ @echo $(RUNTIME)
+
+#
+# Print the Rust version used to build Teleport.
+#
+.PHONY:print-rust-version
+print-rust-version:
+ @echo $(RUST_VERSION)
diff --git a/constants.go b/constants.go
index 6acb8ad1ddbd3..92fb85b936a16 100644
--- a/constants.go
+++ b/constants.go
@@ -739,3 +739,6 @@ const UserSingleUseCertTTL = time.Minute
// StandardHTTPSPort is the default port used for the https URI scheme,
// cf. RFC 7230 § 2.7.2.
const StandardHTTPSPort = 443
+
+// StandardRDPPort is the default port used for RDP.
+const StandardRDPPort = 3389
diff --git a/docs/img/desktop-access/ad-new-user.png b/docs/img/desktop-access/ad-new-user.png
new file mode 100644
index 0000000000000..945daea915b58
Binary files /dev/null and b/docs/img/desktop-access/ad-new-user.png differ
diff --git a/docs/img/desktop-access/apply-gpo.png b/docs/img/desktop-access/apply-gpo.png
new file mode 100644
index 0000000000000..f0f55026f1fb2
Binary files /dev/null and b/docs/img/desktop-access/apply-gpo.png differ
diff --git a/docs/img/desktop-access/create-and-link-gpo.png b/docs/img/desktop-access/create-and-link-gpo.png
new file mode 100644
index 0000000000000..16fa327b851e8
Binary files /dev/null and b/docs/img/desktop-access/create-and-link-gpo.png differ
diff --git a/docs/img/desktop-access/deny-interactive-login.png b/docs/img/desktop-access/deny-interactive-login.png
new file mode 100644
index 0000000000000..d0022b8489347
Binary files /dev/null and b/docs/img/desktop-access/deny-interactive-login.png differ
diff --git a/docs/img/desktop-access/remove-authenticated.png b/docs/img/desktop-access/remove-authenticated.png
new file mode 100644
index 0000000000000..92e2bff49ddce
Binary files /dev/null and b/docs/img/desktop-access/remove-authenticated.png differ
diff --git a/docs/img/desktop-access/select-desktop.png b/docs/img/desktop-access/select-desktop.png
new file mode 100644
index 0000000000000..f299a4ffff871
Binary files /dev/null and b/docs/img/desktop-access/select-desktop.png differ
diff --git a/docs/pages/desktop-access/getting-started.mdx b/docs/pages/desktop-access/getting-started.mdx
index 868b01e3a7406..bb4cc764baaa6 100644
--- a/docs/pages/desktop-access/getting-started.mdx
+++ b/docs/pages/desktop-access/getting-started.mdx
@@ -22,67 +22,89 @@ This guide requires you to have:
- An Active Directory domain, configured for LDAPS (Teleport requires an encrypted LDAP connection)
- Access to a Domain Controller
-- LDAP credentials for Active Directory (usually the same credentials you use
- to log into the Domain Controller)
- An existing Teleport cluster and user, version 8.0 or newer
- - see [Teleport Getting Started](../getting-started.mdx) if you're new to Teleport
+ - See [Teleport Getting Started](../getting-started.mdx) if you're new to Teleport
- A Linux server to run the Teleport Desktop Access service on
- - you can reuse an existing server running any other Teleport instance
+ - You can reuse an existing server running any other Teleport instance
-## Step 1/3. Configure Teleport
+## Step 1/6: Create a User, Group, and Group Policy Object
+
+Teleport requires a service account to connect to your Active Directory domain. We recommend creating a dedicated service account with restrictive permissions
+(described below) for maximal security.
+
+### Create a User and Group
+
+From the start menu of your Domain Controller, search for “Active Directory Users and Computers” and open the corresponding program.
+
+Find your domain in the side menu, and right click the container you want the service account to live in (typically Users). From the context
+menu, select `New > User` and fill out the fields for your Teleport LDAP Service Account. For the "User logon name" field, you can use `svc-teleport`
+On the password screen, unselect “User must change password at next login” and select “Password never expires”. Make a note of what values you put
+for user logon name and password, which will be used in your `teleport.yaml` configuration file later, and then click through the rest of the wizard.
- Prior to v8.0, the Teleport CA was not compatible with Windows logins. If
- you're setting up Desktop Access in an existing cluster created before v8.0,
- you must first perform a [CA rotation](../setup/operations/ca-rotation.mdx)
- in order to resolve this.
+ By default, domain users have Read and List permissions throughout Active Directory. If you have configured
+ any restrictions to Domain Users, you may have to adjust which groups this account is a member of.
-First, we need to enable Desktop Access in Teleport. To do this, add the
-following section in `teleport.yaml` on your Linux server:
+
-```yaml
-windows_desktop_service:
- enabled: yes
- # This is the address that windows_desktop_service will listen on.
- listen_addr: "0.0.0.0:3028"
- # (optional) This is the address that windows_desktop_service will advertise
- # to the rest of Teleport for incoming connections. Only proxy_service should
- # connect to windows_desktop_service, users connect to the proxy's web UI
- # instead.
- public_addr: "desktop-access.example.com:3028"
- ldap:
- # Address of the Domain Controller for LDAP connections. Usually, this
- # address will use port 389, like: domain-controller.example.com:389.
- addr: '$LDAP_SERVER_ADDRESS'
- # Active Directory domain name you are connecting to.
- domain: '$LDAP_DOMAIN_NAME'
- # LDAP username for authentication. This username must include the domain
- # NetBIOS name.
- #
- # For example, if your domain is "example.com", the NetBIOS name for it is
- # likely "EXAMPLE". When connecting as the "Administrator" user, you should
- # use the format: "EXAMPLE\Administrator".
- username: '$LDAP_USERNAME'
- # Plain text file containing the LDAP password for authentication.
- # This is usually the same password you use to login to the Domain Controller.
- password_file: /var/lib/ldap-pass
-```
+Now right click the same container you did before, and select `New > Group`. Choose a Group name like `svc-teleport-group` and ensure that “Global”
+is selected for “Group scope”, and “Security” for “Group type”, then hit "OK". Make note of the Group name you chose, as it will
+be used later for the PowerShell variable `$TeleportLDAPGroupName`.
-After updating `teleport.yaml`, start Teleport as usual using `teleport start`.
+Finally, add the User to the Group you just made by right clicking the User and selecting `Add to group`. Type the name of the Group, and confirm correctness
+by clicking the “Check Names” button, then click “OK”. You should see a dialog saying “The Add to Group operation was successfully completed.”
+
+### Create and Apply Group Policy Object
+
+Next, open the "Start" menu and run "Group Policy Management". On the left pane, navigate to `$FOREST > Domains > $DOMAIN`,
+selecting your forest and domain names respectively. Right click `$DOMAIN` and select `Create a GPO in this domain, and Link it here...` from the context menu.
+Give your GPO a name like `svc-teleport-gpo` and ensure "(none)" is selected for "Source Starter GPO", then hit "OK".
+
+
+
+Now, in the left pane navigate to `$FOREST > Domains > $DOMAIN > Group Policy Objects` and click on the GPO you just created (`svc-teleport-gpo`). In the "Scope" tab
+under "Security Filtering", select `Authenticated Users` and then click the "Remove" button and hit "OK".
+
+
+
+The "Remove" step prevents the GPO from being applied to all authenticated users in this domain, since we only want it to apply to members
+of the security Group created above (`svc-teleport-group`), of which only the User created above is a member (`svc-teleport`).
+
+To make that the case, in the same "Security Filtering" pane select "Add...", and enter the name of the Group (`svc-teleport-group`)
+in the resultant popup, clicking "Check Names" to confirm the spelling before pressing "OK". After this step, only the `svc-teleport-group`
+should be displayed in the "Security Filtering" pane:
+
+
-## Step 2/3. Configure Group Policy to allow Teleport connections
+## Step 2/6. Configure Group Policy to allow Teleport connections
{/* TODO: script this using PowerShell */}
-Next, we need to configure Active Directory to trust Teleport for user
+Next, we need to configure our Group Policy Object to trust Teleport for user
authentication and allow the certificate-based mechanism that Teleport uses under the hood
(smart cards).
-Get the Teleport user CA certificate:
+
+ The following step requires an existing cluster. If you don't already have a Teleport cluster up and running,
+ see our general [Getting Started](https://goteleport.com/docs/getting-started/) guide.
+
+
+Get the Teleport user CA certificate by running:
```
$ tctl auth export --type=windows > user-ca.cer
@@ -90,10 +112,8 @@ $ tctl auth export --type=windows > user-ca.cer
Transfer the `user-ca.cer` file to your Domain Controller.
-Log into your Domain Controller open "Start" menu and run "Group Policy
-Management". On the left pane, navigate to `$FOREST > Domains > $DOMAIN`,
-selecting your forest and domain names respectively. Right click on "Default
-Domain Policy" and select "Edit...".
+Then, on your Domain Controller, again open the "Group Policy Management" window. On the left pane, navigate to
+`$FOREST > Domains > $DOMAIN > Group Policy Objects`, right click on the Group Policy Object you made in step 1 (`svc-teleport-gpo`), and select "Edit...".
### Import Teleport CA
@@ -110,6 +130,53 @@ Click through the wizard, selecting your CA file.
![Import Teleport CA](../../img/desktop-access/ca.png)
+### Enable the Smart Card service
+
+Teleport performs certificate based authentication by emulating a smart card.
+To enable the smart card service, select:
+
+```text
+Computer Configuration > Policies > Windows Settings > Security Settings > System Services
+```
+
+Double click on `Smart Card`, select `Define this policy setting` and switch to
+`Automatic`. Click "OK".
+
+
+
+### Open firewall to inbound RDP connections
+
+Select:
+
+```text
+Computer Configuration > Policies > Windows Settings > Security Settings > Windows Firewall with Advanced Security (x2)
+```
+
+Right click on `Inbound Rules` and select `New Rule...`. Under `Predefined`
+select `Remote Desktop`. Only select the rule for `User Mode (TCP-in)`. On the
+next screen, select `Allow the connection` and finish.
+
+### Deny interactive login
+
+Select:
+
+```text
+Computer Configuration \ Policies \ Windows Settings \ Security Settings \ Local Policies \ User Rights Assignment
+```
+
+Double click `Deny log on locally` and in the popup, check "Define these policy settings". Then click "Add User or Group...", "Browse ...", enter the name
+of the group you created above (`svc-teleport-group`) and hit "Check Names", select your Group, and then hit "OK" on all the windows. (If the system won't let you hit "OK" after
+clicking "Check Names", just hit "Cancel" twice, re-click "Add User or Group", "Browse...", and keep trying again until it does).
+
+Repeat the process from above for `Deny log on through Remote Desktop Services`.
+
+
+
+
### Allow remote RDP connections
Next, select:
@@ -119,7 +186,7 @@ Computer Configuration > Policies > Administrative Templates > Windows Component
```
Right click on `Allow users to connect remotely by using Remote Desktop
-Services` and select "Edit". Select "Enable" and "OK".
+Services` and select "Edit". Select "Enabled" and "OK".