Skip to content

Commit 1ecd34b

Browse files
committed
Update AttestedClaims OID and externalize hardcoded defaults (Tasks 13b, 15b)
1 parent 7bf8535 commit 1ecd34b

File tree

14 files changed

+83
-62
lines changed

14 files changed

+83
-62
lines changed

hybrid-cloud-poc/README-arch-sovereign-unified-identity.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ After workloads receive their SPIRE SVIDs, they can use these certificates to ac
860860

861861
- **WASM Filter Extracts Sensor Information**:
862862
- Parses the certificate chain.
863-
- Extracts Unified Identity extension (OID `1.3.6.1.4.1.99999.2`) from Agent SVID (second certificate in chain).
863+
- Extracts Unified Identity extension (OID `1.3.6.1.4.1.55744.1.1`) from Agent SVID (second certificate in chain).
864864
- Extracts sensor metadata: `sensor_id`, `sensor_type`, `sensor_imei`, `sensor_imsi`, `sensor_msisdn`.
865865
- **Coordinate Propagation**: Extracts `latitude`, `longitude`, and `accuracy` if present in SVID claims to enable the **DB-less verification flow**.
866866
- **No Filter Caching**: The WASM filter is stateless; all result caching is centralized in the mobile location microservice.
@@ -1514,7 +1514,7 @@ typed_config:
15141514
15151515
The WASM filter extracts claims from the SPIRE certificate chain:
15161516
1517-
1. **Extract Unified Identity Extension** (OID `1.3.6.1.4.1.99999.2`) from Agent SVID
1517+
1. **Extract Unified Identity Extension** (OID `1.3.6.1.4.1.55744.1.1`) from Agent SVID
15181518
2. **Parse JSON claims**: `sensor_id`, `sensor_type`, `sensor_imei`, `sensor_imsi`, **`msisdn`** ← NEW
15191519
3. **Apply policy**:
15201520
- GPS/GNSS sensors: Always bypass (trusted hardware)

hybrid-cloud-poc/enterprise-private-cloud/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ tail -f /tmp/mobile-sensor.log
335335

336336
### Certificate Chain Parsing
337337
- **Location**: Unified Identity extension is in the **agent SVID** (second certificate in chain)
338-
- **OID**: 1.3.6.1.4.1.99999.2 (or legacy 1.3.6.1.4.1.99999.1)
338+
- **OID**: 1.3.6.1.4.1.55744.1.1
339339
- **Format**: JSON with `grc.geolocation.sensor_id` field
340340
- **Extraction**: WASM filter parses full certificate chain from `x-forwarded-client-cert` header
341341

hybrid-cloud-poc/enterprise-private-cloud/wasm-plugin/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ configuration:
5353
## How It Works
5454
5555
1. **Certificate Extraction**: Gets client certificate from TLS connection
56-
2. **Sensor Info Extraction**: Parses X.509 Unified Identity extension (OID `1.3.6.1.4.1.99999.2`)
56+
2. **Sensor Info Extraction**: Parses X.509 Unified Identity extension (OID `1.3.6.1.4.1.55744.1.1`)
5757
3. **Claim Parsing**: Extracts sensor metadata from nested `grc.geolocation` structure:
5858
- **Mobile**: `grc.geolocation.mobile` → `sensor_id`, `sensor_imei`, `sim_imsi`, `sim_msisdn`, and `location_verification` (lat/lon/acc)
5959
- **GNSS**: `grc.geolocation.gnss` → `sensor_id`, `sensor_serial_number`, and `retrieved_location` (lat/lon/acc)

hybrid-cloud-poc/enterprise-private-cloud/wasm-plugin/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ use serde::{Deserialize, Serialize};
1818
use std::time::Duration;
1919

2020
// Unified Identity extension OIDs (as ASN.1 OID bytes)
21-
// 1.3.6.1.4.1.99999.2 = 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x63, 0x02
22-
// 1.3.6.1.4.1.99999.1 = 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x63, 0x01
23-
const UNIFIED_IDENTITY_OID_STR: &str = "1.3.6.1.4.1.99999.2";
24-
const LEGACY_OID_STR: &str = "1.3.6.1.4.1.99999.1";
21+
// 1.3.6.1.4.1.55744.1.1 = 0x2b, 0x06, 0x01, 0x04, 0x01, 0x83, 0xb3, 0x40, 0x01, 0x01
22+
const UNIFIED_IDENTITY_OID_STR: &str = "1.3.6.1.4.1.55744.1.1";
23+
const LEGACY_OID_STR: &str = "1.3.6.1.4.1.55744.1.1";
2524

