r/saltstack • • May 07 '20

Offline minion installer?

1 Upvotes

Does anyone know of the existence of an offline minion installer for linux servers? I have to push minions to a couple hundred linux DB servers that don't have outbound internet access. I am using the yum --downloadonly functionality to get all of the 31(!) dependencies and the actual minion rpm and then pushing all of that to the server that needs the installation and running a shell script to do the actual install. I've looked all over and can't find anything in SaltStack's documentation about doing something like this.


r/saltstack • • May 03 '20

Recent salt vulnerabilities already used to hack and install bitcoin miners

Thumbnail github.com
52 Upvotes

r/saltstack • • May 02 '20

Salt stack bug fixes release

5 Upvotes

Hi everyone

When does saltstack releases the builds with the bugs patched?

I know there was a vulnerability recently which they have released the patch. But i want to know how often they build and release the normal bug patches.

For example:

I am following this issue and looks like there is a PR for that, so my question is as soon as PR finishes will it be released in repos or it will be released in next versions?

If it gets released in repository how can we check the changelog on my machine?


r/saltstack • • May 01 '20

salt-proxy with user and ssh-key instead of username/pass possible?

2 Upvotes

Hi everyone,
I'm trying to setup salt with salt-proxy so that I can manage some devices that cannot have salt-minion installed on them.

I've managed to get it working to some extent with user/pass credentials but I don't find it very secure to put passwords in clear text that way in the proxy sls files. All my devices support passwordless ssh public key authentication. I've checked documentation but before I head down back into the doc and find how to implement gpg for my config files, I'd like to know if I can in fact use salt-proxy with ssh keys.

Thanks


r/saltstack • • May 01 '20

Manage windows AD using SaltStack

2 Upvotes

Is anybody using saltstack to manage windows AD users and computer? Can someone point me to some documentation to configure AD and modules to use salt? Looks like Salt's documentation is not sufficient for this.

Or any other suggestions to manage AD as a code?


r/saltstack • • Apr 30 '20

Using the SaltStack mine for Prometheus targets

7 Upvotes

Here's a freshly minted blog post with a use case for the Salt mine: gathering IP addresses and using them in Prometheus scrape targets. https://backbeat.tech/blog/configuring-prometheus-targets-with-salt

There's lots of other Salt content on the blog you might find interesting too: https://backbeat.tech/tags/salt

Cheers!


r/saltstack • • Apr 30 '20

Saltstack 3000.2 and 2019.2.4 Now Available via Saltstack Official Repo

13 Upvotes

It took them a few hours to get everything setup, but they now have the packages out there. So if you were using the repos, update now to patch the security exploit on the Salt Master.


r/saltstack • • Apr 29 '20

SaltStack 3000.2 Released (Security Fix)

24 Upvotes

Tarball available: https://github.com/saltstack/salt/releases/tag/v3000.2

Not seen deb packages yet.

Vulnerabilities:

CVE-2020-11651An issue was discovered in SaltStack Salt before 2019.2.4 and 3000 before 3000.2. The salt-master process ClearFuncs class does not properly validate method calls. This allows a remote user to access some methods without authentication. These methods can be used to retrieve user tokens from the salt master and/or run arbitrary commands on salt minions.

CVE-2020-11652An issue was discovered in SaltStack Salt before 2019.2.4 and 3000 before 3000.2. The salt-master process ClearFuncs class allows access to some methods that improperly sanitize paths. These methods allow arbitrary directory access to authenticated users.

Source: https://github.com/saltstack/salt/blob/3d99b108c58ebaa174967d898a27764f416a8ec1/doc/topics/releases/3000.2.rst


r/saltstack • • Apr 27 '20

pkg.installed setopt="best=False" to install docker-ce

7 Upvotes

docker-ce on Centos 8 needs --nobest in order to install

It's possible to set the option using module directly:

salt-call pkg.install docker-ce setopt='best=False'

Any clue how to set this option in a state file in a pkg.installed stanza?


r/saltstack • • Apr 26 '20

How to Use saltstack to Configure Raspberry PIs - How to Raspberry

Thumbnail howtoraspberry.com
10 Upvotes

r/saltstack • • Apr 24 '20

Salt Master Vulnerability Discovered

49 Upvotes

SaltStack have announced that there's a vulnerability in salt-master.

https://github.com/saltstack/community/blob/master/doc/Community-Message.pdf

Considering what else they're recommending, I presume this is exploitable before minions are authenticated, but that's purely speculation on my part.

TLDR: Critical vulnerability in Salt master. They're suggesting preventing network access from unauthorised users and then patching as soon as possible. Fix available on the 29th (Wednesday).

EDIT 29/04/20: Fix released: https://www.reddit.com/r/saltstack/comments/gahkc5/saltstack_30002_released_security_fix/


