Skip to content
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

[cscli/crowdsec] Test environment improvements #3183

Open
3 tasks
LaurenceJJones opened this issue Aug 20, 2024 · 3 comments
Open
3 tasks

[cscli/crowdsec] Test environment improvements #3183

LaurenceJJones opened this issue Aug 20, 2024 · 3 comments
Labels
needs/kind needs/triage value/low Doing this kinda improves some areas
Milestone

Comments

@LaurenceJJones
Copy link
Contributor

What would you like to be added?

Currently if a user wants to download a test environment its pretty hard to get it configured correctly here are the issue:

/kind enhancement

Why is this needed?

Easier to setup a dev / test environment

Copy link

@LaurenceJJones: Thanks for opening an issue, it is currently awaiting triage.

In the meantime, you can:

  1. Check Crowdsec Documentation to see if your issue can be self resolved.
  2. You can also join our Discord.
  3. Check Releases to make sure your agent is on the latest version.
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

Copy link

@LaurenceJJones: There are no 'kind' label on this issue. You need a 'kind' label to start the triage process.

  • /kind feature
  • /kind enhancement
  • /kind refactoring
  • /kind bug
  • /kind packaging
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@LaurenceJJones LaurenceJJones changed the title [cscli] Test environment improvements [cscli/crowdsec] Test environment improvements Aug 20, 2024
@Natsui31
Copy link

Natsui31 commented Aug 20, 2024

Example of bug repro from fresh debian 12

apt update \
  && apt install -y gettext curl wget git libsqlite3-0
cd $(mktemp -d)
wget https://github.com/crowdsecurity/crowdsec/releases/download/v1.6.2/crowdsec-release.tgz
tar xvzf crowdsec-release.tgz
cd crowdsec-v1.6.2
./test_env.sh
export PATH=$PATH:"$PWD/cmd/crowdsec-cli/":"$PWD/cmd/crowdsec/"
alias csdev="$PWD/cmd/crowdsec-cli/cscli -c $PWD/config/dev.yaml"
git clone https://github.com/crowdsecurity/hub
export PATH=$PATH:"$PWD/cmd/crowdsec/":"$PWD/cmd/crowdsec-cli/"
cd hub
csdev hubtest run --all

With this environment, we got the same error as described in [cscli] We added patterns_dir option to config.yaml but isnt used in hubtest
On my test environment, config_paths.pattern_dir is not set.

root@05391e978e44:/tmp/tmp.MqISOY3GSv/crowdsec-v1.6.2/hub# csdev hubtest run --all
+ /tmp/tmp.MqISOY3GSv/crowdsec-v1.6.2/cmd/crowdsec-cli/cscli -c /tmp/tmp.MqISOY3GSv/crowdsec-v1.6.2/config/dev.yaml hubtest run --all
INFO Running test 'CVE-2017-9841'
ERRO running test 'CVE-2017-9841' failed: unable to copy 'patterns' from '/etc/crowdsec/patterns' to '/tmp/tmp.MqISOY3GSv/crowdsec-v1.6.2/hub/.tests/CVE-2017-9841/runtime/patterns': open /etc/crowdsec/patterns: no such file or directory
INFO Running test 'CVE-2019-18935'
ERRO running test 'CVE-2019-18935' failed: unable to copy 'patterns' from '/etc/crowdsec/patterns' to '/tmp/tmp.MqISOY3GSv/crowdsec-v1.6.2/hub/.tests/CVE-2019-18935/runtime/patterns': open /etc/crowdsec/patterns: no such file or directory
INFO Running test 'CVE-2021-4034'
ERRO running test 'CVE-2021-4034' failed: unable to copy 'patterns' from '/etc/crowdsec/patterns' to '/tmp/tmp.MqISOY3GSv/crowdsec-v1.6.2/hub/.tests/CVE-2021-4034/runtime/patterns': open /etc/crowdsec/patterns: no such file or directory
...

I assume that behavior could be disruptive when testing:

  • Upgrade compatibility to newer major version
  • Older major version installed with newer major version environment test

Note: I expect the test environment to be isolated from any pre-existing installations, ensuring that the results are not influenced by previously installed versions.

@LaurenceJJones LaurenceJJones added this to the 1.6.4 milestone Aug 20, 2024
@buixor buixor added the value/low Doing this kinda improves some areas label Oct 15, 2024
@buixor buixor modified the milestones: 1.6.4, 1.6.5 Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/kind needs/triage value/low Doing this kinda improves some areas
Projects
None yet
Development

No branches or pull requests

3 participants