Outils pour utilisateurs

Outils du site


blog

Notes Ansible - mount - prevent nested loops

Nous voulons interdire les montages imbriqués (montage dans un montage) \ Ou pour le dire autrement : Nous voulons interdire à un utilisateur de créer un point de montage dans un point de montage existant (autre que /).

playbook.yml

- name: is a nested mount ?
  become: true
  shell: |
    # will_be_mounted_on
    # Returns the mount point where the future file given in argument will be located
    set -euo pipefail
    TMP_PATH="{{ PLOP_ACCOUNT_HOME | quote }}"
    while [[ ! -e "$TMP_PATH" ]]
    do
        TMP_PATH="$(dirname $TMP_PATH)"
    done
    df -l --output=target "$TMP_PATH" | tail -1
  check_mode: false
  changed_when: false
  register: mounted_on
  when: PLOP_ACCOUNT_HOME is defined and PLOP_ACCOUNT_HOME != `

- name: assert fail on nested mount
  assert:
    that:
      - mounted_on.stdout_lines[-1] == '/' or mounted_on.stdout_lines[-1] == PLOP_ACCOUNT_HOME
2025/03/24 15:06

Notes Ansible - callback plugins

ansible/plugins/callback/

ansible.cfg

[defaults]
 
# change the default callback, you can only have one 'stdout' type  enabled at a time.
#stdout_callback = skippy
stdout_callback = kafka_logger
 
# Callback pluging activated for /usr/bin/ansible too
bin_ansible_callbacks = true
 
# enable callback plugins, they can output to stdout but cannot be 'stdout' type.
#callback_whitelist = timer, mail
callback_whitelist = timer, mail
 
# callback plugin path
# cp -p /usr/lib/python3.6/site-packages/ansible/plugins/callback/timer.py ansible/plugins/callback/
callback_plugins   = $PWD/ansible/plugins/callback
ansible-doc -t callback -l
2025/03/24 15:06

Notes analyse de paquets réseau avec Wireshark

Wireshark - filtres

Paquets en erreurs ?

!_ws.expert.message == "Retransmission (suspected)" && !_ws.expert.message == "Duplicate ACK (#1)" && !_ws.expert.message == "Out-Of-Order segment"
TZ="Europe/Paris" tshark -n -tad -r tcpdump_client.pcap -Y "smb2.cmd == 5"
tshark -r file.cap -Y frame.number==2001 --hexdump ascii
$ TZ="Europe/Paris" capinfos -aeuc tcpdump_client.pcap 
File name:           0050-nonworking_cp_tcpdump_client.pcap
Number of packets:   2,720 k
Capture duration:    111.092169 seconds
First packet time:   2022-08-19 14:43:44.519951
Last packet time:    2022-08-19 14:45:35.612120

FIXME

2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki