-
Notifications
You must be signed in to change notification settings - Fork 60
Update Learning Mode to V2 API contracts #739
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
Changes from 14 commits
347c352
0c329dd
bd2ec2c
1a8613f
b21163a
dfca3cc
5f4237b
c9934c8
b0a05b8
580c19e
873ddb1
5222015
880c0ea
7436f52
b9368ff
6961b4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| // | ||
| // FlatBuffers schema for the BaseContainer sandbox specification used in the | ||
| // CreateProcessSecurityEnvironment Windows API. | ||
| // | ||
| // This is the CPSE wire format. The legacy CPIS path continues to use | ||
| // SandboxSpec.fbs and its "SBOX" file identifier. | ||
| // | ||
| // ---- FlatBuffers Schema Evolution Rules ---- | ||
| // | ||
| // Compatible (non-breaking) changes: | ||
| // - Add new fields to the END of a table (they get the next vtable slot). | ||
| // - Add new tables, structs, enums, or union members. | ||
| // - Deprecate a field with (deprecated) - the slot is preserved, readers skip it. | ||
| // - Rename a field or table (wire format uses slot indices, not names). | ||
| // | ||
| // BREAKING changes (will corrupt existing buffers): | ||
| // - Remove or reorder fields in a table or struct. | ||
| // - Change a field's type (e.g. uint32 -> int32, or scalar -> string). | ||
| // - Change a field's default value. | ||
| // - Add/remove/reorder values in an enum that is already serialized. | ||
| // - Change the file_identifier or root_type. | ||
| // - Change a field from scalar to non-scalar (or vice versa). | ||
| // | ||
| // To machine-check for breaking changes, keep a copy of the last shipped schema | ||
| // (e.g. ProcessSecurityEnvironment.previous.fbs) and run: | ||
| // | ||
| // flatc --conform ProcessSecurityEnvironment.previous.fbs ProcessSecurityEnvironment.fbs | ||
| // | ||
| // --conform verifies that every field/enum/table in the old schema still exists | ||
| // at the same vtable slot, type, and default in the new schema. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This schema is copied from the official OS PSEC schema, including the FlatBuffer evolution guidance, so I retained it to keep the checked-in contract aligned with its source. If you intended a different specific section on line 32 to be removed, could you clarify which portion? |
||
|
|
||
| namespace ProcessSecurityEnvironmentLayout; | ||
|
|
||
| struct SchemaVersion { | ||
| major:uint16; | ||
| minor:uint16; | ||
| } | ||
|
|
||
| table ProcessSecurityEnvironment { | ||
| version:SchemaVersion (required); | ||
| capabilities:string; | ||
| disallow_win32k_system_calls:bool = false; | ||
| ui_restrictions:uint64 = 0; | ||
| fs_read_write:[string]; | ||
| fs_read_only:[string]; | ||
| fs_deny:[string]; | ||
| network_policy:NetworkPolicy; | ||
| } | ||
|
|
||
| table ProxyInfo { | ||
| url:string; | ||
| } | ||
|
|
||
| enum FilterAction : byte { deny, allow } | ||
| enum IpProtocol : byte { any, tcp, udp, icmpv4, icmpv6 } | ||
|
|
||
| table IpSubnet { | ||
| address:string; | ||
| prefix_length:ubyte = 0; | ||
| } | ||
|
|
||
| table DestinationRule { | ||
| subnet:IpSubnet; | ||
| except:[IpSubnet]; | ||
| } | ||
|
|
||
| table PortRule { | ||
| protocol:IpProtocol = any; | ||
| port:uint16 = 0; | ||
| end_port:uint16 = 0; | ||
| } | ||
|
|
||
| table EndpointRule { | ||
| destinations:[DestinationRule]; | ||
| ports:[PortRule]; | ||
| } | ||
|
|
||
| table EndpointPolicy { | ||
| default_action:FilterAction = deny; | ||
| allow:[EndpointRule]; | ||
| deny:[EndpointRule]; | ||
| } | ||
|
|
||
| table NetworkPolicy { | ||
| proxy:ProxyInfo; | ||
| egress:EndpointPolicy; | ||
| allowed_appcontainer_peer:string; | ||
| } | ||
|
|
||
| root_type ProcessSecurityEnvironment; | ||
| file_identifier "PSEC"; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Provenance for the vendored ProcessSecurityEnvironment FlatBuffers schema. | ||
| # | ||
| # This file is the single source of truth for the pinned regeneration toolchain | ||
| # and the authoritative hash of the vendored `ProcessSecurityEnvironment.fbs`. | ||
| # It is consumed by: | ||
| # * src/core/generated/process_security_environment_specification/regenerate.ps1 | ||
| # (validates the schema hash + pins the exact flatc version before generating) | ||
| # * scripts/versioning/check-psec-codegen.js | ||
| # (CI drift gate β verifies the committed schema + generated crate) | ||
| # | ||
| # Update this file whenever the vendored schema is refreshed from the OS source, | ||
| # then regenerate the bindings (see the crate README). | ||
|
|
||
| [source] | ||
| # The schema originates from the internal Microsoft Windows OS repository and is | ||
| # not publicly redistributable. Only the schema text (not the OS tree) is vendored. | ||
| repository = "Windows OS (internal Azure DevOps)" | ||
| # The PSEC schema is a Windows OS containment contract; there is no public OS | ||
| # revision to cite. Instead of guessing a source path/revision, we record the | ||
| # Windows build the vendored schema contract was validated against. | ||
| validated_windows_build = "10.0.26663.1000" | ||
| # Azure DevOps PR 16307987 is the RELATED Learning Mode trace ABI change β it is | ||
| # NOT the pull request that introduced or last modified this PSEC schema. | ||
| # Recorded for traceability only; do not represent it as the schema's origin. | ||
| related_trace_abi_pull_request = 16307987 | ||
|
|
||
| [schema] | ||
| # SHA-256 of external/windows-sdk/ProcessSecurityEnvironment.fbs, computed over | ||
| # the LF-normalized (git-blob) content so it is checkout-independent regardless | ||
| # of autocrlf. Verified by regenerate.ps1 and the CI drift gate. | ||
| sha256 = "7d14b01850a735329da00cde4d4d2e32e463f49026a39708be9059fd64e764d3" | ||
|
|
||
| [tool] | ||
| # Exact flatc version used to generate the committed bindings. Regeneration | ||
| # pins this exact version (not a floor) so output is byte-reproducible. | ||
| # 25.12.19 is the first release carrying flatbuffers PR #8709, which stops flatc | ||
| # emitting elided lifetimes that trip the `mismatched_lifetime_syntaxes` lint | ||
| # (added in Rust 1.89). | ||
| flatc_version = "25.12.19" | ||
| flatc_release = "https://github.com/google/flatbuffers/releases/tag/v25.12.19" | ||
| generated_date = "2026-08-03" | ||
|
|
||
| # Exact GitHub release assets for flatc 25.12.19. The CI drift gate downloads the | ||
| # platform asset, verifies its SHA-256 against these values, unzips it, and | ||
| # regenerates into a temp directory to diff against the committed bindings. | ||
| [tool.flatc_assets.linux] | ||
| name = "Linux.flatc.binary.clang++-18.zip" | ||
| sha256 = "50c1915deeeb714f2a05c8ec795bd1af898d251a62e2774067703b29188efc90" | ||
|
|
||
| [tool.flatc_assets.windows] | ||
| name = "Windows.flatc.binary.zip" | ||
| sha256 = "fff9445c9db907227bc64b54cc98743084c4949282aa4e576cff6a955724ddc8" |
Uh oh!
There was an error while loading. Please reload this page.