salt icon indicating copy to clipboard operation
salt copied to clipboard

Feature request: make salt master push data to minions, rather than the other way around

Open ManuelAmadorAditazz opened this issue 13 years ago • 13 comments

From my cursory inspection of the code, it appears that the salt master notifies the minions that there is new state, and then the minions proceed to download the requisite states from the server, for local execution. Naturally, these states sometimes require certain files... files that the master serves.

It appears to me, therefore, that a compromised salt minion node could use this facility to obtain files that it would otherwise not be authorized to get. Files containing passwords, certificates, keys, username lists, you name it.

For this reason, I wanted to ask if there are any plans to overhaul the protocol or add an alternative protocol that compiles states and dependent resources on the salt master, and then pushes them to the minions, vetoing any file downloads initiated from the minions.

I know about defense in depth. Firewalls, containers, chroots, permissions, users, all those mechanisms are useful. But I am still concerned that salt can be used to leverage what would otherwise be a minor compromise, into a major compromise.

Thanks.

ManuelAmadorAditazz avatar Feb 20 '13 22:02 ManuelAmadorAditazz

I am aware of Pillar now. What's the plan to fold Pillar into Salt?

ManuelAmadorAditazz avatar Feb 20 '13 22:02 ManuelAmadorAditazz

It's already part of Salt.

UtahDave avatar Feb 20 '13 23:02 UtahDave

I know Pillar is part of Salt. I was wondering if there are any plans to fold Pillar functionality into the Salt master, rather than keeping it as a separate feature.

ManuelAmadorAditazz avatar Feb 20 '13 23:02 ManuelAmadorAditazz

Uh, wait, ignore my question. It is dumb.

Perhaps this functionality needs to be made more prominent on the salt stack docs.

ManuelAmadorAditazz avatar Feb 20 '13 23:02 ManuelAmadorAditazz

Agreed.

UtahDave avatar Feb 20 '13 23:02 UtahDave

Reading the docs, it appears that what a minion can see, is strictly and ultimately based on what grains are associated with the minion.

If I have a compromised minion that is a webserver, and it changes its configuration to mimic the grains of the database server role, my reading of how it works is that pillar will dutifully send the minion sensitive database configuration data upon request.

Is this contention correct?

ManuelAmadorAditazz avatar Feb 20 '13 23:02 ManuelAmadorAditazz

The people at IRC have gently indicated this to me:

Rudd-XXX: yes, a minion can change its grains if you match pillar data with grains, realize that a minion can yes change the grain. Rudd-XXX: it can't change its ID though. but, most of the time you match by hostname, and a hostname can't be changed without reauthorizing the key. without reauthorizing the ID pubkey on the master you should try to match on id, and only use grains for platform detection

My conclusion is that the only secure mechanism to distribute sensitive data is to write pillar states that match only on the host ID.

Is this correct?

ManuelAmadorAditazz avatar Feb 20 '13 23:02 ManuelAmadorAditazz

Yes, this is correct. Authentication is a combination of the minion ID and minion public key. If either of these change, then the minion will be rejected.

UtahDave avatar Feb 20 '13 23:02 UtahDave

Me gusta.

On Wed, Feb 20, 2013 at 3:53 PM, David Boucha [email protected]:

Yes, this is correct. Authentication is a combination of the minion ID and minion public key. If either of these change, then the minion will be rejected.

— Reply to this email directly or view it on GitHubhttps://github.com/saltstack/salt/issues/3813#issuecomment-13864706.

ManuelAmadorAditazz avatar Feb 20 '13 23:02 ManuelAmadorAditazz

Que bien! :)

Let us know if you have any other questions or concerns.

UtahDave avatar Feb 21 '13 00:02 UtahDave

I believe the original questions have been answered here. Can we close this out?

UtahDave avatar Feb 21 '13 01:02 UtahDave

Yes please. Thanks! Please post docs -- what the concerns are, and what the solution is -- on this matter on the salt docs rather than just on the pillar docs.

On Wed, Feb 20, 2013 at 5:00 PM, David Boucha [email protected]:

I believe the original questions have been answered here. Can we close this out?

— Reply to this email directly or view it on GitHubhttps://github.com/saltstack/salt/issues/3813#issuecomment-13866857.

ManuelAmadorAditazz avatar Feb 21 '13 01:02 ManuelAmadorAditazz

OK, will do. Thanks!

UtahDave avatar Feb 21 '13 01:02 UtahDave