Skip to content

Commit

Permalink
Security refactoring documentation and example infinispan#122
Browse files Browse the repository at this point in the history
  • Loading branch information
galderz committed Sep 5, 2019
1 parent ac2e5b7 commit 98bd891
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 41 deletions.
10 changes: 10 additions & 0 deletions deploy/cr/connect_secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Secret
metadata:
name: connect-secret
type: Opaque
stringData:
identities.yaml: |-
credentials
- username: developer
password: changeme
6 changes: 2 additions & 4 deletions deploy/cr/cr_minimal_with_auth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ metadata:
name: example-infinispan
spec:
replicas: 2
connector:
authentication:
type: Credentials
secretName: connect-secret
security:
endpointSecret: connect-secret
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
name: connect-secret
type: Opaque
stringData:
username: developer
password: changeme
identities.yaml: |-
credentials
- username: developer
password: changeme
EOF
6 changes: 2 additions & 4 deletions documentation/asciidoc/topics/cmd_examples/cat_cr_auth.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ metadata:
name: {example_crd_name}
spec:
replicas: 2
connector:
authentication:
type: Credentials
secretName: connect-secret
security:
endpointSecret: connect-secret
EOF
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
$ oc get secret {example_crd_name}-app-generated-secret \
-n my_namespace -o jsonpath="{.data.password}" | base64 --decode
$ oc get secret {example_crd_name}-generated-secret -n my_namespace
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
$ oc get secret {example_crd_name}-app-generated-secret \
-n my_namespace -o json | jq '.data | map_values(@base64d)'
$ oc get secret {example_crd_name}-generated-secret \
-n my_namespace -o jsonpath="{.data.identities\.yaml}" | base64 -D

{
"password": "tUElqbfoJmT,NJVN",
"username": "developer"
}
credentials:
- username: developer
password: dIRs5cAAsHIeeRIL
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
$ oc logs {example_crd_name}-0 | grep ISPN000094

INFO [org.infinispan.CLUSTER] (MSC service thread 1-2) \
ISPN000094: Received new cluster view for channel cluster: \
ISPN000094: Received new cluster view for channel infinispan: \
[{example_crd_name}-0|0] (1) [{example_crd_name}-0]

INFO [org.infinispan.CLUSTER] (jgroups-3,{example_crd_name-0) \
ISPN000094: Received new cluster view for channel cluster: \
ISPN000094: Received new cluster view for channel infinispan: \
[{example_crd_name}-0|1] (2) [{example_crd_name}-0, {example_crd_name}-1]

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions documentation/asciidoc/topics/proc_create_cluster_auth.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include::cmd_examples/cat_connect_secret.adoc[]
The secret must:
+
* Be `type: Opaque`.
* Have `username` and `password` fields.
* `identities.yaml` field containing a YAML-formatted list of application user credentials.
+
[IMPORTANT]
====
Expand All @@ -39,7 +39,7 @@ include::cmd_examples/cat_cr_auth.adoc[]
----
+
* `replicas` specifies the number of nodes in the {brandname} cluster.
* `connector` configures how users connect to {brandname} nodes to store and retrieve data.
* `security.endpointSecret` configures how users connect to {brandname} nodes to store and retrieve data.
+
endif::productized[]
. Apply the custom resource `yaml`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ If you do not create secrets and credentials when you create clusters, the {ispn

Default usernames::
+
* Management user is `admin`.
* Application user is `developer`.

Default credentials secrets::
+
* `{example_crd_name}-mgmt-generated-secret` contains credentials for the management user.
* `{example_crd_name}-app-generated-secret` contains credentials for the application user.
* `{example_crd_name}-generated-secret` contains credentials for the application user.

.Procedure
* Get the credentials from the secret. For example, to get the password for the application user from the default secret:
Expand All @@ -24,7 +22,7 @@ include::cmd_examples/oc_get_app_secret.adoc[]
+
[TIP]
====
Use the `jp` JSON processor to retrieve credentials as follows:
Retrieve credentials as follows:
[source,options="nowrap",subs=attributes+]
----
Expand Down
7 changes: 0 additions & 7 deletions documentation/asciidoc/topics/proc_verify_cluster.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ include::yaml_examples/cluster_view_message.yaml[]
----
endif::productized[]
ifdef::productized[]
. Verify that the {brandname} nodes can discover each other, for example:
+
[source,options="nowrap",subs="attributes"]
----
include::cmd_examples/oc_logs_grep_dns_ping.adoc[]
----
+
. Verify that the nodes have received a clustered view. Do either of the following:

** Retrieve the cluster view from the pod log files.
Expand Down

0 comments on commit 98bd891

Please sign in to comment.