Commit Graph
6 Commits
Author SHA1 Message Date
Zac Bergquist 44a6bb1933 Use pkg slices from the standard library (#35905)
Prefer the stdlib version of the experimental package.
Includes a depguard update to prevent future regressions,
as well as an e-ref update to appease depguard.

Generated with:

    $ gofmt -w -r '"golang.org/x/exp/slices" -> "slices"' . && \
        make fix-imports
2023-12-19 23:06:53 +00:00
fheinecke b178b8b732 Updated Teleport codebase to AGPL3 license (#35259)
Signed-off-by: Fred Heinecke <fred.heinecke@goteleport.com>
2023-12-01 17:48:14 +00:00
Marco André Dinis c3550a24e6 OneOff Script: use ent build if cluster is Enterprise (#33061)
* OneOff Script: use ent build if cluster is Enterprise

We were always using the OSS version of teleport in the one-off scripts.

This PR changes that to pick the correct version depending on the
running version in the Proxy.

* use gzip bestspeed for compressing files
2023-10-09 13:44:30 +00:00
Marco André Dinis c2948bd40c OneOff: add success message (#30425)
When the OneOff script completes, print a success message to let the
user know that everything worked as expected and what their next action
should be.
2023-08-16 07:01:43 +00:00
Marco André Dinis 4f2d9b066a DeployService IAM Configure: unescape arguments (#28807)
We were escaping the command arguments with double quotes.
It works with bash4.3+.

However, AWS CloudShell has bash 4.2 which:
>
> zz. When using the pattern substitution word expansion, bash now runs the
>     replacement string through quote removal, since it allows quotes in that
>     string to act as escape characters.  This is not backwards compatible, so
>     it can be disabled by setting the bash compatibility mode to 4.2.

http://tiswww.case.edu/php/chet/bash/CHANGES

When running this script in bash 4.2, the arguments end up being `"xyz"`
instead of `xyz`.
So, errors like this happen:
```
ERROR: operation error STS: GetCallerIdentity, https response error StatusCode: 0, RequestID: , request send failed, Post "https://sts.\"us-east-1\".amazonaws.com/": dial tcp: lookup sts."us-east-1".amazonaws.com: no such host
```

Removing the quotes means it will work on older and newer bash versions:

Demo:

```
> ./bin/teleport integration configure deployservice-iam --cluster=kimlisa.cloud.gravitational.io --name=r0mant --aws-region=us-east-1 --role=r0mant-oidc --task-role=Test+1=2,3.4@5-6_7
2023/07/07 08:04:05 TaskRole: Boundary Policy "Test+1=2,3.4@5-6_7Boundary" created.
2023/07/07 08:04:05 TaskRole: Role "Test+1=2,3.4@5-6_7" created with Boundary "arn:aws:iam::278576220453:policy/Test+1=2,3.4@5-6_7Boundary".
2023/07/07 08:04:05 TaskRole: IAM Policy "Test+1=2,3.4@5-6_7" added to Role "Test+1=2,3.4@5-6_7".
2023/07/07 08:04:05 IntegrationRole: IAM Policy "DeployService" added to Role "r0mant-oidc"
```
2023-07-12 22:11:24 +00:00
Marco André Dinis 0ef626308c Teleport One Off Script (#27852)
* Teleport One Off Script

This PR creates an endpoint that returns a script.
This script does the following:
- detects the correct os/arch, downloads and extracts the teleport
  binary package
- runs teleport with arguments defined in the endpoint's query param

This will allow the Discover wizard to give bash scripts in the form of
`bash -c "$(curl ..../oneoff... )"` to the user.
The user is then asked to run those commands.

One use case for those commands is the creation of specific AWS Roles
which are then used to give Teleport extra access to other AWS Services
/ Actions.
This specific command will come in a later PR.

* remove endpoint

* disable shellcheck for go templated vars

* use bintest v3
2023-06-27 12:14:23 +00:00