Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

gdp / apps / gdp-create.8 @ master

History | View | Annotate | Download (9.31 KB)

1 a812fe96 Eric Allman
.Dd August 2, 2015
2 eae1d3ec Eric Allman
.Dt GDP-CREATE 8
3 a812fe96 Eric Allman
.Os Swarm-GDP
4
.Sh NAME
5 eae1d3ec Eric Allman
.Nm gdp-create
6 a812fe96 Eric Allman
.Nd create new GDP log
7
.Sh SYNOPSIS
8 eae1d3ec Eric Allman
.Nm gdp-create
9 2a942e9a Eric Allman
.Op Fl C Ar creator-name
10 a812fe96 Eric Allman
.Op Fl D Ar debug-spec
11
.Op Fl e Ar key-crypto
12
.Op Fl G Ar router-ip
13
.Op Fl h Ar hash-alg
14
.Op Fl k Ar key-type
15 80da996e Eric Allman
.Op Fl K Ar owner-key-location
16 a812fe96 Eric Allman
.Op Fl b Ar key-bits
17
.Op Fl c Ar curve-name
18 11e67a2d Eric Allman
.Op Fl q
19 b84971ef Eric Allman
.Op Fl s Ar logd-gdp-addr
20 64259fd2 Eric Allman
.Op Fl S
21 29d35a5e Eric Allman
.Op Fl w
22 80da996e Eric Allman
.Op Fl W Ar writer-key-location
23 c39a16b1 Eric Allman
.Op Ar mdid=metadata ...
24 a812fe96 Eric Allman
.Op Ar external-name
25
.Sh DESCRIPTION
26 eae1d3ec Eric Allman
.Nm gdp-create
27 c39a16b1 Eric Allman
creates a new GDP object,
28
a.k.a.
29
.Ql "Data Capsule"
30 80da996e Eric Allman
(sometimes called a
31
.Ql "log"
32
mostly for historic reasons)
33
on a given log server.
34
In its default mode it also creates a public/secret
35
.Ql "owner"
36
keypair associated with this object,
37
with the public key stored in the object metadata.
38 a812fe96 Eric Allman
Additional (text-based) metadata can be added
39
(arguably this should allow binary metadata as well).
40
Optionally the log can be given a human-understandable name;
41
if not specified a seemingly random name is made up.
42 80da996e Eric Allman
.
43 c39a16b1 Eric Allman
.Pp
44
The human-oriented name has certain requirements:
45
.Bl -bullet
46
.
47
.It
48
It may not look like the base64-encoded internal name of any log.
49
.
50
.It
51
It may not already be listed in the Human-Oriented to GDPname Directory (HONGD).
52
.
53
.It
54
It may not have an equal sign in it.
55
.El
56
.
57
.Pp
58
Also, if the human-oriented name has no dots but the
59
.Ev GDP_NAME_ROOT
60
environment variable is set,
61
the two will be appended in the same way as described in
62
.Xr gdp 7 .
63
.
64 a812fe96 Eric Allman
.Ss "Metadata"
65
User-specified metadata may be added when a log is created.
66
The metadata name is stored as a 32-bit number and is generally represented
67
by four characters.
68
.Pp
69
In addition to user metadata,
70 eae1d3ec Eric Allman
.Nm gdp-create
71 a812fe96 Eric Allman
adds metadata for the log creation time,
72
the public half of the signing key in DER format,
73
and the human-readable name.
74
.Pp
75
Metadata is immutable; there is no way to add, delete, or change metadata
76
after the log is created.
77 80da996e Eric Allman
.
78
.Ss "Key Management"
79
GDP objects may have two secret keys associated with them:
80
the
81
.Ql owner
82
key allows administrative control over the object and the
83
.Ql writer
84
key allows write access to the object.
85
If the writer key is not specifies it defaults to the same as the owner key.
86
.
87 a812fe96 Eric Allman
.Ss "Warning"
88
This implementation will change in the future,
89
and the command will probably be subsumed into a swarm service.
90
.Sh OPTIONS
91
.Bl -tag
92 80da996e Eric Allman
.
93 2a942e9a Eric Allman
.It Fl C
94
Sets the name of the creator in the log metadata.
95
If this is not specified it will be derived from system data.
96
It should be in the form of an email address.
97 80da996e Eric Allman
.
98 a812fe96 Eric Allman
.It Fl D Ar debug-spec
99
Turns on debugging flags using the libep-style format.
100
Useful only with the code in hand.
101 80da996e Eric Allman
.
102 a812fe96 Eric Allman
.It Fl e Ar key-crypto
103
Specifies symmetric encryption algorithm to use for storing the secret key.
104
If
105
.Ar key-crypto
106
is
107
.Li none
108
then the key is stored unencrypted on disk.
109
Defaults to
110
.Va swarm.gdp.crypto.keyenc.alg .
111 80da996e Eric Allman
.
112 a812fe96 Eric Allman
.It Fl G Ar router-ip
113
Contact the given IP address (which may be a DNS name)
114
to get a connection to the GDP routing layer.
115
This will be replaced by automatic discovery
116
(for example, using Zeroconf)
117
soon.
118
The address may have an optional port number after a colon.
119
If this is not specified,
120
the names listed in the
121
.Va swarm.gdp.routers
122
runtime administrative parameter
123
are searched.
124 80da996e Eric Allman
.
125 a812fe96 Eric Allman
.It Fl h Ar hash-alg
126
Selects the hash (message digest) algorithm used when
127
generating and checking signatures.
128
When data is appended to the log,
129
the log name, log metadata, record number, and record data
130
is hashed using this algorithm and then that hash is signed.
131 80da996e Eric Allman
.
132 a812fe96 Eric Allman
.It Fl k Ar key-type
133 29d35a5e Eric Allman
Selects the type of the creator key to be created for this log.
134 a812fe96 Eric Allman
It can be one of
135
.Li rsa ,
136
.Li dsa ,
137
or
138
.Li ec .
139
As a special case, the type
140
.Li none
141
suppresses creation of the keypair.
142 29d35a5e Eric Allman
The creator key has both administrative and write access to the log.
143 80da996e Eric Allman
.
144
.It Fl K Ar owner-key-location
145 a812fe96 Eric Allman
This option has two purposes.
146 0b99b3fa Eric Allman
First, if you want to use an existing keypair
147
(formatted as a PEM file)
148 80da996e Eric Allman
as the owner key
149 0b99b3fa Eric Allman
you can use the
150 a812fe96 Eric Allman
.Fl K
151 80da996e Eric Allman
flag to name an existing PEM file.
152 0b99b3fa Eric Allman
If you want
153
.Nm
154
to create a keypair for you,
155
.Fl K
156 5a32353d Eric Allman
can name a directory into which the secret key will be written;
157
the file will be named with the internal name of the log with
158 80da996e Eric Allman
.Va \&-owner.pem
159 5a32353d Eric Allman
appended.
160 a812fe96 Eric Allman
If
161
.Fl K
162 0b99b3fa Eric Allman
is not specified, the value of the
163 a812fe96 Eric Allman
.Va swarm.gdp.crypto.key.dir
164 5a32353d Eric Allman
administrative parameter will be used;
165
it defaults to
166 a812fe96 Eric Allman
.Pa ./KEYS ,
167 0b99b3fa Eric Allman
or to the current directory if the
168 a812fe96 Eric Allman
.Pa KEYS
169 0b99b3fa Eric Allman
directory does not exist.
170 80da996e Eric Allman
.
171 a812fe96 Eric Allman
.It Fl b Ar key-bits
172
If the key type is RSA or DSA,
173
this parameter specifies the number of bits in the key.
174
If this is omitted and the key type is RSA,
175
this defaults to the value of
176
.Va swarm.gdp.crypto.rsa.keylen .
177
DSA keys use
178
.Va swarm.gdp.crypto.dsa.keylen .
179
Additionally, RSA keys use the
180
.Va swarm.gdp.crypto.rsa.keyexp
181
parameter to set the exponent.
182
This parameter is ignored when creating EC key pairs.
183 80da996e Eric Allman
.
184 a812fe96 Eric Allman
.It Fl c Ar curve-name
185
Sets the name of the curve to use for Elliptic Cryptography keys.
186
This overrides the
187
.Va swarm.gdp.crypto.ec.curve
188
parameter.
189
Ignored when creating RSA or DSA key pairs.
190 80da996e Eric Allman
.
191 11e67a2d Eric Allman
.It Fl q
192
If set,
193
.Nm
194
does not show errors or informational message.
195
In particular, using
196
.Fl q
197
is a way to ensure that a log exists without give an error if it already exists.
198 64259fd2 Eric Allman
.
199 b84971ef Eric Allman
.It Fl s Ar logd-gdp-addr
200
The name of the log daemon on which to create the physical instantiation
201
of the log.
202
If not specified, the value of the
203 b364b308 Eric Allman
.Va swarm.gdp.creation-service.name
204 b84971ef Eric Allman
administrative will be used.
205
If that is not set,
206
it will default to one of the servers at Berkeley.
207
If you want a specific server at your site,
208
either use the
209
.Fl s
210
flag or set that administrative parameter.
211 64259fd2 Eric Allman
.
212
.It Fl S
213
Skips the test to see if the log already exists before creating it.
214
Used for debugging.
215 29d35a5e Eric Allman
.It Fl w
216
Create a separate writer key.
217
The writer key does not convey administrative access to the log.
218
The owner key conveys write access to the log even if a separate
219
writer key is created.
220 80da996e Eric Allman
.
221
.It Fl W Ar writer-key-location
222
Similar to
223
.Fl K ,
224
but for the writer key.
225 a812fe96 Eric Allman
.El
226
.Sh EXIT STATUS
227
.Bl -tag
228 36033ca2 Eric Allman
.It Li EX_OK No (0)
229
Success
230
.It Li EX_CANTCREAT No (73)
231 c31ca46a Eric Allman
The log already exists.
232 36033ca2 Eric Allman
.It Li EX_DATAERR No (65)
233 a812fe96 Eric Allman
A command-line key file could not be parsed.
234 36033ca2 Eric Allman
.It Li EX_IOERR No (74)
235 c31ca46a Eric Allman
A secret key file could not be created.
236 36033ca2 Eric Allman
.It Li EX_NOHOST No (68)
237
The log server name was not valid.
238
.It Li EX_NOINPUT No (67)
239 a812fe96 Eric Allman
A command-line key file could not be opened.
240 36033ca2 Eric Allman
.It Li EX_SOFTWARE No (70)
241 a812fe96 Eric Allman
A successfully created public key could not be converted to external (DER) form
242 36033ca2 Eric Allman
for storage in new log metadata,
243
or severe internal error.
244
.It Li EX_USAGE No (64)
245 a812fe96 Eric Allman
Command line parameters are incorrect.
246 36033ca2 Eric Allman
.It Li EX_UNAVAILABLE No (69)
247 a812fe96 Eric Allman
A specified key length was insecure.
248
It was impossible to create a new key.
249 36033ca2 Eric Allman
Other unspecified error.
250 a812fe96 Eric Allman
.El
251
.Sh ADMINISTRATIVE PARAMETERS
252
.Bl -tag
253 bfc4dc23 Eric Allman
.It swarm.gdp.crypto.dsa.keylen
254 a812fe96 Eric Allman
The DSA key length.
255
Defaults to 2048.
256
Overridden by
257
.Fl b .
258 bfc4dc23 Eric Allman
.It swarm.gdp.crypto.ec.curve
259 a812fe96 Eric Allman
The EC curve.
260
Defaults to
261
.Li sect283r1
262
(also known as
263
.Li B-283 ) .
264
Overridden by
265
.Fl c .
266 bfc4dc23 Eric Allman
.It swarm.gdp.crypto.hash.alg
267 a812fe96 Eric Allman
The hash algorithm.
268
Defaults to
269
.Li sha256 .
270
Overridden by
271
.Fl h .
272 bfc4dc23 Eric Allman
.It swarm.gdp.crypto.key.dir
273 a812fe96 Eric Allman
The directory in which to store secret keys.
274
Defaults to
275
.Pa KEYS
276
(in the current working directory).
277
If that subdirectory does not exist,
278
the keys are written to the current directory.
279
Overridden by
280
.Fl K .
281 bfc4dc23 Eric Allman
.It swarm.gdp.crypto.keyenc.alg
282 a812fe96 Eric Allman
The secret key (symmetric) encryption algorithm.
283
Defaults to
284
.Li aes192 .
285
Overridden by
286
.Fl e .
287 bfc4dc23 Eric Allman
.It swarm.gdp.crypto.rsa.keyexp
288 a812fe96 Eric Allman
The exponent to be used in the RSA algorithm.
289
Defaults to 3.
290 bfc4dc23 Eric Allman
.It swarm.gdp.crypto.rsa.keylen
291 a812fe96 Eric Allman
The key length for the RSA algorithm.
292
Defaults to 2048.
293
Overridden by
294
.Fl b .
295 bfc4dc23 Eric Allman
.It swarm.gdp.crypto.sign.alg
296 a812fe96 Eric Allman
The signing algorithm.
297
Defaults to
298
.Li ec .
299
Overridden by
300
.Fl k .
301 b364b308 Eric Allman
.
302
.It swarm.gdp.creation-service.name
303
The GDPname of the creation service.
304 b84971ef Eric Allman
Overridden by
305
.Fl s .
306 a812fe96 Eric Allman
.El
307 c39a16b1 Eric Allman
.Sh ENVIRONMENT
308
.Bl -tag
309
.
310
.It GDP_NAME_ROOT
311
If set, this is prepended to any human-oriented names
312
that do not already have dots in them.
313
This is an easy way to make your log names unique.
314
See
315
.Xr gdp 7
316
for details.
317 a812fe96 Eric Allman
.\".Sh FILES
318 bfc4dc23 Eric Allman
.Sh SEE ALSO
319
.Xr gdp 7 ,
320
.Xr gdplogd 8
321 a812fe96 Eric Allman
.Sh EXAMPLES
322
.Bl -bullet
323
.It
324 eae1d3ec Eric Allman
To create a GDP log on a default server:
325 c39a16b1 Eric Allman
.Dl newlog=edu.berkeley.cs.eric.example
326
.Dl gdp-create $newlog
327 a812fe96 Eric Allman
The secret key will be written into a a file named
328
.Pa KEYS/<something>.pem ,
329
where
330
.Va <something>
331
is the base-64-encoded internal name of the log, e.g.,
332
.Li 1KZy5jy1QpghTe8QBmDQGqdz3a_9tVP3qp6uxlOeJdk.pem .
333
The password for encrypting this key will be read from the standard input.
334
.It
335 c39a16b1 Eric Allman
To create a GDP log named
336
.Li $newlog
337
on log server named edu.berkeley.eecs.gdp-01 using defaults:
338 399e7621 Christopher Brooks
.Dl logd=edu.berkeley.eecs.gdp-01.gdplogd
339 c39a16b1 Eric Allman
.Dl gdp-create -s $logd $newlog
340 b84971ef Eric Allman
.It
341 c39a16b1 Eric Allman
To create a log on the server named
342 a812fe96 Eric Allman
.Li $logd
343
encrypted with a 1024-bit RSA key,
344
leaving the unencrypted key in a file named
345
.Pa mykey.pem :
346 eae1d3ec Eric Allman
.Dl gdp-create -k RSA -b 1024 -e none -K mykey.pem $newlog
347 a812fe96 Eric Allman
.It
348
To create a log with user-specified metadata:
349 eae1d3ec Eric Allman
.Dl gdp-create Qo "MYMD=My special metadata" Qc $newlog
350 a812fe96 Eric Allman
.It
351
To create a log without a human-friendly name using sha-224
352
as the hash (message digest) algorithm:
353 eae1d3ec Eric Allman
.Dl gdp-create -h sha224
354
.Nm gdp-create
355 a812fe96 Eric Allman
will print the base-64-encoded name of the new log.
356
You should be careful to record that,
357
since it is your only way to access the log.
358
.El
359 c39a16b1 Eric Allman
.
360 a812fe96 Eric Allman
.Sh BUGS
361
There should be some way to provide the key password
362
other than reading it from the standard input.
363 bfc4dc23 Eric Allman
.Pp
364
It should not be necessary to name the server on which the log will be created.
365
This command will be replaced by a smart service
366
that chooses placement based on locality and capacity.