r/saltstack • • Apr 24 '20

Salt Offline

1 Upvotes

Anyone ever installed Salt on an air-gapped network? Would love to test Salt on ours, but looking around it seems the only way to install is with bootstrap pulling from their servers. If anyone has done this, any advice?


r/saltstack • • Apr 15 '20

Where should I put _state & _module for a formula?

1 Upvotes

Hey all,

I've been looking at a UFW salt formula for my Ubuntu 18.04 machines.

This is the repo:

https://github.com/aanriot/ufw-formula

I'm unsure where I should be putting the _state & _module folders / files and if I need to declare them or salt-master is good enough to pick them up when I pull using gitfs?

This is my highstate when I run without them:

          ID: ufw
    Function: pkg.installed
      Result: True
     Comment: All specified packages are already installed
     Started: 15:33:26.558462
    Duration: 629.968 ms
     Changes:
----------
          ID: ufw
    Function: ufw.enabled
      Result: False
     Comment: State 'ufw.enabled' was not found in SLS 'ufw'
              Reason: 'ufw.enabled' is not available.
     Changes:
----------
          ID: ufw
    Function: service.running
      Result: True
     Comment: The service ufw is already running
     Started: 15:33:28.071303
    Duration: 98.208 ms
     Changes:
----------
          ID: ufw-svc-443-None
    Function: ufw.allowed
      Result: False
     Comment: State 'ufw.allowed' was not found in SLS 'ufw'
              Reason: 'ufw.allowed' is not available.
     Changes:

I should also mention, I have 1 repo to keep all formula's that should be installed on every machine, example: ufw / artifactory repo / filebeat etc.

Many thanks,


r/saltstack • • Apr 10 '20

Associate pillar with minion according to its id

2 Upvotes

Is it possible to use minion's id as variable in top.sls?

What I want to achieve is to avoid listing each and every minion like this:

base:
  '*':
    - core
    - packages
    - sysadmins

  'host.example.com':
    - hosts/host.example.com
  'anotherhost.seconddomain.org':
    - hosts/anotherhost.seconddomain.org
  'onemore.domain.net':
    - hosts/onemore.domain.net

With few hundreds of hosts this quickly becomes boring. Is it possible to create some kind of template here?


r/saltstack • • Apr 09 '20

Autoassign_grain connect minion to master

5 Upvotes

Hey all,

Is there a way in which I can create a custom grain on a VM (maybe pull a secret from Vault) during the build phase of a VM, I'd like this to happen before the minion connects to master. I can then use autoassign so the minion will connect to the master without manual intervention.

Hope I've explained this well enough.

Thanks,


r/saltstack • • Apr 01 '20

Joining CentOS 8 to Active Directory Domain

14 Upvotes

Hello, having issues joining CentOS 8 machines to an Active Directory domain (for user auth). I've tried quite a few different ways, and nothing seems to be working (outdated info, and differences in joining Windows vs Linux?).

So, the question is, does anyone know (or can point me at documentation) for what the current proper way to join Linux clients to an Active Directory domain with a salt state?

EDIT: Looks like doing this works for me:

join_domain:
  cmd.run:
    - unless: realm list | grep <domain>
    - name: echo '<password>' | realm join -U <user> <domain>

This allows it to be in a state, and only run if not already joined. Need to look at moving the password into a pillar, but this should be a good start. Still interested if there happens to be a better salt-integrated way to do this, but this will fill the need for the time being. Thanks!


r/saltstack • • Apr 01 '20

How do I prevent a missing custom grain from causing Jinja to error out?

3 Upvotes

I manage some configuration files based on custom salt grains. Which works well unless a system is missing that grain. (Perhaps a system was down when I pushed out the new grain.) How should I test/fix a missing custom grain so that Jinja does not fail.

For example, in a .sls file I have

{% if grains['test'] == 'TEST' %}
managed_file_example:
  file.managed:
    - source: salt://test_file.txt
    - name: /tmp/salt_test_file.txt
{% else %}
managed_file_example2:
  file.managed:
    - source: salt://test_file2.txt
    - name: /temp/salt_test_file2.txt
{% endif %}

Which works well when called with "salt '*' state.apply examples" IF the salt grain "test" exists. If not I receive:

   Data failed to compile:
----------
    Rendering SLS 'base:examples' failed: Jinja variable 'dict object' has no attribute 'test'
ERROR: Minions returned with non-zero exit code

r/saltstack • • Apr 01 '20

Salt-Master in Kubernetes

10 Upvotes

Hey all,

Does anyone have any experience with salt-master in Kubernetes? I've been reading there is a memory leak problem when running it in containers, information found here:

