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

Secret Scanning not working on Linux agents #2269

Open
Argandov opened this issue Jul 25, 2024 · 4 comments
Open

Secret Scanning not working on Linux agents #2269

Argandov opened this issue Jul 25, 2024 · 4 comments
Assignees
Labels
bug Something isn't working needs-triage Indicates that issue is not yet triaged and assigned

Comments

@Argandov
Copy link

Technical Context

  • Components/Services affected: Deepfence agent (Linux)
  • Affected Module: Secret Scanning
  • OS version: Debian GNU/Linux 12 (bookworm), AMD64
  • Deepfence agent version: I have no idea; I am not familiar with the agents' architecture but the installer was deepfence-agent-amd64-2.2.2.tar.gz

Describe the bug

  1. The Secret Scanner is not working in Linux Debian agents. I get an "Error" without any context in Deepfence Web UI as shown below:
image

What I've done to try to understand the error:

I am mostly grepping through the logs at /opt/deepfence/df-agents/copilot/var/log/supervisor/deepfenced.log 

image

I am seeing WARN errors skip <Deepfence_module> rules update already new in the logs for deepfence agents in Linux. I don't know what that means, and I don't know either if there's something wrong with my installation (I don't know either if the WARN messages are related, or if this WARN errors may indicate some other issue I'm not even aware of yet, not related to secret scanning):

image

How I installed the agent:

  1. sudo bash
  2. export MGMT_CONSOLE_URL="MY DF SERVER IP"
    export DEEPFENCE_KEY="MY KEY"
    (As per the instructions in the Web UI)
  3.  bash install_deepfence_agent.sh

Expected behavior

Secret Scanning on Linux hosts working

Thank you, I don't know what to do here, if the error lies on my side or there's something wrong with DF-agents

@Argandov Argandov added bug Something isn't working needs-triage Indicates that issue is not yet triaged and assigned labels Jul 25, 2024
@gnmahanth
Copy link
Contributor

can you please show us the deepfence-worker logs and also is it possible to restart the management console and try again

@Argandov
Copy link
Author

Hi, where are the deepfence-worker logs?

TL;DR: I restarted the management console. secret scanner logs on DF agent are empty. Same error again

image

Deepfence agent on Linux

I'm on the deepfence Linux agent and I don't know where are the deepfence-worker logs:

image

the Secret_scanner.log file is empty (Even after restarting the management console and starting a secret scan again):

image

FTR: Restarting management console

I restarted the management console by:

docker-compose -f docker-compose.yml down

then up again:

docker-compose -f docker-compose.yml up --detach

@Argandov
Copy link
Author

UPDATE:

I just realized you meant deepfence_worker Docker container. Here they are but I'm not sure what exactly would you like to see:

image image

If you want me to do something else with the logs please tell me so I know what exactly to show you

@gnmahanth
Copy link
Contributor

gnmahanth commented Jul 26, 2024

@Argandov

I tried to run agent on Debian 12 and I was able to run all the scans successfully

can you please provide the full log file /opt/deepfence/df-agents/copilot/var/log/supervisor/deepfenced.log we should be able to see why secret scanner is not starting

meanwhile can you try to uninstall and install the agent again

if secret scanner start without any issues the secret scanner log file will have below content

root@mahanth-debian-12:/opt/deepfence/df-agents/mahanth-debian-12/var/log/deepfenced# cat secret_scanner.log 
time="2024-07-26 04:16:05" level=error msg="open /opt/deepfence/df-agents/mahanth-debian-12/home/deepfence/bin/secret-scanner/config/config.yaml: no such file or directory"
time="2024-07-26 04:16:10" level=error msg="open /opt/deepfence/df-agents/mahanth-debian-12/home/deepfence/bin/secret-scanner/config/config.yaml: no such file or directory"
time="2024-07-26 04:16:15" level=error msg="open /opt/deepfence/df-agents/mahanth-debian-12/home/deepfence/bin/secret-scanner/config/config.yaml: no such file or directory"
INFO[2024-07-26T04:16:21Z] grpc.go:98 main: server listening at /opt/deepfence/df-agents/mahanth-debian-12/tmp/secret-scanner.sock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Indicates that issue is not yet triaged and assigned
Projects
None yet
Development

No branches or pull requests

2 participants