-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
744 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ | |
**/*.dbmdl | ||
**/*.jfm | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/compose* | ||
**/Dockerfile* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,4 @@ | |
# Editor configs | ||
.idea/ | ||
.vscode/ | ||
.errors/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
1. Go unit tests | ||
- [ ] Create a new profile | ||
- [ ] Update an existing profile | ||
- [ ] Remove an existing profile | ||
- [ ] Remove a non existing profile | ||
1. Remove kubernetes Service and DaemonSet exposed ports if useless | ||
1. Evaluate an automatic changelog generation from commits like [googleapis/release-please](https://github.com/googleapis/release-please) | ||
1. Add daemonset commands for checking readiness | ||
1. Add tests for all the main functions | ||
1. Add test for checking current confinement state of the app | ||
1. Test on multiple nodes cluster | ||
|
||
|
||
## [0.1.0]() - 2023-02-01 | ||
### Fixed | ||
1. "Unable to replace profiles. Permission denied, app seems still confined." - Switched to ubuntu image | ||
1. No need for SYS_ADMIN capabilities | ||
1. Ignore hidden and system folders while scanning for profiles | ||
|
||
### Added | ||
1. Instructions to test the app in a virtual machine directly running the go app or in microk8s pushing the built container to the local registry | ||
|
||
|
||
## 0.0.6 - 2023-01-26 | ||
|
||
### Added | ||
Helm: | ||
- Added SYS_ADMIN capabilities to the daemonset | ||
- Mounted needed folders in the Dockerfile and in the daemonset | ||
- Added POLL_TIME and profiles files as configurable options through configmaps | ||
|
||
Go: | ||
- Added first testing function | ||
- Moved file operations functions to dedicated module | ||
- Fixed POLL_TIME value passing from configmap | ||
|
||
CI/CD: | ||
- Explicit changelog to help users understanding the project features | ||
- Automatic generation of release notes based on changelog file | ||
- Configurable poll time and profiles directory in the helm values file | ||
|
||
## [0.0.5](https://github.com/tuxerrante/kapparmor/releases/tag/kapparmor-0.0.5-alpha) - 2023-01-23 | ||
|
||
### Added | ||
|
||
Helm: | ||
- Helm Chart based mainly on a DaemonSet and a configmap. No operator needed. | ||
- Load all AppArmor profiles in the configmap template | ||
|
||
Go: | ||
- Possibility to load continuously the security profiles from a configmap with a configurable poll time | ||
|
||
CI/CD: | ||
- Helm chart linting and testing before releasing | ||
- Security vulnerability tests on Go dependencies and container file. | ||
- Auto generation of [GitHub pages](https://tuxerrante.github.io/kapparmor/) | ||
- Container image tag is set to current commit SHA for every release. | ||
|
||
### Fixed | ||
|
||
- Being still an alpha release I will add everything in the "Added" section |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,32 @@ | ||
# --- build stage | ||
FROM golang:1.19-alpine AS builder | ||
RUN apk add --no-cache git | ||
FROM golang:1.19 AS builder | ||
|
||
WORKDIR /go/src/app | ||
COPY . . | ||
RUN go get -d -v ./go/src/app/ | ||
RUN go build -o /go/bin/app -v ./go/src/app/ | ||
|
||
# --- | ||
FROM alpine:latest | ||
FROM ubuntu:latest | ||
LABEL Name=kapparmor Version=0.0.1 | ||
LABEL Author="Affinito Alessandro" | ||
|
||
WORKDIR /app | ||
|
||
RUN addgroup --system appgroup &&\ | ||
adduser --system appuser -G appgroup &&\ | ||
apk --no-cache update &&\ | ||
apk add apparmor | ||
|
||
COPY --chown=appuser:appgroup --from=builder ./go/bin/app /app/ | ||
COPY --chown=appuser:appgroup ./charts/kapparmor/profiles /app/profiles | ||
RUN apt-get update &&\ | ||
apt-get upgrade -y &&\ | ||
apt-get install --no-install-recommends --yes apparmor apparmor-utils &&\ | ||
rm -rf /var/lib/apt/lists/* &&\ | ||
mkdir --parent --verbose /etc/apparmor.d/custom | ||
|
||
RUN chmod 550 app | ||
COPY --from=builder /go/bin/app /app/ | ||
COPY ./charts/kapparmor/profiles /app/profiles/ | ||
|
||
ARG PROFILES_DIR | ||
ARG POLL_TIME | ||
|
||
ENV PROFILES_DIR=$PROFILES_DIR | ||
ENV POLL_TIME=$POLL_TIME | ||
|
||
USER appuser | ||
USER root | ||
CMD ./app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# --- build stage | ||
FROM golang:1.19-alpine AS builder | ||
RUN apk add --no-cache git | ||
WORKDIR /go/src/app | ||
COPY . . | ||
RUN go get -d -v ./go/src/app/ | ||
RUN go build -o /go/bin/app -v ./go/src/app/ | ||
|
||
# --- | ||
FROM alpine:latest | ||
LABEL Name=kapparmor Version=0.0.1 | ||
LABEL Author="Affinito Alessandro" | ||
|
||
WORKDIR /app | ||
|
||
RUN apk --no-cache update &&\ | ||
apk add apparmor libapparmor &&\ | ||
mkdir --parent --verbose /etc/apparmor.d/custom | ||
|
||
COPY --from=builder ./go/bin/app /app/ | ||
COPY ./charts/kapparmor/profiles /app/profiles | ||
|
||
ARG PROFILES_DIR | ||
ARG POLL_TIME | ||
|
||
ENV PROFILES_DIR=$PROFILES_DIR | ||
ENV POLL_TIME=$POLL_TIME | ||
|
||
USER root | ||
CMD ./app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
charts/kapparmor/templates/configmap.yaml → charts/kapparmor/templates/cm-profiles.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "kapparmor.fullname" . }} | ||
name: kapparmor-profiles | ||
data: | ||
{{ (.Files.Glob "profiles/*").AsConfig | indent 2 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: kapparmor-settings | ||
data: | ||
PROFILES_DIR: "{{ .Values.app.profiles_dir }}" | ||
POLL_TIME: "{{ .Values.app.poll_time }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.