Refine Local Agent.sh use
[aaf/authz.git] / docs / sections / configuration / AAF_4.1_config.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright © 2017 AT&T Intellectual Property. All rights reserved.
4
5 ========================================
6 Automated Configuration and Certificates
7 ========================================
8
9 *Note: this document assumes UNIX Bash Shell.  Being Java, AAF works in Windows, but you will have to create your own script/instruction conversions.*
10
11 =================
12 Optimal Strategy
13 =================
14
15 ONAP is deployed in Docker Containers or Kubernetes managed Docker Containers.  Therefore, this instruction utilizes a Docker Container as a standalone Utility... (This means that this container will stop as soon as it is done with its work... it is not a long running daemon)
16
17 Given that all ONAP entities are also in Docker Containers, they all can access Persistent Volumes.
18
19 This tool creates all the Configurations, including Certificates, onto a declared Volume on the directories starting with "/opt/app/osaaf"
20
21 ==================
22 Prerequisites
23 ==================
24   * Access to a RUNNING AAF System
25
26     * For ONAP TEST, this means
27
28       * Windriver VPN
29       * include "10.12.6.214 aaf-onap-test.osaaf.org" in your /etc/hosts or DNS
30   * For Writing to Volumes for Docker or K8s
31
32     * Docker
33
34       * Note: it does NOT have to be the SAME Docker that AAF is deployed on...
35
36          * but it DOES have be accessible to the AAF Instance.  
37
38   * For creating Configurations on Local Disk
39
40     * For Development purposes
41     * For running AAF on Bare Metal (or VM)
42     * A Truststore that includes your CA
43
44       * for ONAP TEST, you can obtain truststoreONAPall.jks from the `AAF FileServer`_.
45
46         * (You can also get the ONAP TEST Root CA there)
47
48     * the latest aaf-auth-cmd-<VERSION>-full.jar from `ONAP Nexus`_.
49     * you can still use the same "agent.sh" script below
50
51 .. _AAF FileServer: http://aaf-onap-test.osaaf.org/-
52 .. _ONAP Nexus: https://nexus.onap.org/#nexus-search;quick~aaf-auth-cmd
53
54 -----------------------
55 Obtain the Agent Script
56 -----------------------
57 Choose the directory you wish to start in... 
58
59 If you don't want to clone all of AAF, just get the "agent.sh" from a Browser:
60
61   https://gerrit.onap.org/r/gitweb?p=aaf/authz.git;a=blob_plain;f=auth/docker/agent.sh;hb=HEAD
62   
63   rename file "auth-docker-agent.sh" to "agent.sh" (named because of subdirectory in which it is found) 
64
65 Note: curl/wget returns an  html, instead of text.  This cannot be used!
66   | You have to mv, and rename it to "agent.sh", but avoids full clone...
67
68 =============
69 Run Script
70 =============
71 ----------------
72 For Docker/K8s
73 ----------------
74 In your chosen directory ::
75  
76   $ bash agent.sh
77
78 The Agent will look for "aaf.props", and if it doesn't exist, or is missing information, it will ask for it.
79
80 This file is available to reuse for multiple calls. More importantly, you should use it as a template for auto-configuration.  (In ONAP, these are HEAT templates and OOM Helm Charts)
81
82 --------------------------
83 For Local/BareMetal (VM)
84 --------------------------
85 In your chosen directory ::
86  
87   $ bash agent.sh local <instructions>
88
89 The Agent will look for "aaf.props", and if it doesn't exist, or is missing information, it will ask for it.
90
91 =======================
92 'aaf.prop' Properties
93 =======================
94
95 These properties will be created when you run "agent.sh".  Many of the values will be defaulted, or allow you to change.  It will be placed into an "aaf.props" file for you to save, edit or otherwise modify/utilize.
96
97 ==================== ================= ============
98 Query                Tag               Description
99 ==================== ================= ============
100 DOCKER REPOSITORY    DOCKER_REPOSITORY Defaults to current ONAP Repository
101 CADI Version         VERSION           Defaults to current CADI (AAF) version
102 AAF's FQDN           AAF_FQDN          PUBLIC Name for AAF. For ONAP Test, it is 'aaf-onap-test.osaaf.org'
103 AAF FQDN IP          AAF_FQDN_IP       If FQDN isn't actually found with DNS, you will have to enter the IP.  For 'aaf-onap-test.osaaf.org', it is '10.12.6.214'
104 Deployer's FQI       DEPLOY_FQI        In a REAL system, this would be a person or process. For ONAP Testing, the id is 'deployer@people.osaaf.org'
105 Deployer's PASSWORD  DEPLOY_PASSWORD   OPTIONAL!! REAL systems should not store passwords in clear text. For ONAP Testing, the password is 'demo123456!'
106 App's Root FQDN      APP_FQDN          This will show up in the Cert Subject, make it the App Acronym. i.e 'clamp'
107 App's FQI            APP_FQI           Fully Qualified ID given by Organization and with AAF NS/domain.  ex: 'clamp@clamp.onap.org'
108 App's Volume         VOLUME            Volume to put the data, see above. ex: 'clamp_config'
109 DRIVER               DRIVER            Docker Volume type... See Docker Volume documentation. Default is 'local'
110 LATITUDE of Node     LATITUDE          Global latitude coordinate of Node (best guess in Kubernetes)
111 LONGITUDE of Node    LONGITUDE         Global longitude coordinate of Node (best guess in Kubernetes)
112 HOSTNAME             HOSTNAME          Defaults to SYSTEM provided "hostname". Use when System doesn't report what is actually needed, such as vanity urls, multi-NIC cards, short names, i.e. htydb77 reported instead of htydb77.some.company.org, etc.
113 Docker User          DUSER             User needed inside the Docker Container.  Without, this will be root
114 Container NS         CONTAINER_NS      The Namespace for the container.  Provided for Multi-NS support, this would be "onap" for Test OOM, etc.
115 ==================== ================= ============
116
117 =================================
118 Typical ONAP Entity Info in AAF
119 =================================
120 *This is not intended to be a comprehensive list, but a short list of main entities*
121
122 ============================= ===========================  ======================= ==============================================
123 ONAP Namespaces               APP FQI                      APP FQDN OOM            APP FQDN HEAT
124 ============================= ===========================  ======================= ==============================================
125 org.osaaf.aaf                 aaf@aaf.osaaf.org            aaf.onap                aaf.api.simpledemo.onap.org
126 org.onap.aaf-sms              aaf-sms@aaf-sms.onap.org     aaf-sms.onap            aaf-sms.api.simpledemo.onap.org
127 org.onap.aai                  aai@aai.onap.org             aai.onap                aai.api.simpledemo.onap.org
128 org.onap.appc                 appc@appc.onap.org           appc.onap               appc.api.simpledemo.onap.org
129 org.onap.clamp                clamp@clamp.onap.org         clamp.onap              clamp.api.simpledemo.onap.org
130 org.onap.dcae                 dcae@dcae.onap.org           dcae.onap               dcae.api.simpledemo.onap.org
131 org.onap.dmaap                dmaap@dmaap.onap.org         dmaap.onap              dmaap.api.simpledemo.onap.org                                         
132 org.onap.dmaap-bc             dmaap-bc@dmaap-bc.onap.org   dmaap-bc.onap           dmaap-bc.api.simpledemo.onap.org
133 org.onap.dmaap-dr             dmaap-bc@dmaap-dr.onap.org   dmaap-dr.onap           dmaap-dr.api.simpledemo.onap.org                                           
134 org.onap.dmaap-mr             dmaap-mr@dmaap-mr.onap.org   dmaap-mr.onap           dmaap-mr.api.simpledemo.onap.org
135 org.onap.oof                  oof@oof.onap.org             oof.onap                oof.api.simpledemo.onap.org
136 org.onap.policy               policy@policy.onap.org       policy.onap             policy.api.simpledemo.onap.org
137 org.onap.pomba                pomba@pomba.onap.org         pomba.onap              pomba.api.simpledemo.onap.org
138 org.onap.portal               portal@portal.onap.org       portal.onap             portal.api.simpledemo.onap.org
139 org.onap.sdc                  sdc@sdc.onap.org             sdc.onap                sdc.api.simpledemo.onap.org
140 org.onap.sdnc                 sdnc@sdnc.onap.org           sdnc.onap               sdnc.api.simpledemo.onap.org
141 org.onap.so                   so@so.onap.org               so.onap                 so.api.simpledemo.onap.org
142 org.onap.vfc                  vfc@vfc.onap.org             vfc.onap                vfc.api.simpledemo.onap.org
143 org.onap.vid                  vid@vid.onap.org             vid.onap                vid.api.simpledemo.onap.org
144 ============================= ===========================  ======================= ==============================================
145
146 *Note 1: FQDNs are set in AAF's Credential Artifact data, accessible in "Cred Details" from Namespace Page*
147
148 *Note 2: Also, AAF itself is different, as it is not an ONAP only component... It is also expected to be used outside of ONAP.*
149
150 If something goes wrong, and Certificate is not created, you can adjust the data, remove the data from the Container's /opt/app/osaaf/local dir, and it will generate again. ::
151
152   root@77777:/opt/app/osaaf/local# rm *
153   root@77777:/opt/app/osaaf/local# exit
154   $ bash agent.sh bash
155
156 ===============
157 Informational
158 ===============
159
160 There are two sets of Credentials at play here.  The ability to create the Certificate belongs to one of
161   
162   * The person responsible for the ID in the Organization 
163   * A delegated deployer
164
165 It is expected in large organizations that Individual Employees are given the responsibility of an ID for an APP they are responsible for.
166
167   In ONAP test, to simplify create/tear-down environment... 
168      | The **Owner** is always "mmanager@people.osaaf.org". 
169      | The **Sponsor** is always "aaf_admin@people.osaaf.org".
170
171 In a large org, there are probably many Operations teams to support many different apps.
172
173   In ONAP test, 
174      The **Deployer** is always set to "deployer@people.osaaf.org" for all Apps.
175
176
177
178
179
180
181
182
183
184
185
186