summaryrefslogtreecommitdiff
path: root/op-mode-definitions
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-04-26 19:14:46 +0200
committerGitHub <noreply@github.com>2022-04-26 19:14:46 +0200
commitec3e1e43d24b823c5804ba80cdcbbfec25f7ea3a (patch)
tree94d4dd739bc728bfce51f64a269b5959e2ec305e /op-mode-definitions
parent7b72f6326ea64ab05e6884e36d1c8c6f9b76f64c (diff)
parent1e3909f4186e29d2d8e7be7e255ccdfec050537f (diff)
downloadvyos-1x-ec3e1e43d24b823c5804ba80cdcbbfec25f7ea3a.tar.gz
vyos-1x-ec3e1e43d24b823c5804ba80cdcbbfec25f7ea3a.zip
Merge pull request #1294 from goodNETnick/ocserv_otp_keygen
ocserv: T4380: 2FA OTP key generator in VyOS CLI
Diffstat (limited to 'op-mode-definitions')
-rw-r--r--op-mode-definitions/generate-openconnect-user-key.xml.in67
1 files changed, 67 insertions, 0 deletions
diff --git a/op-mode-definitions/generate-openconnect-user-key.xml.in b/op-mode-definitions/generate-openconnect-user-key.xml.in
new file mode 100644
index 000000000..80cdfb3d7
--- /dev/null
+++ b/op-mode-definitions/generate-openconnect-user-key.xml.in
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<interfaceDefinition>
+ <node name="generate">
+ <children>
+ <node name="openconnect">
+ <properties>
+ <help>Generate OpenConnect client parameters</help>
+ </properties>
+ <children>
+ <tagNode name="username">
+ <properties>
+ <help>Username used for authentication</help>
+ <completionHelp>
+ <list>&lt;username&gt;</list>
+ </completionHelp>
+ </properties>
+ <children>
+ <node name="otp-key">
+ <properties>
+ <help>Generate OpenConnect OTP token</help>
+ </properties>
+ <children>
+ <node name="hotp-time">
+ <properties>
+ <help>HOTP time-based token</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/generate_openconnect_otp_key.py --username "$4" --interval 30 --digits 6</command>
+ <children>
+ <tagNode name="interval">
+ <properties>
+ <help>Duration of single time interval</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/generate_openconnect_otp_key.py --username "$4" --interval "$8" --digits 6</command>
+ <children>
+ <tagNode name="digits">
+ <properties>
+ <help>The number of digits in the one-time password</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/generate_openconnect_otp_key.py --username "$4" --interval "$8" --digits "${10}"</command>
+ </tagNode>
+ </children>
+ </tagNode>
+ <tagNode name="digits">
+ <properties>
+ <help>The number of digits in the one-time password</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/generate_openconnect_otp_key.py --username "$4" --interval 30 --digits "$8"</command>
+ <children>
+ <tagNode name="interval">
+ <properties>
+ <help>Duration of single time interval</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/generate_openconnect_otp_key.py --username "$4" --interval "${10}" --digits $8</command>
+ </tagNode>
+ </children>
+ </tagNode>
+ </children>
+ </node>
+ </children>
+ </node>
+ </children>
+ </tagNode>
+ </children>
+ </node>
+ </children>
+ </node>
+</interfaceDefinition>