2625
#[derive(Serialize, Deserialize)]
2726
struct VerifyRequest {

hybrid-cloud-poc/mobile-sensor-microservice/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,15 @@ This installs both runtime dependencies (Flask, requests) and the `pytest` tooli
3232
| `CAMARA_SCOPE` | Scope used in `/bc-authorize` | `dpv:FraudPreventionAndDetection#device-location-read` |
3333
| `CAMARA_BYPASS` | Set to `true` to skip CAMARA API calls (for testing only) | `false` |
3434
| `DEMO_MODE` | Set to `true` to suppress CAMARA_BYPASS log messages (useful for demos). Defaults to `true` when `CAMARA_BYPASS` is enabled. | `false` (or `true` if `CAMARA_BYPASS=true`) |
35-
| `CAMARA_VERIFY_CACHE_TTL_SECONDS` | Cache TTL for `verify_location` API results. The actual CAMARA API is called at most once per TTL period; subsequent calls return the cached result. | `900` (15 minutes) |
35+
| `CAMARA_VERIFY_CACHE_TTL_SECONDS` | Cache TTL for `verify_location` API results. | `900` (15 minutes) |
36+
| `MOBILE_SENSOR_ID` | Default sensor ID for mapping | `12d1:1433` |
37+
| `MOBILE_SENSOR_MSISDN` | Default MSISDN for mapping | `+34696810912` |
38+
| `MOBILE_SENSOR_LAT_DEFAULT` | Default latitude for mapping | `40.33` |
39+
| `MOBILE_SENSOR_LON_DEFAULT` | Default longitude for mapping | `-3.7707` |
40+
| `MOBILE_SENSOR_ACC_DEFAULT` | Default accuracy for mapping | `7.0` |
41+
| `CAMARA_AUTHORIZE_PATH` | Path for CAMARA authorize endpoint | `/bc-authorize` |
42+
| `CAMARA_TOKEN_PATH` | Path for CAMARA token endpoint | `/token` |
43+
| `CAMARA_VERIFY_PATH` | Path for CAMARA verify endpoint | `/location/v0/verify` |
3644

3745
### Obtaining CAMARA Credentials
3846

hybrid-cloud-poc/mobile-sensor-microservice/service.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838

3939
LOG = logging.getLogger("mobile_sensor_service")
4040

41-
DEFAULT_SCOPE = "dpv:FraudPreventionAndDetection#device-location-read"
42-
DEFAULT_SENSOR_ID = "12d1:1433"
43-
DEFAULT_SENSOR_IMEI = "356345043865103"
44-
DEFAULT_SENSOR_IMSI = "214070610960475"
45-
DEFAULT_MSISDN = "+34696810912"
46-
DEFAULT_LATITUDE = 40.33
47-
DEFAULT_LONGITUDE = -3.7707
48-
DEFAULT_ACCURACY = 7.0
41+
DEFAULT_SCOPE = os.getenv("MOBILE_SENSOR_SCOPE", "dpv:FraudPreventionAndDetection#device-location-read")
42+
DEFAULT_SENSOR_ID = os.getenv("MOBILE_SENSOR_ID", "12d1:1433")
43+
DEFAULT_SENSOR_IMEI = os.getenv("MOBILE_SENSOR_IMEI_DEFAULT", "356345043865103")
44+
DEFAULT_SENSOR_IMSI = os.getenv("MOBILE_SENSOR_IMSI_DEFAULT", "214070610960475")
45+
DEFAULT_MSISDN = os.getenv("MOBILE_SENSOR_MSISDN", "+34696810912")
46+
DEFAULT_LATITUDE = float(os.getenv("MOBILE_SENSOR_LAT_DEFAULT", "40.33"))
47+
DEFAULT_LONGITUDE = float(os.getenv("MOBILE_SENSOR_LON_DEFAULT", "-3.7707"))
48+
DEFAULT_ACCURACY = float(os.getenv("MOBILE_SENSOR_ACC_DEFAULT", "7.0"))
4949

5050
# Prometheus metrics (Task 18: Observability)
5151
REQUEST_COUNT = Counter(
@@ -70,9 +70,9 @@
7070
CAMARA_BASE = os.getenv(
7171
"CAMARA_BASE_URL", "https://sandbox.opengateway.telefonica.com/apigateway"
7272
)
73-
AUTHORIZE_PATH = "/bc-authorize"
74-
TOKEN_PATH = "/token"
75-
VERIFY_PATH = "/location/v0/verify"
73+
AUTHORIZE_PATH = os.getenv("CAMARA_AUTHORIZE_PATH", "/bc-authorize")
74+
TOKEN_PATH = os.getenv("CAMARA_TOKEN_PATH", "/token")
75+
VERIFY_PATH = os.getenv("CAMARA_VERIFY_PATH", "/location/v0/verify")
7676

7777

7878
def _get_default_latitude() -> float:

hybrid-cloud-poc/python-app-demo/fetch-sovereign-svid-grpc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,19 +534,19 @@ def fetch_from_workload_api_grpc(max_wait_seconds=60):
534534
print()
535535

536536
# Unified-Identity - Verification: Extract Unified Identity claims from certificate extension
537-
# Try new Unified Identity extension (OID 1.3.6.1.4.1.99999.2) first, then legacy (1.3.6.1.4.1.99999.1)
537+
# Try Unified Identity extension (OID 1.3.6.1.4.1.55744.1.1)
538538
claims_json = None
539539
extension_claims = None
540540
try:
541541
# Try new Unified Identity extension (Verification)
542-
oid = x509.ObjectIdentifier("1.3.6.1.4.1.99999.2")
542+
oid = x509.ObjectIdentifier("1.3.6.1.4.1.55744.1.1")
543543
ext = cert.extensions.get_extension_for_oid(oid)
544544
ext_value = ext.value.value if hasattr(ext.value, "value") else ext.value
545545
extension_claims = json.loads(ext_value)
546546
except Exception:
547547
try:
548548
# Fall back to legacy AttestedClaims extension (if present)
549-
oid = x509.ObjectIdentifier("1.3.6.1.4.1.99999.1")
549+
oid = x509.ObjectIdentifier("1.3.6.1.4.1.55744.1.1")
550550
ext = cert.extensions.get_extension_for_oid(oid)
551551
ext_value = ext.value.value if hasattr(ext.value, "value") else ext.value
552552
extension_claims = json.loads(ext_value)

hybrid-cloud-poc/scripts/demo.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ if [ -f "./fetch-sovereign-svid-grpc.py" ]; then
158158
if [ -f "${PHASE2_DIR}/dump-svid-attested-claims.sh" ]; then
159159
echo " ${PHASE2_DIR}/dump-svid-attested-claims.sh /tmp/svid-dump/svid.pem"
160160
else
161-
echo " openssl x509 -in /tmp/svid-dump/svid.pem -text -noout | grep -A 2 \"1.3.6.1.4.1.99999\""
161+
echo " openssl x509 -in /tmp/svid-dump/svid.pem -text -noout | grep -A 2 \"1.3.6.1.4.1.55744.1.1\""
162162
fi
163163
fi
164164

hybrid-cloud-poc/scripts/dump-svid-attested-claims.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ for idx, cert in enumerate(certs):
514514
515515
# Check for AttestedClaims extension
516516
for ext in cert.extensions:
517-
if ext.oid.dotted_string == "1.3.6.1.4.1.99999.1":
517+
if ext.oid.dotted_string == "1.3.6.1.4.1.55744.1.1":
518518
attested_extension = ext
519519
try:
520520
data = ext.value.value if hasattr(ext.value, "value") else ext.value

hybrid-cloud-poc/spire/pkg/server/credtemplate/attested_claims_extension.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ import (
1010
)
1111

1212
// Unified-Identity - Verification: Hardware Integration & Delegated Certification
13-
// OID for AttestedClaims extension: 1.3.6.1.4.1.99999.1 (Private Enterprise Number - placeholder)
14-
// In production, this should use a registered OID from IANA
15-
var AttestedClaimsExtensionOID = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 99999, 1}
13+
// OID for AttestedClaims extension: 1.3.6.1.4.1.55744.1.1 (Sovereign Unified Identity Claims)
14+
var AttestedClaimsExtensionOID = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 55744, 1, 1}
1615

1716
// AttestedClaimsExtension embeds Unified Identity claims as a certificate extension.
1817
// If unifiedJSON is provided it is embedded verbatim; otherwise the legacy

0 commit comments

Comments
 (0)