-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathpssht.xml
281 lines (247 loc) · 12.3 KB
/
pssht.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<!-- GENERAL SETTINGS -->
<!--
String or collection of strings specifying the addresses/ports
the server should listen on, in the form "address:port".
If 0 is used as the port, a random port will be selected
automatically.
Use brackets for IPv6 addresses (eg. "[::1]:0").
Define a collection to listen on multiple addresses/ports:
<parameter key="listen" type="collection">
<parameter>[::1]:0</parameter>
<parameter>0.0.0.0:0</parameter>
</parameter>
-->
<parameter key="listen">0.0.0.0:22222</parameter>
<!--
Application to run after a connection has been accepted.
This class' constructor will be called with the following
arguments:
* \fpoirotte\Pssht\Transport (transport layer for the session)
* \fpoirotte\Pssht\Connection (connection layer for the session)
* \fpoirotte\Pssht\MessageInterface (SSH message which caused
a new instance of the application to be created; usually
an instance of \fpoirotte\Pssht\Messages\CHANNEL\REQUEST\Exec
or \fpoirotte\Pssht\Messages\CHANNEL\REQUEST\Shell)
Alternatively, you may modify the "client" or "applicationFactory"
services to set another application factory.
-->
<parameter key="application">\fpoirotte\Pssht\Application\EchoService</parameter>
<!--
A banner (eg. legal disclaimer) to display upon connection.
Do not forget to add a trailing carriage return / linefeed
if needed (using " " or " " respectively).
-->
<parameter key="banner">Hello world! </parameter>
<!--
Server's private keys (PEM-encoded).
You may provide several keys here, one per supported key type.
-->
<parameter key="server_keys" type="collection">
<parameter key="ssh-rsa" type="collection">
<parameter key="file">file://%pssht.base_dir%/tests/data/plaintext/rsa/4096</parameter>
<parameter key="passphrase"></parameter>
</parameter>
<parameter key="ssh-dss" type="collection">
<parameter key="file">file://%pssht.base_dir%/tests/data/plaintext/dsa/1024</parameter>
<parameter key="passphrase"/>
</parameter>
<parameter key="ecdsa-sha2-nistp256" type="collection">
<parameter key="file">file://%pssht.base_dir%/tests/data/plaintext/ecdsa/256</parameter>
<parameter key="passphrase"/>
</parameter>
<!-- <parameter key="ecdsa-sha2-nistp384" type="collection">-->
<!-- <parameter key="file">file://%pssht.base_dir%/tests/data/plaintext/ecdsa/384</parameter>-->
<!-- <parameter key="passphrase"/>-->
<!-- </parameter>-->
<!-- <parameter key="ecdsa-sha2-nistp521" type="collection">-->
<!-- <parameter key="file">file://%pssht.base_dir%/tests/data/plaintext/ecdsa/521</parameter>-->
<!-- <parameter key="passphrase"/>-->
<!-- </parameter>-->
</parameter>
<!-- AUTHENTICATION SETTINGS -->
<!--
Allows the user running pssht to log in
using the password "pssht".
-->
<parameter key="auth.passwords" type="collection">
<parameter key="%USER%">pssht</parameter>
</parameter>
<!--
Allows the user running pssht to log in
using one of his/her authorized SSH public keys.
-->
<parameter key="auth.pubkeys" type="collection">
<parameter key="%USER%" type="collection">
<parameter>%HOME%/.ssh/authorized_keys</parameter>
</parameter>
</parameter>
<!--
Allows the user running pssht to log in
using the server's public key.
Note: this configuration does not really make sense,
but shows just how easy it is to configure the server
for varying needs.
-->
<parameter key="auth.hostbased" type="collection">
<parameter key="%USER%" type="collection">
<parameter>/etc/ssh/ssh_host_dsa_key.pub</parameter>
<parameter>/etc/ssh/ssh_host_rsa_key.pub</parameter>
<parameter>/etc/ssh/ssh_host_ecdsa_key.pub</parameter>
<parameter>/etc/ssh/ssh_host_ed25519_key.pub</parameter>
</parameter>
</parameter>
<!--
Controls the frequency of key re-exchange (aka. rekeying).
* "rekeying.size" specifies how many bytes may be sent
before rekeying is requested.
The default is one gigabyte as recommended in RFC 4253.
* "rekeying.time" specifies how many seconds may pass
before rekeying is requested.
The default is one hour as recommended in RFC 4253.
-->
<parameter key="rekeying.size">1073741824</parameter>
<parameter key="rekeying.time">3600</parameter>
</parameters>
<!--
SERVICE DEFINITIONS.
Skip to the "authMethods" service if you want to disable
some of the default authentication methods.
-->
<services>
<!-- The "client" service is used to handle new clients. -->
<service id="client" scope="prototype" class="\fpoirotte\Pssht\Transport">
<argument>%server_keys%</argument>
<argument type="service" id="authMethods"/>
<!-- Encoder: use the default encoder. -->
<argument type="constant">null</argument>
<!-- Decoder: use the default decoder. -->
<argument type="constant">null</argument>
<argument>%rekeying.size%</argument>
<argument>%rekeying.time%</argument>
<call method="setApplicationFactory">
<argument type="collection">
<argument type="service" id="applicationFactory"/>
<argument>newInstance</argument>
</argument>
</call>
<call method="setBanner">
<argument>%banner%</argument>
</call>
</service>
<!-- End of "client" service. -->
<!-- The "logging" service is used to log messages. -->
<service id="logging" factory-class="\Plop\Plop" factory-method="getInstance">
<call method="addLogger">
<argument type="service">
<service class="\Plop\Logger">
<argument type="constant">null</argument>
<argument type="constant">null</argument>
<argument type="constant">null</argument>
<argument type="service">
<service class="\Plop\HandlersCollection">
<call method="offsetSet">
<argument type="constant">null</argument>
<argument type="service">
<service class="\Plop\Handler\Stream">
<argument type="constant">STDERR</argument>
<call method="setFormatter">
<argument type="service">
<service class="\Plop\Formatter">
<argument>[%%(asctime)s] %%(levelname)s: %%(message)s</argument>
<argument>r</argument>
</service>
</argument>
</call>
</service>
</argument>
</call>
</service>
</argument>
<call method="setLevel">
<argument>DEBUG</argument>
</call>
</service>
</argument>
</call>
</service>
<!-- End of "logging" service. -->
<!--
The "authMethods" service is used to indicate
which authentication methods are allowed.
-->
<service id="authMethods" scope="prototype" public="false"
class="\fpoirotte\Pssht\Handlers\SERVICE\REQUEST">
<argument type="service">
<service scope="prototype"
class="\fpoirotte\Pssht\Handlers\USERAUTH\REQUEST">
<argument type="collection">
<!--
Password-based authentication.
Remove or comment the following XML block
to disable password-based authentication.
-->
<argument type="service">
<service class="\fpoirotte\Pssht\Authentication\Password">
<argument>%auth.passwords%</argument>
</service>
</argument>
<!-- End of password-based authentication. -->
<!--
Public key-based authentication.
Remove or comment the following XML block
to disable public key-based authentication.
-->
<argument type="service">
<service class="\fpoirotte\Pssht\Authentication\PublicKey">
<argument type="service">
<service public="false"
factory-service="authPublicKeysLoader"
factory-method="getStore"/>
</argument>
</service>
</argument>
<!-- End of public key-based authentication. -->
<!--
Host-based authentication.
Remove or comment the following XML block
to disable host-based authentication.
-->
<argument type="service">
<service class="\fpoirotte\Pssht\Authentication\HostBased">
<argument type="service">
<service public="false"
factory-service="authHostBasedLoader"
factory-method="getStore"/>
</argument>
</service>
</argument>
<!-- End of host-based authentication. -->
</argument>
</service>
</argument>
</service>
<!-- End of "authMethods" service. -->
<!-- The following services are factories used by other services. -->
<service id="authPublicKeysLoader" public="false"
class="\fpoirotte\Pssht\KeyStoreLoader\File">
<call method="loadBulk">
<argument>%auth.pubkeys%</argument>
</call>
</service>
<service id="authHostBasedLoader" public="false"
class="\fpoirotte\Pssht\KeyStoreLoader\File">
<call method="loadBulk">
<argument>%auth.hostbased%</argument>
</call>
</service>
<service id="applicationFactory" public="false" class="ReflectionClass">
<argument>%application%</argument>
</service>
<!-- End of factory services. -->
</services>
</container>