# Code Books

# Wazuh

# Upgrade Wazuh Agents

1\. First we need to ssh into Wazuh container

```bash
sudo docker exec -it single-node-wazuh.manager-1 /bin/bash
```

2\. Next we run

```
/var/ossec/bin/agent_upgrade -l
```

to check which agents can be updated.

3\. RUn the next command to update the agent/agents

```
/var/ossec/bin/agent_upgrade -a IDNUMBERHERE
```

# Ansible

To copy the ansible user ssh key to a VM or container:

```
ssh-copy-id -i ~/.ssh/ansible.pub -p PORTOFSERVER thesabear@IPOFSERVER
ssh-copy-id -i ~/.ssh/ansible.pub -p 10018 thesabear@10.27.27.18
```

To run a manual update&amp;upgrade of all machines in inventory

```
ansible all -m apt -a "upgrade=dist" --become --ask-become-pass
```