Skip to content

Instantly share code, notes, and snippets.

View mirceaulinic's full-sized avatar
🍫
Probably munching chocolate.

Mircea Ulinic mirceaulinic

🍫
Probably munching chocolate.
View GitHub Profile
@mirceaulinic
mirceaulinic / salt-sproxy.txt
Last active August 2, 2023 16:19
salt-sproxy Python client
root@salt:/# isalt --master
__ _______. ___ __ .___________.
| | / | / \ | | | |
| | | (----` / ^ \ | | `---| |----`
| | \ \ / /_\ \ | | | |
| | .----) | / _____ \ | `----. | |
|__| |_______/ /__/ \__\ |_______| |__|
@mirceaulinic
mirceaulinic / gist:6746ea681cf97ee58ca4877b4e80c265
Created May 18, 2022 17:20
Incorrectly computed dependency versions (under Pipfile.lock) for --dev
<details><summary>$ pipenv --support</summary>
Pipenv version: `'2022.5.2'`
Pipenv location: `'/usr/local/lib/python3.9/site-packages/pipenv'`
Python location: `'/usr/local/bin/python'`
Python installations found:
{%- set cmd = 'show configuration | display set | match prod-net-master01' %}
{%- set cli = salt.net.cli(cmd) %}
{%- set ret = cli.out[cmd] %}
{%- for line in ret.splitlines() %}
{{ line | replace('set ', 'delete ') }}
{%- endfor %}
@mirceaulinic
mirceaulinic / gazillion-reads.log
Created March 15, 2021 17:02
Starting Salt Master
root@dev-salt-master02:~# salt-master -l debug
[DEBUG ] Reading configuration from /etc/salt/master
[DEBUG ] Changed git to gitfs in master opts' fileserver_backend list
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: dev-salt-master02.example.com
[INFO ] Processing `log_handlers.sentry`
[DEBUG ] Grains refresh requested. Refreshing grains.
[DEBUG ] Reading configuration from /etc/salt/master
[DEBUG ] Marking 'http_query' as a jinja filter
[DEBUG ] Marking 'strftime' as a jinja filter
[DEBUG ] Marking 'date_format' as a jinja filter
@mirceaulinic
mirceaulinic / CVE-2020-1165_2018.3.x.patch
Created May 7, 2020 08:46
CVE-2020-11651 and CVE-2020-11652 patches for Salt 2018.3.x
From ac9691f3c86bb7fd27ae84bff620addfbec8853d Mon Sep 17 00:00:00 2001
From: "Daniel A. Wozniak" <dwozniak@saltstack.com>
Date: Fri, 24 Apr 2020 18:01:01 +0000
Subject: [PATCH] CVE-2020-11651 and CVE-2020-11652
---
salt/master.py | 58 +++++++++++++++++++++++++++++++++-------
salt/tokens/localfs.py | 3 +++
salt/utils/verify.py | 57 +++++++++++++++++++++++++++++++++++----
salt/wheel/config.py | 8 +++++-

Keybase proof

I hereby claim:

  • I am mirceaulinic on github.
  • I am mirceaulinic (https://keybase.io/mirceaulinic) on keybase.
  • I have a public key whose fingerprint is A17C 1D1C 37DA FF75 E410 4138 3EFF 87F6 091B 4B29

To claim this, I am signing this object:

$ docker exec -it salt-master bash (git) 0dd843a8ba93 salt-47117
root@salt-master:/# salt napalm test.versions_report
napalm:
Salt Version:
Salt: 2018.3.0
Dependency Versions:
cffi: 1.11.5
cherrypy: Not Installed
dateutil: 2.5.3
proxy:
proxytype: netmiko
device_type: cisco_ios
host: ip-172-31-46-249
username: napalm
password: zzzz
[INFO ] nxos proxy __virtual__() called...
[DEBUG ] rest_sample proxy __virtual__() called...
[INFO ] ssh_sample proxy __virtual__() called...
[DEBUG ] Could not LazyLoad netmiko.grains: 'netmiko.grains' is not available.
[DEBUG ] starting thread (client mode): 0x40279690L
[DEBUG ] Local version/idstring: SSH-2.0-paramiko_2.1.2
[DEBUG ] Remote version/idstring: SSH-2.0-Cisco-1.25
[INFO ] Connected (version 2.0, client Cisco-1.25)
[DEBUG ] kex algos:[u'diffie-hellman-group-exchange-sha1', u'diffie-hellman-group14-sha1'] server key:[u'ssh-rsa'] client encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes128-cbc', u'3des-cbc', u'aes192-cbc', u'aes256-cbc'] server encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes128-cbc', u'3des-cbc', u'aes192-cbc', u'aes256-cbc'] client mac:[u'hmac-sha1', u'hmac-sha1-96'] server mac:[u'hmac-sha1', u'hmac-sha1-96'] client compress:[u'none'] server compress:[u'none'] client lang:[u''] server lang:[u''] kex follows?False
[DEBUG ] Kex agreed: d
root@ip-172-31-13-136:~# salt device1 netmiko.send_command "show clock"
device1:
*11:46:08.849 UTC Tue Mar 21 2017
root@ip-172-31-13-136:~# salt device1 netmiko.send_command "show ip interface brief"
device1:
Interface IP-Address OK? Method Status Protocol
GigabitEthernet1 172.31.46.249 YES DHCP up up
root@ip-172-31-13-136:~# salt device1 netmiko.send_command "show interfaces"
device1:
GigabitEthernet1 is up, line protocol is up