Add template allowing to create a distribution in which sensiNact internal security is enabled
diff --git a/distribution/generator/pom.xml b/distribution/generator/pom.xml
index ca58072..42a64d7 100644
--- a/distribution/generator/pom.xml
+++ b/distribution/generator/pom.xml
@@ -67,7 +67,24 @@
 						</configuration>
 					</execution>
 					<execution>
-						<id>copy-dependencies-profile1</id>
+						<id>copy-sensinact-distribution-with-security</id>
+						<phase>package</phase>
+						<goals>
+							<goal>unpack</goal>
+						</goals>
+						<configuration>
+							<artifactItems>
+								<artifactItem>
+									<type>zip</type>
+									<groupId>org.eclipse.sensinact.gateway.distribution</groupId>
+									<artifactId>sensinact-distribution-template-with-security</artifactId>
+									<outputDirectory>${project.build.directory}/</outputDirectory>
+								</artifactItem>
+							</artifactItems>
+						</configuration>
+					</execution>
+					<execution>
+						<id>copy-dependencies-bundle1</id>
 						<phase>package</phase>
 						<goals>
 							<goal>copy</goal>
@@ -131,9 +148,81 @@
 							</artifactItems>
 							<outputDirectory>${project.build.directory}/dependencies/bundle/1</outputDirectory>
 						</configuration>
+					</execution>					
+					<execution>
+						<id>copy-dependencies-with-security-bundle1</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy</goal>
+						</goals>
+						<configuration>
+							<artifactItems>
+								<artifactItem>
+									<groupId>org.apache.felix</groupId>
+									<artifactId>org.apache.felix.framework.security</artifactId>
+									<type>jar</type>
+									<overWrite>true</overWrite>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.eclipse.sensinact.gateway</groupId>
+									<artifactId>sensinact-framework-extension</artifactId>
+									<type>jar</type>
+									<overWrite>true</overWrite>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.apache.felix</groupId>
+									<artifactId>org.apache.felix.gogo.runtime</artifactId>
+									<type>jar</type>
+									<overWrite>true</overWrite>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.apache.felix</groupId>
+									<artifactId>org.apache.felix.gogo.command</artifactId>
+									<type>jar</type>
+									<overWrite>true</overWrite>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.jline</groupId>
+									<artifactId>jline</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.fusesource.jansi</groupId>
+									<artifactId>jansi</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.apache.felix</groupId>
+									<artifactId>org.apache.felix.gogo.jline</artifactId>
+									<type>jar</type>
+									<overWrite>true</overWrite>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.slf4j</groupId>
+									<artifactId>slf4j-api</artifactId>
+									<type>jar</type>
+									<overWrite>true</overWrite>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.slf4j</groupId>
+									<artifactId>slf4j-simple</artifactId>
+									<type>jar</type>
+									<overWrite>true</overWrite>
+								</artifactItem>
+								<artifactItem>
+									<groupId>ch.qos.logback</groupId>
+									<artifactId>logback-classic</artifactId>
+									<overWrite>true</overWrite>
+								</artifactItem>
+								<artifactItem>
+									<groupId>ch.qos.logback</groupId>
+									<artifactId>logback-core</artifactId>
+									<overWrite>true</overWrite>
+								</artifactItem>
+							</artifactItems>
+							<outputDirectory>${project.build.directory}/dependencies-with-security/bundle/1</outputDirectory>
+						</configuration>
 					</execution>
 					<execution>
-						<id>copy-dependencies-profile2</id>
+						<id>copy-dependencies-bundle2</id>
 						<phase>package</phase>
 						<goals>
 							<goal>copy</goal>
@@ -223,7 +312,105 @@
 						</configuration>
 					</execution>
 					<execution>