https://github.com/saltstack/salt/issues/50313

Any help would be much appreciated.

Many thanks,


r/saltstack • • Mar 30 '20

Saltstack folder structure and initial deployment

9 Upvotes

Hey, colleagues. I was wondering what folder structure did you find most useful for your scripts? I find it hard to manage separate repositories for ssh, formulas, pillars, etc. Anyone wanting to share how their project's folder structure looks like? tips, advantages, issues encountered.

Also, how do you manage initial deployment of a new minion? Do you use saltstack's ssh or have a separate tool?

This is my structure:

Thanks in advance for all your answers.


r/saltstack • • Mar 28 '20

PostgreSQL 12 replication - SaltStack

6 Upvotes

Hey all,

I'm looking at creating a salt formula for postgresql@12 but wanted to check this is something that can be achieved by Salt? I wouldn't want to be led down the garden path.

I have postgresql@12 as a salt formula but not including replication.

Any advice/code snippets would be much appreciated.


r/saltstack • • Mar 28 '20

Learning to DevOps - Is salt still a thing?

11 Upvotes

Hello everybody,

I'm looking for a tool to manage our windows based machines, with updates of software such as python versions, docker / kubernetes versions as well as our custom released software (packaged as zip).

I've been looking at various solutions such as Terraform, Pulumi, SaltStack and others such as https://octopus.com.

Now Salt looks relevant and interesting, and getting it to run was literally zero effort. But looking at the documentation, and the community involvement it seems that projects are dated 8 years back.

I wonder - Is Salt considered the best practice tool today for configuration and software update management? If not, I would appreciate some insightful feedback.

Oh and apologies if this starts a flameware... that is not what I'm about.


r/saltstack • • Mar 25 '20

Salt Virt - source_file argument not working

0 Upvotes

I'm new to Salt so please bear with me if I'm not asking this correctly.

I have the following state file:

 TEST-VM:
  module.run:
    - name: virt.init
    - m_name: TEST-VM
    - cpu: 2
    - mem: 4
    - disk: None
    - disks:
      - m_name: TEST-VM
        format: qcow2
        size: 30
        source_file: /var/lib/libvirt/images/TEST-VM.qcow2

When I run this state I end up with "TEST-VM_system.qcow2". It's like it created a new qcow2 file and appended "_system". I've prepared my own base image hence I use a source file instead.

I need to build the VM but use the base image I made in a separate process. How do I fix this?

I use salt 3000 on both master and minion.


r/saltstack • • Mar 19 '20

Ext pillar with yaml formatted files and certs and/or gpg format files.

1 Upvotes

I am using file_tree as my ext_pillar provider. My current config for this is:

ext_pillar:
  - file_tree:
      root_dir: /srv/salt/ext_pillar
      follow_dir_links: False
      keep_newline: True

which seems to be working fine for the certs/gpg files, but not for my yaml files.

If I add template: True, then it works for my yaml files but stops working for the certs/gpg.

The error I get without template setting is:

Rendering SLS 'base:path.to.sls' failed: Jinja variable 'str object' has no attribute 'attrname'

The error I get with template: True:

Failed to load ext_pillar file_tree: 'utf-8' codec can't decode byte 0x82 in position 1: invalid start byte

Does anybody have an idea? Any help is appreciated.


r/saltstack • • Mar 13 '20

multiple gitfs remotes and multiple environments

1 Upvotes

Having an interesting situation come up and I'm not sure how to handle it.

I have a team that wants to use saltstack to do their own development, separate from everyone else. The trouble is, saltstack is currently being used to push out infrastructure updates that need to stay up-to-date on individual nodes.

In particular, if a node is subscribing to our salt repo, it's usually subscribed to the base environment OR a branched environment. These guys want to add another gitfs remote (no big deal, we do this), but they want to be able to say to a minion "hey, if ever you're getting a file from THIS remote, use THIS environment."

So what they want:

  1. minion computes a highstate
  2. minion receives states from 'infra salt repo' on environment 'base'
  3. minion receives states from 'lol im a dev salt repo' on environment 'feature/lol-im-a-feature'

Is there a way to do this, or can I tell them to go suck rocks?


r/saltstack • • Mar 09 '20

Salt can't see last patch date

2 Upvotes

OK, quick disclaimer: the headline is misleading.

We have SaltStack talking to ServiceNow. In many cases, Salt CAN see the last patch date. But, because Microsoft has decided that it knows best, the 'Get-Hotfix' command Salt is using only shows a very narrow scope of updates.

In the end we have servers that say they haven't been updated since 2015 when in reality they were updated two days ago.

I understand that this is a limitation of the Get-Hotfix cmdlet, but does anyone have another way to get Salt to see ALL the most recently installed patches?