Skip to content

Commit

Permalink
Merge pull request #7 from CybercentreCanada/use-service-template
Browse files Browse the repository at this point in the history
Change repository to use service template.
  • Loading branch information
cccs-shellyw authored Oct 9, 2024
2 parents 91cf106 + 938a31f commit 70f0499
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 14 deletions.
58 changes: 51 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,68 @@

This guide covers the basics of how to contribute to the Assemblyline project.

Python code should follow the PEP8 guidelines defined here: [PEP8 Guidelines](https://www.python.org/dev/peps/pep-0008/).
Python code should follow the PEP8 guidelines defined here:
[PEP8 Guidelines](https://www.python.org/dev/peps/pep-0008/).

## Tell us want you want to build/fix
Before you start coding anything you should connect with the [Assemblyline community](https://groups.google.com/d/forum/cse-cst-assemblyline) to make sure no one else is working on the same thing and that whatever you are going to build still fits with the vision off the system.

Before you start coding anything you should connect with the Assemblyline community via the
[Assemblyline Discord server](https://discord.gg/GUAy9wErNu) and/or the
[central Assemblyline GitHub project](https://github.com/CybercentreCanada/assemblyline/issues) to make sure no one
else is working on the same thing and that whatever you are going to build still fits with the vision of the system.

## Git workflow

- Clone the repo to your own account
- Checkout and pull the latest commits from the master branch
- Make a branch
- Work in any way you like and make sure your changes actually work
- When you're satisfied with your changes, create a pull requests to the main assemblyline repo
- Work on your modifications and make sure your changes work as expected
- When you're satisfied with your changes, create a pull requests to the Assemblyline repo

#### Transfer your service repo
If you've worked on a new service that you want to be included in the default service selection you'll have to transfer the repo into our control.

If you've worked on a new service that you want to be included in the default service selection you'll have to transfer
the associated repo into our control.

#### You are not allow to merge:

Even if you try to merge in your pull request, you will be denied. Only a few people in our team are allowed to merge code into our repositories.
Even if you try to merge in your pull request, you will be denied. Only a few people in our team are allowed to merge
code into our repositories.

We check for new pull requests every day and will merge them in once they have been approved by someone in our team.

# Guide de contribution d'Assemblyline

Ce guide couvre les bases de la façon de contribuer au projet Assemblyline.

Le code Python doit suivre les directives PEP8 définies ici:
[Directives PEP8](https://www.python.org/dev/peps/pep-0008/).

## Dites-nous que vous voulez construire / réparer

Avant de commencer à coder quoi que ce soit, vous devriez vous connecter à la communauté Assemblyline via le
[Serveur Discord Assemblyline](https://discord.gg/GUAy9wErNu) et/ou le
[projet GitHub central Assemblyline](https://github.com/CybercentreCanada/assemblyline/issues) pour vous assurer que
personne d'autre ne travaille sur la même chose et que tout ce que vous allez construire correspond toujours à la vision
du système.

## Flux de travail avec Git

- Clonez le référentiel sur votre propre compte
- Changez de branche pour la branche principale et la synchroniser avec le serveur de référence
- Faire une nouvelle branche
- Travaillez sur ce que vous souhaitez et assurez-vous que vos modifications fonctionnent comme prévu
- Lorsque vous êtes satisfait de vos modifications, créez une demande de fusion sur le référentiel d'Assemblyline

#### Transférer votre référentiel de service

Si vous avez travaillé sur un nouveau service que vous souhaitez inclure dans la sélection de service par défaut, vous
devrez transférer le référentiel associé sous notre contrôle.

#### Vous n'êtes pas autorisé à compléter une fusion:

Même si vous tentez de compléter une demande de fusion, vous serez refusé. Seules quelques personnes de notre équipe
sont autorisées à fusionner dans nos référentiels.

We check for new pull requests every day and will merge them in once they have been approved by someone in our team.
Nous vérifions les nouvelles demande de fusion tous les jours et les fusionnerons une fois qu'elles auront été approuvées
par quelqu'un de notre équipe.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ USER root
RUN sed -i -e "s/\$SERVICE_TAG/$version/g" service_manifest.yml

# Switch to assemblyline user
USER assemblyline
USER assemblyline
2 changes: 1 addition & 1 deletion LICENSE.md → LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Crown Copyright, Government of Canada (Canadian Centre for Cyber Security / Communications Security Establishment)
Copyright (c) 2024 Crown Copyright, Government of Canada (Canadian Centre for Cyber Security / Communications Security Establishment)

Copyright title to all 3rd party software distributed with Assemblyline (AL) is held by the respective copyright holders as noted in those files. Users are asked to read the 3rd Party Licenses referenced with those assets.

Expand Down
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ifndef VERSION
$(error VERSION is undefined)
endif

TAG?=latest
ORG?=cccs

ifneq ($(ORG)x, x)
ORG:=$(ORG)/
endif
ifneq ($(REGISTRY)x, x)
ORG:=$(REGISTRY)/
endif

.PHONY: default
default: build

.PHONY: build
build:
docker build \
--pull \
--build-arg version=$(VERSION) \
--build-arg branch=stable \
-t $(REGISTRY)$(ORG)assemblyline-service-onenote:$(TAG)\
-f ./Dockerfile \
.
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Static Badge](https://img.shields.io/badge/github-assemblyline\_service\_onenote-blue?logo=github)](https://github.com/CybercentreCanada/assemblyline-service-onenote)
[![License](https://img.shields.io/github/license/CybercentreCanada/assemblyline-service-onenote)](./LICENSE)

# enenote Service
# Oenenote Service

Assemblyline service for analyzing OneNote Documents.

Expand All @@ -28,7 +28,7 @@ This is an Assemblyline service. It is designed to run as part of the Assemblyli
If you would like to test this service locally, you can run the Docker image directly from the a shell:

docker run \
--name AssemblylineServiceOnenote \
--name Onenote \
--env SERVICE_API_HOST=http://`ip addr show docker0 | grep "inet " | awk '{print $2}' | cut -f1 -d"/"`:5003 \
--network=host \
/assemblyline-service-onenote
Expand All @@ -39,3 +39,40 @@ To add this service to your Assemblyline deployment, follow this
## Documentation

General Assemblyline documentation can be found at: https://cybercentrecanada.github.io/assemblyline4_docs/


# Service OneNote

Service de Assemblyline pour analyser les documents OneNote.

## Variantes et étiquettes d'image

Les services d'Assemblyline sont construits à partir de l'image de base [Assemblyline service](https://hub.docker.com/r/cccs/assemblyline-v4-service-base),
qui est basée sur Debian 11 avec Python 3.11.

Les services d'Assemblyline utilisent les définitions d'étiquettes suivantes:

| **Type d'étiquette** | **Description** | **Exemple d'étiquette** |
| :------------------: | :------------------------------------------------------------------------------------------------------------- | :------------------------: |
| dernière version | La version la plus récente (peut être instable). | `latest` |
| build_type | Type de construction utilisé. `dev` est la dernière version instable. `stable` est la dernière version stable. | `stable` ou `dev` |
| série | Détails de construction complets, comprenant la version et le type de build: `version.buildType`. | `4.5.stable`, `4.5.1.dev3` |

## Exécution de ce service

Il s'agit d'un service d'Assemblyline. Il est optimisé pour fonctionner dans le cadre d'un déploiement d'Assemblyline.

Si vous souhaitez tester ce service localement, vous pouvez exécuter l'image Docker directement à partir d'un terminal:

docker run \
--name Onenote \
--env SERVICE_API_HOST=http://`ip addr show docker0 | grep "inet " | awk '{print $2}' | cut -f1 -d"/"`:5003 \
--network=host \
cccs/assemblyline-service-onenote

Pour ajouter ce service à votre déploiement d'Assemblyline, suivez ceci
[guide](https://cybercentrecanada.github.io/assemblyline4_docs/fr/developer_manual/services/run_your_service/#add-the-container-to-your-deployment).

## Documentation

La documentation générale sur Assemblyline peut être consultée à l'adresse suivante: https://cybercentrecanada.github.io/assemblyline4_docs/
Empty file added pkglist.txt
Empty file.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tool.cruft]
skip = ["pkglist.txt", "README.md", "assemblyline_service_onenote", "tests"]
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
assemblyline
assemblyline-v4-service
pyonenote
5 changes: 2 additions & 3 deletions service_manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: OneNote
version: $SERVICE_TAG
description: >-
This service extracts attachements and metadata from Microsoft Onenote files.
description: Assemblyline service for analyzing OneNote Documents.
accepts: document/office/onenote
rejects: empty|metadata/.*

Expand All @@ -21,4 +20,4 @@ uses_temp_submission_data: false
docker_config:
image: ${REGISTRY}cccs/assemblyline-service-onenote:$SERVICE_TAG
cpu_cores: 1
ram_mb: 512
ram_mb: 512

0 comments on commit 70f0499

Please sign in to comment.