go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/providers/network/resources/network.lr (about)

     1  // Copyright (c) Mondoo, Inc.
     2  // SPDX-License-Identifier: BUSL-1.1
     3  
     4  option provider = "go.mondoo.com/cnquery/providers/network"
     5  option go_package = "go.mondoo.com/cnquery/providers/network/resources"
     6  
     7  // Socket
     8  socket @defaults("protocol port address") {
     9    // Protocol for this socket
    10    protocol string
    11    // Port number
    12    port int
    13    // Target address
    14    address string
    15  }
    16  
    17  // TLS
    18  tls @defaults("socket domainName") {
    19    init(target string)
    20    // Socket of this connection
    21    socket socket
    22    // An optional domain name which will be tested
    23    domainName string
    24    // Params is a list of all parameters for this TLS/SSL connection
    25    params(socket, domainName) dict
    26    // Version of TLS/SSL that is being used
    27    versions(params) []string
    28    // Ciphers supported by a given TLS/SSL connection
    29    ciphers(params) []string
    30    // Extensions supported by this TLS/SSL connection
    31    extensions(params) []string
    32    // Certificates provided in this TLS/SSL connection
    33    certificates(params) []certificate
    34    // Certificates provided without server name indication (SNI)
    35    nonSniCertificates(params) []certificate
    36  }
    37  
    38  // x509 certificates resource
    39  certificates {
    40    []certificate
    41    // PEM content
    42    pem string
    43  }
    44  
    45  // x509 certificate resource
    46  certificate @defaults("serial subject.commonName subject.dn") {
    47    // PEM content
    48    pem string
    49    // Certificate Fingerprints
    50    fingerprints() map[string]string
    51    // Serial Number
    52    serial() string
    53    // Subject Unique Identifier
    54    subjectKeyID() string
    55    // Authority Key Identifier
    56    authorityKeyID() string
    57    // Subject
    58    subject() pkix.name
    59    // Issuer
    60    issuer() pkix.name
    61    // Version Number
    62    version() int
    63    // Validity period Validity period
    64    notBefore() time
    65    // Validity period Not After
    66    notAfter() time
    67    // Expiration Duration
    68    expiresIn() time
    69    // Signature
    70    signature() string
    71    // Signature Algorithm ID
    72    signingAlgorithm() string
    73    // Flag if Certificate Authority
    74    isCA() bool
    75    // Key Usage
    76    keyUsage() []string
    77    // Extended Key Usage
    78    extendedKeyUsage() []string
    79    // Extensions
    80    extensions() []pkix.extension
    81    // Policy Identifier
    82    policyIdentifier() []string
    83    // CRL Distribution Points
    84    crlDistributionPoints() []string
    85    // OCSP
    86    ocspServer() []string
    87    // Issuing Certificate Url
    88    issuingCertificateUrl() []string
    89    // Identifies if this certificate has been revoked
    90    isRevoked() bool
    91    // The time at which this certificate was revoked
    92    revokedAt() time
    93    // Indicates if the certificate is valid by checking its chain
    94    isVerified() bool
    95  }
    96  
    97  // x509 certificate PKIX name
    98  pkix.name @defaults("id dn commonName") {
    99    // ID
   100    id string
   101    // Distinguished Name Qualifier
   102    dn string
   103    // Serial Number
   104    serialNumber string
   105    // Common Name
   106    commonName string
   107    // Country
   108    country []string
   109    // Organization
   110    organization []string
   111    // Organizational Unit
   112    organizationalUnit []string
   113    locality []string
   114    // State or Province
   115    province []string
   116    // Street Address
   117    streetAddress []string
   118    // Postal Code
   119    postalCode []string
   120    names      map[string]string
   121    extraNames map[string]string
   122  }
   123  
   124  // x509 certificate PKIX extension
   125  pkix.extension {
   126    // Extension Identifier
   127    identifier string
   128    // Flag for Critical Extension
   129    critical bool
   130    // Extension Value
   131    value string
   132  }
   133  
   134  private openpgp.entities {
   135    []openpgp.entity(content)
   136    content string
   137  }
   138  
   139  // OpenPGP Entity
   140  private openpgp.entity {
   141    // primary public key, which must be a signing key
   142    primaryPublicKey openpgp.publicKey
   143    // Entity's Identities
   144    identities() []openpgp.identity
   145  }
   146  
   147  // OpenPGP Public Key
   148  private openpgp.publicKey {
   149    // Key ID
   150    id string
   151    // Key Version
   152    version int
   153    // Key Fingerprint
   154    fingerprint string
   155    // Key Algorithm
   156    keyAlgorithm string
   157    // Key Bit Length
   158    bitLength int
   159    // Key creation time
   160    creationTime time
   161  }
   162  
   163  // OpenPGP Identity
   164  private openpgp.identity {
   165    // Primary Key Fingerprint
   166    fingerprint string
   167    // Full name in form of "Full Name (comment) <email@example.com>"
   168    id string
   169    // Name
   170    name string
   171    // Email
   172    email string
   173    // Comment
   174    comment string
   175    // Identity Signatures
   176    signatures() []openpgp.signature
   177  }
   178  
   179  // OpenPGP Signature
   180  private openpgp.signature {
   181    // Primary Key Fingerprint
   182    fingerprint string
   183    // Identity Name
   184    identityName string
   185    // Signature Hash
   186    hash string
   187    // Signature Version
   188    version int
   189    // Signature Type
   190    signatureType string
   191    // Hash Algorithm
   192    keyAlgorithm string
   193    // Creation Time
   194    creationTime time
   195    // Signature Lifetime in Seconds
   196    lifetimeSecs int
   197    // Expiration Duration
   198    expiresIn time
   199    // Key Lifetime in Seconds
   200    keyLifetimeSecs int
   201    // Key Expiration Duration
   202    keyExpiresIn time
   203  }
   204  
   205  // Domain name
   206  domainName @defaults("fqdn") {
   207    init(fqdn string)
   208    // Fully qualified domain name (FQDN)
   209    fqdn string
   210    // effectiveTLDPlusOne returns the effective top level domain plus one more label
   211    effectiveTLDPlusOne string
   212    // Top-Level Domain
   213    tld string
   214    // Flag indicates if the TLD is ICANN managed
   215    tldIcannManaged bool
   216    // Domain Labels
   217    labels []string
   218  }
   219  
   220  // DNS resource
   221  dns @defaults("fqdn") {
   222    init(fqdn string)
   223    // Fully qualified domain name (FQDN)
   224    fqdn string
   225    // Params is a list of all parameters for DNS FQDN
   226    params(fqdn) dict
   227    // Successful DNS records
   228    records(params) []dns.record
   229    // Successful DNS MX records
   230    mx(params) []dns.mxRecord
   231    // DKIM TXT records
   232    dkim(params) []dns.dkimRecord
   233  }
   234  
   235  // DNS record
   236  dns.record @defaults("name type") {
   237    // DNS name
   238    name string
   239    // Time-To-Live (TTL) in seconds
   240    ttl int
   241    // DNS class
   242    class string
   243    // DNS type
   244    type string
   245    // Resource Data
   246    rdata []string
   247  }
   248  
   249  // DNS MX record
   250  dns.mxRecord @defaults("domainName") {
   251    name string
   252    preference int
   253    domainName string
   254  }
   255  
   256  // DKIM public key representation as defined in RFC 6376
   257  dns.dkimRecord @defaults("dnsTxt") {
   258    // DNS Text Representation
   259    dnsTxt string
   260    // DKIM Selector Domain
   261    domain string
   262    // Version
   263    version string
   264    // Acceptable Hash Algorithms
   265    hashAlgorithms []string
   266    // Key Type
   267    keyType string
   268    // Notes
   269    notes string
   270    // Public Key Data base64-Encoded
   271    publicKeyData string
   272    // Service Types
   273    serviceTypes []string
   274    // Flags
   275    flags []string
   276    // Verifies if the DKIM entry and public key is valid
   277    valid() bool
   278  }