Securing .NET 10 applications: authentication with cookies, JWT, OAuth 2.0, OpenID Connect and Microsoft Entra ID; authorisation models; practical cryptography; the OWASP Top 10 in ASP.NET Core; and senior topics such as threat modelling, secrets, PII and supply chain security, with Australian privacy and ACSC context.
-
What are claims-based and policy-based authorisation in ASP.NET Core? Explain policies, requirements and handlers, how RequireAuthorization works on Minimal API endpoints and route groups, and the difference between the default policy and the fallback policy.
Policy-based authorisation in ASP.NET Core: AuthorizationPolicy, requirements and handlers, RequireClaim and RequireAssertion, AND/OR evaluation, RequireAuthorization on Minimal APIs and groups, AllowAnonymous, and DefaultPolicy vs FallbackPolicy.
Intermediate
Theory
Authorization
Β· π 2 follow-ups
-
Write a custom authorisation handler in ASP.NET Core. Show a requirement and an AuthorizationHandler that uses a DI service, explain how multiple handlers for the same requirement combine, when to call Succeed versus Fail, and how you register and test the handler.
Custom authorisation in ASP.NET Core: IAuthorizationRequirement, AuthorizationHandler<T> with injected services, handler lifetimes, OR semantics across handlers and Fail as a veto, IAuthorizationRequirementData attributes, failure reasons and unit testing.
Mid-Level
Coding
Authorization
Β· π 2 follow-ups Β· π 1 real-world
-
Show how you implement resource-based authorisation in ASP.NET Core, for example 'only the document's owner or an editor in the same team may edit it'. Why can't a policy on the endpoint do this alone, and how do you use IAuthorizationService.AuthorizeAsync with the loaded resource?
Resource-based authorisation: why endpoint policies can't see the record, AuthorizationHandler<TRequirement, TResource>, OperationAuthorizationRequirement, calling IAuthorizationService.AuthorizeAsync after loading, 403 vs 404, and filtering lists in the query.
Mid-Level
Coding
Authorization
Β· π 2 follow-ups Β· π 1 real-world
-
Your ASP.NET Core API seems to ignore [Authorize]: some endpoints return data to anonymous callers, others return 401 when you expect 403, and a policy on a Minimal API route group doesn't seem to apply. How do you diagnose and fix it?
Diagnosing authorisation that seems ignored: middleware order (UseRouting, UseAuthentication, UseAuthorization), endpoint metadata, AllowAnonymous precedence, missing default scheme, 401 vs 403 and cookie redirects, group metadata and authorisation debug logs.
Mid-Level
Debugging
Authorization
Β· π 3 follow-ups Β· π 1 real-world
-
A penetration test finds broken object-level authorisation (IDOR) in your API: changing the order id in GET /api/orders/{id} returns another customer's order. How do you fix this one endpoint, and how do you make sure the same flaw doesn't exist anywhere else in the codebase?
Broken object-level authorisation (OWASP API1:2023, IDOR): vulnerable code and exploit, ownership in the query, resource-based authorisation, tenant query filters and RLS, opaque ids, finding every affected endpoint, cross-user tests, logging enumeration, and NDB assessment.
Senior
Security
Authorization
Β· π 2 follow-ups Β· π 1 real-world
-
Design permission-based authorisation for a large multi-tenant SaaS product where customers define their own roles. Would you put permissions in the access token or look them up per request? How do you cache them, keep them fresh when an admin changes a role, and express them as ASP.NET Core policies without registering hundreds of them?
Permission-based authorisation architecture: permissions vs roles, tenant-defined roles, token size and staleness vs per-request lookup, caching and invalidation, a dynamic IAuthorizationPolicyProvider with one generic handler, auditing and when to adopt an external engine (Zanzibar-style, OPA).
Senior
Architecture
Authorization
Β· π 3 follow-ups Β· π 1 real-world
-
Code review: an ASP.NET Core controller for invoices has authorisation enforced only by hiding buttons in the React UI, role strings like "Admin" and "FinanceManager" repeated in attributes, [AllowAnonymous] on the controller 'for the health check', and an Approve action that takes the approver's user id from the request body. What do you flag, in what order, and what does the fixed version look like?
Code review of authorisation: controller-level AllowAnonymous, UI-only checks, missing resource and tenant checks, user id from the request body, scattered role strings, and the rewrite with policies, resource-based authorisation, claims-derived identity, fallback policy and tests.
Senior
CodeReview
Authorization
Β· π 3 follow-ups Β· π 1 real-world
-
What is the difference between hashing, encryption and encoding? Give a .NET example of each, and explain why storing SHA256(password) is not proper password hashing.
Distinguishes hashing, encryption and encoding by purpose and reversibility, with .NET APIs for each, and explains why a fast hash like SHA-256 is unsafe for passwords.
Junior
Theory
Cryptography
Β· π 2 follow-ups
-
How should an ASP.NET Core application store user passwords? Explain salts, peppers and work factors, compare PBKDF2, bcrypt and Argon2id, describe what Identity's PasswordHasher does, and how you would upgrade a database of old SHA-1 or MD5 hashes without forcing every user to reset.
Covers secure password storage: per-user salts, optional pepper, tunable work factors, PBKDF2 vs bcrypt vs Argon2id, Identity's versioned PasswordHasher and migrating legacy hashes by wrapping and rehash-on-login.
Intermediate
Security
Cryptography
Β· π 2 follow-ups Β· π 1 real-world
-
Show how you would encrypt and decrypt sensitive values in .NET with AesGcm. Explain the key and nonce sizes, why reusing a nonce with the same key is catastrophic, what authenticated encryption gives you over AES-CBC, and how you would store the output.
Covers symmetric authenticated encryption with System.Security.Cryptography.AesGcm: 256-bit keys, 96-bit nonces, 128-bit tags, the consequences of nonce reuse, associated data, the stored payload format and when to use Data Protection or Key Vault instead.
Mid-Level
Coding
Cryptography
Β· π 2 follow-ups Β· π 1 real-world
-
Explain asymmetric cryptography with RSA and ECDSA. What is the difference between encrypting and signing with a key pair, which key sizes and curves are acceptable today, why padding such as OAEP and PSS matters, and when would you use asymmetric rather than symmetric cryptography in a .NET system?
Covers public-key cryptography in .NET: RSA vs ECDSA/ECDH, encrypt-with-public vs sign-with-private, key sizes and curves, OAEP and PSS padding versus PKCS#1 v1.5, hybrid encryption and where asymmetric keys appear in real systems.
Mid-Level
Theory
Cryptography
Β· π 3 follow-ups Β· π 1 real-world
-
Write code to verify an incoming webhook signed with HMAC-SHA256, for example from Stripe or GitHub. Explain what HMAC guarantees, why you must compare signatures in constant time with CryptographicOperations.FixedTimeEquals, why you must hash the raw request body, and how you prevent replay.
Covers HMAC-based webhook verification in ASP.NET Core: keyed integrity and authenticity, computing HMACSHA256 over the raw body, constant-time comparison, timestamp checks against replay, and secret rotation.
Intermediate
Coding
Cryptography
Β· π 2 follow-ups
-
How do digital signatures and X.509 certificates work together? Explain what a certificate contains, how a chain of trust is validated, how you would sign and verify a token or document in .NET, and why .NET 9 introduced X509CertificateLoader to replace the X509Certificate2 constructors.
Covers digital signatures and X.509 in .NET: certificate fields, chain building and revocation, signing documents and tokens with certificate keys, X509Chain validation, and the move to X509CertificateLoader (SYSLIB0057) in .NET 9 and later.
Mid-Level
Theory
Cryptography
Β· π 2 follow-ups Β· π 1 real-world
-
How do you manage and rotate encryption keys in an Azure-hosted .NET system? Explain Key Vault keys versus secrets, envelope encryption with data keys and key-encryption keys, how to rotate a key without downtime using key ids, and when you would need an HSM or Managed HSM.
Covers key management for .NET on Azure: Key Vault keys vs secrets vs certificates, envelope encryption (DEK/KEK), key versioning and zero-downtime rotation, re-encryption strategies, HSM tiers, access control and auditing.
Senior
Theory
Cryptography
Β· π 3 follow-ups Β· π 1 real-world
-
What is the ASP.NET Core Data Protection API? Explain what uses it (cookies, antiforgery, TempData), how the key ring works, purposes and IDataProtector, key lifetime and rotation, and how you persist and protect keys when an app runs on several instances, for example with Azure Blob Storage and Key Vault.
Covers ASP.NET Core Data Protection: the consumers that depend on it, the key ring and automatic 90-day rotation, purpose strings, time-limited protectors, default key storage locations, and production configuration with PersistKeysToAzureBlobStorage, ProtectKeysWithAzureKeyVault and SetApplicationName.
Mid-Level
Theory
Cryptography
Β· π 2 follow-ups Β· π 1 real-world
-
After every deployment of your ASP.NET Core app, all users are logged out, and with three instances behind a load balancer you see intermittent antiforgery errors and 'The key {guid} was not found in the key ring' in the logs. How do you diagnose and fix it?
A debugging walk-through for unshared ASP.NET Core Data Protection keys: recognising the symptoms in cookies, antiforgery and OIDC, reading the Data Protection logs, finding where keys are stored per host, and fixing it with a shared, protected key ring and a fixed application name.
Senior
Debugging
Cryptography
Β· π 2 follow-ups Β· π 1 real-world
-
How do you manage TLS and signing certificates for .NET services in Azure and Kubernetes? Cover automated renewal, App Service managed certificates versus Key Vault certificates, cert-manager on AKS, getting a renewed certificate to running apps without a restart, monitoring expiry, the move to much shorter certificate lifetimes, and what post-quantum cryptography means for your plans.
Covers certificate lifecycle at scale: inventory, automated issuance and renewal (App Service managed certificates, Key Vault issuers, cert-manager/ACME), distributing renewed certificates, expiry monitoring, the CA/Browser Forum schedule to 47-day TLS certificates, and post-quantum readiness with ML-KEM and ML-DSA in .NET 10.
Senior
Theory
Cryptography
Β· π 3 follow-ups Β· π 1 real-world
-
Which security headers should an ASP.NET Core app send, and how do you roll out a Content Security Policy safely? Explain what each header protects against, how you set them in middleware, how CSP nonces work with Razor, and why you start in report-only mode.
The security headers that matter for ASP.NET Core apps and APIs, setting them in middleware, nonce-based CSP with Razor, and a report-only rollout.
Intermediate
Theory
Web Security
Β· π 2 follow-ups
-
How do you protect an ASP.NET Core API from oversized or deeply nested request payloads?
Mid-Level
Security
Web Security
-
What is the OWASP Top 10? Walk me through the current edition and tell me, for each category, what ASP.NET Core gives you by default and what you still have to do yourself.
The OWASP Top 10:2025 categories mapped to the built-in ASP.NET Core defences and the gaps a developer must still close.
Junior
Theory
Web Security
Β· π 2 follow-ups