Skip to content

How can I make CFEngine report PermitRootLogin from sshd_config as part of Inventory? #4474

Answered by nickanderson
olehermanse asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @olehermanse

There are a few functions that come to mind with respect to parsing text. \

Of these, the first two are the ones I most commonly use. For cases where you have a unique key you can use data_readstringarray(), for cases where you might have the same key multiple times you will probably want to use data_readstringarrayidx(). I am going to ignore the match feature for sshd and assume unique keys for this file, that is to say if you have PermitRootLogin multiple times, the last one will win.

bundle agent example_parse_and_inventory_ss…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@olehermanse
Comment options

Answer selected by olehermanse
Comment options

You must be logged in to vote
2 replies
@olehermanse
Comment options

@nickanderson
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants