blob: e0ad496ddaa7166a9d7a76ac1ae8832275db8c5a [file] [log] [blame]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +05301type=page
2status=published
3title=Managing Administrative Security
4next=running-in-secure-environment.html
5prev=security-in-cluster-mode.html
6~~~~~~
David Matějček7a39e792021-12-19 14:08:00 +01007
David Matějčekdbccabf2021-12-20 14:06:31 +01008= Managing Administrative Security
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +05309
10[[GSSCG00039]][[gknqh]]
11
12
13[[managing-administrative-security]]
David Matějčekdbccabf2021-12-20 14:06:31 +010014== 5 Managing Administrative Security
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +053015
16This chapter describes how to manage administrative security by using
17the secure administration feature.
18
19This chapter assumes that you are familiar with security features such
20as authentication, authorization, and certificates. If you are not,
21first see link:system-security.html#ablnk[Administering System Security].
22
David Matějček6c58c142021-12-20 20:22:31 +010023Instructions for accomplishing the tasks specific to {productName} by
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +053024using the Administration Console are contained in the Administration
25Console online help.
26
27* link:#gkocp[Secure Administration Overview]
28* link:#gkofl[How Secure Admin Works: The Big Picture]
David Matějček6c58c142021-12-20 20:22:31 +010029* link:#gkofe[Considerations When Running {productName} With Default Security]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +053030* link:#gkomz[Running Secure Admin]
31* link:#gkolu[Additional Considerations When Creating Local Instances]
32* link:#gkqah[Secure Admin Use Case]
David Matějček7a39e792021-12-19 14:08:00 +010033* link:#gkodn[Upgrading an SSL-Enabled Secure GlassFish Installation to Secure Admin]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +053034
35[[gkocp]][[GSSCG00162]][[secure-administration-overview]]
36
David Matějčekdbccabf2021-12-20 14:06:31 +010037=== Secure Administration Overview
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +053038
39The secure administration feature allows an administrator to secure all
40administrative communication between the domain administration server
41(DAS), any remote instances, and administration clients such as the
42`asadmin` utility, the administration console, and REST clients.
43
44In addition, secure administration helps to prevent DAS-to-DAS and
45instance-to-instance traffic, and carefully restricts
46administration-client-to-instance traffic.
47
48The secure administration feature, which is henceforth referred to as
49secure admin, provides a secure environment, in which you can be
50confident that rogue users or processes cannot intercept or corrupt
David Matějček6c58c142021-12-20 20:22:31 +010051administration traffic or impersonate legitimate {productName} components.
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +053052
David Matějček6c58c142021-12-20 20:22:31 +010053When you install {productName} or create a new domain, secure admin
54is disabled by default. When secure admin is disabled, {productName}
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +053055does not encrypt administrative communication among the system
David Matějček7a39e792021-12-19 14:08:00 +010056components and does not accept administrative connections from remote hosts.
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +053057
58The following subcommands enable and disable secure admin:
59
David Matějček7a39e792021-12-19 14:08:00 +010060* enable-secure-admin +
61The `enable-secure-admin` subcommand turns on
David Matějček6c58c142021-12-20 20:22:31 +010062secure admin. {productName} uses SSL encryption to protect subsequent
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +053063administrative traffic and will accept remote administrative
64connections. Enabling secure admin affects the entire domain, including
65the DAS and all instances. The DAS must be running, and not any
66instances, when you run `enable-secure-admin`. You must restart the DAS
67immediately after enabling secure admin, and then start any instances
David Matějček7a39e792021-12-19 14:08:00 +010068you want to run.
69+
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +053070[NOTE]
David Matějček7a39e792021-12-19 14:08:00 +010071====
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +053072The `enable-secure-admin` subcommand fails if any administrative user
73has a blank password.
David Matějček7a39e792021-12-19 14:08:00 +010074====
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +053075
David Matějček7a39e792021-12-19 14:08:00 +010076* disable-secure-admin +
77The `disable-secure-admin` subcommand turns off
David Matějček6c58c142021-12-20 20:22:31 +010078secure admin. {productName} no longer encrypts administrative
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +053079messages and will no longer accept remote administration connections.
80Disabling secure admin affects the entire domain, including the DAS and
81all instances. The DAS must be running , and not any instances, when you
82run `disable-secure-admin`. You must restart the DAS immediately after
David Matějček7a39e792021-12-19 14:08:00 +010083disabling secure admin, and then start any instances you want to run.
84+
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +053085If secure admin is not enabled, this subcommand has no effect.
86
87This section describes how to use these commands to run secure admin,
88and the implications of doing so.
89
90[[gkofl]][[GSSCG00163]][[how-secure-admin-works-the-big-picture]]
91
David Matějčekdbccabf2021-12-20 14:06:31 +010092=== How Secure Admin Works: The Big Picture
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +053093
94Secure admin is a domain-wide setting. It affects the DAS and all
95instances and all administration clients. This section describes the
96following topics:
97
98* link:#gkqce[Functions Performed by Secure Admin]
99* link:#gkocv[Which Administration Account is Used?]
David Matějček7a39e792021-12-19 14:08:00 +0100100* link:#gkodi[What Authentication Methods Are Used for Secure Administration?]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530101* link:#gkpex[Understanding How Certificate Authentication is Performed]
102* link:#gkoey[What Certificates Are Used?]
David Matějček7a39e792021-12-19 14:08:00 +0100103* link:#glgmy[An Alternate Approach: Using Distinguished Names to Specify Certificates]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530104* link:#gkqjj[Guarding Against Unwanted Connections]
105
106[[gkqce]][[GSSCG00227]][[functions-performed-by-secure-admin]]
107
David Matějčekdbccabf2021-12-20 14:06:31 +0100108==== Functions Performed by Secure Admin
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530109
110The `enable-secure-admin` subcommand performs the following functions.
111Subsequent sections describe these functions in more detail.
112
113* Enables the secure admin behavior, optionally setting which aliases
David Matějček7a39e792021-12-19 14:08:00 +0100114 are to be used for identifying the DAS and instance certificates.
115
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530116* Adjusts all configurations in the domain, including default-config.
David Matějček7a39e792021-12-19 14:08:00 +0100117
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530118* Adjusts Grizzly settings:
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530119** SSL/TLS is enabled in the DAS's admin listener and the instances'
David Matějček7a39e792021-12-19 14:08:00 +0100120 admin listeners.
121** Port unification (that is, HTTP and HTTPS are handled by the same port),
122 http—to—https redirection, and client authentication
123 (client-auth=want) are enabled.
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530124** Configures SSL to use the administration truststore.
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530125** Configures SSL to use the administration keystore and the correct
David Matějček7a39e792021-12-19 14:08:00 +0100126 alias (for the self-signed cert) for authenticating itself.
127 (You can use your own certificate instead, as described in link:#gkped[
128 Using Your Own Certificates].
129
130+
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530131The Grizzly configuration on the DAS and each instance is identical,
132with the exception that the DAS uses the `s1as` alias for SSL/TLS
133authentication and the instances use the `glassfish-instance` alias.
134(These alias names are the default, and you can change them.) +
135A server restart is required to change the Grizzly adapter behavior. +
136The restart also synchronizes the restarted instances. When you start
David Matějček7a39e792021-12-19 14:08:00 +0100137the instances, the DAS delivers the updated configuration to the instances.
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530138
139[[gkocv]][[GSSCG00228]][[which-administration-account-is-used]]
140
David Matějčekdbccabf2021-12-20 14:06:31 +0100141==== Which Administration Account is Used?
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530142
David Matějček6c58c142021-12-20 20:22:31 +0100143If only one administration account exists in the realm, {productName}
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530144treats that account as the current default administration account. In
145this case, when you run an `asadmin` command, you do not need to specify
146the username. If a password for that username is required, you need to
147specify it, typically by using the `--passwordfile` option or by letting
148`asadmin` prompt you for it.
149
David Matějček6c58c142021-12-20 20:22:31 +0100150By default, {productName} includes a single account for user "admin"
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530151and an empty password. Therefore, if you make no other changes before
152you enable secure admin, "admin" is the initial default username and no
153password is required. You need to decide whether enabling secure admin
154without also requiring a password makes sense in your environment.
155
David Matějček6c58c142021-12-20 20:22:31 +0100156If multiple admin accounts exist, then {productName} does not
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530157recognize any admin username as the default. You must then specify a
158valid username via the `-—user` option when you use the `asadmin`
159command (or by or defining the `AS_ASDMIN_USER` environment variable),
160and its associated password (if the associated password is not empty).
161
162The username and password used for a login attempt must match the
163username and password (if required) for an account defined in the realm,
164and you must have set up the account as a member of the admin group.
165
166[[gkodi]][[GSSCG00229]][[what-authentication-methods-are-used-for-secure-administration]]
167
David Matějčekdbccabf2021-12-20 14:06:31 +0100168==== What Authentication Methods Are Used for Secure Administration?
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530169
170The secure admin feature enforces security via the following
171authentication methods:
172
173* The DAS and instances authenticate to each other via mutual (two-way)
174SSL/TLS certificate authentication. The DAS authenticates to clients via
David Matějček7a39e792021-12-19 14:08:00 +0100175one-way SSL/TLS certificate authentication.
176+
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530177The domain creation process creates a default keystore and truststore,
178plus a default private key for the DAS. Secure admin uses this initial
179configuration to set up the truststore so that the DAS and instances
180always trust each other.
181* Remote administration clients (`asadmin`, administration console,
182browsers, and IDEs) must accept the public certificate presented by the
183DAS. If accepted, remote administration clients then send a user name
184and password (HTTP Basic authentication) in the HTTP Authorization
185header. The receiving DAS or instance makes sure those credentials are
186valid in its realm, and authenticates and authorizes the user.
187* A locally-running `asadmin` (that is, connecting to an instance on the
188same host) authenticates and authorizes to the co-located instance using
189a locally-provisioned password.
190* Credentials or other sensitive information sent over the network are
191always encrypted if secure admin is enabled. No credentials are sent in
192the clear if secure admin is enabled. (If secure admin is disabled,
193credentials are sent in the clear.) Messages between administration
194clients and the DAS, between the DAS and remote instances, and between
195local administration clients and instances are encrypted using SSL/TLS.
196This is true even if you explicitly set the `asadmin` `-—secure` option
197to false.
198
199link:#gkobl[Table 5-1] shows which authentication methods are employed
200when secure admin is enabled or disabled.
201
202[[sthref35]][[gkobl]]
203
204Table 5-1 Authentication Methods Employed
205
206[width="100%",cols="30%,30%,40%",options="header",]
David Matějček7a39e792021-12-19 14:08:00 +0100207|===
208|Access Method |When Secure Admin is Disabled |When Secure Admin is Enabled
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530209
David Matějček7a39e792021-12-19 14:08:00 +0100210|Remote administration access to the DAS
211|Rejected.
212|Username/password authentication. (Client must also accept server certificate.)
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530213
David Matějček7a39e792021-12-19 14:08:00 +0100214|Communication between DAS and instances
215|Cleartext messages. No mutual authentication.
216|SSL-encrypted messages. SSL mutual authentication using certificates.
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530217
David Matějček7a39e792021-12-19 14:08:00 +0100218|Communication between administration clients and DAS
219|Cleartext messages. No DAS authentication.
220|SSL-encrypted messages. DAS uses SSL certificate server authentication.
221
222|Local asadmin client to instance on same node
223|Cleartext messages. Locally-provisioned password mechanism is used.
224|SSL-encrypted messages. Locally-provisioned password mechanism is used.
225|===
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530226
227
228[[gkpex]][[GSSCG00230]][[understanding-how-certificate-authentication-is-performed]]
229
David Matějčekdbccabf2021-12-20 14:06:31 +0100230==== Understanding How Certificate Authentication is Performed
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530231
232The domain creation process creates a primary (private) key and a
233self-signed certificate for the DAS, and a separate private key and
234self-signed certificate for remote instances.
235
236Then, when you enable secure admin, the following actions are performed:
237
David Matějček7a39e792021-12-19 14:08:00 +0100238* Both private keys are stored in the domain-wide DAS keystore file, keystore.jks.
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530239* Both public certificates are stored in the domain-wide DAS truststore
David Matějček7a39e792021-12-19 14:08:00 +0100240 file, cacerts.jks.
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530241
242When the DAS sends a message to an instance:
243
David Matějček7a39e792021-12-19 14:08:00 +01002441. SSL on the instance asks the DAS to provide an SSL/TLS certificate.
2452. The DAS sends the certificate with the alias you specified using the
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530246`--adminalias` option when you ran the `enable-secure-admin` subcommand.
David Matějček7a39e792021-12-19 14:08:00 +01002473. SSL on the instance makes sure the certificate is valid and
David Matějček6c58c142021-12-20 20:22:31 +0100248{productName} makes sure that the security Principal associated with
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530249the incoming request (provided automatically by Grizzly and the SSL/TLS
250Java implementation) matches the Principal associated with the
251adminalias from the instance's truststore.
252
253[[gkoey]][[GSSCG00231]][[what-certificates-are-used]]
254
David Matějčekdbccabf2021-12-20 14:06:31 +0100255==== What Certificates Are Used?
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530256
257When you enable secure admin, you can optionally set the `--adminalias`
258and `--instancealias` options that tell secure admin which aliases to
259use for the DAS and instance certificates.
260
261The DAS uses the alias associated with the `--instancealias` option to
262check incoming requests that use SSL/TLS cert authentication.
263Conversely, instances use the alias associated with the `--adminalias`
264option to check incoming requests with certificate authentication.
265
266By default, `--adminalias` of the `enable-secure-admin` subcommand uses
267the `s1as` alias, and the `--instancealias` option uses the
268`glassfish-instance` alias, both of which identify the default
269self-signed certificates.
270
271You can use your tool of choice, such as keytool, to list the default
272self-signed certificates in the keystore, similar to the following:
273
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530274[NOTE]
David Matějček7a39e792021-12-19 14:08:00 +0100275====
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530276You can list the contents of the keystore without supplying a password.
277However, for a request that affects the private key, such as the
278keytool.exe `--certreq` option, the keystore password is required. This
279is the master password and has a default value of changeit unless you
280change it with the `change-master-password` subcommand.
David Matějček7a39e792021-12-19 14:08:00 +0100281====
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530282
David Matějček7a39e792021-12-19 14:08:00 +0100283[source]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530284----
David Matějček7a39e792021-12-19 14:08:00 +0100285keytool.exe -list -keystore keystore.jks
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530286Enter keystore password:
287
288***************** WARNING WARNING WARNING *****************
289* The integrity of the information stored in your keystore *
290* has NOT been verified! In order to verify its integrity, *
291* you must provide your keystore password. *
292***************** WARNING WARNING WARNING *****************
293
294Keystore type: JKS
295Keystore provider: SUN
296
297Your keystore contains 2 entries
298
299glassfish-instance, Jan 3, 2011, PrivateKeyEntry,
300Certificate fingerprint (MD5): 06:A4:83:84:57:52:9C:2F:E1:FD:08:68:BB:2D:ED:E8
301s1as, Jan 3, 2011, PrivateKeyEntry,
302Certificate fingerprint (MD5): 8B:7D:5A:4A:32:36:1B:5D:6A:29:66:01:B0:A3:CB:85
303----
304
305The `--adminalias` and `--instancealias` values are maintained. Because
306of this design, normal instance creation operations (create-instance
307over SSH and create-local-instance) apply the up-to-date keystore,
308truststore, and configuration to each instance.
309
310[[gkpfi]][[GSSCG00201]][[self-signed-certificates-and-trust]]
311
David Matějčekdbccabf2021-12-20 14:06:31 +0100312===== Self-Signed Certificates and Trust
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530313
David Matějček6c58c142021-12-20 20:22:31 +0100314The self-signed certificates that {productName} uses might not be
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530315trusted by clients by default because a certificate authority does not
316vouch for the authenticity of the certificate. If you enable secure
317admin and then contact the DAS using an administration client, that
318client will detect whether the certificate is automatically trusted.
319
320Browsers will warn you, let you view the certificate, and ask you to
321reject the certificate, accept it once, or accept it indefinitely, as
322shown in link:#gkqpv[Figure 5-1].
323
324[[GSSCG00002]][[gkqpv]]
325
326
327.*Figure 5-1 Sample Browser Response to Untrusted Certificate*
328image:img/accept-certif.png[
David Matějček7a39e792021-12-19 14:08:00 +0100329"This screen shot shows how a browser might respond to an untrusted certificate."]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530330
331
332Similarly, the first time `asadmin` receives an untrusted certificate,
333it displays the certificate and lets you accept it or reject it, as
334follows: (If you accept it, `asadmin` also accepts that certificate in
335the future. )
336
David Matějček7a39e792021-12-19 14:08:00 +0100337[source]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530338----
David Matějček0a14ebe2021-11-28 19:28:03 +0100339D:\glassfish7\glassfish\bin>asadmin enable-secure-admin
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530340Command enable-secure-admin executed successfully.
341
342
David Matějček0a14ebe2021-11-28 19:28:03 +0100343D:\glassfish7\glassfish\bin>asadmin stop-domain domain1
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530344Waiting for the domain to stop .......
345Command stop-domain executed successfully.
346
David Matějček0a14ebe2021-11-28 19:28:03 +0100347D:\glassfish7\glassfish\bin>asadmin start-domain domain1
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530348Waiting for domain1 to start ..............................
349Successfully started the domain : domain1
David Matějček0a14ebe2021-11-28 19:28:03 +0100350domain Location: D:\glassfish7\glassfish\domains\domain1
351Log File: D:\glassfish7\glassfish\domains\domain1\logs\server.log
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530352Admin Port: 4848
353Command start-domain executed successfully.
354
David Matějček0a14ebe2021-11-28 19:28:03 +0100355D:\glassfish7\glassfish\bin>asadmin list-domains
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530356[
357[
358 Version: V3
359 Subject: CN=machine.oracle.com, OU=GlassFish, O=Oracle Corporation, L=San
360ta Clara, ST=California, C=US
361 Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
362
363 Key: Sun RSA public key, 1024 bits
364 modulus: 916043595073784449632358756374297330881618062298549101072702252458856
36574079656358328568800001548507219262910864311924824938195045822088563459253216383
36621100660819657204757523896415606833471499564071226722478056407102318862796797465
3676245090519956376357288295037519504394674686082145398885236913866246525691704749
368 public exponent: 65537
369 Validity: [From: Tue Jan 04 14:30:08 EST 2011,
370 To: Fri Jan 01 14:30:08 EST 2021]
371 Issuer: CN=machine.oracle.com, OU=GlassFish, O=Oracle Corporation, L=Sant
372a Clara, ST=California, C=US
373 SerialNumber: [ 4d237540]
374
375Certificate Extensions: 1
376[1]: ObjectId: 2.5.29.14 Criticality=false
377SubjectKeyIdentifier [
378KeyIdentifier [
3790000: AF 8B 90 1E 51 9A 80 1B EB A4 D9 C6 01 8A A0 FD ....Q...........
3800010: DE EC 83 8A ....
381]
382]
383
384]
385 Algorithm: [SHA1withRSA]
386 Signature:
3870000: 3F 2B 30 CE 97 0B 5E F3 72 0E 60 18 8D 3B 04 DC ?+0...^.r.`..;..
3880010: 26 E6 7A 6F D0 19 CC 26 1D 90 C0 DE 33 4E 53 FB &.zo...&....3NS.
3890020: DC E7 AE 78 9E BA EF 14 86 57 36 D4 3E 9B C9 FB ...x.....W6.>...
3900030: C0 B4 EF 72 27 D9 4F 79 1F 89 91 B8 96 26 33 64 ...r'.Oy.....&3d
3910040: 9F 4B 04 4B 83 B9 BF 4D 54 B4 8F 75 17 1A 51 BD .K.K...MT..u..Q.
3920050: F3 69 94 CE 90 95 08 55 2C 07 D2 23 AC AE EC 6D .i.....U,..#...m
3930060: 84 B6 3D 00 FB FE 92 50 37 1A 2D 00 F1 21 5C E6 ..=....P7.-..!\.
3940070: 1F 39 26 B2 5D C1 FD C8 B1 4F CC EE 26 84 B8 B5 .9&.]....O..&...
395
396]
397Do you trust the above certificate [y|N] -->
398----
399
400`asadmin` saves certificates you accept in the file `.asadmintruststore`
401in your log-in default directory. You do not generally need to work with
402the file directly, but if you delete or move the file, `asadmin` will
403prompt you again when it receives untrusted certificates.
404
405Some `asadmin` commands such as run-script can contact an instance
406directly to retrieve information (but not to make configuration
407changes). The instances do not use the same certificate as the DAS, so
408in these cases `asadmin` then prompts you to accept or reject the
409instance certificate.
410
411[[gkped]][[GSSCG00202]][[using-your-own-certificates]]
412
David Matějčekdbccabf2021-12-20 14:06:31 +0100413===== Using Your Own Certificates
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530414
415By default, `--adminalias` of the `enable-secure-admin` subcommand uses
416the `s1as` alias, and the `--instancealias` option uses the
417`glassfish-instance` alias, both of which identify the default
418self-signed certificates.
419
David Matějček6c58c142021-12-20 20:22:31 +0100420You can instead have {productName} use your own certificates for this
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530421purpose by first adding your certificates to the keystore and
422truststore, and then running `enable-secure-admin` and specifying the
423aliases for your certificates.
424
425It is also possible to use `s1as` and `glassfish-instance` as the alias
426names for your own certificates. A benefit of doing so is that you would
427not have to specify alias names with the `enable-secure-admin`
428subcommand.
429
430In addition, your own certificate identified by the `s1as` alias would
431be used in all other cases within the domain where the `s1as` alias is
432used (by default), such as in the SSL configuration of the IIOP and
433http-listener-2 listeners, and as the `encryption.key.alias` and
434`signature.key.alias` used for provider configuration in the SOAP
435authentication layer for Message Security configuration.
436
437You may find the wide-reaching effect of using the `s1as` alias with
438your own certificate to be either a useful feature or an unintended
439consequence. Therefore, you should understand the implications of using
440the `s1as` alias before doing so.
441
442If you decide to use the `s1as` and `glassfish-instance` aliases with
443your own certificates, you will first need to disable secure admin (if
444enabled) and then change or delete the exiting `s1as` alias from both
445the `keystore.jks` keystore and `cacerts.jks` truststore for the DAS.
446You can use the `--changealias` or`--delete` option of `keytool` to
447accomplish this. Then, import your own certificates.
448
449When you enable secure admin, the DAS and the instances then have copies
450of the same keystore and truststore
451
452[[glgmy]][[GSSCG00232]][[an-alternate-approach-using-distinguished-names-to-specify-certificates]]
453
David Matějčekdbccabf2021-12-20 14:06:31 +0100454==== An Alternate Approach: Using Distinguished Names to Specify Certificates
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530455
456By default, the DAS uses the alias associated with the `--instancealias`
457option to check incoming requests that use SSL/TLS cert authentication.
458Conversely, instances use the alias associated with the `--adminalias`
459option to check incoming requests with certificate authentication.
460
David Matějček2a4fd862021-12-22 09:49:49 +0100461The link:reference-manual/enable-secure-admin-principal.html#GSRFM00131[
David Matějček7a39e792021-12-19 14:08:00 +0100462`enable-secure-admin-principal`] subcommand
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530463provides an alternate approach. `enable-secure-admin-principal`
David Matějček6c58c142021-12-20 20:22:31 +0100464instructs {productName} to accept admin requests when accompanied by
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530465an SSL certificate with the specified distinguished name (DN).
466
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530467[NOTE]
David Matějček7a39e792021-12-19 14:08:00 +0100468====
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530469Any certificate you specify with `enable-secure-admin-principal` must
470either be issued by a trusted certificate authority or, if it is
David Matějček6c58c142021-12-20 20:22:31 +0100471self-signed, must already be in the {productName} truststore.
David Matějček7a39e792021-12-19 14:08:00 +0100472====
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530473
474For example, assume that you write your own admin client that uses the
475REST interface. When your client establishes the connection, it can
476choose which certificate to use for its client cert. You would then
477specify the DN of this certificate to `enable-secure-admin-principal`.
478
479You must specify either the DN or the `--alias` option of the
480`enable-secure-admin-principal` subcommand.
481
David Matějček6c58c142021-12-20 20:22:31 +0100482If you specify the DN, {productName} records the value you specify as
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530483the DN. You specify the DN as a comma-separated list in quotes. For
484example,
485`"CN=system.amer.oracle.com,OU=GlassFish,O=Oracle Corporation,L=Santa Clara,ST=California,C=US"`.
486
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530487[NOTE]
David Matějček7a39e792021-12-19 14:08:00 +0100488====
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530489The `enable-secure-admin-principal` subcommand accepts the string you
490enter and does not immediately validate it. However, secure admin must
491be able to match the DN you specify in order to use it.
David Matějček7a39e792021-12-19 14:08:00 +0100492====
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530493
494If you have sufficient privileges to view the content of the keystore,
495you can use keytool to display the DN of a certificate:
496
David Matějček7a39e792021-12-19 14:08:00 +0100497[source]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530498----
499keytool.exe -v -list -keystore keystore.jks
500Enter keystore password:
501
502Keystore type: JKS
503Keystore provider: SUN
504
505Your keystore contains 2 entries
506
507Alias name: glassfish-instance
508Creation date: Jul 7, 2011
509Entry type: PrivateKeyEntry
510Certificate chain length: 1
511Certificate[1]:
David Matějček7a39e792021-12-19 14:08:00 +0100512Owner: CN=systemname.amer.oracle.com-instance, OU=GlassFish,
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530513O=Oracle Corporation, L=Santa Clara, ST=California, C=US
514Issuer: CN=systemname.amer.oracle.com-instance, OU=GlassFish, O=Oracle Corporation,
515 L=Santa Clara, ST=California, C=US
516Serial number: 4e15d6e7
517Valid from: Thu Jul 07 11:55:19 EDT 2011 until: Sun Jul 04 11:55:19 EDT 2021
518Certificate fingerprints:
519 MD5: 05:6E:01:D6:CE:9D:29:DA:55:D9:10:5E:BE:CC:55:05
520 SHA1: 2A:6D:A2:52:A5:2B:ED:DE:CD:B4:76:4A:65:9D:B5:79:A6:EA:3C:10
521 Signature algorithm name: SHA1withRSA
522 Version: 3
523
524Extensions:
525
526#1: ObjectId: 2.5.29.14 Criticality=false
527SubjectKeyIdentifier [
528KeyIdentifier [
5290000: 96 99 36 B6 CF 60 1E 8A AE 25 75 4E C8 34 AA AB ..6..`...%uN.4..
5300010: E1 3B CF 03 .;..
531]
532]
533----
534
David Matějček6c58c142021-12-20 20:22:31 +0100535If you use the "`--alias` aliasname" form, then {productName} looks
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530536in its truststore for a certificate with the specified alias and uses
537the DN associated with that certificate. alias-name must be an alias
538associated with a certificate currently in the truststore. Therefore,
539you may find it most useful for self-signed certificates for which you
540know the alias.
541
542If you have sufficient privileges to view the contents of the
543truststore, you can use keytool to display the alias of a certificate:
544
David Matějček7a39e792021-12-19 14:08:00 +0100545[source]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530546----
547keytool.exe -v -list -keystore cacerts.jks
548Enter keystore password:
549:
550:
551Alias name: glassfish-instance
552Creation date: Jul 7, 2011
553Entry type: trustedCertEntry
554
555Owner: CN=systemname.amer.oracle.com-instance, OU=GlassFish, O=Oracle Corporation,
556L=Santa Clara, ST=California, C=US
557Issuer: CN=systemname.amer.oracle.com-instance, OU=GlassFish, O=Oracle Corporation,
558 L=Santa Clara, ST=California, C=US
559Serial number: 4e15d6e7
560Valid from: Thu Jul 07 11:55:19 EDT 2011 until: Sun Jul 04 11:55:19 EDT 2021
561Certificate fingerprints:
562 MD5: 05:6E:01:D6:CE:9D:29:DA:55:D9:10:5E:BE:CC:55:05
563 SHA1: 2A:6D:A2:52:A5:2B:ED:DE:CD:B4:76:4A:65:9D:B5:79:A6:EA:3C:10
564 Signature algorithm name: SHA1withRSA
565 Version: 3
566
567Extensions:
568
569#1: ObjectId: 2.5.29.14 Criticality=false
570SubjectKeyIdentifier [
571KeyIdentifier [
5720000: 96 99 36 B6 CF 60 1E 8A AE 25 75 4E C8 34 AA AB ..6..`...%uN.4..
5730010: E1 3B CF 03 .;..
574]
575]
576----
577
David Matějček6c58c142021-12-20 20:22:31 +0100578When you run `enable-secure-admin`, {productName} automatically
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530579records the DNs for the admin alias and the instance alias, whether you
580specify those values or use the defaults. You do not need to run
581`enable-secure-admin-principal` yourself for those certificates.
582
583Other than these certificates, you must run
David Matějček6c58c142021-12-20 20:22:31 +0100584`enable-secure-admin-principal` for any other DN that {productName}
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530585should authorize to send admin requests. This includes DNs corresponding
586to trusted certificates (those with a certificate chain to a trusted
587authority.)
588
589You can run `enable-secure-admin-principal` multiple times so that
David Matějček6c58c142021-12-20 20:22:31 +0100590{productName} accepts admin requests from a client sending a
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530591certificate with any of the DNs you specify.
592
593The following example shows how to specify a DN for authorizing access
594in secure administration:
595
David Matějček7a39e792021-12-19 14:08:00 +0100596[source]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530597----
598asadmin> enable-secure-admin-principal
599"CN=system.amer.oracle.com,OU=GlassFish,
600O=Oracle Corporation,L=Santa Clara,ST=California,C=US"
601
602Command enable-secure-admin-principal executed successfully.
603----
604
David Matějček2a4fd862021-12-22 09:49:49 +0100605You can use the link:reference-manual/disable-secure-admin-principal.html#GSRFM00123[`disable-secure-admin-principal`]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530606subcommand to disable a specific certificate for authenticating and
607authorizing access in secure admin. You must specify either the DN or
608the `--alias` option of the `disable-secure-admin-principal` subcommand.
609To disable multiple certificates for authenticating and authorizing
610access in secure admin, run the `disable-secure-admin-principal`
611subcommand multiple times.
612
David Matějček2a4fd862021-12-22 09:49:49 +0100613You can use the link:reference-manual/list-secure-admin-principals.html#GSRFM00200[`list-secure-admin-principals`]
David Matějček6c58c142021-12-20 20:22:31 +0100614subcommand to list the certificates for which {productName} accepts
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530615admin requests from clients.
616
617[[gkqjj]][[GSSCG00233]][[guarding-against-unwanted-connections]]
618
David Matějčekdbccabf2021-12-20 14:06:31 +0100619==== Guarding Against Unwanted Connections
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530620
621Secure admin guards against unwanted connections in several ways:
622
623* DAS-to-DAS, instance-to-instance:
624
625** The DAS and the instances have copies of the same truststore, which
626contains the public certificate of the DAS and the separate public
David Matějček6c58c142021-12-20 20:22:31 +0100627certificate that is used by all instances. In addition, {productName}
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530628includes a unique, generated "domain ID" that servers use to ensure that
David Matějček6c58c142021-12-20 20:22:31 +0100629admin requests from other {productName}s originate from the correct
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530630domain.
631
632** DAS-to-other-DAS communication is not authenticated because each
633different DAS will have its own self-signed certificate that is not in
634the truststore of the other DAS.
635
636** DAS-to-itself communication is unlikely unless you were to
637misconfigure the admin listener port for an instance on the same host so
638it is the same as for the DAS. Similarly, instance-to-instance traffic
639is unlikely unless you were to misconfigure listener ports for instances
David Matějček7a39e792021-12-19 14:08:00 +0100640on the same host.
641+
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530642To prevent both of these situations, both cases are handled by making
643sure that the connecting Principal (alias) is not the running Principal.
644secure admin ensures that if the client has authenticated using SSL/TLS
645client authentication that the Principal associated with the remote
646client is not the same as the current process. That is, the DAS makes
647sure that the Principal is not itself. Similarly, each instance ensures
648that the client is not an instance. (The instances share the same
649self-signed certificate and therefore are mapped to the same Principal.)
David Matějček7a39e792021-12-19 14:08:00 +0100650* Remote client-to-instance:
651+
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530652Remote `asadmin` clients are unable to connect directly to instances. If
653the user on host "test1" runs a local command but specifies a remote
654instance on host "test2," `asadmin` on test1 will read and send that
655locally-provisioned password. The instance on "test2" will have a
656different locally-provisioned password and so the authentication attempt
David Matějček7a39e792021-12-19 14:08:00 +0100657will fail.
658+
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530659Therefore, a user on "test1" will not be able to run a remote command
660targeting an instance on "test2."
661
662[[gkofe]][[GSSCG00164]][[considerations-when-running-glassfish-server-with-default-security]]
663
David Matějček6c58c142021-12-20 20:22:31 +0100664=== Considerations When Running {productName} With Default Security
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530665
David Matějček6c58c142021-12-20 20:22:31 +0100666In {productName}, the default admin account is username "admin" with
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530667an empty password. Admin clients provide empty credentials or none at
668all, and all are authenticated and authorized as that default admin
669user. None of the participants (clients, DAS, or instances) encrypts
670network messages.
671
672If this level of security is acceptable in your environment, no changes
673are needed and you do not need to enable secure administration. Imposing
674a heightened level of security is optional.
675
676However, consider link:#gkode[Table 5-2], which shows which operations
677are accepted and rejected when secure admin is disabled.
678
679
680[NOTE]
David Matějček7a39e792021-12-19 14:08:00 +0100681====
David Matějček6c58c142021-12-20 20:22:31 +0100682When secure admin is disabled, {productName} does allow remote
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530683monitoring (read-only) access via the REST interface.
David Matějček7a39e792021-12-19 14:08:00 +0100684====
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530685
686
687[[sthref37]][[gkode]]
688
689Table 5-2 Accepted and Rejected Operations if Secure Admin is Disabled
690
691[width="100%",cols="30%,25%,45%",options="header",]
David Matějček7a39e792021-12-19 14:08:00 +0100692|===
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530693|Operation |Run From Same System as DAS |Run From Remote System
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530694
David Matějček7a39e792021-12-19 14:08:00 +0100695|`start-local-instance`
696|Functions as expected
697|Cannot sync with DAS.
698The instance starts but cannot communicate with the DAS.
699DAS will not see the instance.
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530700
David Matějček7a39e792021-12-19 14:08:00 +0100701|Any other `asadmin` subcommand
702|Functions as expected
703|Rejected. A user sees the username/password prompt, but even correct entries are rejected.
704
705|Commands that use SSH. For example, `create-instance`.
706|Functions as expected; requires prior SSH configuration.
707|Functions as expected; requires prior SSH configuration.
708|===
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530709
710
711[[gkomz]][[GSSCG00165]][[running-secure-admin]]
712
David Matějčekdbccabf2021-12-20 14:06:31 +0100713=== Running Secure Admin
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530714
715This section describes how to run secure admin. The section begins with
716prerequisites for running secure admin.
717
718[[gkokc]][[GSSCG00234]][[prerequisites-for-running-secure-admin]]
719
David Matějčekdbccabf2021-12-20 14:06:31 +0100720==== Prerequisites for Running Secure Admin
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530721
David Matějček6c58c142021-12-20 20:22:31 +0100722Before running {productName} with secure admin enabled, you must make
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530723sure that:
724
David Matějček7a39e792021-12-19 14:08:00 +01007251. The DAS is installed, initialized, and running.
7262. If one or more remote instances are installed and initialized, they
727 must not be running.
7283. Any administration clients you require are installed.
7294. The DAS communicates on the `-—adminport` you configure when you
730 create the domain, and defaults to 4848. An instance communicates on the
731 `ASADMIN_LISTENER_PORT` system property you specify for the instance.
7325. The user name and password sent by remote administration clients
733 (`asadmin`, administration console, browsers, and IDEs) must exist in
734 the realm and be in the admin group.
7356. The keystore and truststore for the domain exist. (They are created
David Matějček6c58c142021-12-20 20:22:31 +0100736 by default when you create the domain or install {productName}.)
David Matějček7a39e792021-12-19 14:08:00 +0100737+
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530738If you are not using the default self-signed certificates, you must add
David Matějček7a39e792021-12-19 14:08:00 +0100739 your own valid certificates and CA root in the keystore and truststore,
740 respectively.
7417. If you are not using the default self-signed certificates, create
742 two aliases corresponding to certificates in the keystore and
743 truststore: one that the DAS will use for authenticating itself in
744 administration traffic, and one that the instances will use for
745 authenticating itself in administration traffic.
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530746
747[[glgmh]][[GSSCG00235]][[an-alternate-approach-using-a-user-name-and-password-for-internal-authentication-and-authorization]]
748
David Matějčekdbccabf2021-12-20 14:06:31 +0100749==== An Alternate Approach: Using A User Name and Password for Internal Authentication and Authorization
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530750
David Matějček6c58c142021-12-20 20:22:31 +0100751By default, secure admin uses the {productName} self-signed
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530752certificates, via the aliases corresponding to these certificates, to
753authenticate the DAS and instances with each other and to authorize
754secure admin operations. Specifically, the DAS uses the (`s1as`) alias
755for authenticating itself and authorizing access in administration
756traffic, and instances use the (`glassfish-instance`) alias for
David Matějček7a39e792021-12-19 14:08:00 +0100757authenticating themselves and authorizing access in secure admin traffic.
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530758
759As described in link:#gkped[Using Your Own Certificates], you can
760instead use your own certificates and their associated aliases for
David Matějček7a39e792021-12-19 14:08:00 +0100761authenticating and authorizing the DAS and instances in administration traffic.
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530762
763As an alternative to this certificate-based authentication and
764authorization, you can instead use the
David Matějček2a4fd862021-12-22 09:49:49 +0100765link:reference-manual/enable-secure-admin-internal-user.html#GSRFM00130[
David Matějček7a39e792021-12-19 14:08:00 +0100766`enable-secure-admin-internal-user`] subcommand to
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530767instruct all servers in the domain to authenticate to each other, and to
768authorize admin operations submitted to each other, using an existing
769admin user name and password rather than SSL certificates.
770
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530771[NOTE]
David Matějček7a39e792021-12-19 14:08:00 +0100772====
David Matějček6c58c142021-12-20 20:22:31 +0100773If secure admin is enabled, all {productName} processes continue to
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530774use SSL encryption to secure the content of the admin messages,
775regardless of how they authenticate to each other.
David Matějček7a39e792021-12-19 14:08:00 +0100776====
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530777
778You might want to use the
David Matějček2a4fd862021-12-22 09:49:49 +0100779link:reference-manual/enable-secure-admin-internal-user.html#GSRFM00130[
David Matějček7a39e792021-12-19 14:08:00 +0100780`enable-secure-admin-internal-user`] subcommand if your
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530781use case favors the use of a user name and password combination over the
782use of SSL certificates and aliases.
783
784This generally means that you must:
785
David Matějček7a39e792021-12-19 14:08:00 +01007861. Create a valid admin user.
787+
788[source]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530789----
David Matějček7a39e792021-12-19 14:08:00 +0100790asadmin> create-file-user --authrealmname admin-realm --groups
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530791asadmin newAdminUsername
792----
David Matějček7a39e792021-12-19 14:08:00 +01007932. Create a password alias for the just-created password.
794+
795[source]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530796----
797asadmin> create-password-alias passwordAliasName
798----
David Matějček7a39e792021-12-19 14:08:00 +01007993. Use that user name and password for inter-process authentication and
800admin authorization.
801+
802[source]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530803----
David Matějček7a39e792021-12-19 14:08:00 +0100804asadmin> enable-secure-admin-internal-user
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530805--passwordalias passwordAliasName
806newAdminUsername
807----
808
809The following example allows secure admin to use a user name and
810password alias for authentication and authorization between the DAS and
811instances, instead of certificates.
812
David Matějček7a39e792021-12-19 14:08:00 +0100813[source]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530814----
David Matějček7a39e792021-12-19 14:08:00 +0100815asadmin> enable-secure-admin-internal-user
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530816--passwordalias passwordAliasName
817newAdminUsername
818----
819
David Matějček6c58c142021-12-20 20:22:31 +0100820If {productName} finds at least one secure admin internal user, then
821if secure admin is enabled {productName} processes will not use SSL
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530822authentication and authorization with each other and will instead use
823user name password pairs.
824
825Most users who use this subcommand will need to set up only one secure
826admin internal user. If you set up more than one secure admin internal
827user, you should not make any assumptions about which user name and
David Matějček6c58c142021-12-20 20:22:31 +0100828password pair {productName} will choose to use for any given admin
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530829request.
830
831As a general practice, you should not use the same user name and
832password pair for internal admin communication and for admin user login.
833That is, create at least one admin account specifically for internal
834admin communication.
835
David Matějček2a4fd862021-12-22 09:49:49 +0100836You can use the link:reference-manual/disable-secure-admin-internal-user.html#GSRFM00122[`disable-secure-admin-internal-user`]
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530837subcommand to disable secure admin from using the user name (instead of
838SSL certificates) to authenticate the DAS and instances with each other
839and to authorize admin operations. To disable multiple user names for
840authenticating and authorizing access in secure admin, run the
841`disable-secure-admin-internal-user` subcommand multiple times.
842
David Matějček2a4fd862021-12-22 09:49:49 +0100843You can use the link:reference-manual/list-secure-admin-internal-users.html#GSRFM00199[`list-secure-admin-internal-users`]
David Matějček6c58c142021-12-20 20:22:31 +0100844subcommand to list the user names for which {productName}
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530845authenticate the DAS and instances with each other and authorizes admin
846operations.
847
848[[gkqby]][[GSSCG00236]][[example-of-running-enable-secure-admin]]
849
David Matějčekdbccabf2021-12-20 14:06:31 +0100850==== Example of Running enable-secure-admin
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530851
852The following example shows how to enable secure admin for a domain
853using the default admin alias and the default instance alias. You must
854restart the DAS immediately after enabling secure admin.
855
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530856[NOTE]
David Matějček7a39e792021-12-19 14:08:00 +0100857====
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530858The only indicator that secure admin is enabled is the successful status
859from the `enable-secure-admin` subcommand. When secure admin is running,
860the DAS and instances do not report the secure admin status.
David Matějček7a39e792021-12-19 14:08:00 +0100861====
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530862
David Matějček7a39e792021-12-19 14:08:00 +0100863[source]
864----
865asadmin> enable-secure-admin
866Command enable-secure-admin executed successfully.
867----
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530868
869The following example shows how to enable secure admin for a domain
870using an admin alias adtest and an instance alias intest. You can also
871use this command to modify an existing secure admin configuration to use
872different aliases.
873
David Matějček7a39e792021-12-19 14:08:00 +0100874[source]
875----
876asadmin> enable-secure-admin --adminalias adtest --instancealias intest
877----
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530878
879The following example shows how to disable secure admin:
David Matějček7a39e792021-12-19 14:08:00 +0100880[source]
881----
882asadmin> disable-secure-admin
883Command disable-secure-admin executed successfully.
884----
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530885
886You can use the following command to see the current state of secure
887admin in a domain:
David Matějček7a39e792021-12-19 14:08:00 +0100888[source]
889----
890asadmin> get secure-admin.enabled
891secure-admin.enabled=false
892Command get executed successfully.
893----
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530894
895[[gkolu]][[GSSCG00166]][[additional-considerations-when-creating-local-instances]]
896
David Matějčekdbccabf2021-12-20 14:06:31 +0100897=== Additional Considerations When Creating Local Instances
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530898
899If you use `xxx-local-instance` commands to set up local instances,
900either leave secure admin disabled, or enable it before you create or
901start the instances and leave it that way.
902
903However, if you use `xxx-instance` commands over SSH to manage remote
904instances, you can enable and disable secure admin, although this is not
905recommended because it can result in an inconsistent security model.
906
907[[gkqah]][[GSSCG00167]][[secure-admin-use-case]]
908
David Matějčekdbccabf2021-12-20 14:06:31 +0100909=== Secure Admin Use Case
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530910
911This section describes a simple secure admin use case.
912
913In the
914`asadmin --secure=false --user me --passwordfile myFile.txt cmd ...` use
915case, the user submits a command with `--secure` set to false, and
916supplies password credentials.
917
918The important concept to note is that `asadmin` uses HTTPS because of
919the DAS redirection, even though the command sets `--secure` to false.
David Matějček7a39e792021-12-19 14:08:00 +0100920`asadmin` sends the HTTP Authorization header along with the redirected request.
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530921
922In addition to the flow described here, certificate authentication is
923also performed as described in link:#gkqax[Table 5-3]. Also, the
924credentials that the user supplies are assumed to be valid administrator
925credentials for the DAS.
926
927[[sthref38]][[gkqax]]
928
929Table 5-3 asadmin --secure=false, With Username and Password
930
931[width="100%",cols="34%,33%,33%",options="header",]
David Matějček7a39e792021-12-19 14:08:00 +0100932|===
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530933|asadmin |Grizzly |AdminAdapter
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530934
David Matějček7a39e792021-12-19 14:08:00 +0100935|Sends HTTP request, no authorization header (because the transport is not secure).
936|
937|
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530938
David Matějček7a39e792021-12-19 14:08:00 +0100939|
940|Returns 3xx status and redirects HTTP to HTTPS.
941|
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530942
David Matějček7a39e792021-12-19 14:08:00 +0100943|Follows redirection, this time adding the Authorization header (because transport is now HTTPS).
944|
945|
946
947|
948|
949|Authenticates admin user and password from HTTP Authorization
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530950header in the realm Executes command, and responds with success status.
David Matějček7a39e792021-12-19 14:08:00 +0100951|===
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530952
953
954[[gkodn]][[GSSCG00168]][[upgrading-an-ssl-enabled-secure-glassfish-installation-to-secure-admin]]
955
David Matějčekdbccabf2021-12-20 14:06:31 +0100956=== Upgrading an SSL-Enabled Secure GlassFish Installation to Secure Admin
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530957
David Matějček6c58c142021-12-20 20:22:31 +0100958If you enable secure admin on an SSL-enabled {productName}
Vinay Vishal7c4c4fc2019-01-28 12:01:04 +0530959installation, secure admin uses the existing <ssl cert-nickname> value
960as the DAS adminalias for secure admin.
961
962