-						<id>ext-copy-dependencies-profile3</id>
+						<id>copy-dependencies-with-security-bundle2</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy</goal>
+						</goals>
+						<configuration>
+							<artifactItems>
+								<artifactItem>
+									<groupId>org.eclipse.sensinact.gateway.sthbnd.mqtt</groupId>
+									<artifactId>mqtt-utils</artifactId>
+									<type>jar</type>
+									<overWrite>true</overWrite>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.eclipse.sensinact.gateway.tools</groupId>
+									<artifactId>mixed-osgi-over-slf4j</artifactId>
+									<type>jar</type>
+									<overWrite>true</overWrite>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.apache.felix</groupId>
+									<artifactId>org.apache.felix.fileinstall</artifactId>
+									<type>jar</type>
+									<overWrite>true</overWrite>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.apache.felix</groupId>
+									<artifactId>org.apache.felix.configadmin</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.osgi</groupId>
+									<artifactId>org.osgi.service.component</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.osgi</groupId>
+									<artifactId>org.osgi.service.cm</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.osgi</groupId>
+									<artifactId>org.osgi.service.metatype</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.osgi</groupId>
+									<artifactId>org.osgi.namespace.extender</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.osgi</groupId>
+									<artifactId>org.osgi.util.promise</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.osgi</groupId>
+									<artifactId>org.osgi.util.function</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.osgi</groupId>
+									<artifactId>org.osgi.util.pushstream</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.osgi</groupId>
+									<artifactId>org.osgi.service.log</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.apache.felix</groupId>
+									<artifactId>org.apache.felix.log</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.apache.felix</groupId>
+									<artifactId>org.apache.felix.bundlerepository</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.apache.felix</groupId>
+									<artifactId>org.apache.felix.scr</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.osgi</groupId>
+									<artifactId>org.osgi.service.component</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.osgi</groupId>
+									<artifactId>org.osgi.service.remoteserviceadmin</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.eclipse.paho</groupId>
+									<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.apache.felix</groupId>
+									<artifactId>org.apache.felix.http.servlet-api</artifactId>
+								</artifactItem>
+								<artifactItem>									
+									<groupId>org.apache.aries.spec</groupId>
+					    			<artifactId>org.apache.aries.javax.jax.rs-api</artifactId>
+								</artifactItem>
+							</artifactItems>
+							<outputDirectory>${project.build.directory}/dependencies-with-security/bundle/2</outputDirectory>
+						</configuration>
+					</execution>
+					<execution>
+						<id>ext-copy-dependencies-bundle3</id>
 						<phase>package</phase>
 						<goals>
 							<goal>copy</goal>
@@ -281,7 +468,69 @@
 						</configuration>
 					</execution>
 					<execution>
-						<id>copy-dependencies-profile4</id>
+						<id>ext-copy-dependencies-with-security-bundle3</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy</goal>
+						</goals>
+						<configuration>
+							<artifactItems>
+								<artifactItem>
+								    <groupId>org.slf4j</groupId>
+								    <artifactId>osgi-over-slf4j</artifactId>
+									<type>jar</type>
+									<overWrite>true</overWrite>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.eclipse.sensinact.gateway</groupId>
+									<artifactId>sensinact-utils</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.eclipse.sensinact.gateway</groupId>
+									<artifactId>sensinact-common</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.eclipse.sensinact.gateway</groupId>
+									<artifactId>sensinact-datastore-api</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.eclipse.sensinact.gateway</groupId>
+									<artifactId>sensinact-sqlite-connector</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.eclipse.sensinact.gateway</groupId>
+									<artifactId>sensinact-signature-validator</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.eclipse.sensinact.gateway</groupId>
+									<artifactId>sensinact-security-core</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.eclipse.sensinact.gateway</groupId>
+									<artifactId>sensinact-core</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.eclipse.sensinact.gateway</groupId>
+									<artifactId>sensinact-generic</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.eclipse.sensinact.gateway</groupId>
+									<artifactId>sensinact-shell</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.eclipse.sensinact.gateway</groupId>
+									<artifactId>sensinact-system</artifactId>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.eclipse.sensinact.gateway.nthbnd</groupId>
+									<artifactId>sensinact-northbound-access</artifactId>
+								</artifactItem>
+							</artifactItems>
+							<outputDirectory>${project.build.directory}/dependencies-with-security/bundle/3</outputDirectory>
+						</configuration>
+					</execution>					
+					<execution>
+						<id>copy-dependencies-bundle4</id>
 						<phase>package</phase>
 						<goals>
 							<goal>copy</goal>
@@ -336,6 +585,34 @@
 						</configuration>
 					</execution>
 					<execution>
