feat: make feed license configurable via environment variable#609
feat: make feed license configurable via environment variable#609opbot-xd wants to merge 43 commits intointelowlproject:developfrom
Conversation
* adjusted dependabot config * Bump library/nginx from 1.21.1-alpine to 1.23.4-alpine in /docker (intelowlproject#118) Bumps library/nginx from 1.21.1-alpine to 1.23.4-alpine. --- updated-dependencies: - dependency-name: library/nginx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update drf-spectacular requirement in /requirements (intelowlproject#119) Updates the requirements on [drf-spectacular](https://github.com/tfranzel/drf-spectacular) to permit the latest version. - [Release notes](https://github.com/tfranzel/drf-spectacular/releases) - [Changelog](https://github.com/tfranzel/drf-spectacular/blob/master/CHANGELOG.rst) - [Commits](tfranzel/drf-spectacular@0.22.0...0.26.1) --- updated-dependencies: - dependency-name: drf-spectacular dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * added twitter publish * Update certego-saas requirement from ~=0.2.0 to ~=0.5.0 in /requirements (intelowlproject#124) Updates the requirements on [certego-saas](https://github.com/certego/certego-saas) to permit the latest version. - [Release notes](https://github.com/certego/certego-saas/releases) - [Commits](certego/certego-saas@0.2.0...0.5.0) --- updated-dependencies: - dependency-name: certego-saas dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump myst-parser from 0.17.0 to 1.0.0 in /requirements (intelowlproject#120) Bumps [myst-parser](https://github.com/executablebooks/MyST-Parser) from 0.17.0 to 1.0.0. - [Release notes](https://github.com/executablebooks/MyST-Parser/releases) - [Changelog](https://github.com/executablebooks/MyST-Parser/blob/master/CHANGELOG.md) - [Commits](executablebooks/MyST-Parser@v0.17.0...v1.0.0) --- updated-dependencies: - dependency-name: myst-parser dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * added healthchecks * fixed nginx location * added back uwsgi and uwsgitop * added stag override * uwsgi adjustments * adjusted uwsgi path and removed healthcheck for celery * fixed uwsgi installation in alpine --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* adjusted messages for the registration (intelowlproject#184) * adjusted messages * runned prettier --------- Co-authored-by: Martina Carella <m.carella@external.certego.net> * added recaptcha on login page (intelowlproject#185) * adjusted messages * runned prettier * added recaptcha on login page * adjusted tests * adjusted docs --------- Co-authored-by: Matteo Lodi <30625432+mlodic@users.noreply.github.com> * updated dependencies * Bump celery from 5.3.0 to 5.3.1 in /requirements (intelowlproject#192) Bumps [celery](https://github.com/celery/celery) from 5.3.0 to 5.3.1. - [Release notes](https://github.com/celery/celery/releases) - [Changelog](https://github.com/celery/celery/blob/main/Changelog.rst) - [Commits](celery/celery@v5.3.0...v5.3.1) --- updated-dependencies: - dependency-name: celery dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump library/nginx from 1.25.0-alpine to 1.25.1-alpine in /docker (intelowlproject#193) Bumps library/nginx from 1.25.0-alpine to 1.25.1-alpine. --- updated-dependencies: - dependency-name: library/nginx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump django from 4.1.9 to 4.1.10 in /requirements (intelowlproject#200) Bumps [django](https://github.com/django/django) from 4.1.9 to 4.1.10. - [Commits](django/django@4.1.9...4.1.10) --- updated-dependencies: - dependency-name: django dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Matteo Lodi <30625432+mlodic@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump uwsgi from 2.0.21 to 2.0.22 in /requirements (intelowlproject#217) Bumps [uwsgi](https://github.com/unbit/uwsgi-docs) from 2.0.21 to 2.0.22. - [Commits](https://github.com/unbit/uwsgi-docs/commits) --- updated-dependencies: - dependency-name: uwsgi dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Matteo Lodi <30625432+mlodic@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump library/nginx from 1.25.1-alpine to 1.25.2-alpine in /docker (intelowlproject#216) Bumps library/nginx from 1.25.1-alpine to 1.25.2-alpine. --- updated-dependencies: - dependency-name: library/nginx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump certego-saas from 0.6.0 to 0.7.0 in /requirements (intelowlproject#213) Bumps [certego-saas](https://github.com/certego/certego-saas) from 0.6.0 to 0.7.0. - [Release notes](https://github.com/certego/certego-saas/releases) - [Commits](certego/certego-saas@0.6.0...0.7.0) --- updated-dependencies: - dependency-name: certego-saas dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * tweak * Bump psycopg2-binary from 2.9.6 to 2.9.7 in /requirements (intelowlproject#212) Bumps [psycopg2-binary](https://github.com/psycopg/psycopg2) from 2.9.6 to 2.9.7. - [Changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS) - [Commits](psycopg/psycopg2@2.9.6...2.9.7) --- updated-dependencies: - dependency-name: psycopg2-binary dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * updated read the docs * Moved * Squashed '.github/' content from commit 492bd6d git-subtree-dir: .github git-subtree-split: 492bd6d16d1620011d5ed428d5325538ee83f6ad * merge * Bump django from 4.1.10 to 4.1.11 in /requirements (intelowlproject#219) Bumps [django](https://github.com/django/django) from 4.1.10 to 4.1.11. - [Commits](django/django@4.1.10...4.1.11) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump celery from 5.3.1 to 5.3.4 in /requirements (intelowlproject#220) Bumps [celery](https://github.com/celery/celery) from 5.3.1 to 5.3.4. - [Release notes](https://github.com/celery/celery/releases) - [Changelog](https://github.com/celery/celery/blob/main/Changelog.rst) - [Commits](celery/celery@v5.3.1...v5.3.4) --- updated-dependencies: - dependency-name: celery dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Django admin autologin (intelowlproject#222) * django admin auto login * bump alpine from 3.14 to 3.18 in dockerfile --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Martina Carella <m.carella@external.certego.net> Co-authored-by: Daniele Rosetti <d.rosetti@certego.net> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: 0ssigeno <s.berni@certego.net> Co-authored-by: Martina Carella <m.carella@certego.net>
Bumps [axios](https://github.com/axios/axios) from 0.27.2 to 0.28.0. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v0.28.0/CHANGELOG.md) - [Commits](axios/axios@v0.27.2...v0.28.0) --- updated-dependencies: - dependency-name: axios dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…t#270)" (intelowlproject#286) This reverts commit 080321e.
* Command sequences. Closes intelowlproject#457 (intelowlproject#468) * add CommandSequence model * add CommandSequence model to admin page * make migration file * add unique constraint to commands hash in CommandSequence model * add extraction of command sequences * add tests * add clustering task for command sequences * limit single command length during extraction * add tests for clustering * add 10 second delay to extraction jobs (will hopefully fix intelowlproject#451) * removed twitter publish cause not working * Deliver scores in Feeds API (intelowlproject#473) * add scores to serializer * fix docstring * add scores to required fields in deeds_response function * adapt tests * fix constant assignments (see intelowlproject#469) * make pending migration * skip empty IP address fields when extracting attacker data fixes intelowlproject#475 * Advanced feeds integration (intelowlproject#476) * Rename "age" to "prioritize" in backend code and add new prioritization mechanisms * Rename "age" to "prioritize" in frontend code * fix tests * adapt frontend tests * Bump numpy from 2.2.2 to 2.2.3 in /requirements (intelowlproject#465) Bumps [numpy](https://github.com/numpy/numpy) from 2.2.2 to 2.2.3. - [Release notes](https://github.com/numpy/numpy/releases) - [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst) - [Commits](numpy/numpy@v2.2.2...v2.2.3) --- updated-dependencies: - dependency-name: numpy dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bump --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: tim <46972822+regulartim@users.noreply.github.com> Co-authored-by: tim <tim.leonhard@posteo.de> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump joblib from 1.5.0 to 1.5.1 in /requirements (intelowlproject#515) Bumps [joblib](https://github.com/joblib/joblib) from 1.5.0 to 1.5.1. - [Release notes](https://github.com/joblib/joblib/releases) - [Changelog](https://github.com/joblib/joblib/blob/main/CHANGES.rst) - [Commits](joblib/joblib@1.5.0...1.5.1) --- updated-dependencies: - dependency-name: joblib dependency-version: 1.5.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bump 1.6.3 and removed support for ARM builds --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Matteo Lodi <mlodi@vmray.com>
* Include mass scanners in advanced API by default. Closes intelowlproject#580 (intelowlproject#581) * Partly revert "added mass scanner exclusion as default" This reverts commit f953887. * adapt tests * add "tor exit nodes" to default excludes * add test case for tor exit node inclusion * add test case for tor exit node inclusion (ii) * fix syntax * rename method * Upgrade Django to 5.2. Closes intelowlproject#502 (intelowlproject#579) * bump django-rest-email-auth * bump django to 5.2 * bump postgres to 18 (this requires manual manual intervention when upgrading GreedyBear) * Link to admin interface for staff users. Closes intelowlproject#529 (intelowlproject#582) * remove restriction to only show link to superusers * fix indentation * bump 2.0.0 * adapt CI
adjusting commit history
…elowlproject#595) Bumps the pip group with 1 update in the /requirements directory: [django](https://github.com/django/django). Updates `django` from 5.2.7 to 5.2.8 - [Commits](django/django@5.2.7...5.2.8) --- updated-dependencies: - dependency-name: django dependency-version: 5.2.8 dependency-type: direct:production dependency-group: pip ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Move FEEDS_LICENSE from hardcoded constant to optional environment variable - Update settings.py to read FEEDS_LICENSE from environment - Add FEEDS_LICENSE configuration to env_file_template with example - Modify API views to only include license field when FEEDS_LICENSE is set - Update tests to handle both scenarios (with/without license configured) - This allows self-hosted instances to use different licenses or none at all Fixes intelowlproject#599
regulartim
left a comment
There was a problem hiding this comment.
Thank you, good work! 👍
api/views/utils.py
Outdated
| if FEEDS_LICENSE: | ||
| license_text = ( | ||
| f"# These feeds are generated by The Honeynet Project once every {EXTRACTION_INTERVAL} minutes " | ||
| f"and are protected by the following license: {FEEDS_LICENSE}" | ||
| ) |
There was a problem hiding this comment.
Maybe we should handle the license stuff here the same way you solved it in the other API endpoints. This particular text is only relevant for one single instance of GreedyBear, the one that runs on the Honeynet Server. Is it sufficient to remove the text and just link to the URL in the FEED_LICENSE constant @mlodic ? This way we have uniform license handling across all API endpoints. What do you think @opbot-xd ?
There was a problem hiding this comment.
That makes more sense. Let me update it to just include the license URL directly in the FEED_LICENSE constant without the extra text wrapping. This way it's cleaner across all endpoints.
There was a problem hiding this comment.
For the tests I think we should always test both cases: (1) when FEED_LICENSE is populated and (2) when it is not. At the moment that depends on the environment variable and therefore only one of those two cases is tested, correct? Could you please do that @opbot-xd ?
|
Hi! I've updated the PR based on your feedback:
Let me know if any other changes are needed. Thank you! |
…e_settings compatibility The @override_settings decorator only works when accessing settings through django.conf.settings, not with direct imports. This fixes test failures where FEEDS_LICENSE was imported directly from greedybear.settings. Changes: - api/views/utils.py: Import settings and use settings.FEEDS_LICENSE - api/views/command_sequence.py: Import settings and use settings.FEEDS_LICENSE - api/views/cowrie_session.py: Import settings and use settings.FEEDS_LICENSE - tests/test_views.py: Import settings and use settings.FEEDS_LICENSE This ensures tests with @override_settings(FEEDS_LICENSE="...") work correctly.
|
@opbot-xd : You have to follow our checklist diligently, if you want to contribute to our project. You checked the box at "The pull request is for the branch develop.". However, this PR is for the |
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 20141940 | Triggered | Username Password | 127d67a | tests/authentication/test_auth.py | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
|
This PR was mistakenly opened against main instead of develop, which caused an incorrect commit history. |
feat: make feed license configurable. Closes #599
Description
This PR makes the feed license configurable via environment variable, allowing self-hosted GreedyBear instances to use different licenses or none at all.
Changes:
FEEDS_LICENSEfrom hardcoded constant to optional environment variable.env_file_templatewith documentation.Implementation Details:
FEEDS_LICENSEis set, it's included in all API responses (feeds, enrichment, etc.).Related issues
Closes #599
Type of change
Checklist
develop.Black,Flake,Isort) gave 0 errors.