agent: | Auto Exec |
What is an "Expert"? How do we create our own expert?
Add credentials for various integrations
Managing workspaces and access control
DagKnows Architecture Overview
Setting up SSO via Azure AD for Dagknows
Enable "Auto Exec" and "Send Execution Result to LLM" in "Adjust Settings" if desired
(Optionally) Add ubuntu user to docker group and refresh group membership
Deployment of an EKS Cluster with Worker Nodes in AWS
Adding, Deleting, Listing DagKnows Proxy credentials or key-value pairs
Comprehensive AWS Security and Compliance Evaluation Workflow (SOC2 Super Runbook)
AWS EKS Version Update 1.29 to 1.30 via terraform
Instruction to allow WinRM connection
MSP Usecase: User Onboarding Azure + M365
Post a message to a Slack channel
How to debug a kafka cluster and kafka topics?
Open VPN Troubleshooting (Powershell)
Execute a simple task on the proxy
Assign the proxy role to a user
Create roles to access credentials in proxy
Install OpenVPN client on Windows laptop
Setup Kubernetes kubectl and Minikube on Ubuntu 22.04 LTS
Install Prometheus and Grafana on the minikube cluster on EC2 instance in the monitoring namespace
update the EKS versions in different clusters
AI agent session 2024-09-12T09:36:14-07:00 by Sarang Dharmapurikar
Parse EDN content and give a JSON out
Check whether a user is there on Azure AD and if the user account status is enabled
Get the input parameters of a Jenkins pipeline
Evaluate all default security groups in every Amazon VPC and verify that they do not allow any inbound or outbound traffic; return NON_COMPLIANT if any default security group has one or more inbound or outbound rules. Tabulate the results.
- 1p9Dzht4LoQjZs5SAhLaGList all VPCs in the AWS account.
1
List all VPCs in the AWS account.
There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.Lists all VPCs in the AWS account across all regions.
inputsoutputsimport boto3 import json # Retrieve AWS credentials from environment variables aws_access_key_id = getEnvVar('AWS_ACCESS_KEY_ID') aws_secret_access_key = getEnvVar('AWS_SECRET_ACCESS_KEY') # Initialize a session using Amazon EC2 session = boto3.Session( aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key, region_name='us-east-2' ) ec2_client = session.client('ec2') # Retrieve all regions regions = [region['RegionName'] for region in ec2_client.describe_regions()['Regions']] # List to store all VPCs vpcs = [] # Iterate over each region for region in regions: ec2_client = session.client('ec2', region_name=region) # Describe all VPCs vpcs_in_region = ec2_client.describe_vpcs()['Vpcs'] vpcs.extend(vpcs_in_region) # Print all VPCs print(json.dumps(vpcs, indent=4, default=str))copied1 - 2qYk9cupRDMmHW4xlrVqhFor each VPC, list all default security groups.
2
For each VPC, list all default security groups.
There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.Lists all default security groups for each VPC across all regions.
inputsoutputsimport boto3 import json # Retrieve AWS credentials from environment variables aws_access_key_id = getEnvVar('AWS_ACCESS_KEY_ID') aws_secret_access_key = getEnvVar('AWS_SECRET_ACCESS_KEY') # Initialize a session using Amazon EC2 session = boto3.Session( aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key, region_name='us-east-2' ) ec2_client = session.client('ec2') # Retrieve all regions regions = [region['RegionName'] for region in ec2_client.describe_regions()['Regions']] # List to store all default security groups default_security_groups = [] # Iterate over each region for region in regions: ec2_client = session.client('ec2', region_name=region) # Describe all VPCs vpcs = ec2_client.describe_vpcs()['Vpcs'] # Iterate over each VPC for vpc in vpcs: # Describe security groups for the VPC security_groups = ec2_client.describe_security_groups(Filters=[{'Name': 'vpc-id', 'Values': [vpc['VpcId']]}])['SecurityGroups'] # Filter default security groups for sg in security_groups: if sg['GroupName'] == 'default': default_security_groups.append(sg) # Print all default security groups print(json.dumps(default_security_groups, indent=4, default=str))copied2 - 3q3PLAaLey1Ft3YFfwTmTEvaluate each default security group to verify that they do not allow any inbound or outbound traffic.
3
There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.Evaluates each default security group to verify that they do not allow any inbound or outbound traffic and tabulates the compliance results.
inputsoutputsimport boto3 import json # Retrieve AWS credentials from environment variables aws_access_key_id = getEnvVar('AWS_ACCESS_KEY_ID') aws_secret_access_key = getEnvVar('AWS_SECRET_ACCESS_KEY') # Initialize a session using Amazon EC2 session = boto3.Session( aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key, region_name='us-east-2' ) ec2_client = session.client('ec2') # Retrieve all regions regions = [region['RegionName'] for region in ec2_client.describe_regions()['Regions']] # List to store compliance results compliance_results = [] # Iterate over each region for region in regions: ec2_client = session.client('ec2', region_name=region) # Describe all VPCs vpcs = ec2_client.describe_vpcs()['Vpcs'] # Iterate over each VPC for vpc in vpcs: # Describe security groups for the VPC security_groups = ec2_client.describe_security_groups(Filters=[{'Name': 'vpc-id', 'Values': [vpc['VpcId']]}])['SecurityGroups'] # Filter default security groups for sg in security_groups: if sg['GroupName'] == 'default': # Check if there are any inbound or outbound rules if sg['IpPermissions'] or sg['IpPermissionsEgress']: compliance_results.append({ 'VpcId': vpc['VpcId'], 'SecurityGroupId': sg['GroupId'], 'Compliance': 'NON_COMPLIANT' }) else: compliance_results.append({ 'VpcId': vpc['VpcId'], 'SecurityGroupId': sg['GroupId'], 'Compliance': 'COMPLIANT' }) # Print compliance results print(json.dumps(compliance_results, indent=4, default=str))copied3