-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enterprise/enhancements #754
Changes from 25 commits
70960b8
5f6e19d
6173223
103f040
b43092d
47530f7
a02ddbc
2ae718c
34ccaf9
cd899ac
759a673
a41d07c
baaefcb
9b9f9d3
c7b8e40
1c0ca54
6185bfc
eeb58e0
6cb0d99
ce3cdf8
7420e92
69698b2
636dc55
8d2f1e9
962b538
c830546
f4181a4
b8602f7
9ef32c8
0dd959f
b2afd67
d624ca9
d79c828
f18ad24
5c21b3b
ed88018
bca5eae
211b085
3d9d552
6ed7afd
e8563ab
b6b8fda
b2bcb38
36fe34d
39c51a8
cdae16c
a70a95b
27f561d
f90175c
697a722
76fb7e6
987fe09
0d29704
78edb74
800976a
ef5bbcb
cd62335
cef05f9
235bb58
0fa276e
4a48bb6
5936a3f
d1b7867
3a4141d
6e3daeb
292d34c
51ecd96
69dc36f
ad26ba4
4aae05b
a0f4ee4
a8d4251
44a4f7d
a97b395
fae7cb2
5c95353
f04fc3d
6304fa4
0399171
6966dcb
6084f92
28c4b98
26b3970
72ec8bc
c4a24f0
824d58c
b61c6df
34de01f
6297c03
c58a780
c235a38
de98925
eea65b3
4b579dd
8eeef0f
03883ce
5fc0d92
f4ff73c
6d18e9a
2e4c452
0ec5b54
9339b93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,6 @@ Here is an overview of CISO Assistant features and capabilities: | |
|
||
![overview](features.png) | ||
|
||
|
||
CISO Assistant is developed and maintained by [intuitem](https://intuitem.com/), a French 🇫🇷 company specialized in Cyber Security, Cloud and Data/AI. | ||
|
||
## Quick Start 🚀 | ||
|
@@ -87,11 +86,11 @@ and run the starter script | |
> If you're getting warnings or errors about image's platform not matching host platform, raise an issue with the details and we'll add it shortly after. You can also use `docker-compose-build.sh` instead (see below) to build for your specific architecture. | ||
|
||
> [!CAUTION] | ||
> Don't use the `main` branch code directly for production as it's the merge upstream and can have breaking changes during our developemnt. Either use the `tags` for stable versions or prebuilt images. | ||
> Don't use the `main` branch code directly for production as it's the merge upstream and can have breaking changes during our developemnt. Either use the `tags` for stable versions or prebuilt images. | ||
|
||
## End-user Documentation | ||
|
||
Check out the online documentation on https://intuitem.gitbook.io/ciso-assistant. | ||
Check out the online documentation on <https://intuitem.gitbook.io/ciso-assistant>. | ||
|
||
## Supported frameworks 🐙 | ||
|
||
|
@@ -158,13 +157,12 @@ Check out the online documentation on https://intuitem.gitbook.io/ciso-assistant | |
3. ANSSI : Recommandations de configuration d'un système GNU/Linux 🇫🇷 | ||
4. PSSI-MCAS (Politique de sécurité des systèmes d’information pour les ministères chargés des affaires sociales) 🇫🇷 | ||
5. ANSSI : Recommandations pour la protection des systèmes d'information essentiels 🇫🇷 | ||
6. ANSSI : Recommandations de sécurité pour l'architecture d'un système de journalisation 🇫🇷 | ||
6. ANSSI : Recommandations de sécurité pour l'architecture d'un système de journalisation 🇫🇷 | ||
7. ANSSI : Recommandations de sécurité relatives à TLS 🇫🇷 | ||
8. New Zealand Information Security Manual (NZISM) 🇳🇿 | ||
<br/> | ||
<br/> | ||
|
||
> [!NOTE] | ||
> `*` These frameworks require an extra manual step of getting the latest Excel sheet through their website as their license prevent direct usage. | ||
> [!NOTE] > `*` These frameworks require an extra manual step of getting the latest Excel sheet through their website as their license prevent direct usage. | ||
|
||
<br/> | ||
|
||
|
@@ -364,7 +362,7 @@ python manage.py migrate | |
python manage.py createsuperuser | ||
``` | ||
|
||
9. Run development server. | ||
9. Run development server. | ||
|
||
```sh | ||
python manage.py runserver | ||
|
@@ -398,7 +396,7 @@ npm install | |
npm run dev | ||
``` | ||
|
||
4. Reach the frontend on http://localhost:5173 | ||
4. Reach the frontend on <http://localhost:5173> | ||
|
||
> [!NOTE] | ||
> Safari will not properly work in this setup, as it requires https for secure cookies. The simplest solution is to use Chrome or Firefox. An alternative is to use a caddy proxy. This is the solution used in docker-compose, so you can use it as an example. | ||
|
@@ -407,13 +405,13 @@ npm run dev | |
|
||
All variables in the frontend have handy default values. | ||
|
||
If you move the frontend on another host, you should set the following variable: PUBLIC_BACKEND_API_URL. Its default value is http://localhost:8000/api. | ||
If you move the frontend on another host, you should set the following variable: PUBLIC_BACKEND_API_URL. Its default value is <http://localhost:8000/api>. | ||
|
||
When you launch "node server" instead of "npm run dev", you need to set the ORIGIN variable to the same value as CISO_ASSISTANT_URL in the backend (e.g. http://localhost:3000). | ||
When you launch "node server" instead of "npm run dev", you need to set the ORIGIN variable to the same value as CISO_ASSISTANT_URL in the backend (e.g. <http://localhost:3000>). | ||
|
||
### Managing migrations | ||
|
||
The migrations are tracked by version control, https://docs.djangoproject.com/en/4.2/topics/migrations/#version-control | ||
The migrations are tracked by version control, <https://docs.djangoproject.com/en/4.2/topics/migrations/#version-control> | ||
|
||
For the first version of the product, it is recommended to start from a clean migration. | ||
|
||
|
@@ -449,7 +447,7 @@ The goal of the test harness is to prevent any regression, i.e. all the tests sh | |
|
||
## API and Swagger | ||
|
||
- The API documentation is available in dev mode on the `<backend_endpoint>/api/schema/swagger/`, for instance http://127.0.0.1:8000/api/schema/swagger/ | ||
- The API documentation is available in dev mode on the `<backend_endpoint>/api/schema/swagger/`, for instance <http://127.0.0.1:8000/api/schema/swagger/> | ||
|
||
To interact with it: | ||
|
||
|
@@ -496,7 +494,7 @@ Set DJANGO_DEBUG=False for security reason. | |
|
||
## Security | ||
|
||
Great care has been taken to follow security best practices. Please report any issue to [email protected]. | ||
Great care has been taken to follow security best practices. Please report any issue to <[email protected]>. | ||
|
||
## License | ||
|
||
|
@@ -506,6 +504,6 @@ All the files within the top-level "enterprise" directory are released under the | |
|
||
All the files outside the top-level "enterprise" directory are released under the [AGPLv3](https://choosealicense.com/licenses/agpl-3.0/). | ||
|
||
See [LICENSE.txt](./LICENSE.txt) for details. | ||
See [LICENSE.txt](./LICENSE.txt) for details. For more details about the commercial editions, you can reach us on <[email protected]>. | ||
|
||
Unless otherwise noted, all files are © intuitem. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,15 @@ | ||
# Quick start (development) | ||
|
||
1. Install the `enterprise_core` package | ||
1. Make sure you are in the `enterprise/backend` directory | ||
|
||
```bash | ||
cd enterprise/backend | ||
poetry install | ||
``` | ||
|
||
2. Start the development server with the enterprise settings file | ||
2. Install the `enterprise_core` package | ||
|
||
```bash | ||
python manage.py runserver --settings=enterprise_core.settings | ||
poetry install | ||
``` | ||
|
||
# Running a white label instance | ||
|
||
This can be done by running the development server with the `FF_WHITE_LABEL` environment variable set to `true`. | ||
3. Start the development server with the enterprise settings file | ||
|
||
```bash | ||
export FF_WHITE_LABEL=true | ||
python manage.py runserver --settings=enterprise_core.settings | ||
poetry run manage.sh runserver | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
DJANGO_DIR=../../backend | ||
ENTERPRISE_SETTINGS=enterprise_core.settings | ||
|
||
python $DJANGO_DIR/manage.py $@ --settings=$ENTERPRISE_SETTINGS |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,45 @@ | ||||||||||
version: "3.9" | ||||||||||
|
||||||||||
services: | ||||||||||
backend: | ||||||||||
container_name: backend | ||||||||||
build: | ||||||||||
context: ./backend | ||||||||||
dockerfile: Dockerfile | ||||||||||
restart: always | ||||||||||
environment: | ||||||||||
- ALLOWED_HOSTS=backend,localhost | ||||||||||
- CISO_ASSISTANT_URL=https://localhost:8443 | ||||||||||
- DJANGO_DEBUG=True | ||||||||||
volumes: | ||||||||||
- ./db:/code/db | ||||||||||
|
||||||||||
frontend: | ||||||||||
container_name: frontend | ||||||||||
environment: | ||||||||||
- PUBLIC_BACKEND_API_URL=http://backend:8000/api | ||||||||||
- PUBLIC_BACKEND_API_EXPOSED_URL=https://localhost:8443/api | ||||||||||
- PROTOCOL_HEADER=x-forwarded-proto | ||||||||||
- HOST_HEADER=x-forwarded-host | ||||||||||
|
||||||||||
build: ./frontend | ||||||||||
depends_on: | ||||||||||
- backend | ||||||||||
|
||||||||||
caddy: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue identified by the Semgrep linter is that the To mitigate this risk, the root filesystem should be set to read-only. This can be done by adding the Here is the single line change to fix the issue:
Suggested change
This comment was generated by an experimental AI tool. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue identified by the Semgrep linter is that the To mitigate this issue, you should add the Here's the single line code suggestion to fix the issue:
Suggested change
This comment was generated by an experimental AI tool. |
||||||||||
container_name: caddy | ||||||||||
image: caddy:2.7.6 | ||||||||||
environment: | ||||||||||
- CISO_ASSISTANT_URL=https://localhost:8443 | ||||||||||
restart: unless-stopped | ||||||||||
ports: | ||||||||||
- 8443:8443 | ||||||||||
volumes: | ||||||||||
- ./db:/data | ||||||||||
command: | | ||||||||||
sh -c 'echo $$CISO_ASSISTANT_URL "{ | ||||||||||
reverse_proxy /api/iam/sso/redirect/ backend:8000 | ||||||||||
reverse_proxy /api/accounts/saml/0/acs/ backend:8000 | ||||||||||
reverse_proxy /api/accounts/saml/0/acs/finish/ backend:8000 | ||||||||||
reverse_proxy /* frontend:3000 | ||||||||||
}" > Caddyfile && caddy run' |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,57 @@ | ||||||||||
version: "3.9" | ||||||||||
|
||||||||||
services: | ||||||||||
backend: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue identified by the Semgrep linter is that the To mitigate this issue, you can add a security option to drop all capabilities and then explicitly add only the necessary ones. In Docker Compose, this can be achieved using the Here's the single line change to run the container as a non-root user, which can help prevent privilege escalation:
Suggested change
So the updated YAML fragment would look as follows: version: "3.9"
services:
backend:
container_name: backend
image: ghcr.io/intuitem/ciso-assistant-community/enterprise-backend:latest
restart: always
depends_on:
- postgres
user: "1000:1000"
environment:
- ALLOWED_HOSTS=backend
- CISO_ASSISTANT_URL=https://localhost:8443
- DJANGO_DEBUG=True
- POSTGRES_NAME=ciso_assistant This comment was generated by an experimental AI tool. |
||||||||||
container_name: backend | ||||||||||
image: ghcr.io/intuitem/ciso-assistant-community/enterprise-backend:latest | ||||||||||
restart: always | ||||||||||
depends_on: | ||||||||||
- postgres | ||||||||||
environment: | ||||||||||
- ALLOWED_HOSTS=backend | ||||||||||
- CISO_ASSISTANT_URL=https://localhost:8443 | ||||||||||
- DJANGO_DEBUG=True | ||||||||||
- POSTGRES_NAME=ciso_assistant | ||||||||||
- POSTGRES_USER=ciso_assistant | ||||||||||
- POSTGRES_PASSWORD=ciso_assistant | ||||||||||
- DB_HOST=postgres | ||||||||||
volumes: | ||||||||||
- ./db:/code/db | ||||||||||
|
||||||||||
frontend: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue identified by Semgrep is related to potential privilege escalation within the To mitigate this risk, you can add the
Suggested change
This option ensures that no process in the container can gain new privileges, effectively preventing privilege escalation. Here's the corrected YAML fragment with the added security option: frontend:
container_name: frontend
environment:
- PUBLIC_BACKEND_API_URL=http://backend:8000/api
- PROTOCOL_HEADER=x-forwarded-proto
- HOST_HEADER=x-forwarded-host
image: ghcr.io/intuitem/ciso-assistant-community/enterprise-frontend:latest
depends_on:
- backend
security_opt: ["no-new-privileges:true"] This comment was generated by an experimental AI tool. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The security issue identified by the Semgrep linter is that the To mitigate this risk, you should set the Here is the code suggestion to fix the issue:
Suggested change
This comment was generated by an experimental AI tool. |
||||||||||
container_name: frontend | ||||||||||
environment: | ||||||||||
- PUBLIC_BACKEND_API_URL=http://backend:8000/api | ||||||||||
- PROTOCOL_HEADER=x-forwarded-proto | ||||||||||
- HOST_HEADER=x-forwarded-host | ||||||||||
|
||||||||||
image: ghcr.io/intuitem/ciso-assistant-community/enterprise-frontend:latest | ||||||||||
depends_on: | ||||||||||
- backend | ||||||||||
|
||||||||||
postgres: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue identified by the Semgrep linter is related to the potential for privilege escalation via setuid or setgid binaries within the To mitigate this issue, we should run the container with a non-root user. One way to do this is by specifying the
Suggested change
This comment was generated by an experimental AI tool. |
||||||||||
container_name: postgres | ||||||||||
image: postgres:16 | ||||||||||
restart: always | ||||||||||
environment: | ||||||||||
POSTGRES_DB: ciso_assistant | ||||||||||
POSTGRES_USER: ciso_assistant | ||||||||||
POSTGRES_PASSWORD: ciso_assistant | ||||||||||
volumes: | ||||||||||
- ./db/pg:/var/lib/postgresql/data | ||||||||||
|
||||||||||
caddy: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue identified by the Semgrep linter is that the To fix this issue, you can set the Here is the single line change that addresses this issue:
Suggested change
This comment was generated by an experimental AI tool. |
||||||||||
container_name: caddy | ||||||||||
image: caddy:2.7.6 | ||||||||||
restart: unless-stopped | ||||||||||
ports: | ||||||||||
- 8443:8443 | ||||||||||
command: | ||||||||||
- caddy | ||||||||||
- reverse-proxy | ||||||||||
- --from | ||||||||||
- https://localhost:8443 | ||||||||||
- --to | ||||||||||
- frontend:3000 | ||||||||||
volumes: | ||||||||||
- ./db:/data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apk add <package>
useapk add <package>=<version>
The issue identified by Hadolint is that the
apk add
command does not specify exact versions for the packages being installed. This can lead to inconsistencies and potential issues in the future if the packages are updated and introduce breaking changes. By pinning the package versions, you ensure that the same versions are used each time the Docker image is built, which helps in maintaining a stable and reproducible build environment.Here's the single line change to fix the issue:
This comment was generated by an experimental AI tool.