Commit Graph
23 Commits
Author SHA1 Message Date
Russell Jones 46653322af Refactor tests under util package.
Refactored all tests under "lib/util" to use testify instead
of gocheck.
2022-07-14 19:22:54 -07:00
Noah Stride 02b4f8575f Configure linter to catch British 🇬🇧 spellings 🇺🇸 🦅 📖 (#14363)
* configure golangci-lint misspell to check for anglicized spellings

* Americanize spellings

* fix aws constant value with british spelling 🇬🇧

* update api types with americanized spellings

* use american spellings .cloudbuild/scripts
2022-07-14 10:51:23 +00:00
Trent Clarke e1b2a267a9 Allow login over plain http in restricted situations (#7835)
This patch will allow the web api to (optionally) fall back from HTTPS
to HTTP under very particular circumstances:

  1. The appropriate `insecure` flag was set, and
  2. The target host is the loopback

If both conditions are met, this patch will allow the WebAPI client to
fall back to plain HTTP when attempting to login to the auth server.
2021-09-17 19:47:03 +10:00
Andrew Lytvynov c6832ec606 Set server_addr in audit events from connection info (#4985)
This sets a useful server IP, when no advertise_ip is set. Previously,
the address was taken from the listener, and is usually "0.0.0.0:3022"
or "[::]:3022".

Also, add some test cases in utils for IPv6 handling.
2020-11-25 12:08:37 -08:00
Roman Tkachenko 07b25088ec Remote tctl execution. (#2991)
* Teach tctl to use remote auth servers and identity.

* Tests and cleanups.
2019-09-24 14:01:30 -07:00
Russell Jones df9962d572 Test cleanup.
Initialize in main utils_test.go file and name test functions match
package names.
2019-09-03 13:44:20 -07:00
Sasha Klizhentas ba1fcf5d77 Fix teleport parsing to support IPV6
This commit fixes #2124
2019-07-23 20:36:34 -07:00
Cove Schneider f4f539a282 fix private network masks when guessing ip 2018-11-16 16:41:16 -08:00
Sasha Klizhentas 1f3b4e2c96 Kubernetes configuration, fetch proxy settings.
This commit moves proxy kubernetes configuration
to a separate nested block to provide more fine
grained settings:

```yaml
auth:
  kubernetes_ca_cert_path: /tmp/custom-ca
proxy:
  enabled: yes
  kubernetes:
    enabled: yes
    public_addr: [custom.example.com:port]
    api_addr: kuberentes.example.com:443
    listen_addr: localhost:3026
```

1. Kubernetes config section is explicitly enabled
and disabled. It is disabled by default.

2. Public address in kubernetes section
is propagated to tsh profile

The other part of the commit updates Ping
endpoint to send proxy configuration back to
the client, including kubernetes public address
and ssh listen address.

Clients updates profile accordingly to configuration
received from the proxy.
2018-08-06 11:57:36 -07:00
Sasha Klizhentas 68b65f5b24 Teleport signal handling and live reload.
This commit introduces signal handling.
Parent teleport process is now capable of forking
the child process and passing listeners file descriptors
to the child.

Parent process then can gracefully shutdown
by tracking the amount of current connections and
closing listeners once the amount goes to 0.

Here are the signals handled:

* USR2 signal will cause the parent to fork
a child process and pass listener file descriptors to it.
Child process will close unused file descriptors
and will bind to the used ones.

At this moment two processes - the parent
and the forked child process will be serving requests.
After looking at the traffic and the log files,
administrator can either shut down the parent process
or the child process if the child process is not functioning
as expected.

* TERM, INT signals will trigger graceful process shutdown.
Auth, node and proxy processes will wait until the amount
of active connections goes down to 0 and will exit after that.

* KILL, QUIT signals will cause immediate non-graceful
shutdown.

* HUP signal combines USR2 and TERM signals in a convenient
way: parent process will fork a child process and
self-initate graceful shutdown. This is a more convenient
than USR2/TERM sequence, but less agile and robust
as if the connection to the parent process drops, but
the new process exits with error, administrators
can lock themselves out of the environment.

Additionally, boltdb backend has to be phased out,
as it does not support read/writes by two concurrent
processes. This had required refactoring of the dir
backend to use file locking to allow inter-process
collaboration on read/write operations.
2018-02-13 15:18:47 -08:00
Ev Kontsevoy e932dbe5c3 Fixed the regression with GuessAdvertiseIP()
Fixes #486
2016-08-04 16:23:00 -07:00
dmitri 43ba205566 Cover the missing edge cases to replicate the old behavior:
- use arbitrary IP address if none from the preference list matched
  - fallback to loopback if no suitable address has been found
2016-06-24 23:39:50 +02:00
dmitri 98be2a591b Fix GuessHostIP to correctly ignore IPv6 addresses and follow the
defined order of address preferences.
2016-06-24 18:43:50 +02:00
Roman Tkachenko a44dca17e4 Add marshalling function to NetAddr 2016-06-10 00:11:31 -07:00
Ev Kontsevoy 64393d8d27 Fixed tests 2016-05-20 20:09:13 -07:00
Ev Kontsevoy d7f756cac1 Auth server heartbeat presence cleanup 2016-05-20 17:14:04 -07:00
Ev Kontsevoy e9730cc925 Implemented automatic-advertise-ip routine
Refs #416
2016-05-18 09:47:24 -07:00
klizhentas 23fa0ac2fe fix tests 2016-03-23 18:23:48 -07:00
klizhentas 94dd0f7fd9 use custom certificate pool instead of insecure connections for localhost proxies 2016-03-23 18:08:17 -07:00
klizhentas d42e122ef1 small fixes, refs #290
* do not populate auth servers advertising local ips
* fix annoying resize on session create
* decrease TTLs for active sessions and parties
2016-03-23 11:12:24 -07:00
klizhentas 09725aab60 recover etcd backend support 2016-03-10 17:03:01 -08:00
Ev Kontsevoy bb060fbbde Protection against nodes registering with unreachable IPs
auth:UpsertServer() now uses IP address on the wire if it detects looback or
unspecified IPs.

Refs #183
2016-03-01 17:18:06 -08:00
Ev Kontsevoy d6d5cb7d9c Added support for auth-server and tokens 2016-02-08 21:33:46 -08:00