Back to Cilium

Protocol Documentation

api/v1/standalone-dns-proxy/README.md

1.19.39.7 KB
Original Source
<!-- This file was autogenerated via "make generate-sdp-api", do not edit manually -->

Protocol Documentation

<a name="top"></a>

Table of Contents

<a name="standalone-dns-proxy_standalone-dns-proxy-proto"></a>

<p align="right"><a href="#top">Top</a></p>

standalone-dns-proxy/standalone-dns-proxy.proto

<a name="standalonednsproxy-DNSPolicy"></a>

DNSPolicy

L7 DNS policy specifying which requests are permitted to which DNS server

FieldTypeLabelDescription
source_endpoint_iduint32Endpoint ID of the workload this L7 DNS policy should apply to
dns_patternstringrepeatedAllowed DNS pattern this identity is allowed to resolve.
dns_serversDNSServerrepeatedList of DNS servers to be allowed to connect.

<a name="standalonednsproxy-DNSServer"></a>

DNSServer

DNServer identity, port and protocol the requests be allowed to

FieldTypeLabelDescription
dns_server_identityuint32Identity of destination DNS server
dns_server_portuint32
dns_server_protouint32

<a name="standalonednsproxy-EndpointInfo"></a>

EndpointInfo

cilium endpoint ipaddress and ID

FieldTypeLabelDescription
iduint64
ipbytesrepeated

<a name="standalonednsproxy-FQDNMapping"></a>

FQDNMapping

FQDN-IP mapping goalstate sent from SDP to agent

FieldTypeLabelDescription
fqdnstringdns name
record_ipbytesrepeatedList of IPs corresponding to dns name
ttluint32TTL of DNS record
source_identityuint32Identity of the client making the DNS request
source_ipbytesIP address of the client making the DNS request
response_codeuint32DNS Response code as specified in RFC2316

<a name="standalonednsproxy-IdentityToEndpointMapping"></a>

IdentityToEndpointMapping

Cilium Identity ID to IP address mapping

FieldTypeLabelDescription
identityuint32
endpoint_infoEndpointInforepeated

<a name="standalonednsproxy-IdentityToPrefixMapping"></a>

IdentityToPrefixMapping

Cilium Identity ID to IP prefix mapping

FieldTypeLabelDescription
identityuint32
prefixbytesrepeated

<a name="standalonednsproxy-PolicyState"></a>

PolicyState

L7 DNS policy snapshot of all local endpoints and identity to ip mapping of source and destinatione egress endpoints enforcing fqdn rules.

FieldTypeLabelDescription
egress_l7_dns_policyDNSPolicyrepeated
request_idstringRandom UUID based identifier which will be referenced in ACKs
identity_to_endpoint_mappingIdentityToEndpointMappingrepeatedIdentity to Endpoint mapping for the DNS server and the source identity
identity_to_prefix_mappingIdentityToPrefixMappingrepeatedIdentity to Prefix mapping for the identity

<a name="standalonednsproxy-PolicyStateResponse"></a>

PolicyStateResponse

Ack sent from SDP to Agent on processing DNS policy rules

FieldTypeLabelDescription
responseResponseCode
request_idstringRequest ID for which response is sent to

<a name="standalonednsproxy-UpdateMappingResponse"></a>

UpdateMappingResponse

Ack returned by cilium agent to SDP on receiving FQDN-IP mapping update

FieldTypeLabelDescription
responseResponseCode

<a name="standalonednsproxy-ResponseCode"></a>

ResponseCode

Response code returned by RPC methods.

NameNumberDescription
RESPONSE_CODE_UNSPECIFIED0
RESPONSE_CODE_NO_ERROR1
RESPONSE_CODE_FORMAT_ERROR2
RESPONSE_CODE_SERVER_FAILURE3
RESPONSE_CODE_NOT_IMPLEMENTED4
RESPONSE_CODE_ERROR_INVALID_ARGUMENT6Invalid argument passed to the RPC method
RESPONSE_CODE_ERROR_ENDPOINT_NOT_FOUND5Endpoint not found for the given IP
RESPONSE_CODE_REFUSED7

<a name="standalonednsproxy-FQDNData"></a>

FQDNData

Cilium agent runs the FQDNData service and Standalone DNS proxy connects to it to get the DNS Policy rules. Standalone DNS proxy sends FQDN-IP mapping updates to Cilium Agent. CFP: https://github.com/cilium/design-cfps/pull/54

Method NameRequest TypeResponse TypeDescription
StreamPolicyStatePolicyStateResponse streamPolicyState streamStreamPolicyState is used by the Standalone DNS proxy to get the current policy state. Policy state includes the DNS policies and the identity to IP mapping. Cilium agent will stream DNS policies state to Standalone DNS proxy. In case of any client side error, cilium agent will cancel the stream and SDP will have to re-subscribe. In case of any server side error, cilium agent will send an error response and SDP will have to re-subscribe.
UpdateMappingRequestFQDNMappingUpdateMappingResponseUpdateMappingRequest is used by the Standalone DNS proxy to update ciliium agent with FQDN-IP mappings which in turn update L3/L4 policy maps. In case of any error, SDP will either retry the connection if the error is server side or will error out. Note: In case of concurrent updates, since this is called in a callback(notifyDNSMsg) from the DNS server it follows the same behavior as the inbuilt dns proxy in cilium.

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
<a name="double" /> doubledoubledoublefloatfloat64doublefloatFloat
<a name="float" /> floatfloatfloatfloatfloat32floatfloatFloat
<a name="int32" /> int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
<a name="int64" /> int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
<a name="uint32" /> uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
<a name="uint64" /> uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
<a name="sint32" /> sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
<a name="sint64" /> sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
<a name="fixed32" /> fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
<a name="fixed64" /> fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
<a name="sfixed32" /> sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
<a name="sfixed64" /> sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
<a name="bool" /> boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
<a name="string" /> stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
<a name="bytes" /> bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)