Compare commits

...

7 Commits

Author SHA1 Message Date
Istio Automation d4e543a299
Automator: update common-files@release-1.26 in istio/ztunnel@release-1.26 (#1593) 2025-07-08 16:37:30 -04:00
Istio Automation 67fe8764d1
Automator: update common-files@release-1.26 in istio/ztunnel@release-1.26 (#1579) 2025-06-20 13:39:11 -04:00
Yuval Kohavi c5c31102fd
Make csr test stricter and more correct (previously #1432) (#1550) (#1552)
* Make csr test stricter and more correct

Part of https://github.com/istio/ztunnel/issues/1431

Fails without https://github.com/rustls/rcgen/pull/311

* update rcgen



* fix merge issue

* format fix



---------

Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Co-authored-by: John Howard <john.howard@solo.io>
2025-05-08 15:12:46 -04:00
Istio Automation ddd676893f
[release-1.26] fix istio_build metric (#1535)
* fix istio_build metric

* fmt

---------

Co-authored-by: zirain <zirain2009@gmail.com>
2025-05-07 05:58:44 -04:00
Istio Automation 2f601957bd
http2: tune connection window size and add config (#1542)
Fixes https://github.com/istio/ztunnel/issues/1538

See comment for motivation as to why this change is needed.

Co-authored-by: John Howard <john.howard@solo.io>
2025-04-24 16:07:02 -04:00
Istio Automation 0d440ba3fe
Automator: update common-files@release-1.26 in istio/ztunnel@release-1.26 (#1533) 2025-04-18 05:42:25 -04:00
Daniel Hawton 68b5e48a1f
[release-1.26] Automated branching step 4 (#1528) 2025-04-17 16:10:24 -04:00
10 changed files with 53 additions and 100 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "istio build-tools", "name": "istio build-tools",
"image": "gcr.io/istio-testing/build-tools:master-fcd42145fc132acd1e8f607e9e7aca15058e9fb9", "image": "gcr.io/istio-testing/build-tools:release-1.26-70fd8a76e8fc5feb19b8499f0fafb75f97325aee",
"privileged": true, "privileged": true,
"remoteEnv": { "remoteEnv": {
"USE_GKE_GCLOUD_AUTH_PLUGIN": "True", "USE_GKE_GCLOUD_AUTH_PLUGIN": "True",

View File

@ -1,6 +1 @@
* @istio/wg-networking-maintainers-ztunnel * @istio/release-managers-1-26
/Makefile* @istio/wg-test-and-release-maintainers
/*.md @istio/wg-test-and-release-maintainers
/common/ @istio/wg-test-and-release-maintainers
/common-protos/ @istio/wg-test-and-release-maintainers
/scripts/ @istio/wg-test-and-release-maintainers

93
Cargo.lock generated
View File

@ -112,29 +112,13 @@ version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
[[package]]
name = "asn1-rs"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048"
dependencies = [
"asn1-rs-derive 0.5.1",
"asn1-rs-impl",
"displaydoc",
"nom",
"num-traits",
"rusticata-macros",
"thiserror 1.0.69",
"time",
]
[[package]] [[package]]
name = "asn1-rs" name = "asn1-rs"
version = "0.7.1" version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56624a96882bb8c26d61312ae18cb45868e5a9992ea73c58e45c3101e56a1e60" checksum = "56624a96882bb8c26d61312ae18cb45868e5a9992ea73c58e45c3101e56a1e60"
dependencies = [ dependencies = [
"asn1-rs-derive 0.6.0", "asn1-rs-derive",
"asn1-rs-impl", "asn1-rs-impl",
"displaydoc", "displaydoc",
"nom", "nom",
@ -144,18 +128,6 @@ dependencies = [
"time", "time",
] ]
[[package]]
name = "asn1-rs-derive"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.100",
"synstructure",
]
[[package]] [[package]]
name = "asn1-rs-derive" name = "asn1-rs-derive"
version = "0.6.0" version = "0.6.0"
@ -761,27 +733,13 @@ dependencies = [
"const-oid", "const-oid",
] ]
[[package]]
name = "der-parser"
version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553"
dependencies = [
"asn1-rs 0.6.2",
"displaydoc",
"nom",
"num-bigint",
"num-traits",
"rusticata-macros",
]
[[package]] [[package]]
name = "der-parser" name = "der-parser"
version = "10.0.0" version = "10.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07da5016415d5a3c4dd39b11ed26f915f52fc4e0dc197d87908bc916e51bc1a6" checksum = "07da5016415d5a3c4dd39b11ed26f915f52fc4e0dc197d87908bc916e51bc1a6"
dependencies = [ dependencies = [
"asn1-rs 0.7.1", "asn1-rs",
"displaydoc", "displaydoc",
"nom", "nom",
"num-bigint", "num-bigint",
@ -1844,7 +1802,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"windows-targets 0.52.6", "windows-targets 0.48.5",
] ]
[[package]] [[package]]
@ -2226,22 +2184,13 @@ dependencies = [
"memchr", "memchr",
] ]
[[package]]
name = "oid-registry"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9"
dependencies = [
"asn1-rs 0.6.2",
]
[[package]] [[package]]
name = "oid-registry" name = "oid-registry"
version = "0.8.1" version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12f40cff3dde1b6087cc5d5f5d4d65712f34016a03ed60e9c08dcc392736b5b7" checksum = "12f40cff3dde1b6087cc5d5f5d4d65712f34016a03ed60e9c08dcc392736b5b7"
dependencies = [ dependencies = [
"asn1-rs 0.7.1", "asn1-rs",
] ]
[[package]] [[package]]
@ -2815,16 +2764,16 @@ dependencies = [
[[package]] [[package]]
name = "rcgen" name = "rcgen"
version = "0.13.2" version = "0.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75e669e5202259b5314d1ea5397316ad400819437857b90861765f24c4cf80a2" checksum = "887a643fa081058097896d87764863994f6c32a1716e76adc479bd283974a825"
dependencies = [ dependencies = [
"aws-lc-rs", "aws-lc-rs",
"pem", "pem",
"ring", "ring",
"rustls-pki-types", "rustls-pki-types",
"time", "time",
"x509-parser 0.16.0", "x509-parser",
"yasna", "yasna",
] ]
@ -4305,36 +4254,18 @@ version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51"
[[package]]
name = "x509-parser"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69"
dependencies = [
"asn1-rs 0.6.2",
"data-encoding",
"der-parser 9.0.0",
"lazy_static",
"nom",
"oid-registry 0.7.1",
"ring",
"rusticata-macros",
"thiserror 1.0.69",
"time",
]
[[package]] [[package]]
name = "x509-parser" name = "x509-parser"
version = "0.17.0" version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4569f339c0c402346d4a75a9e39cf8dad310e287eef1ff56d4c68e5067f53460" checksum = "4569f339c0c402346d4a75a9e39cf8dad310e287eef1ff56d4c68e5067f53460"
dependencies = [ dependencies = [
"asn1-rs 0.7.1", "asn1-rs",
"data-encoding", "data-encoding",
"der-parser 10.0.0", "der-parser",
"lazy_static", "lazy_static",
"nom", "nom",
"oid-registry 0.8.1", "oid-registry",
"ring", "ring",
"rusticata-macros", "rusticata-macros",
"thiserror 2.0.12", "thiserror 2.0.12",
@ -4510,7 +4441,7 @@ dependencies = [
"matches", "matches",
"netns-rs", "netns-rs",
"nix 0.29.0", "nix 0.29.0",
"oid-registry 0.8.1", "oid-registry",
"once_cell", "once_cell",
"openssl", "openssl",
"pin-project-lite", "pin-project-lite",
@ -4553,6 +4484,6 @@ dependencies = [
"tracing-log", "tracing-log",
"tracing-subscriber", "tracing-subscriber",
"url", "url",
"x509-parser 0.17.0", "x509-parser",
"ztunnel", "ztunnel",
] ]

View File

@ -1 +1 @@
a1d5c4198ab79a14c09c034f2d95245efa3e2bcb 53d979131718316e26b55212a3cef935a8c0f4e8

View File

@ -92,7 +92,7 @@ mirror-licenses: mod-download-go
@license-lint --mirror @license-lint --mirror
TMP := $(shell mktemp -d -u) TMP := $(shell mktemp -d -u)
UPDATE_BRANCH ?= "master" UPDATE_BRANCH ?= "release-1.26"
BUILD_TOOLS_ORG ?= "istio" BUILD_TOOLS_ORG ?= "istio"

View File

@ -32,7 +32,7 @@ set -x
#################################################################### ####################################################################
# DEFAULT_KIND_IMAGE is used to set the Kubernetes version for KinD unless overridden in params to setup_kind_cluster(s) # DEFAULT_KIND_IMAGE is used to set the Kubernetes version for KinD unless overridden in params to setup_kind_cluster(s)
DEFAULT_KIND_IMAGE="gcr.io/istio-testing/kind-node:v1.32.0" DEFAULT_KIND_IMAGE="gcr.io/istio-testing/kind-node:v1.33.1"
# the default kind cluster should be ipv4 if not otherwise specified # the default kind cluster should be ipv4 if not otherwise specified
KIND_IP_FAMILY="${KIND_IP_FAMILY:-ipv4}" KIND_IP_FAMILY="${KIND_IP_FAMILY:-ipv4}"

View File

@ -75,7 +75,7 @@ fi
TOOLS_REGISTRY_PROVIDER=${TOOLS_REGISTRY_PROVIDER:-gcr.io} TOOLS_REGISTRY_PROVIDER=${TOOLS_REGISTRY_PROVIDER:-gcr.io}
PROJECT_ID=${PROJECT_ID:-istio-testing} PROJECT_ID=${PROJECT_ID:-istio-testing}
if [[ "${IMAGE_VERSION:-}" == "" ]]; then if [[ "${IMAGE_VERSION:-}" == "" ]]; then
IMAGE_VERSION=master-fcd42145fc132acd1e8f607e9e7aca15058e9fb9 IMAGE_VERSION=release-1.26-70fd8a76e8fc5feb19b8499f0fafb75f97325aee
fi fi
if [[ "${IMAGE_NAME:-}" == "" ]]; then if [[ "${IMAGE_NAME:-}" == "" ]]; then
IMAGE_NAME=build-tools IMAGE_NAME=build-tools

View File

@ -70,6 +70,10 @@ const ENABLE_ORIG_SRC: &str = "ENABLE_ORIG_SRC";
const PROXY_CONFIG: &str = "PROXY_CONFIG"; const PROXY_CONFIG: &str = "PROXY_CONFIG";
const IPV6_ENABLED: &str = "IPV6_ENABLED"; const IPV6_ENABLED: &str = "IPV6_ENABLED";
const HTTP2_STREAM_WINDOW_SIZE: &str = "HTTP2_STREAM_WINDOW_SIZE";
const HTTP2_CONNECTION_WINDOW_SIZE: &str = "HTTP2_CONNECTION_WINDOW_SIZE";
const HTTP2_FRAME_SIZE: &str = "HTTP2_FRAME_SIZE";
const UNSTABLE_ENABLE_SOCKS5: &str = "UNSTABLE_ENABLE_SOCKS5"; const UNSTABLE_ENABLE_SOCKS5: &str = "UNSTABLE_ENABLE_SOCKS5";
const DEFAULT_WORKER_THREADS: u16 = 2; const DEFAULT_WORKER_THREADS: u16 = 2;
@ -619,9 +623,15 @@ pub fn construct_config(pc: ProxyConfig) -> Result<Config, Error> {
DEFAULT_POOL_UNUSED_RELEASE_TIMEOUT, DEFAULT_POOL_UNUSED_RELEASE_TIMEOUT,
)?, )?,
window_size: 4 * 1024 * 1024, // window size: per-stream limit
connection_window_size: 4 * 1024 * 1024, window_size: parse_default(HTTP2_STREAM_WINDOW_SIZE, 4 * 1024 * 1024)?,
frame_size: 1024 * 1024, // connection window size: per connection.
// Setting this to the same value as window_size can introduce deadlocks in some applications
// where clients do not read data on streamA until they receive data on streamB.
// If streamA consumes the entire connection window, we enter a deadlock.
// A 4x limit should be appropriate without introducing too much potential buffering.
connection_window_size: parse_default(HTTP2_CONNECTION_WINDOW_SIZE, 16 * 1024 * 1024)?,
frame_size: parse_default(HTTP2_FRAME_SIZE, 1024 * 1024)?,
self_termination_deadline: match parse_duration(CONNECTION_TERMINATION_DEADLINE)? { self_termination_deadline: match parse_duration(CONNECTION_TERMINATION_DEADLINE)? {
Some(period) => period, Some(period) => period,

View File

@ -124,28 +124,44 @@ impl CsrOptions {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::tls; use crate::tls;
use itertools::Itertools;
#[test] #[test]
fn test_csr() { fn test_csr() {
use x509_parser::prelude::FromDer; use x509_parser::prelude::*;
let csr = tls::csr::CsrOptions { let csr = tls::csr::CsrOptions {
san: "spiffe://td/ns/ns1/sa/sa1".to_string(), san: "spiffe://td/ns/ns1/sa/sa1".to_string(),
} }
.generate() .generate()
.unwrap(); .unwrap();
let (_, der) = x509_parser::pem::parse_x509_pem(csr.csr.as_bytes()).unwrap(); let (_, der) = x509_parser::pem::parse_x509_pem(csr.csr.as_bytes()).unwrap();
let (_, cert) = let (_, cert) =
x509_parser::certification_request::X509CertificationRequest::from_der(&der.contents) x509_parser::certification_request::X509CertificationRequest::from_der(&der.contents)
.unwrap(); .unwrap();
cert.verify_signature().unwrap(); cert.verify_signature().unwrap();
let subject = cert.certification_request_info.subject.iter().collect_vec();
assert_eq!(subject.len(), 0);
let attr = cert let attr = cert
.certification_request_info .certification_request_info
.iter_attributes() .iter_attributes()
.next() .next()
.unwrap(); .unwrap();
// SAN is encoded in some format I don't understand how to parse; this could be improved.
// but make sure it's there in a hacky manner let ParsedCriAttribute::ExtensionRequest(parsed) = attr.parsed_attribute() else {
assert!(attr.value.ends_with(b"spiffe://td/ns/ns1/sa/sa1")); panic!("not a ExtensionRequest")
};
let ext = parsed.clone().extensions;
assert_eq!(ext.len(), 1);
let ext = ext.into_iter().next().unwrap();
assert!(ext.critical);
let ParsedExtension::SubjectAlternativeName(san) = ext.parsed_extension() else {
panic!("not a SubjectAlternativeName")
};
assert_eq!(
&format!("{san:?}"),
"SubjectAlternativeName { general_names: [URI(\"spiffe://td/ns/ns1/sa/sa1\")] }"
)
} }
} }

View File

@ -45,7 +45,8 @@ impl BuildInfo {
build_profile: BUILD_RUST_PROFILE.to_string(), build_profile: BUILD_RUST_PROFILE.to_string(),
build_status: BUILD_STATUS.to_string(), build_status: BUILD_STATUS.to_string(),
git_tag: BUILD_TAG.to_string(), git_tag: BUILD_TAG.to_string(),
istio_version: env::var("ISTIO_VERSION").unwrap_or_else(|_| "unknown".to_string()), istio_version: env::var("ISTIO_META_ISTIO_VERSION")
.unwrap_or_else(|_| "unknown".to_string()),
} }
} }
} }