Skip to content

feat: make feed license configurable via environment variable#609

Closed
opbot-xd wants to merge 43 commits intointelowlproject:developfrom
opbot-xd:feature/configurable-feed-license
Closed

feat: make feed license configurable via environment variable#609
opbot-xd wants to merge 43 commits intointelowlproject:developfrom
opbot-xd:feature/configurable-feed-license

Conversation

@opbot-xd
Copy link
Copy Markdown
Contributor

@opbot-xd opbot-xd commented Dec 13, 2025

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:

  • Moved FEEDS_LICENSE from hardcoded constant to optional environment variable.
  • Updated all API views to conditionally include license field only when configured.
  • Modified tests to handle both scenarios (with/without license).
  • Added configuration option to env_file_template with documentation.

Implementation Details:

  • When FEEDS_LICENSE is set, it's included in all API responses (feeds, enrichment, etc.).
  • When not set, the license field is completely omitted from responses.
  • Backward compatible: existing deployments can set the variable to maintain current behavior.

Related issues

Closes #599

Type of change

  • New feature (non-breaking change which adds functionality).

Checklist

  • I have read and understood the rules about how to Contribute to this project.
  • The pull request is for the branch develop.
  • I have added documentation of the new features.
  • Linters (Black, Flake, Isort) gave 0 errors.
  • I have added tests for the feature/bug I solved. All the tests (new and old ones) gave 0 errors.
  • If changes were made to an existing model/serializer/view, the docs were updated and regenerated (check CONTRIBUTE.md).
  • If the GUI has been modified:
    • I have a provided a screenshot of the result in the PR.
    • I have created new frontend tests for the new component or updated existing ones.

mlodic and others added 30 commits April 6, 2023 16:21
* 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>
* 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>
mlodic and others added 10 commits July 18, 2025 19:14
* 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
…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
Copy link
Copy Markdown
Collaborator

@regulartim regulartim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, good work! 👍

Comment on lines +210 to +214
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}"
)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes sure

@opbot-xd
Copy link
Copy Markdown
Contributor Author

Hi! I've updated the PR based on your feedback:

  • Simplified license handling to use the constant directly
  • Added tests for both populated and empty FEEDS_LICENSE scenarios

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.
@regulartim
Copy link
Copy Markdown
Collaborator

Looks good to me! 👍
Please use the PR template next time @opbot-xd .

@mlodic : Are you fine with the changes? Then I would like to merge.

@regulartim
Copy link
Copy Markdown
Collaborator

@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 main branch, as was your last one. Go through the checklist again and make sure that everything you checked is actually true. Then confirm this with a comment.

@opbot-xd opbot-xd changed the base branch from main to develop December 16, 2025 13:14
@gitguardian
Copy link
Copy Markdown

gitguardian bot commented Dec 16, 2025

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
20141940 Triggered Username Password 127d67a tests/authentication/test_auth.py View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. 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


🦉 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.

@opbot-xd
Copy link
Copy Markdown
Contributor Author

This PR was mistakenly opened against main instead of develop, which caused an incorrect commit history.
Closing it and will submit a clean PR targeting develop. Apologies for the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Static feed license

4 participants