Skip to content

Commit

Permalink
Merge PR #8 from mohideen/internal-audit
Browse files Browse the repository at this point in the history
  • Loading branch information
escowles committed Apr 22, 2015
2 parents 3d4a505 + 430914b commit bd8b713
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 4 deletions.
32 changes: 30 additions & 2 deletions README.md
Expand Up @@ -7,18 +7,20 @@ integration test exists to perform a basic deployment test only and may be usefu
identifying syntax errors in configuration file updates or third party library version
incompatibilities.

# Authentication Packages

Basic Authentication is configured for both profiles at this time. To choose a different
method, update the web.xml deployment descriptor for the webapp in question, being aware
that this may break the single integration test.

# Role-Base Access Control Lists
## Role-Base Access Control Lists

The default maven build profile, these configuration files are found in src/rbacl.
```
mvn install
```

# XACML-based Access Control
## XACML-based Access Control
An alternative maven build profile, these configuration files are found in src/xacml.

Default policy sets and root policy are extracted into target/policies for the integration
Expand All @@ -28,3 +30,29 @@ configuration to point to your own policy directories.
```
mvn install -P xacml
```

# Audit Capability Package
This profile builds webapp that includes the [fcrepo-audit](https://github.com/fcrepo4-labs/fcrepo-audit) module that provides internal auditing capability.

```
mvn install -P audit -DskipTests=true
```



## Audit capability with Authentication
Audit capability can be packaged with either of the authentication options by using the ```audit``` profile in conjunction with ```rbacl``` or ```xacml``` profiles.

#### Audit capability with RBACL

```
mvn install -P audit,rbacl
```


#### Audit capability with XACML

```
mvn install -P audit,xacml
```

40 changes: 38 additions & 2 deletions pom.xml
Expand Up @@ -14,6 +14,9 @@

<properties>
<project_name>fcrepo-webapp-plus</project_name>
<audit.build.name></audit.build.name>
<audit.rbacl.context>${project.basedir}/src/audit/dummy-resources</audit.rbacl.context>
<audit.rbacl.excludes></audit.rbacl.excludes>
<!-- integration test properties -->
<fcrepo.test.context.path>/</fcrepo.test.context.path>
</properties>
Expand Down Expand Up @@ -239,6 +242,33 @@
</build>

<profiles>


<profile>
<id>audit</id>
<properties>
<audit.src.dir>${project.basedir}/src/audit</audit.src.dir>
<audit.build.name>-audit</audit.build.name>
<audit.rbacl.context>${audit.src.dir}/rbacl-resources</audit.rbacl.context>
<audit.rbacl.excludes>**/auth-master.xml</audit.rbacl.excludes>
</properties>
<dependencies>
<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-audit</artifactId>
<version>4.1.2-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>${project.name}-audit-${project.version}</finalName>
<resources>
<resource>
<directory>${audit.src.dir}/resources</directory>
</resource>
</resources>
</build>
</profile>

<profile>
<id>xacml</id>
<properties>
Expand All @@ -253,7 +283,7 @@
</dependencies>

<build>
<finalName>${project.name}-xacml-${project.version}</finalName>
<finalName>${project.name}-xacml${audit.build.name}-${project.version}</finalName>
<resources>
<resource>
<directory>${profile.src.dir}/resources</directory>
Expand Down Expand Up @@ -327,12 +357,18 @@
</dependency>
</dependencies>
<build>
<finalName>${project.name}-rbacl-${project.version}</finalName>
<finalName>${project.name}-rbacl${audit.build.name}-${project.version}</finalName>
<resources>
<resource>
<directory>${audit.rbacl.context}</directory>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warSourceDirectory>${profile.src.dir}/webapp</warSourceDirectory>
<warSourceExcludes>${audit.rbacl.excludes}</warSourceExcludes>
<overlays>
<overlay>
<groupId>org.fcrepo</groupId>
Expand Down
18 changes: 18 additions & 0 deletions src/audit/rbacl-resources/spring/auth-master.xml
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

<!-- Master context for fcrepo4. -->

<import resource="${fcrepo.spring.repo.configuration:classpath:/spring/auth-repo.xml}"/>
<import resource="${fcrepo.spring.rest.configuration:classpath:/spring/rest.xml}"/>
<import resource="${fcrepo.spring.minter.configuration:classpath:/spring/minter.xml}"/>
<import resource="${fcrepo.spring.eventing.configuration:classpath:/spring/eventing.xml}"/>
<import resource="${fcrepo.spring.jms.configuration:classpath:/spring/jms.xml}"/>
<import resource="${fcrepo.spring.transactions.configuration:classpath:/spring/transactions.xml}"/>

<!-- audit context -->
<import resource="${fcrepo.spring.jms.configuration:classpath:/spring/audit.xml}"/>
</beans>
40 changes: 40 additions & 0 deletions src/audit/resources/logback.xml
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n</pattern>
</encoder>
</appender>

<logger name="org.fcrepo.auth" additivity="false" level="${fcrepo.log.auth:-INFO}">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="org.fcrepo.connector.file" additivity="false" level="${fcrepo.log.connector.file:-INFO}">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="org.fcrepo.http.api" additivity="false" level="${fcrepo.log.http.api:-INFO}">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="org.fcrepo.http.commons" additivity="false" level="${fcrepo.log.http.commons:-INFO}">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="org.fcrepo.jms" additivity="false" level="${fcrepo.log.jms:-INFO}">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="org.fcrepo.kernel" additivity="false" level="${fcrepo.log.kernel:-INFO}">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="org.fcrepo.transform" additivity="false" level="${fcrepo.log.transform:-INFO}">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="org.fcrepo" additivity="false" level="${fcrepo.log:-INFO}">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="org.fcrepo.audit" additivity="false" level="${fcrepo.log.audit:-TRACE}">
<appender-ref ref="STDOUT"/>
</logger>
<root additivity="false" level="WARN">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
16 changes: 16 additions & 0 deletions src/audit/resources/spring/audit.xml
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

<context:annotation-config/>

<!-- publishes events from the internal bus to JMS -->
<bean class="org.fcrepo.audit.InternalAuditor"/>



</beans>
18 changes: 18 additions & 0 deletions src/audit/resources/spring/master.xml
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

<!-- Master context for fcrepo4. -->

<import resource="${fcrepo.spring.repo.configuration:classpath:/spring/repo.xml}"/>
<import resource="${fcrepo.spring.rest.configuration:classpath:/spring/rest.xml}"/>
<import resource="${fcrepo.spring.minter.configuration:classpath:/spring/minter.xml}"/>
<import resource="${fcrepo.spring.eventing.configuration:classpath:/spring/eventing.xml}"/>
<import resource="${fcrepo.spring.jms.configuration:classpath:/spring/jms.xml}"/>
<import resource="${fcrepo.spring.transactions.configuration:classpath:/spring/transactions.xml}"/>

<!-- audit context -->
<import resource="${fcrepo.spring.jms.configuration:classpath:/spring/audit.xml}"/>
</beans>

0 comments on commit bd8b713

Please sign in to comment.