+						<id>copy-resources-merge-with-security</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy-resources</goal>
+						</goals>
+						<configuration>
+							<outputDirectory>${project.build.directory}/sensinact-with-security</outputDirectory>
+							<resources>
+								<resource>
+									<directory>${project.build.directory}/sensinact-distribution-template-with-security-${project.version}/</directory>
+									<filtering>false</filtering>
+									<includes>
+										<include>**/*</include>
+									</includes>
+								</resource>
+								<resource>
+									<directory>${project.build.directory}/sensinact-distribution-template-with-security-${project.version}/</directory>
+									<filtering>true</filtering>
+									<includes>
+										<include>sensinact</include>
+										<include>info.txt</include>
+										<include>conf/config.properties</include>
+									</includes>
+								</resource>
+							</resources>
+						</configuration>
+					</execution>
+					<execution>
 						<id>copy-resources</id>
 						<phase>package</phase>
 						<goals>
@@ -361,6 +638,31 @@
 						</configuration>
 					</execution>
 					<execution>
+						<id>copy-resources-with-security</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy-resources</goal>
+						</goals>
+						<configuration>
+							<outputDirectory>${project.build.directory}/sensinact-with-security</outputDirectory>
+							<resources>
+								<resource>
+									<directory>${project.build.directory}/felix-framework-${org.apache.felix.version}/</directory>
+									<filtering>false</filtering>
+									<excludes>
+										<exclude>bundle/</exclude>
+										<exclude>doc/</exclude>
+										<exclude>conf/</exclude>
+										<exclude>DEPENDENCIES</exclude>
+										<exclude>LICENSE</exclude>
+										<exclude>LICENSE.kxml2</exclude>
+										<exclude>NOTICE</exclude>
+									</excludes>
+								</resource>
+							</resources>
+						</configuration>
+					</execution>
+					<execution>
 						<id>copy-resources-dep</id>
 						<phase>package</phase>
 						<goals>
@@ -376,6 +678,38 @@
 							</resources>
 						</configuration>
 					</execution>
+					<execution>
+						<id>copy-resources-dep-with-security</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy-resources</goal>
+						</goals>
+						<configuration>
+							<outputDirectory>${project.build.directory}/sensinact-with-security/</outputDirectory>
+							<resources>
+								<resource>
+									<directory>${project.build.directory}/dependencies-with-security/</directory>
+									<filtering>false</filtering>
+								</resource>
+							</resources>
+						</configuration>
+					</execution>
+					<execution>
+						<id>copy-resources-dep-with-security-bundle4</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy-resources</goal>
+						</goals>
+						<configuration>
+							<outputDirectory>${project.build.directory}/sensinact-with-security/bundle/4/</outputDirectory>
+							<resources>
+								<resource>
+									<directory>${project.build.directory}/dependencies/bundle/4/</directory>
+									<filtering>false</filtering>
+								</resource>
+							</resources>
+						</configuration>
+					</execution>
 				</executions>
 			</plugin>
 		</plugins>
diff --git a/distribution/generator/profile/pom.xml b/distribution/generator/profile/pom.xml
index 33ed4d3..4edea2d 100644
--- a/distribution/generator/profile/pom.xml
+++ b/distribution/generator/profile/pom.xml
@@ -50,6 +50,11 @@
 			<artifactId>sensinact-distribution-template</artifactId>
 			<type>pom</type>
 		</dependency>
+		<dependency>
+			<groupId>org.eclipse.sensinact.gateway.distribution</groupId>
+			<artifactId>sensinact-distribution-template-with-security</artifactId>
+			<type>pom</type>
+		</dependency>
 	</dependencies>
 
 	<build>
@@ -74,8 +79,60 @@
 							</resources>
 						</configuration>
 					</execution>
+					<execution>
+						<id>copy-resources-this-build-with-security</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy-resources</goal>
+						</goals>
+						<configuration>
+							<outputDirectory>${project.build.directory}/../../../target/sensinact-with-security</outputDirectory>
+							<resources>
+								<resource>
+									<directory>${project.build.directory}/sensinact/</directory>
+									<filtering>false</filtering>
+								</resource>
+							</resources>
+						</configuration>
+					</execution>
 				</executions>
-			</plugin>
+			</plugin>			
+            <plugin>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <inherited>false</inherited>
+                <executions>
+                    <execution>
+                        <id>copy-dependencies</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/sensinact/load/${project.artifactId}</outputDirectory>
+                            <excludeArtifactIds>${excludeArtifactId}</excludeArtifactIds>
+                            <excludeGroupIds>${excludeGroupId}</excludeGroupIds>
+                            <excludeTransitive>${excludeTransitive}</excludeTransitive>
+                            <excludeTypes>pom</excludeTypes>
+                        </configuration>
+                        <inherited>false</inherited>
+                    </execution>                    
+                    <execution>
+                        <id>copy-dependencies-with-security</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/sensinact-with-security/load/${project.artifactId}</outputDirectory>
+                            <excludeArtifactIds>${excludeArtifactId}</excludeArtifactIds>
+                            <excludeGroupIds>${excludeGroupId}</excludeGroupIds>
+                            <excludeTransitive>${excludeTransitive}</excludeTransitive>
+                            <excludeTypes>pom</excludeTypes>
+                        </configuration>
+                        <inherited>false</inherited>
+                    </execution>
+                </executions>
+            </plugin>
 		</plugins>
 	</build>
 
diff --git a/distribution/generator/profile/swagger-profile/pom.xml b/distribution/generator/profile/swagger-profile/pom.xml
index 069b080..6e84861 100644
--- a/distribution/generator/profile/swagger-profile/pom.xml
+++ b/distribution/generator/profile/swagger-profile/pom.xml
@@ -54,29 +54,4 @@
         </dependency>
     </dependencies>
 
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <inherited>false</inherited>
-                <executions>
-                    <execution>
-                        <id>copy-dependencies</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>copy-dependencies</goal>
-                        </goals>
-                        <configuration>
-                            <outputDirectory>${project.build.directory}/sensinact/load/${project.artifactId}</outputDirectory>
-                            <excludeArtifactIds>${excludeArtifactId}</excludeArtifactIds>
-                            <excludeGroupIds>${excludeGroupId}</excludeGroupIds>
-                            <excludeTransitive>${excludeTransitive}</excludeTransitive>
-                            <excludeTypes>pom</excludeTypes>
-                        </configuration>
-                        <inherited>false</inherited>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
 </project>
diff --git a/distribution/pom.xml b/distribution/pom.xml
index 15161f0..c5fee8d 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -30,6 +30,7 @@
     <modules>
         <module>generator</module>
         <module>template</module>
+        <module>template-with-security</module>
         <module>archetypes</module>
     </modules>
 </project>
diff --git a/distribution/template-with-security/conf/all.policy b/distribution/template-with-security/conf/all.policy
new file mode 100644
index 0000000..75b23cf
--- /dev/null
+++ b/distribution/template-with-security/conf/all.policy
@@ -0,0 +1,11 @@
+grant codeBase "file:bin/felix.jar" {
+  permission java.security.AllPermission;
+};
+
+grant codeBase "http://felix.extensions:9/" {
+  permission java.security.AllPermission;
+};
+
+grant codeBase "file:bundle/" {
+  permission java.security.AllPermission;
+};
\ No newline at end of file
diff --git a/distribution/template-with-security/conf/config.properties b/distribution/template-with-security/conf/config.properties
new file mode 100644
index 0000000..1e1f7fa
--- /dev/null
+++ b/distribution/template-with-security/conf/config.properties
@@ -0,0 +1,315 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#
+# Framework config properties.
+# (This version will be interpolated)
+
+# To override the packages the framework exports by default from the
+# class path, set this variable.
+#org.osgi.framework.system.packages=
+
+# To append packages to the default set of exported system packages,
+# set this value.#
+org.osgi.framework.system.packages.extra=\
+ com.sun.net.httpserver,\
+ sun.security.action,\
+ javax.annotation.meta,\
+ javax.smartcardio,\
+ javax.net.ssl,\
+ javax.mail, \
+ javax.microedition.io, \
+ javax.mail.internet, \
+ javax.persistence, \
+ com.google.common.base, \
+ sun.misc
+
+org.osgi.framework.system.capabilities=\
+osgi.ee;osgi.ee:List="JavaSE,JavaSE/compact1";version:List="1.0,1.0.0,1.1,1.1.0,1.2,1.2.0,1.3,1.3.0,1.4, 1.4.0,1.5,1.5.0,1.6,1.6.0,1.7,1.7.0,1.8,1.8.0"
+
+# The following property makes specified packages from the class path
+# available to all bundles. You should avoid using this property.
+#org.osgi.framework.bootdelegation=sun.*,com.sun.*,javax.net.*
+
+# Felix tries to guess when to implicitly boot delegate in certain
+# situations to ease integration without outside code. This feature
+# is enabled by default, uncomment the following line to disable it.
+#felix.bootdelegation.implicit=false
+
+# The following property explicitly specifies the location of the bundle
+# cache, which defaults to "felix-cache" in the current working directory.
+# If this value is not absolute, then the felix.cache.rootdir controls
+# how the absolute location is calculated. (See next property)
+#org.osgi.framework.storage=${felix.cache.rootdir}/felix-cache
+
+# The following property is used to convert a relative bundle cache
+# location into an absolute one by specifying the root to prepend to
+# the relative cache path. The default for this property is the
+# current working directory.
+#felix.cache.rootdir=/home/christophe/workspace-200328/sensinact_master_20190625
+
+# The following property controls whether the bundle cache is flushed
+# the first time the framework is initialized. Possible values are
+# "none" and "onFirstInit"; the default is "none".
+org.osgi.framework.storage.clean=onFirstInit
+
+# The following property determines which actions are performed when
+# processing the auto-deploy directory. It is a comma-delimited list of
+# the following values: 'install', 'start', 'update', and 'uninstall'.
+# An undefined or blank value is equivalent to disabling auto-deploy
+# processing.
+felix.auto.deploy.action=install,start
+
+# The following property specifies the directory to use as the bundle
+# auto-deploy directory; the default is 'bundle' in the working directory.
+#felix.auto.deploy.dir=bundle
+
+# The following property is a space-delimited list of bundle URLs
+# to install when the framework starts. The ending numerical component
+# is the target start level. Any number of these properties may be
+# specified for different start levels.
+#felix.auto.install.1=
+
+# The following property is a space-delimited list of bundle URLs
+# to install and start when the framework starts. The ending numerical
+# component is the target start level. Any number of these properties
+# may be specified for different start levels.
+#  file:bundle/1/org.apache.felix.gogo.shell-${gogo.version}.jar \
+
+
+felix.auto.install.1= \
+  file:bundle/1/slf4j-simple-${slf4j.simple.version}.jar
+  
+felix.auto.start.1= \
+  file:bundle/1/logback-classic-${logback.version}.jar \
+  file:bundle/1/logback-core-${logback.version}.jar \
+  file:bundle/1/jline-${org.jline.version}.jar \
+  file:bundle/1/jansi-${org.fusesource.jansi.version}.jar \
+  file:bundle/1/org.apache.felix.framework.security-${org.apache.felix.framework.security.version}.jar \
+  file:bundle/1/sensinact-framework-extension-${project.version}.jar \
+  file:bundle/1/org.apache.felix.gogo.runtime-${org.apache.felix.gogo.runtime.version}.jar \
+  file:bundle/1/org.apache.felix.gogo.command-${org.apache.felix.gogo.command.version}.jar \
+  file:bundle/1/org.apache.felix.gogo.jline-${org.apache.felix.gogo.jline.version}.jar \
+  file:bundle/1/slf4j-api-${slf4j.version}.jar
+  
+felix.auto.install.2= \
+  file:bundle/2/org.apache.felix.http.servlet-api-${org.apache.felix.http.servlet-api.version}.jar \
+  file:bundle/2/org.apache.aries.javax.jax.rs-api-${org.apache.aries.jax.rs.version}.jar 
+  
+felix.auto.start.2= \
+  file:bundle/2/org.apache.felix.fileinstall-${org.apache.felix.fileinstall.version}.jar \
+  file:bundle/2/org.apache.felix.configadmin-${org.apache.felix.configadmin.version}.jar \
+  file:bundle/2/org.apache.felix.bundlerepository-${org.apache.felix.bundlerepository.version}.jar \
+  file:bundle/2/org.apache.felix.scr-${org.apache.felix.scr.version}.jar \
+  file:bundle/2/mixed-osgi-over-slf4j-${project.version}.jar \
+  file:bundle/2/org.osgi.service.component-${org.osgi.service.component.version}.jar \
+  file:bundle/2/org.osgi.service.remoteserviceadmin-${org.osgi.service.remoteserviceadmin.version}.jar \
+  file:bundle/2/org.osgi.util.function-${org.osgi.util.function.version}.jar \
+  file:bundle/2/org.osgi.util.promise-${org.osgi.util.promise.version}.jar \
+  file:bundle/2/org.osgi.util.pushstream-${org.osgi.util.pushstream.version}.jar \
+  file:bundle/2/mqtt-utils-${project.version}.jar \
+  file:bundle/2/org.eclipse.paho.client.mqttv3-${org.eclipse.paho.client.mqttv3.version}.jar \
+  file:bundle/2/org.apache.felix.log-${org.apache.felix.log.version}.jar \
+  file:bundle/2/org.osgi.namespace.extender-${org.osgi.namespace.extender.version}.jar \
+  file:bundle/2/org.osgi.service.cm-${org.osgi.service.cm.version}.jar \
+  file:bundle/2/org.osgi.service.log-${org.osgi.service.log.version}.jar \
+  file:bundle/2/org.osgi.service.metatype-${org.osgi.service.metatype.version}.jar
+  
+felix.auto.install.3= \
+  file:bundle/3/sensinact-common-${project.version}.jar \
+  file:bundle/3/sensinact-datastore-api-${project.version}.jar \
+  file:bundle/3/sensinact-sqlite-connector-${project.version}.jar \
+  file:bundle/3/sensinact-security-core-${project.version}.jar \
+  file:bundle/3/sensinact-utils-${project.version}.jar
+
+felix.auto.start.3= \
+  file:bundle/3/sensinact-core-${project.version}.jar \
+  file:bundle/3/sensinact-generic-${project.version}.jar \
+  file:bundle/3/sensinact-northbound-access-${project.version}.jar \
+  file:bundle/3/sensinact-shell-${project.version}.jar \
+  file:bundle/3/sensinact-signature-validator-${project.version}.jar \
+  file:bundle/3/sensinact-system-${project.version}.jar
+
+felix.auto.start.4= \
+  file:bundle/4/org.apache.felix.shell.remote-${org.apache.felix.shell.remote.version}.jar \
+  file:bundle/4/attributes-filter-${project.version}.jar
+  
+    
+felix.log.level=3
+
+# Sets the initial start level of the framework upon startup.
+org.osgi.framework.startlevel.beginning=5
+
+# Sets the start level of newly installed bundles.
+felix.startlevel.bundle=5
+
+# Felix installs a stream and content handler factories by default,
+# uncomment the following line to not install them.
+#felix.service.urlhandlers=false
+
+# The launcher registers a shutdown hook to cleanly stop the framework
+# by default, uncomment the following line to disable it.
+felix.shutdown.hook=false
+
+#
+# Apache Felix Log service config properties.
+#
+
+# The maximum size of the log history. A value of -1 means the log has
+# no maximum size; a value of 0 means that no historical information
+# is maintained. The default is '100'.
+org.apache.felix.log.maxSize=-1
+
+
+# Determines whether or not debug messages will be stored in the history.
+# The default is 'false'.
+org.apache.felix.log.storeDebug=false
+
+#
+# Apache Felix HTTP service config properties.
+#
+
+# Enable Jetty as the HTTP container. The default is false. Uncomment the
+# following line to enable it.
+org.apache.felix.http.jettyEnabled=true
+
+# Enable the whiteboard implementation. The default is false.
+org.apache.felix.http.whiteboardEnabled=true
+
+# Security management is turned on
+# org.osgi.framework.security=osgi
+
+#Flag to enable debugging for this service implementation. The default is false.
+org.apache.felix.http.debug=true
+#Host name or IP Address of the interface to listen on. The default is null causing
+# Jetty to listen on all interfaces.
+#org.apache.felix.http.host 
+
+#The port used for servlets and resources available via HTTP. The default is 8080. 
+#See port settings below for additional information. A negative port number has the same effect 
+#as setting org.apache.felix.http.enable to false.	
+org.osgi.service.http.port=8080
+	
+#The port used for servlets and resources available via HTTPS. The default is 8443. 
+#See port settings below for additional information. A negative port number has the same effect 
+#as setting org.apache.felix.https.enable to false.
+#org.osgi.service.http.port.secure=8443
+
+#The servlet Context Path to use for the Http Service. If this property is not configured it defaults 
+#to "/". This must be a valid path starting with a slash and not ending with a slash (unless it is the root context).
+#org.apache.felix.http.context_path 	
+
+#Connection timeout in milliseconds. The default is 60000 (60 seconds).
+#org.apache.felix.http.timeout
+ 	
+#Allows for the specification of the Session life time as a number of minutes. This property serves the 
+#same purpose as the session-timeout element in a Web Application descriptor. The default is "0" (zero) 
+#for no timeout at all.
+#org.apache.felix.http.session.timeout 	
+
+#Flag to enable the use of HTTP. The default is true.
+#org.apache.felix.http.enable=true	
+
+#Flag to enable the user of HTTPS. The default is false.
+#org.apache.felix.https.enable=true	
+
+#The name of the file containing the keystore.
+#org.apache.felix.https.keystore
+ 
+#The password for the keystore.	
+#org.apache.felix.https.keystore.password 
+	
+#The password for the key in the keystore.
+#org.apache.felix.https.keystore.key.password 
+	
+#The name of the file containing the truststore.
+#org.apache.felix.https.truststore 	
+
+#The type of truststore to use. The default is JKS.
+#org.apache.felix.https.truststore.type 	
+
+#The password for the truststore.
+#org.apache.felix.https.truststore.password 
+	
+#Flag to determine if the HTTPS protocol requires, wants or does not use client certificates. Legal values 
+#are needs, wants and none. The default is none.
+#org.apache.felix.https.clientcertificate 	
+
+#Size of the buffer for request and response headers, in bytes. Default is 16 KB.
+#org.apache.felix.http.jetty.headerBufferSize 
+	
+#Size of the buffer for requests not fitting the header buffer, in bytes. Default is 8 KB.
+#org.apache.felix.http.jetty.requestBufferSize 
+	
+#Size of the buffer for responses, in bytes. Default is 24 KB.
+#org.apache.felix.http.jetty.responseBufferSize 	
+
+#The maximum size accepted for a form post, in bytes. Defaults to 200 KB.
+#org.apache.felix.http.jetty.maxFormSize
+
+#If true, enables the MBean server functionality. The default is false.
+#org.apache.felix.http.mbeans 	
+
+#If false, the Server HTTP header is no longer included in responses. The default is false.
+#org.apache.felix.http.jetty.sendServerHeader
+ 	
+#Name of the cookie used to transport the Session ID. The default is JSESSIONID.
+#org.eclipse.jetty.servlet.SessionCookie 
+	
+#Name of the request parameter to transport the Session ID. The default is jsessionid.
+#org.eclipse.jetty.servlet.SessionURL 	
+
+#Domain to set on the session cookie. The default is null.
+#org.eclipse.jetty.servlet.SessionDomain 	
+
+#The path to set on the session cookie. The default is the configured session context path ("/").
+#org.eclipse.jetty.servlet.SessionPath 	
+
+#The maximum age value to set on the cookie. The default is "-1".
+#org.eclipse.jetty.servlet.MaxAge 	
+
+#
+# Eclipse sensiNact properties.
+#
+# Security properties
+org.eclipse.sensinact.gateway.security.jks.filename=datastore/keystore/keystore.jks
+org.eclipse.sensinact.gateway.security.jks.password=sensiNact_team
+
+# Datastore property
+org.eclipse.sensinact.gateway.security.database=datastore/storage/sensinact.sqlite
+
+#Fileinstall configuration
+felix.fileinstall.dir=./cfgs
+felix.fileinstall.noInitialDelay=true
+felix.fileinstall.poll=1000
+
+sensinact.log.mode=info
+sensinact.log.service.filter.property.key=description
+sensinact.log.service.filter.property.value=An SLF4J LogService implementation.
+
+# Location of the Gateway
+org.eclipse.sensinact.gateway.location.latitude=45.19334890078532d
+org.eclipse.sensinact.gateway.location.longitude=5.706474781036377d
+
+# Enable the GUI for the simulated devices (e.g., slider, light, button,...)
+org.eclipse.sensinact.simulated.gui.enabled=true
+
+# Enable HTTP cross-origin resource sharing
+org.eclipse.sensinact.http.corsheader=true
+
+#Telnet port configuration
+osgi.shell.telnet.port=6671
diff --git a/distribution/template-with-security/conf/logback.xml b/distribution/template-with-security/conf/logback.xml
new file mode 100644
index 0000000..909f403
--- /dev/null
+++ b/distribution/template-with-security/conf/logback.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright (c) 2020 Kentyou.
+  ~ All rights reserved. This program and the accompanying materials
+  ~ are made available under the terms of the Eclipse Public License v1.0
+  ~ which accompanies this distribution, and is available at
+  ~ http://www.eclipse.org/legal/epl-v10.html
+  ~
+  ~ Contributors:
+*    Kentyou - initial API and implementation
+  -->
+<configuration>
+    <logger name="org.eclipse.jetty.server.session" level="WARN" />
+    <logger name="org.eclipse.jetty.io" level="WARN" />
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>DEBUG</level>
+        </filter>
+        <encoder>
+            <pattern>%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>log/sensinact.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <fileNamePattern>log/sensinact.%d{yyyy-MM-dd}_%i.log</fileNamePattern>
+            <maxFileSize>10MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>1GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>%date{yyyy/MM/dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
+        </encoder>
+    </appender>
+    <logger name="org.eclipse.jetty.server.session" level="WARN" />
+    <logger name="org.eclipse.jetty.io" level="WARN" />
+    <root level="debug">
+        <appender-ref ref="FILE" />
+        <appender-ref ref="STDOUT" />
+    </root>
+</configuration>
diff --git a/distribution/template-with-security/conf/system.properties b/distribution/template-with-security/conf/system.properties
new file mode 100644
index 0000000..021aca8
--- /dev/null
+++ b/distribution/template-with-security/conf/system.properties
@@ -0,0 +1,12 @@
+# Copyright (c) 2020 Kentyou.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#    Kentyou - initial API and implementation
+#
+
+gnu.io.log.mode=SILENT_MODE
+org.slf4j.simpleLogger.defaultLogLevel=info
\ No newline at end of file
diff --git a/distribution/template-with-security/distribution.xml b/distribution/template-with-security/distribution.xml
new file mode 100644
index 0000000..5ef410f
--- /dev/null
+++ b/distribution/template-with-security/distribution.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright (c) 2020 Kentyou.
+  ~ All rights reserved. This program and the accompanying materials
+  ~ are made available under the terms of the Eclipse Public License v1.0
+  ~ which accompanies this distribution, and is available at
+  ~ http://www.eclipse.org/legal/epl-v10.html
+  ~
+  ~ Contributors:
+*    Kentyou - initial API and implementation
+  -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
+          http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+    <id>distribution</id>
+
+    <formats>
+        <format>zip</format>
+    </formats>
+
+    <fileSets>
+        <fileSet>
+            <directory>${project.basedir}/../template</directory>
+            <outputDirectory>.</outputDirectory>
+            <useDefaultExcludes>true</useDefaultExcludes>
+            <excludes>
+                <exclude>**/distribution.xml</exclude>
+                <exclude>**/.settings</exclude>
+                <exclude>**/.project</exclude>
+                <exclude>**/*.log</exclude>
+                <exclude>**/*.iml</exclude>
+                <exclude>**/.gitignore</exclude>
+                <exclude>**/pom.xml</exclude>
+                <exclude>**/${project.build.directory}/**</exclude>
+                <exclude>**/about.html</exclude>
+                <exclude>**/conf/**</exclude>
+            </excludes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}</directory>
+            <outputDirectory>.</outputDirectory>
+            <useDefaultExcludes>true</useDefaultExcludes>
+            <excludes>
+                <exclude>**/distribution.xml</exclude>
+                <exclude>**/.settings</exclude>
+                <exclude>**/.project</exclude>
+                <exclude>**/*.log</exclude>
+                <exclude>**/*.iml</exclude>
+                <exclude>**/.gitignore</exclude>
+                <exclude>**/pom.xml</exclude>
+                <exclude>**/${project.build.directory}/**</exclude>
+            </excludes>
+        </fileSet>
+        <fileSet>
+            <directory>${sensinact.rootdir}/platform/sensinact-security/sensinact-security-core/src/test/resources/</directory>
+            <outputDirectory>datastore/storage</outputDirectory>
+            <useDefaultExcludes>true</useDefaultExcludes>
+            <excludes>
+                <exclude>**/MANIFEST.MF</exclude>
+                <exclude>**/all.policy</exclude>
+            </excludes>
+        </fileSet>
+    </fileSets>
+</assembly>
diff --git a/distribution/template-with-security/pom.xml b/distribution/template-with-security/pom.xml
new file mode 100644
index 0000000..42953a9
--- /dev/null
+++ b/distribution/template-with-security/pom.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright (c) 2020 Kentyou.
+  ~ All rights reserved. This program and the accompanying materials
+  ~ are made available under the terms of the Eclipse Public License v1.0
+  ~ which accompanies this distribution, and is available at
+  ~ http://www.eclipse.org/legal/epl-v10.html
+  ~
+  ~ Contributors:
+*    Kentyou - initial API and implementation
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.eclipse.sensinact.gateway.distribution</groupId>
+		<artifactId>parent</artifactId>
+		<version>2.0-SNAPSHOT</version>
+	</parent>
+
+	<artifactId>sensinact-distribution-template-with-security</artifactId>
+
+	<name>sensiNact IoT Gateway - OSGi Distribution Template With Security</name>
+
+	<description>Felix with sensiNact bundles</description>
+
+	<packaging>pom</packaging>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-assembly-plugin</artifactId>
+				<configuration>
+					<appendAssemblyId>false</appendAssemblyId>
+					<descriptors>
+						<descriptor>${project.basedir}/distribution.xml</descriptor>
+					</descriptors>
+				</configuration>
+				<executions>
+					<execution>
+						<id>make-assembly</id>
+						<phase>package</phase>
+						<goals>
+							<goal>single</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+</project>
diff --git a/distribution/template/distribution.xml b/distribution/template/distribution.xml
index 4f810c4..7bd50b7 100644
--- a/distribution/template/distribution.xml
+++ b/distribution/template/distribution.xml
@@ -26,6 +26,8 @@
             <useDefaultExcludes>true</useDefaultExcludes>
             <excludes>
                 <exclude>**/distribution.xml</exclude>
+                <exclude>**/.settings</exclude>
+                <exclude>**/.project</exclude>
                 <exclude>**/*.log</exclude>
                 <exclude>**/*.iml</exclude>
                 <exclude>**/.gitignore</exclude>