From 97a8b0f8162138d048cc6f7b1f901f1787fa1b17 Mon Sep 17 00:00:00 2001 From: Ravi Geda Date: Wed, 7 Nov 2018 22:37:16 +0000 Subject: Add Pluggable Security to aai-resources Note that by default this feature is turned off. To enable update the installSidecarSecurity in aai/values.yaml to true. Change-Id: If5d2be859ead2f0bd81aabb4fde749f105974bcf Issue-ID: AAF-616 Signed-off-by: Ravi Geda --- .../resources/config/auth/aai_policy.json | 298 +++++++++++++++++++++ .../resources/fproxy/config/auth/client-cert.p12 | Bin 0 -> 3617 bytes .../resources/fproxy/config/auth/fproxy_truststore | Bin 0 -> 4639 bytes .../resources/fproxy/config/auth/tomcat_keystore | Bin 0 -> 2214 bytes .../resources/fproxy/config/fproxy.properties | 2 + .../resources/fproxy/config/logback-spring.xml | 48 ++++ .../resources/fproxy/config/readme.txt | 1 + .../resources/rproxy/config/auth/client-cert.p12 | Bin 0 -> 4291 bytes .../resources/rproxy/config/auth/org.onap.aai.p12 | Bin 0 -> 4158 bytes .../resources/rproxy/config/auth/tomcat_keystore | Bin 0 -> 4943 bytes .../rproxy/config/auth/uri-authorization.json | 99 +++++++ .../resources/rproxy/config/cadi.properties | 39 +++ .../rproxy/config/forward-proxy.properties | 4 + .../resources/rproxy/config/logback-spring.xml | 48 ++++ .../rproxy/config/primary-service.properties | 3 + .../resources/rproxy/config/readme.txt | 1 + .../rproxy/config/reverse-proxy.properties | 1 + .../resources/rproxy/config/security/keyfile | 27 ++ 18 files changed, 571 insertions(+) create mode 100644 charts/aai-resources/resources/config/auth/aai_policy.json create mode 100644 charts/aai-resources/resources/fproxy/config/auth/client-cert.p12 create mode 100644 charts/aai-resources/resources/fproxy/config/auth/fproxy_truststore create mode 100644 charts/aai-resources/resources/fproxy/config/auth/tomcat_keystore create mode 100644 charts/aai-resources/resources/fproxy/config/fproxy.properties create mode 100644 charts/aai-resources/resources/fproxy/config/logback-spring.xml create mode 100644 charts/aai-resources/resources/fproxy/config/readme.txt create mode 100644 charts/aai-resources/resources/rproxy/config/auth/client-cert.p12 create mode 100644 charts/aai-resources/resources/rproxy/config/auth/org.onap.aai.p12 create mode 100644 charts/aai-resources/resources/rproxy/config/auth/tomcat_keystore create mode 100644 charts/aai-resources/resources/rproxy/config/auth/uri-authorization.json create mode 100644 charts/aai-resources/resources/rproxy/config/cadi.properties create mode 100644 charts/aai-resources/resources/rproxy/config/forward-proxy.properties create mode 100644 charts/aai-resources/resources/rproxy/config/logback-spring.xml create mode 100644 charts/aai-resources/resources/rproxy/config/primary-service.properties create mode 100644 charts/aai-resources/resources/rproxy/config/readme.txt create mode 100644 charts/aai-resources/resources/rproxy/config/reverse-proxy.properties create mode 100644 charts/aai-resources/resources/rproxy/config/security/keyfile (limited to 'charts/aai-resources/resources') diff --git a/charts/aai-resources/resources/config/auth/aai_policy.json b/charts/aai-resources/resources/config/auth/aai_policy.json new file mode 100644 index 0000000..65f13ef --- /dev/null +++ b/charts/aai-resources/resources/config/auth/aai_policy.json @@ -0,0 +1,298 @@ +{ + "roles": [ + { + "name": "admin", + "functions": [ + { + "name": "actions", + "methods": [ + { + "name": "GET" + }, + { + "name": "DELETE" + }, + { + "name": "PUT" + } + ] + }, + { + "name": "servers", + "methods": [ + { + "name": "GET" + }, + { + "name": "DELETE" + }, + { + "name": "PUT" + } + ] + }, + { + "name": "cloudinfra", + "methods": [ + { + "name": "GET" + }, + { + "name": "DELETE" + }, + { + "name": "PUT" + } + ] + }, + { + "name": "cloud-infrastructure", + "methods": [ + { + "name": "GET" + }, + { + "name": "DELETE" + }, + { + "name": "PUT" + } + ] + }, + { + "name": "sdandc", + "methods": [ + { + "name": "GET" + }, + { + "name": "DELETE" + }, + { + "name": "PUT" + } + ] + }, + { + "name": "service-design-and-creation", + "methods": [ + { + "name": "GET" + }, + { + "name": "DELETE" + }, + { + "name": "PUT" + } + ] + }, + { + "name": "business", + "methods": [ + { + "name": "GET" + }, + { + "name": "DELETE" + }, + { + "name": "PUT" + } + ] + }, + { + "name": "network", + "methods": [ + { + "name": "GET" + }, + { + "name": "DELETE" + }, + { + "name": "PUT" + } + ] + }, + { + "name": "search", + "methods": [ + { + "name": "GET" + }, + { + "name": "POST" + } + ] + }, + { + "name": "util", + "methods": [ + { + "name": "GET" + } + ] + }, + { + "name": "license-management", + "methods": [ + { + "name": "GET" + }, + { + "name": "DELETE" + }, + { + "name": "PUT" + } + ] + }, + { + "name": "examples", + "methods": [ + { + "name": "GET" + } + ] + }, + { + "name": "resources", + "methods": [ + { + "name": "GET" + } + ] + }, + { + "name": "generateurl", + "methods": [ + { + "name": "GET" + } + ] + }, + { + "name": "bulkadd", + "methods": [ + { + "name": "PUT" + } + ] + }, + { + "name": "nodes", + "methods": [ + { + "name": "GET" + } + ] + }, + { + "name": "query", + "methods": [ + { + "name": "PUT" + } + ] + }, + { + "name": "dbquery", + "methods": [ + { + "name": "PUT" + } + ] + }, + { + "name": "bulk", + "methods": [ + { + "name": "POST" + } + ] + }, + { + "name": "bulkprocess", + "methods": [ + { + "name": "PUT" + } + ] + }, + { + "name": "recents", + "methods": [ + { + "name": "GET" + } + ] + }, + { + "name": "dsl", + "methods": [ + { + "name": "PUT" + } + ] + }, + { + "name": "common", + "methods": [ + { + "name": "GET" + }, + { + "name": "DELETE" + }, + { + "name": "PUT" + } + ] + } + ], + "users": [ + { + "username": "CN=aai, OU=OSAAF, OU=aai@aai.onap.org, O=ONAP, C=US" + } + ] + }, + { + "name": "basicauth", + "functions": [ + { + "name": "util", + "methods": [ + { + "name": "GET" + } + ] + } + ], + "users": [ + { + "user": "aai", + "pass": "OBF:1u2a1t2v1vgb1s3g1s3m1vgj1t3b1u30" + } + ] + }, + { + "name": "HAProxy", + "functions": [ + { + "name": "util", + "methods": [ + { + "name": "GET" + } + ] + } + ], + "users": [ + { + "username": "CN=haproxyuser, OU=OSAAF, OU=aai@aai.onap.org, O=ONAP, C=US" + } + ] + } + ] +} diff --git a/charts/aai-resources/resources/fproxy/config/auth/client-cert.p12 b/charts/aai-resources/resources/fproxy/config/auth/client-cert.p12 new file mode 100644 index 0000000..d9fe86e Binary files /dev/null and b/charts/aai-resources/resources/fproxy/config/auth/client-cert.p12 differ diff --git a/charts/aai-resources/resources/fproxy/config/auth/fproxy_truststore b/charts/aai-resources/resources/fproxy/config/auth/fproxy_truststore new file mode 100644 index 0000000..f6ebc75 Binary files /dev/null and b/charts/aai-resources/resources/fproxy/config/auth/fproxy_truststore differ diff --git a/charts/aai-resources/resources/fproxy/config/auth/tomcat_keystore b/charts/aai-resources/resources/fproxy/config/auth/tomcat_keystore new file mode 100644 index 0000000..9eec841 Binary files /dev/null and b/charts/aai-resources/resources/fproxy/config/auth/tomcat_keystore differ diff --git a/charts/aai-resources/resources/fproxy/config/fproxy.properties b/charts/aai-resources/resources/fproxy/config/fproxy.properties new file mode 100644 index 0000000..f512fb7 --- /dev/null +++ b/charts/aai-resources/resources/fproxy/config/fproxy.properties @@ -0,0 +1,2 @@ +credential.cache.timeout.ms=180000 +transactionid.header.name=X-TransactionId \ No newline at end of file diff --git a/charts/aai-resources/resources/fproxy/config/logback-spring.xml b/charts/aai-resources/resources/fproxy/config/logback-spring.xml new file mode 100644 index 0000000..4fae434 --- /dev/null +++ b/charts/aai-resources/resources/fproxy/config/logback-spring.xml @@ -0,0 +1,48 @@ + + + + + + + + + + %d{ISO8601} %-5level [%t] %C{1.}: %msg%n%throwable + + + + + + ${LOGS}/${FILEPREFIX}.log + + %d %p %C{1.} [%t] %m%n + + + + + ${LOGS}/archived/${FILEPREFIX}-%d{yyyy-MM-dd}.%i.log + + + 10MB + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/charts/aai-resources/resources/fproxy/config/readme.txt b/charts/aai-resources/resources/fproxy/config/readme.txt new file mode 100644 index 0000000..79cf29e --- /dev/null +++ b/charts/aai-resources/resources/fproxy/config/readme.txt @@ -0,0 +1 @@ +Relevant configuration files need to be copied here to successfully run this service locally. \ No newline at end of file diff --git a/charts/aai-resources/resources/rproxy/config/auth/client-cert.p12 b/charts/aai-resources/resources/rproxy/config/auth/client-cert.p12 new file mode 100644 index 0000000..071d407 Binary files /dev/null and b/charts/aai-resources/resources/rproxy/config/auth/client-cert.p12 differ diff --git a/charts/aai-resources/resources/rproxy/config/auth/org.onap.aai.p12 b/charts/aai-resources/resources/rproxy/config/auth/org.onap.aai.p12 new file mode 100644 index 0000000..023e2ea Binary files /dev/null and b/charts/aai-resources/resources/rproxy/config/auth/org.onap.aai.p12 differ diff --git a/charts/aai-resources/resources/rproxy/config/auth/tomcat_keystore b/charts/aai-resources/resources/rproxy/config/auth/tomcat_keystore new file mode 100644 index 0000000..6ad5f51 Binary files /dev/null and b/charts/aai-resources/resources/rproxy/config/auth/tomcat_keystore differ diff --git a/charts/aai-resources/resources/rproxy/config/auth/uri-authorization.json b/charts/aai-resources/resources/rproxy/config/auth/uri-authorization.json new file mode 100644 index 0000000..e23c03d --- /dev/null +++ b/charts/aai-resources/resources/rproxy/config/auth/uri-authorization.json @@ -0,0 +1,99 @@ +[ + { + "uri": "\/not\/allowed\/at\/all$", + "permissions": [ + "test.auth.access.ifYouLikedItYouShouldHavePutAPermissionOnIt" + ] + }, + { + "uri": "\/one\/auth\/required$", + "permissions": [ + "test.auth.access.aSimpleSingleAuth" + ] + }, + { + "uri": "\/multi\/auth\/required$", + "permissions": [ + "test.auth.access.aMultipleAuth1", + "test.auth.access.aMultipleAuth2", + "test.auth.access.aMultipleAuth3" + ] + }, + { + "uri": "\/one\/[^\/]+\/required$", + "permissions": [ + "test.auth.access.aSimpleSingleAuth" + ] + }, + { + "uri": "\/services\/getAAFRequest$", + "permissions": [ + "test.auth.access|services|GET,PUT" + ] + }, + { + "uri": "\/admin\/getAAFRequest$", + "permissions": [ + "test.auth.access|admin|GET,PUT,POST" + ] + }, + { + "uri": "\/service\/aai\/webapp\/index.html$", + "permissions": [ + "test.auth.access|services|GET,PUT" + ] + }, + { + "uri": "\/services\/aai\/webapp\/index.html$", + "permissions": [ + "test.auth.access|services|GET,PUT" + ] + }, + { + "uri": "\/$", + "permissions": [ + "\\|services\\|GET", + "test\\.auth\\.access\\|services\\|GET,PUT" + ] + }, + { + "uri": "\/aai\/v10\/cloud-infrastructure\/cloud-regions$", + "permissions": [ + "test\\.auth\\.access\\|rest\\|read" + ] + }, + { + "uri": "\/aai\/v10\/cloud-infrastructure\/cloud-regions\/cloud-region\/[^\/]+[\/][^\/]+$*", + "permissions": [ + "test.auth.access|clouds|read", + "test.auth.access|tenants|read" + ] + }, + { + "uri": "\/aai\/v10\/cloud-infrastructure\/cloud-regions\/cloud-region\/[^\/]+[\/][^\/]+\/tenants/tenant/[^\/]+/vservers/vserver/[^\/]+$", + "permissions": [ + "test.auth.access|clouds|read", + "test.auth.access|tenants|read", + "test.auth.access|vservers|read" + ] + }, + { + "uri": "\/backend$", + "permissions": [ + "test\\.auth\\.access\\|services\\|GET,PUT", + "\\|services\\|GET" + ] + }, + { + "uri": "\/aai\/.*", + "permissions": [ + "org\\.onap\\.aai\\.resources\\|\\*\\|.*" + ] + }, + { + "uri": "\/aai\/util\/echo", + "permissions": [ + "org\\.onap\\.aai\\.resources\\|\\*\\|.*" + ] + } +] diff --git a/charts/aai-resources/resources/rproxy/config/cadi.properties b/charts/aai-resources/resources/rproxy/config/cadi.properties new file mode 100644 index 0000000..c2b628d --- /dev/null +++ b/charts/aai-resources/resources/rproxy/config/cadi.properties @@ -0,0 +1,39 @@ +# This is a normal Java Properties File +# Comments are with Pound Signs at beginning of lines, +# and multi-line expression of properties can be obtained by backslash at end of line + +#hostname is used for local testing where you may have to set your hostname to **.att.com or **.sbc.com. The example given below +#will allow for an ATT cross domain cookie to be used for GLO. If you are running on Windows corp machine, your machine name +#may be used automatically by cadi. However, if it is not, you will need to use hostname=mywebserver.att.com and add mywebserver.att.com +#to your hosts file on your machine. +#hostname=test.aic.cip.att.com + +cadi_loglevel=DEBUG + +# OAuth2 +aaf_oauth2_token_url=https://AAF_LOCATE_URL/AAF_NS.token:2.0/token +aaf_oauth2_introspect_url=https://AAF_LOCATE_URL/AAF_NS.introspect:2.0/introspect + +cadi_latitude=37.78187 +cadi_longitude=-122.26147 + +# Locate URL (which AAF Env) +aaf_locate_url=https://aaf-locate.{{.Release.Namespace}}:8095 + +# AAF URL +aaf_url=https://AAF_LOCATE_URL/AAF_NS.service:2.0 + +cadi_keyfile=/opt/app/rproxy/config/security/keyfile +cadi_keystore=/opt/app/rproxy/config/auth/org.onap.aai.p12 +cadi_keystore_password=enc:383RDJRFA6yQz9AOxUxC1iIg3xTJXityw05MswnpnEtelRQy2D4r5INQjrea7GTV +cadi_alias=aai@aai.onap.org +cadi_truststore=/opt/app/rproxy/config/auth/tomcat_keystore +cadi_truststore_password=OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10 + +aaf_env=DEV + +aaf_id=demo@people.osaaf.org +aaf_password=enc:92w4px0y_rrm265LXLpw58QnNPgDXykyA1YTrflbAKz + +# This is a colon separated list of client cert issuers +cadi_x509_issuers=CN=ONAP, OU=ONAP, O=ONAP, L=Ottawa, ST=Ontario, C=CA diff --git a/charts/aai-resources/resources/rproxy/config/forward-proxy.properties b/charts/aai-resources/resources/rproxy/config/forward-proxy.properties new file mode 100644 index 0000000..1b58d42 --- /dev/null +++ b/charts/aai-resources/resources/rproxy/config/forward-proxy.properties @@ -0,0 +1,4 @@ +forward-proxy.protocol = https +forward-proxy.host = localhost +forward-proxy.port = 10680 +forward-proxy.cacheurl = /credential-cache \ No newline at end of file diff --git a/charts/aai-resources/resources/rproxy/config/logback-spring.xml b/charts/aai-resources/resources/rproxy/config/logback-spring.xml new file mode 100644 index 0000000..57bc4e2 --- /dev/null +++ b/charts/aai-resources/resources/rproxy/config/logback-spring.xml @@ -0,0 +1,48 @@ + + + + + + + + + + %d{ISO8601} %-5level [%t] %C{1.}: %msg%n%throwable + + + + + + ${LOGS}/${FILEPREFIX}.log + + %d %p %C{1.} [%t] %m%n + + + + + ${LOGS}/archived/${FILEPREFIX}-%d{yyyy-MM-dd}.%i.log + + + 10MB + + + + + + + + + + + + + + + + + diff --git a/charts/aai-resources/resources/rproxy/config/primary-service.properties b/charts/aai-resources/resources/rproxy/config/primary-service.properties new file mode 100644 index 0000000..2c89d28 --- /dev/null +++ b/charts/aai-resources/resources/rproxy/config/primary-service.properties @@ -0,0 +1,3 @@ +primary-service.protocol = https +primary-service.host = localhost +primary-service.port = 8447 diff --git a/charts/aai-resources/resources/rproxy/config/readme.txt b/charts/aai-resources/resources/rproxy/config/readme.txt new file mode 100644 index 0000000..79cf29e --- /dev/null +++ b/charts/aai-resources/resources/rproxy/config/readme.txt @@ -0,0 +1 @@ +Relevant configuration files need to be copied here to successfully run this service locally. \ No newline at end of file diff --git a/charts/aai-resources/resources/rproxy/config/reverse-proxy.properties b/charts/aai-resources/resources/rproxy/config/reverse-proxy.properties new file mode 100644 index 0000000..8d46e1f --- /dev/null +++ b/charts/aai-resources/resources/rproxy/config/reverse-proxy.properties @@ -0,0 +1 @@ +transactionid.header.name=X-TransactionId \ No newline at end of file diff --git a/charts/aai-resources/resources/rproxy/config/security/keyfile b/charts/aai-resources/resources/rproxy/config/security/keyfile new file mode 100644 index 0000000..3416d4a --- /dev/null +++ b/charts/aai-resources/resources/rproxy/config/security/keyfile @@ -0,0 +1,27 @@ +2otP92kNFHdexroZxvgYY7ffslFiwCD3CiVYMIfUF2edqZK7972NwkvE_mbaBo6jh8lByLIqrWAf +jyzoiVsvQ_kCa0cS1xaRLpcxv3bx1b7o3hGPBqpd6vmSG4y2JLzNlCBZWuTJz827wr8p_fWrYuUm +4L1WoaEe8W5PRnXjl4hDqbJBAlEoRIBXugUDt_7O5wgx2Rl3HVoOczZtf0RzONZ1F0BmKf3QlAUe +moSbARitYRgIPt5sLbT7qPyoEpGDhQ1XBowR744-wsjBc-14yO62Ajp5xWKTp15uWn3_HHuw1SAf +GWSBRGlSlEVkXQqi9Hw5jDttKVzHX1ckwR0SQOirbtHPHplxPX3WKjKhSdSeMzw6LOAHIQYRMKBT +74oGnULAfPtV7TaGwOKriT3P49C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