Page MenuHomeDevCentral

D1332.id3417.diff
No OneTemporary

D1332.id3417.diff

diff --git a/pillar/core/users.sls b/pillar/core/users.sls
--- a/pillar/core/users.sls
+++ b/pillar/core/users.sls
@@ -80,6 +80,8 @@
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBYKQdGZ2ZWZ6IvSDlre8rRBGep/9YY8l8Z2Rdb62exK dereckson@tigraki.dereckson.drake
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHN4kIcBjQuVqwaTjH9/Y2g9zghh/zjzQH2QipMdzhRQ dereckson@xyrogh.dereckson.drake
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEVY2Oeppn//0Jm4W3ejLDe+D/+4FMFZR9rzeVrnFkPE dereckson@yakin.dereckson.drake
+ yubi_keys:
+ - ccccccbjncrt
uid: 5001
erol:
fullname: Erol Unutmaz
diff --git a/roles/bastion/init.sls b/roles/bastion/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/bastion/init.sls
@@ -0,0 +1,12 @@
+# -------------------------------------------------------------
+# Salt — Bastion
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Description: This role allows to login through alternative
+# ways, like traditional keys or with an OTP.
+# Created: 2018-02-18
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+include:
+ - .yubico
diff --git a/roles/bastion/yubico/authorized_yubikeys.sls b/roles/bastion/yubico/authorized_yubikeys.sls
new file mode 100644
--- /dev/null
+++ b/roles/bastion/yubico/authorized_yubikeys.sls
@@ -0,0 +1,24 @@
+# -------------------------------------------------------------
+# Salt — Bastion - Yubikeys
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2018-02-18
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% for username, user in salt['forest.get_users']().iteritems() %}
+
+{% if 'yubi_keys' in user %}
+/home/{{ username }}/.yubico:
+ file.directory:
+ - user: {{ username }}
+ - mode: 700
+
+/home/{{ username }}/.yubico/authorized_yubikeys:
+ file.managed:
+ - user: {{ username }}
+ - mode: 600
+ - contents: {{ username + ':' + ':'.join(user['yubi_keys']) }}
+{% endif %}
+
+{% endfor %}
diff --git a/roles/bastion/yubico/init.sls b/roles/bastion/yubico/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/bastion/yubico/init.sls
@@ -0,0 +1,12 @@
+# -------------------------------------------------------------
+# Salt — Bastion
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Description: This role allows to login through alternative
+# ways, like traditional keys or with an OTP.
+# Created: 2018-02-18
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+include:
+ - .authorized_yubikeys

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 15:11 (19 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2262691
Default Alt Text
D1332.id3417.diff (2 KB)

Event Timeline