Aller au contenu

Poste Linux Orange Business#

Cette documentation décrit les étapes à réaliser pour configurer un poste de travail Linux Orange OBS SA. Elles sont à réaliser dans l'ordre, en autonomie, mais nécessitent parfois l'intervention d'un membre de Caascad avec des droits spécifiques.

Comptes#

Vos comptes doivent avoir été créés :

  • Sur l'AD
  • Sur l'AD-SUBS avec l'appartenance au groupe GG-OBSSA-PA-VPNSSL
  • Avec une adresse e-mail en @orange.com
  • Sur les outils de la Product Factory (Keycloak, Jira, Bastions, etc.).

Connexions réseaux#

Wi-Fi Orange Business#

wifi@eburo_subs (Sur les sites Orange Business uniquement)

Dans la configuration de la connexion, cliquez sur le « CA Certificat » et pointez sur le fichier /etc/ssl/certs/ca-certificates.crt.

Username: CUID@ad-subs

Password: <Votre mot de passe AD-SUBS>

Validez avec Se Connecter.

VPN#

Voir la documentation OBS Flexible Identity Authentication (FIA)

SSH#

Clé personnelle#

Générer une paire de clés SSH avec l'adresse e-mail @orange.com en commentaire :

ssh-keygen -t ed25519 -C "xxx@orange.com"

Transmettre la clé publique SSH ~/.ssh/id_ed25519.pub dans le chan #support sur Mattermost.

Config client SSH#

Créer une configuration SSH de base :

