Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
andreamargheri committed Dec 13, 2017
1 parent 02908fb commit 9e140e5
Show file tree
Hide file tree
Showing 16 changed files with 4,931 additions and 0 deletions.
8 changes: 8 additions & 0 deletions install/ds-infrastructure/attributes/attribute-birthday.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<AttributeDesignator xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd"
Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"
AttributeId="urn:oasis:names:tc:xacml:2.0:conformance-test:attribute-birthday"
DataType="http://www.w3.org/2001/XMLSchema#date" MustBePresent="false"/>
8 changes: 8 additions & 0 deletions install/ds-infrastructure/attributes/attribute-body-data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<AttributeDesignator xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd"
Category="urn:sunfish:attribute-category:request"
AttributeId="urn:sunfish:attribute:request:body-data"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<AttributeDesignator xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd"
Category="urn:sunfish:attribute-category:request"
AttributeId="urn:sunfish:attribute:request:content-type"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<AttributeDesignator xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd"
Category="urn:sunfish:attribute-category:request"
AttributeId="urn:sunfish:attribute:request:header-parameter"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
8 changes: 8 additions & 0 deletions install/ds-infrastructure/attributes/attribute-pep.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<AttributeDesignator xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd"
Category="urn:sunfish:attribute-category:pep"
AttributeId="urn:sunfish:attribute:service:pep"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<AttributeDesignator xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd"
Category="urn:sunfish.attribute-category:response"
AttributeId="urn:sunfish:attribute:response:body-data"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<AttributeDesignator xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd"
Category="urn:sunfish:attribute-category:response"
AttributeId="urn:sunfish:attribute:response:content-type"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<AttributeDesignator xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd"
Category="urn:sunfish:attribute-category:response"
AttributeId="urn:sunfish:attribute:response:header-parameter"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
8 changes: 8 additions & 0 deletions install/ds-infrastructure/attributes/attribute-sample.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<AttributeDesignator xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd"
Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"
AttributeId="urn:oasis:names:tc:xacml:2.0:conformance-test:sample-attribute"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<AttributeDesignator xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd"
Category="urn:sunfish:attribute-category:target"
AttributeId="urn:sunfish:attribute:target:zone"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<AttributeDesignator xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd"
Category="urn:sunfish:attribute-category:target"
AttributeId="urn:sunfish:attribute:target:host"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<AttributeDesignator xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd"
Category="urn:sunfish:attribute-category:request"
AttributeId="urn:sunfish:attribute:request:url-parameter"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
28 changes: 28 additions & 0 deletions install/ds-infrastructure/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

TOMCAT_PORT=8080

# PAP Config
#**********************************************
PAP_URL_RI="http://localhost:8080/ri/mocked"


# PDP Config
#**********************************************
# All possible PRPs (seperated by comma)
PDP_URLS_PRPS="http://localhost:8080/prp/v1"
# All possible PIPs (seperated by comma)
PDP_URLS_PIPS="http://localhost:8080/pip/v1"


# PRP Config
#**********************************************
PRP_MAX_THREADS=8
PRP_MAX_POLICY_COUNT=1000
PRP_URL_RI="http://localhost:8080/ri/mocked"


# PIP Database
#**********************************************
declare -A PIP_DATABASE
PIP_DATABASE["sample.entry"]="test"
105 changes: 105 additions & 0 deletions install/ds-infrastructure/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#!/bin/bash

source config.sh

CONTAINER=`docker run -it -d -p 8080:$TOMCAT_PORT sunfish:infra /bin/sh`
INFRA_IP=`docker inspect -f '{{ .NetworkSettings.IPAddress }}' $CONTAINER`
SUNFISH_CONF=/usr/local/tomcat/conf/sunfish/

PROXY_HOME=/usr/local/tomcat/


echo " *********************************"
echo " Welcome to the SUNFISH Installer!"
echo " *********************************"
echo
echo "-----------------------------------------------------------------------------------------"
echo "Container $CONTAINER up and running"
echo "set the following IP for the tenant: $INFRA_IP"
read -p "hit return when done"
echo "-----------------------------------------------------------------------------------------"
echo

function createPAPConf {


echo "ri = $PAP_URL_RI" > pap.config
docker cp pap.config $CONTAINER:$SUNFISH_CONF
echo "PAP Config"
}


function createPDPConf {

echo "prps = $PDP_URLS_PRPS" > pdp.config
echo "pips = $PDP_URLS_PIPS" >> pdp.config
docker cp pdp.config $CONTAINER:$SUNFISH_CONF
echo "PDP Config"
}

function createPRPConf {


echo "maxThreads = $PRP_MAX_THREADS" > prp.config
echo "maxPolicyCount = $PRP_MAX_POLICY_COUNT" >> prp.config
echo "ri = $PRP_URL_RI" >> prp.config
docker cp prp.config $CONTAINER:$SUNFISH_CONF

echo "PRP Config"
}

function copyPIPAttributes {

docker cp attributes $CONTAINER:$SUNFISH_CONF/pip

echo "PIP Attributes"
}

function createPIPDatabase {

for entry in "${!PIP_DATABASE[@]}"; do echo "$entry = ${PIP_DATABASE[$entry]}" >> pip_database.config; done

docker cp pip_database.config $CONTAINER:$SUNFISH_CONF/pip/database

}


function createRIConf {

echo "rootPolicy.dir = $SUNFISH_CONF/ri" >> ri.config
docker exec $CONTAINER mkdir /usr/local/tomcat/conf/sunfish/ri
docker cp ri.config $CONTAINER:$SUNFISH_CONF/ri.config


}

function copyProxyFilter {

docker cp dependencies/ProxyFilter-0.0.1-SNAPSHOT.jar $CONTAINER:$PROXY_HOME/lib
docker cp dependencies/commons-io-1.3.2.jar $CONTAINER:$PROXY_HOME/lib
docker cp dependencies/json-20170516.jar $CONTAINER:$PROXY_HOME/lib
docker cp dependencies/json-simple-1.1.jar $CONTAINER:$PROXY_HOME/lib
docker cp dependencies/httpclient-4.5.3.jar $CONTAINER:$PROXY_HOME/lib
docker cp dependencies/httpcore-4.4.6.jar $CONTAINER:$PROXY_HOME/lib
docker cp dependencies/commons-logging-1.1.1.jar $CONTAINER:$PROXY_HOME/lib
docker cp dependencies/jdom-2.0.2.jar $CONTAINER:$PROXY_HOME/lib
docker cp dependencies/commons-codec-1.10.jar $CONTAINER:$PROXY_HOME/lib
docker cp web.xml $CONTAINER:$PROXY_HOME/conf
docker cp params.json $CONTAINER:$PROXY_HOME/conf
echo "ProxyFilter setup"
}

createPAPConf
createPDPConf
createPRPConf
createRIConf
copyPIPAttributes
createPIPDatabase
copyProxyFilter

rm pap.config pdp.config pip_database.config prp.config ri.config

docker exec -it $CONTAINER /usr/local/tomcat/bin/catalina.sh run

#docker kill $CONTAINER

9 changes: 9 additions & 0 deletions install/ds-infrastructure/params.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"loggerID":"PDP",
"ServerIP":"172.16.22.139",
"Port":"8089",
"Path":"sli/monitoring/store",
"requestorID":"TODO",
"token":"TODO",
"dataType":"REQUEST"
}
Loading

0 comments on commit 9e140e5

Please sign in to comment.