mondoohq / docs

Mondoo Documentation
https://mondoo.com/docs
Mozilla Public License 2.0
3 stars 1 forks source link

cnspec scan via ansible inventory #455

Open atomic111 opened 2 days ago

atomic111 commented 2 days ago

I didn't get the command to work, so I think it's no longer correct

https://github.com/mondoohq/docs/blob/main/docs/platform/infra/opsys/automation/ansible.md?plain=1#L242

this works:

https://github.com/mondoohq/docs/blob/main/docs/platform/infra/opsys/automation/ansible.md?plain=1#L262

Can we please test the command and correct the ansible docs.

misterpantz commented 2 days ago

What shell are you using, @atomic111

atomic111 commented 2 days ago

i use zsh. I think we have two issues. At first the flag --insecure is not supported

ansible-inventory -i inventory-test.yml --list | cnspec scan --inventory-format-ansible --insecure
Error: unknown flag: --insecure

if i remove the the --insecure flag it scans my notebook but not the target that is defined in the inventory

ansible-inventory -i inventory-test.yml --list | cnspec scan --inventory-format-ansible
→ no provider specified, defaulting to local. Use --help to see all providers.
→ loaded configuration from /Users/user/.config/mondoo/mondoo.yml using source default
→ using service account credentials
→ discover related assets for 1 asset(s)

 notebook ───────────────────────────────────────────────────────────────────────────────────────────   0%

→ synchronize assets

my inventory file:

all:
  vars:
    ansible_connection: ssh
    ansible_port: 22
  hosts:
    debian12:
      ansible_host: 1.176.111.111
      ansible_user: admin
      ansible_ssh_private_key_file: ~/.ssh/key-rsa
misterpantz commented 1 day ago

@chris-rock believes this is likely a product issue. So I created https://github.com/mondoohq/cnquery/issues/4846.

In the meantime, I have this: https://github.com/mondoohq/docs/pull/457