Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cnspec scan via ansible inventory #455

Open
atomic111 opened this issue Nov 11, 2024 · 6 comments
Open

cnspec scan via ansible inventory #455

atomic111 opened this issue Nov 11, 2024 · 6 comments
Assignees

Comments

@atomic111
Copy link
Member

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.

@atomic111 atomic111 added the bug Something isn't functioning in the docs mechanism label Nov 11, 2024
@misterpantz
Copy link
Contributor

What shell are you using, @atomic111

@atomic111
Copy link
Member Author

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 misterpantz removed the bug Something isn't functioning in the docs mechanism label Nov 12, 2024
@misterpantz misterpantz self-assigned this Nov 12, 2024
@misterpantz
Copy link
Contributor

@chris-rock believes this is likely a product issue. So I created mondoohq/cnquery#4846.

In the meantime, I have this: #457

@misterpantz
Copy link
Contributor

Reopening. @slntopp investigated and found that it works -- it's just that no one knew how! :)

@misterpantz misterpantz reopened this Nov 25, 2024
@misterpantz
Copy link
Contributor

mondoohq/cnquery#4846

@misterpantz
Copy link
Contributor

This is fixed in the location @atomic111 identified. I'm going to keep this issue open because I want to update the provider help as well. It doesn't have wrong info but @slntopp provided some helpful info that I want to pass on to users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants