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

Improve export of AWS Inspector findings #39

Open
theodoorscholte opened this issue Nov 1, 2022 · 0 comments
Open

Improve export of AWS Inspector findings #39

theodoorscholte opened this issue Nov 1, 2022 · 0 comments

Comments

@theodoorscholte
Copy link
Collaborator

theodoorscholte commented Nov 1, 2022

The labeler should support extraction of the following fields:

  • Platform name
  • AMI ID
  • IP addresses
  • VPC ID
  • Subnet ID
  • CVE ID
  • CVE vendor URL
  • CVSS score + vectors
  • Affected packages
  • Tags on resources

An Inspector finding in Security Hub looks as follows:
``

{
        "SchemaVersion": "2018-10-08",
        "Id": "arn:aws:inspector2:eu-central-1:<AWS_ACCOUNT_ID>:finding/<FINDING_ID>",
        "ProductArn": "arn:aws:securityhub:eu-central-1::product/aws/inspector",
        "ProductName": "Inspector",
        "CompanyName": "Amazon",
        "Region": "eu-central-1",
        "GeneratorId": "AWSInspector",
        "AwsAccountId": "<AWS_ACCOUNT_ID>",
        "Types": [
            "Software and Configuration Checks/Vulnerabilities/CVE"
        ],
        "FirstObservedAt": "2022-10-14T09:46:26Z",
        "LastObservedAt": "2022-11-01T11:31:51Z",
        "CreatedAt": "2022-10-14T09:46:26Z",
        "UpdatedAt": "2022-11-01T11:31:51Z",
        "Severity": {
            "Label": "MEDIUM",
            "Normalized": 40
        },
        "Title": "CVE-2022-37434 - zlib",
        "Description": "A security vulnerability was found in zlib. The flaw triggered a heap-based buffer in inflate in the inflate.c function via a large gzip header extra field. This flaw is only applicable in the call inflateGetHeader.",
        "Remediation": {
                            "Recommendation": {
                "Text": "None Provided"
            }
        },
        "ProductFields": {
            "aws/inspector/FindingStatus": "ACTIVE",
            "aws/inspector/inspectorScore": "6.2",
            "aws/inspector/resources/1/resourceDetails/awsEc2InstanceDetails/platform": "AMAZON_LINUX_2",
            "aws/inspector/ProductVersion": "2",
            "aws/inspector/instanceId": "<INSTANCE_ID>",
            "aws/securityhub/FindingId": "arn:aws:securityhub:eu-central-1::product/aws/inspector/arn:aws:inspector2:eu-central-1:<AWS_ACCOUNT_ID>:finding/<FINDING_ID>",
            "aws/securityhub/ProductName": "Inspector",
            "aws/securityhub/CompanyName": "Amazon"
        },
        "Resources": [
            {
                "Type": "AwsEc2Instance",
                "Id": "arn:aws:ec2:eu-central-1:<INSTANCE_ID>",
                "Partition": "aws",
                "Region": "eu-central-1",
                "Tags": {
                    "map-migrated": "d-server-<INSTANCE_ID>",
                    "aws:autoscaling:groupName": "<eks_ID>",
                    "aws:ec2:fleet-id": "fleet-<FLEET ID>",
                    "kubernetes.io/cluster/team-name": "owned",
                    "k8s.io/cluster-autoscaler/team-name": "owned",
                    "aws:eks:cluster-name": "team-name",
                                           "eks:cluster-name": "team-name",
                    "aws:ec2launchtemplate:version": "1",
                    "eks:nodegroup-name": "another name",
                    "k8s.io/cluster-autoscaler/enabled": "true",
                    "aws:ec2launchtemplate:id": "<team name>"
                },
                "Details": {
                    "AwsEc2Instance": {
                        "Type": "c5.large",
                        "ImageId": "ami-<ID>",
                        "IpV4Addresses": [
                            "127.0.0.1",
                            "127.0.0.1"
                        ],
                        "IamInstanceProfileArn": "arn:aws:iam::<AWS_ACCOUNT_ID>:instance-profile/eks-<id>>",
                        "VpcId": "vpc-<id>>",
                        "SubnetId": "subnet-<id>>",
                        "LaunchedAt": "2022-08-31T09:31:47Z"
                    }
                }
            }
        ],
        "WorkflowState": "NEW",
        "Workflow": {
            "Status": "NEW"
        },
        "RecordState": "ACTIVE",
                    "Vulnerabilities": [
            {
                "Id": "CVE-2022-37434",
                "VulnerablePackages": [
                    {
                        "Name": "zlib",
                        "Version": "1.2.7",
                        "Epoch": "0",
                        "Release": "19.amzn2.0.1",
                        "Architecture": "X86_64"
                    }
                ],
                "Cvss": [
                    {
                        "Version": "3.1",
                        "BaseScore": 7,
                        "BaseVector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:H"
                    },
                    {
                        "Version": "3.1",
                        "BaseScore": 9.8,
                        "BaseVector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
                    },
                    {
                        "Version": "3.1",
                        "BaseScore": 6.2,
                                            "RelatedVulnerabilities": [
                    "RHSA-2022:7106"
                ],
                "Vendor": {
                    "Name": "REDHAT_CVE",
                    "Url": "https://access.redhat.com/security/cve/CVE-2022-37434",
                    "VendorSeverity": "Moderate",
                    "VendorCreatedAt": "2022-08-05T00:00:00Z"
                },
                "ReferenceUrls": [
                    "https://access.redhat.com/errata/RHSA-2022:7106"
                ]
            }
        ],
        "FindingProviderFields": {
            "Severity": {
                "Label": "MEDIUM"
            },
            "Types": [
                "Software and Configuration Checks/Vulnerabilities/CVE"
            ]
        }
    }
@theodoorscholte theodoorscholte changed the title Better support for exporting Inspector findings Improve export of AWS Inspector findings Nov 1, 2022
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

No branches or pull requests

1 participant