# Reference SSH role exercising the role options operators tune
# most often. Trim to taste. Every option below has a sensible
# default, so this file is meant to be read field-by-field.
apiVersion: almaforge.com/v1
kind: Role
metadata:
  name: ssh-options-ref
spec:
  options:
    maxSessionTTL: 8h # Maximum credential lifetime.
    forwardAgent: true # Allow native SSH agent forwarding through the Proxy.
    portForwarding: true # Allow `-L`/`-R` TCP forwards.
    sshFileCopy: true # Allow SCP and SFTP. Omit to block file copy.
    clientIdleTimeout: 30m # Disconnect idle clients after this period. "never" disables.
    disconnectExpiredCert: true # End the session if the user's cert expires mid-session.
    maxSessions: 10 # Max channels per SSH connection. 10 matches OpenSSH.
    maxConnections: 0 # Cluster-wide concurrent session cap. 0 = no limit. Adds backend load when set.
    pinSourceIp: false # Embed the login IP in the cert. The cert refuses use from any other IP.
    recordSession:
      default: bestEffort # Fallback recording mode for protocols without an explicit setting.
      ssh: bestEffort # Per-protocol mode for SSH sessions.
  allow:
    serverLabels:
      env: ['dev', 'staging']
    serverLogins:
      - '{{external.preferred_username}}'
