dschadow/ApplicationIntrusionDetection

View on GitHub
duke-encounters/pom.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<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">
    <parent>
        <groupId>de.dominikschadow</groupId>
        <artifactId>applicationintrusiondetection</artifactId>
        <version>0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>duke-encounters</artifactId>
    <packaging>jar</packaging>
    <name>Duke Encounters</name>

    <description>Application Intrusion Detection with AppSensor sample project. Requires a server like Apache Tomcat or
        the embedded server by Spring Boot. After launching, open the web application in your browser at
        http://localhost:8080. With Boxfuse you can deploy the image to AWS, or you can use Docker as container service.
    </description>

    <properties>
        <start-class>de.dominikschadow.dukeencounters.DukeEncountersApplication</start-class>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>

        <dependency>
            <groupId>org.owasp.appsensor</groupId>
            <artifactId>appsensor-core</artifactId>
            <!-- exclude for conflict with Spring Boot -->
            <exclusions>
                <exclusion>
                    <artifactId>logback-classic</artifactId>
                    <groupId>ch.qos.logback</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>logback-core</artifactId>
                    <groupId>ch.qos.logback</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.owasp.appsensor</groupId>
            <artifactId>appsensor-local</artifactId>
        </dependency>
        <dependency>
            <groupId>org.owasp.appsensor</groupId>
            <artifactId>appsensor-storage-in-memory</artifactId>
        </dependency>
        <dependency>
            <groupId>org.owasp.appsensor</groupId>
            <artifactId>appsensor-analysis-reference</artifactId>
        </dependency>
        <dependency>
            <groupId>org.owasp.appsensor</groupId>
            <artifactId>appsensor-reporting-simple-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>org.owasp.appsensor</groupId>
            <artifactId>appsensor-access-control-reference</artifactId>
        </dependency>
        <dependency>
            <groupId>org.owasp.appsensor</groupId>
            <artifactId>appsensor-configuration-stax</artifactId>
        </dependency>
        <dependency>
            <groupId>org.owasp.appsensor</groupId>
            <artifactId>appsensor-integration-spring-security</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>spring-security-core</artifactId>
                    <groupId>org.springframework.security</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.owasp</groupId>
            <artifactId>security-logging-logback</artifactId>
        </dependency>

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>bootstrap</artifactId>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery</artifactId>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>webjars-locator</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <build>
        <finalName>${project.artifactId}</finalName>
        <defaultGoal>spring-boot:run</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>build-info</goal>
                        </goals>
                        <configuration>
                            <additionalProperties>
                                <versions.spring-boot>${project.parent.parent.version}</versions.spring-boot>
                            </additionalProperties>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <configuration>
                    <skipDockerBuild>false</skipDockerBuild>
                    <imageName>${docker.image.prefix}/${project.artifactId}</imageName>
                    <dockerDirectory>duke-encounters</dockerDirectory>
                    <resources>
                        <resource>
                            <targetPath>/</targetPath>
                            <directory>${project.build.directory}</directory>
                            <include>${project.build.finalName}.jar</include>
                        </resource>
                    </resources>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- Boxfuse requires credentials as described here: https://boxfuse.com/docs/maven/ -->
        <profile>
            <id>boxfuse-local</id>
            <activation>
                <file>
                    <exists>${user.home}/.boxfuse/boxfuse.conf</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.boxfuse.client</groupId>
                        <artifactId>boxfuse-maven-plugin</artifactId>
                        <configuration>
                            <image>duke-encounters:${project.version}</image>
                            <healthcheck.path>/</healthcheck.path>
                        </configuration>
                        <executions>
                            <execution>
                                <id>fuse-image</id>
                                <goals>
                                    <goal>fuse</goal>
                                </goals>
                                <phase>package</phase>
                            </execution>
                            <execution>
                                <id>run-on-test</id>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <env>test</env>
                                </configuration>
                            </execution>
                            <execution>
                                <id>kill-on-test</id>
                                <goals>
                                    <goal>kill</goal>
                                </goals>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <env>test</env>
                                </configuration>
                            </execution>
                            <execution>
                                <id>run-on-prod</id>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <phase>deploy</phase>
                                <configuration>
                                    <env>prod</env>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <!-- Travis CI only deploys to AWS test and kills the instance right away afterwards -->
            <id>boxfuse</id>
            <activation>
                <property>
                    <name>env.BOXFUSE_USER</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.boxfuse.client</groupId>
                        <artifactId>boxfuse-maven-plugin</artifactId>
                        <configuration>
                            <image>duke-encounters:${project.version}</image>
                            <healthcheck.path>/</healthcheck.path>
                        </configuration>
                        <executions>
                            <execution>
                                <id>fuse-image</id>
                                <goals>
                                    <goal>fuse</goal>
                                </goals>
                                <phase>package</phase>
                            </execution>
                            <execution>
                                <id>run-on-test</id>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <env>test</env>
                                </configuration>
                            </execution>
                            <execution>
                                <id>kill-on-test</id>
                                <goals>
                                    <goal>kill</goal>
                                </goals>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <env>test</env>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>