Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python3.6 /
site-packages /
salt /
sdb /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
__init__.py
29
B
-rw-r--r--
2022-05-16 09:16
cache.py
2.71
KB
-rw-r--r--
2022-05-16 09:16
confidant.py
3.69
KB
-rw-r--r--
2022-05-16 09:16
consul.py
1.68
KB
-rw-r--r--
2022-05-16 09:16
couchdb.py
2.34
KB
-rw-r--r--
2022-05-16 09:16
env.py
1.65
KB
-rw-r--r--
2022-05-16 09:16
etcd_db.py
1.95
KB
-rw-r--r--
2022-05-16 09:16
keyring_db.py
2.48
KB
-rw-r--r--
2022-05-16 09:16
memcached.py
1.61
KB
-rw-r--r--
2022-05-16 09:16
redis_sdb.py
1.72
KB
-rw-r--r--
2022-05-16 09:16
rest.py
3.25
KB
-rw-r--r--
2022-05-16 09:16
sqlite3.py
3.57
KB
-rw-r--r--
2022-05-16 09:16
tism.py
2.16
KB
-rw-r--r--
2022-05-16 09:16
vault.py
2.89
KB
-rw-r--r--
2022-05-16 09:16
yaml.py
2.53
KB
-rw-r--r--
2022-05-16 09:16
Save
Rename
""" Vault SDB Module :maintainer: SaltStack :maturity: New :platform: all .. versionadded:: 2016.11.0 This module allows access to Hashicorp Vault using an ``sdb://`` URI. Base configuration instructions are documented in the execution module docs. Below are noted extra configuration required for the sdb module, but the base configuration must also be completed. Like all sdb modules, the vault module requires a configuration profile to be configured in either the minion configuration file or a pillar. This profile requires only setting the ``driver`` parameter to ``vault``: .. code-block:: yaml myvault: driver: vault Once configured you can access data using a URL such as: .. code-block:: yaml password: sdb://myvault/secret/passwords/mypassword In this URL, ``myvault`` refers to the configuration profile, ``secret/passwords`` is the path where the data resides, and ``mypassword`` is the key of the data to return. The above URI is analogous to running the following vault command: .. code-block:: bash $ vault read -field=mypassword secret/passwords """ import logging import salt.exceptions log = logging.getLogger(__name__) __func_alias__ = {"set_": "set"} def set_(key, value, profile=None): """ Set a key/value pair in the vault service """ if "?" in key: path, key = key.split("?") else: path, key = key.rsplit("/", 1) data = {key: value} version2 = __utils__["vault.is_v2"](path) if version2["v2"]: path = version2["data"] data = {"data": data} try: url = "v1/{}".format(path) response = __utils__["vault.make_request"]("POST", url, json=data) if response.status_code != 204: response.raise_for_status() return True except Exception as e: # pylint: disable=broad-except log.error("Failed to write secret! %s: %s", type(e).__name__, e) raise salt.exceptions.CommandExecutionError(e) def get(key, profile=None): """ Get a value from the vault service """ if "?" in key: path, key = key.split("?") else: path, key = key.rsplit("/", 1) version2 = __utils__["vault.is_v2"](path) if version2["v2"]: path = version2["data"] try: url = "v1/{}".format(path) response = __utils__["vault.make_request"]("GET", url) if response.status_code == 404: return None if response.status_code != 200: response.raise_for_status() data = response.json()["data"] if version2["v2"]: if key in data["data"]: return data["data"][key] else: if key in data: return data[key] return None except Exception as e: # pylint: disable=broad-except log.error("Failed to read secret! %s: %s", type(e).__name__, e) raise salt.exceptions.CommandExecutionError(e)