cat > ~/.ssh/config << EOF
# Load all valid SSH config founded in ~/.ssh/config.d/
Include config.d/*.conf
EOF

mkdir -vp ~/.ssh/config.d

Ajouter les configurations SSH pour prendre en compte les ProxyJump Caascad / Product Factory :

cat > ~/.ssh/config.d/pf_hosts.conf << EOF
### Product Factory environment / Profil = Dev (Caascad, NGOT)
# Note: The first entry in the ssh config file always takes precedence, if you
#       want something specific then put it in first, anything generic put it
#       at the bottom.

## SSH to GitLab corp
Host git.corp.caascad.com
  User git

## Default parameters for Caascad & NGOT Env
Host *.caascad.com *.csfpriv.com *.cloudservicesfactory.com
  User cloud
  PreferredAuthentications publickey

  # Send Keep-Alive signal every 10s (Keep a low value for Orange proxies <= 10s)
  ServerAliveInterval 10

  # Speed tuning
  ControlMaster auto
  ControlPath ~/.ssh/master-%C
  ControlPersist 30m
EOF

Pour les ops uniquement (si vous ne savez pas, vous n'êtes pas concerné), ajouter (Il faut récupérer les clefs SSH dans le Vault Corp) :

cat > ~/.ssh/config.d/pf_hosts_ops.conf << EOF
### Product Factory environment / Profil = Ops (Caascad, NGOT)
# Note: The first entry in the ssh config file always takes precedence, if you
#       want something specific then put it in first, anything generic put it
#       at the bottom.
## SSH to Jitsi PRD Caascad
Host jitsi.corp.caascad.com
  IdentityFile ~/.ssh/corp.caascad.com.pem

## SSH to Jitsi STG Caascad
Host jitsi-stg.corp.caascad.com
  IdentityFile ~/.ssh/corp.caascad.com.pem

## SSH to Jira(s) & Confluence(s) Caascad PRD/STG
Host jira*.*.caascad.com confluence*.*.caascad.com
  IdentityFile ~/.ssh/corp.caascad.com.pem
EOF

Enfin, ajuster les permissions

chmod go-rwx -Rv ~/.ssh/config.d

Proxy HTTP(S)#

En fonction de son environnement de travail, il vous faudra probablement utiliser un serveur proxy NTLM1 (Utilise votre compte AD) pour les flux HTTP / HTTPS (Plus d'informations sur les proxies Orange) :

  • Accès direct à Internet : Pas de proxy
  • Accès à Internet via LAN SI Orange : proxybkp.si.francetelecom.fr:8080
  • Accès à Internet via VPN FIA : proxypartner.itn.ftgroup:8080.

Configurer son navigateur#

Déclarer le proxy préconisé précédemment. Éventuellement, il peut être intéressant d'ajouter une extension pour jongler entre les différents environnements.

Pour Firefox, vous pouvez installer l'extension FoxyProxy et importer la configuration suivante:

{
  "mode": "pattern",
  "sync": true,
  "autoBackup": false,
  "passthrough": "",
  "theme": "",
  "container": {
    "incognito": "",
    "container-1": "",
    "container-2": "",
    "container-3": "",
    "container-4": ""
  },
  "commands": {
    "setProxy": "",
    "setTabProxy": "",
    "quickAdd": ""
  },
  "data": [
    {
      "active": true,
      "title": "Proxy VPN Orange",
      "type": "http",
      "hostname": "127.0.0.1",
      "port": "3128",
      "username": "",
      "password": "",
      "cc": "",
      "city": "",
      "color": "#ff8839",
      "pac": "",
      "pacString": "",
      "proxyDNS": false,
      "include": [
        {
          "type": "wildcard",
          "title": "infra ftgroupe",
          "pattern": "*://*.infra.ftgroup/",
          "active": true
        },
        {
          "type": "wildcard",
          "title": "intraorange",
          "pattern": "*://*.intraorange/",
          "active": true
        },
        {
          "type": "wildcard",
          "title": "si.fr.intraorange",
          "pattern": "*://*.si.fr.intraorange/",
          "active": true
        },
        {
          "type": "wildcard",
          "title": "tech.orange",
          "pattern": "*://*.tech.orange/",
          "active": true
        },
        {
          "type": "wildcard",
          "title": "login.microsoftonline.com",
          "pattern": "*://*microsoftonline.com/",
          "active": true
        },
        {
          "type": "wildcard",
          "title": "nsaii-health-check",
          "pattern": "*://nsaii-health-check.orange.com/*",
          "active": true
        },
        {
          "type": "wildcard",
          "title": "sso.intraorange",
          "pattern": "*://*.sso.intraorange/",
          "active": true
        },
        {
          "type": "wildcard",
          "title": "sso.infra.ftgroup",
          "pattern": "*://*.sso.infra.ftgroup/",
          "active": true
        },
        {
          "type": "wildcard",
          "title": "com.intraorange",
          "pattern": "*://*.com.intraorange",
          "active": true
        },
        {
          "type": "wildcard",
          "title": "wam.sso.intraorange",
          "pattern": "*://*.wam.sso.intraorange",
          "active": true
        }
      ],
      "exclude": [
        {
          "type": "regex",
          "title": "local hostnames (usually no dots in the name). Pattern exists because 'Do not use this proxy for localhost and intranet/private IP addresses' is checked.",
          "pattern": "^[^:]+://(?:[^:@/]+(?::[^@/]+)?@)?(?:localhost|127\\.\\d+\\.\\d+\\.\\d+)(?::\\d+)?(?:/.*)?/",
          "active": true
        },
        {
          "type": "regex",
          "title": "local subnets (IANA reserved address space). Pattern exists because 'Do not use this proxy for localhost and intranet/private IP addresses' is checked.",
          "pattern": "^[^:]+://(?:[^:@/]+(?::[^@/]+)?@)?(?:192\\.168\\.\\d+\\.\\d+|10\\.\\d+\\.\\d+\\.\\d+|172\\.(?:1[6789]|2[0-9]|3[01])\\.\\d+\\.\\d+)(?::\\d+)?(?:/.*)?/",
          "active": true
        },
        {
          "type": "regex",
          "title": "localhost - matches the local host optionally prefixed by a user:password authentication string and optionally suffixed by a port number. The entire local subnet (127.0.0.0/8) matches. Pattern exists because 'Do not use this proxy for localhost and intranet/private IP addresses' is checked.",
          "pattern": "^[^:]+://(?:[^:@/]+(?::[^@/]+)?@)?[\\w-]+(?::\\d+)?(?:/.*)?/",
          "active": true
        }
      ]
    }
  ]
}

Configurer son shell#

Le support des proxies NTLM est assuré sur Linux par le service Alpaca ou Cntlm.

Installer au choix :

Installation d'Alpaca#

Warning

Si vous avez malgré tout choisi d'installer Cntlm, l'installation d'Alpaca n'est pas nécessaire.

Installer Alpaca (Méthode à adapter selon son environnement)

nix-env --install --attr 'nixpkgs.alpaca-proxy'
sudo apt install alpaca

Générer le secret NTLMv2

alpaca-proxy -d AD -u "${USERNAME}" -H
alpaca -d AD -u "${USERNAME}" -H

Exécuter la commande générée, par ex

NTLM_CREDENTIALS="abcd1234@AD:d43eb3c12d597dfe44a31859c586b2dc"; export NTLM_CREDENTIALS

Génerer l'environnement pour notre service systemctl

cat > ~/.config/alpaca.environment << EOF
LISTEN_ADDRESS=localhost
LISTEN_PORT=3128
NTLM_CREDENTIALS="${NTLM_CREDENTIALS}"

# Proxy PAC Orange Business
PAC_URL="http://www-cache-obssa.si.fr.intraorange:8080/proxy-vdr.pac"

# Proxy PAC Orange SA
#PAC_URL="http://proxypac.si.francetelecom.fr:8080"
EOF

Créer le service systemd alpaca

mkdir -vp ~/.config/systemd/user/

cat > ~/.config/systemd/user/alpaca.service << "EOF"
[Unit]
Description=Alpaca Proxy NTLM Server
After=network.target network-online.target systemd-networkd.service NetworkManager.service

[Service]
EnvironmentFile=%h/.config/alpaca.environment
ExecStart=%h/.nix-profile/bin/alpaca-proxy -C "${PAC_URL}" -l "${LISTEN_ADDRESS}" -p "${LISTEN_PORT}"
Restart=on-failure

[Install]
WantedBy=default.target
EOF
mkdir -vp ~/.config/systemd/user/

cat > ~/.config/systemd/user/alpaca.service << "EOF"
[Unit]
Description=Alpaca Proxy NTLM Server
After=network.target network-online.target systemd-networkd.service NetworkManager.service

[Service]
EnvironmentFile=%h/.config/alpaca.environment
ExecStart=/usr/bin/alpaca -C "${PAC_URL}" -l "${LISTEN_ADDRESS}" -p "${LISTEN_PORT}"
Restart=on-failure

[Install]
WantedBy=default.target
EOF

Activer et démarrer le service

systemctl --user enable alpaca.service --now

Pour consulter les logs du service

journalctl --user -u alpaca -f

Effacer les variables sensibles

unset NTLM_CREDENTIALS

Installation Cntlm#

Warning

Si vous avez choisi d'installer Alpaca, l'installation de Cntlm n'est pas nécéssaire.

Installer Cntlm en fonction de son environnement :

  • Linux Debian like (Ubuntu, etc.) :
    sudo apt install cntlm
    

Configurer le service (Conf à adapter au besoin) :

echo "Mot de passe / Compte AD"
read -s AD_SECRET

# Générer les secrets LM, NT et NTLMv2
CNTLM_PASSLM=$(echo "${AD_SECRET}"     | cntlm -u ${USERNAME} -H -d AD | awk '/^PassLM[[:blank:]]/ {print $2}')
CNTLM_PASSNT=$(echo "${AD_SECRET}"     | cntlm -u ${USERNAME} -H -d AD | awk '/^PassNT[[:blank:]]/ {print $2}')
CNTLM_PASSNTLMV2=$(echo "${AD_SECRET}" | cntlm -u ${USERNAME} -H -d AD | awk '/^PassNTLMv2[[:blank:]]/ {print $2}')

cat > /etc/cntlm.conf << EOF
### Configure CNTLM for Orange authenticated proxies
# CNTLM listen port
Listen          3128

# Proxies list for VPN Nomade / Orange SA / RSC environment
#Proxy           proxybkp.si.francetelecom.fr:8080
#Proxy           oppr5aub1-prd.idf.fr.intraorange:8080
#Proxy           oppr5aub2-prd.idf.fr.intraorange:8080
#Proxy           oppr5vdr1-prd01.si.fr.intraorange:8080
#Proxy           oppr5vdr2-prd01.si.fr.intraorange:8080

# Proxies list for VPN FIA / Orange Business environment
Proxy            www-cache-obssa.si.fr.intraorange:80
#Proxy           proxypartner.itn.ftgroup:8080

# Proxy exclusion list
#   VoIP / SoftPhone =>  195.25.83.*, *.businesstogether.orange-business.com
NoProxy         localhost, 127.0.0.*, 10.*, 192.168.*, 195.25.83.*, *.businesstogether.orange-business.com

# Secrets used for proxy authentication
#   Generate hash : sudo cntlm -u <USER_CUID> -H -d AD
Username        ${USERNAME}
Domain          AD
PassLM          ${CNTLM_PASSLM}
PassNT          ${CNTLM_PASSNT}
PassNTLMv2      ${CNTLM_PASSNTLMV2}

# Force server hostname (Fix hostname for OS / laptop migration)
Workstation     reykjavik
EOF

Redémarrer le service Cntlm :

sudo systemctl enable --now cntlm
sudo systemctl restart cntlm

Déclarer le proxy dans le shell#

Déclarer le proxy Cntlm pour le shell (Utilisé par curl, wget, etc.) :

export {http_proxy,HTTP_PROXY,https_proxy,HTTPS_PROXY}='http://127.0.0.1:3128'
export {no_proxy,NO_PROXY}='localhost'

Il est possible de les déclarer en alias pour faciliter l'usage :

alias proxy-off='unset {http_proxy,HTTP_PROXY,https_proxy,HTTPS_PROXY,no_proxy,NO_PROXY}'
alias proxy-on='export {http_proxy,HTTP_PROXY,https_proxy,HTTPS_PROXY}=http://127.0.0.1:3128 ; export {no_proxy,NO_PROXY}=localhost'

Déclarer le proxy dans les outils#

Les principaux outils en CLI utiliseront la configuration système (curl, wget, docker, etc.). Néanmoins, pour certains outils, ils ont leur propre configuration du proxy, par exemple (Liste non-exhaustive à ajuster en fonction de votre contexte) :

  • git (Il est aussi possible d'associer un proxy à un repository)
    alias gitproxy-off='unalias git'
    alias gitproxy-on="alias git='git -c http.proxy=http://127.0.0.1:3128'"
    
  • apt (A noter qu'il existe aussi des repositories en interne Orange)
    sudo cat > /etc/apt/apt.conf.d/proxy.conf << EOF
    Acquire::http::Proxy "http://127.0.0.1:3128";
    Acquire::https::Proxy "http://127.0.0.1:3128";
    EOF
    
  • snap
    sudo snap set system proxy.http="http://127.0.0.1:3128"
    sudo snap set system proxy.https="http://127.0.0.1:3128"
    

Toolbox#

Suivre les instructions d'installation de la toolbox.

Vidéos d'introduction à la toolbox et à Nix :

Youtube

GPG#

Installer gnupg#

toolbox install gnupg

Fermer puis réouvrir votre terminal

S'assurer que l'on utilise la version Nix de gpg :

command -v gpg
# devrait renvoyer: /home/<...>/.nix-profile/bin/gpg

Générer gpg keys#

Changer le nom, e-mail. Indiquer une passphrase lorsqu'elle vous est demandée.

gpg --batch --gen-key <<EOF
Key-Type: 1
Key-Length: 4096
Subkey-Type: 1
Subkey-Length: 4096
Name-Real: John Smith
Name-Email: john.smith@orange.com
Expire-Date: 10y
EOF

Git#

Suivre les instructions de configuration de git

Keystore#

Suivre les instructions de configuration du keystore.

Vault#

Dans un nouveau shell :

toolbox install vault vault-token-helper

vault-token-helper enable

export VAULT_ADDR=https://vault.infra-prd.caascad.com
vault login -method oidc

export VAULT_ADDR=https://vault.infra-stg.caascad.com
vault login -method oidc

Installation de podman#

Cette opération permet d'installer podman sur un poste eburo linux dont la version est supérieure ou égale à 20.04 LTS.

Pour s'assurer que les commandes suivantes se déroulent correctement, il faut se mettre en root.

sudo -i
# Exporter les différentes informations sur la version de l'OS.
source /etc/os-release

# Ajouter le registry podman.
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list

# Ajouter la clé GPG pour vérififier l'intégrité du package.
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add -

# Installer podman.
apt-get update &&  apt-get -y upgrade
apt-get -y install podman

# Vérifier la version de podman.
podman --version

  1. NT Lan Manager est un protocole d'authentification propriétaire Microsoft.