Skip to content

Commit cc5ae81

Browse files
committed
defender setup + dependabot
1 parent 066d95b commit cc5ae81

10 files changed

Lines changed: 614 additions & 126 deletions

File tree

.github/dependabot.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: 2
2+
updates:
3+
# Root python dependencies (if used)
4+
- package-ecosystem: "pip"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
open-pull-requests-limit: 5
9+
10+
# App dependencies
11+
- package-ecosystem: "pip"
12+
directory: "/src"
13+
schedule:
14+
interval: "weekly"
15+
open-pull-requests-limit: 5
16+
17+
# A2A server dependencies
18+
- package-ecosystem: "pip"
19+
directory: "/src/a2a"
20+
schedule:
21+
interval: "weekly"
22+
open-pull-requests-limit: 5
23+
24+
# Terraform provider updates
25+
- package-ecosystem: "terraform"
26+
directory: "/terraform-infrastructure"
27+
schedule:
28+
interval: "weekly"
29+
open-pull-requests-limit: 5

.github/workflows/codeql.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
schedule:
9+
- cron: "35 2 * * 1" # weekly
10+
11+
permissions:
12+
contents: read
13+
security-events: write
14+
15+
jobs:
16+
analyze:
17+
name: Analyze (Python)
18+
runs-on: ubuntu-latest
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: ["python"]
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v3
31+
with:
32+
languages: ${{ matrix.language }}
33+
34+
- name: Autobuild
35+
uses: github/codeql-action/autobuild@v3
36+
37+
- name: Perform CodeQL Analysis
38+
uses: github/codeql-action/analyze@v3
39+
with:
40+
category: "/language:${{ matrix.language }}"

README.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Last updated: 2026-02-02
1616
<summary><b>List of References</b> (Click to expand)</summary>
1717

1818
- [Microsoft Foundry SDKs and Endpoints](https://learn.microsoft.com/en-us/azure/ai-foundry/how-to/develop/sdk-overview?view=foundry&pivots=programming-language-python)
19+
- Microsoft Defender for Cloud (DevOps security)
20+
- [Connect GitHub to Defender for Cloud](https://learn.microsoft.com/azure/defender-for-cloud/quickstart-onboard-github)
21+
- [Connect Azure DevOps to Defender for Cloud](https://learn.microsoft.com/azure/defender-for-cloud/quickstart-onboard-devops)
22+
- [DevOps security permissions and prerequisites](https://learn.microsoft.com/azure/defender-for-cloud/devops-support)
1923

2024
</details>
2125

@@ -28,10 +32,21 @@ Last updated: 2026-02-02
2832
> [!IMPORTANT]
2933
> The deployment process typically takes 15-20 minutes
3034
>
31-
> 1. Adjust [terraform.tfvars](./terraform-infrastructure/terraform.tfvars) values
35+
> 1. Pick a deployment approach (Container Apps or App Service)
36+
> 2. Adjust [terraform.tfvars](./terraform-infrastructure/terraform.tfvars) values
3237
> 2. Initialize terraform with `terraform init`. Click here to [understand more about the deployment process](./terraform-infrastructure/README.md)
3338
> 3. Run `terraform apply`, you can also leverage `terraform apply -auto-approve`.
3439
40+
### Deployment Approaches (pick one)
41+
42+
- **Container Apps (recommended default in this repo)**
43+
- In `terraform-infrastructure/terraform.tfvars`: set `deployment_target = "containerapps"`
44+
- Run: `cd terraform-infrastructure` then `terraform apply -var-file terraform.tfvars`
45+
46+
- **App Service (Linux custom container)**
47+
- In `terraform-infrastructure/terraform.tfvars`: set `deployment_target = "appservice"` and choose `app_service_sku` (e.g. `P0v3`)
48+
- Run: `cd terraform-infrastructure` then `terraform apply -var-file terraform.tfvars`
49+
3550
## Key Features
3651

3752
- **Multi-agent chat orchestration (default runtime)**: WebSocket `/ws` chat app orchestrates multiple agents in a single conversation flow (routing + multi-step handoffs)
@@ -49,6 +64,54 @@ Last updated: 2026-02-02
4964
- **UI-visible diagnostics**: Correlated `error_id` responses and optional tracebacks via `A2A_DEBUG=true` for faster troubleshooting
5065
- **Optional A2A server included**: `src/a2a/` contains an A2A-style server framework, but it is not the default Container Apps entrypoint unless you deploy it explicitly
5166

67+
## More Security with Microsoft Defender
68+
69+
> [!IMPORTANT]
70+
> **Defender is enabled by default in this repo's Terraform defaults.** This can incur Azure costs (Defender plans) and will provision DevOps security connector resources that still require a one-time interactive authorization step for GitHub/Azure DevOps.
71+
> To opt out, explicitly set the related variables to `false` in [terraform-infrastructure/terraform.tfvars](terraform-infrastructure/terraform.tfvars).
72+
73+
This repo supports two complementary “Defender” scenarios:
74+
75+
1. **Microsoft Defender for Cloud (workload protection / cloud posture)**
76+
- This repo includes an opt-in Terraform configuration to enable Defender for Cloud plans at the subscription scope.
77+
- Toggle via `enable_defender_for_cloud` in [terraform-infrastructure/terraform.tfvars](terraform-infrastructure/terraform.tfvars) (or the example `tfvars` files above).
78+
- Note: enabling Defender plans can incur Azure costs.
79+
80+
2. **Defender for Cloud DevOps Security (GHAS / ADO aggregation & reporting)**
81+
- This repo can provision the **connector resources** via Terraform, but onboarding still requires **interactive authorization** to GitHub and/or Azure DevOps in the Azure portal (or providing a one-time OAuth code).
82+
- This is the feature area that provides the “central dashboard” experience for GHAS-like findings (code scanning, dependency, secrets) across **organizations/projects** (not just individual repos).
83+
- It can optionally add **Pull Request annotations** (a write-back action) but only when you explicitly enable/configure that feature.
84+
85+
### Opt out (disable Defender)
86+
87+
- In [terraform-infrastructure/terraform.tfvars](terraform-infrastructure/terraform.tfvars), set:
88+
- `enable_defender_for_cloud = false`
89+
- `enable_defender_devops_security = false`
90+
91+
### Visibility-first rollout (recommended for demos)
92+
93+
- Onboard **GitHub connector only** first to validate the Defender dashboards/workbooks.
94+
- Onboard **Azure DevOps connector** only in a **sandbox org/project**.
95+
- Keep **PR annotations OFF** initially (no write-back to PRs) until you decide to enable them.
96+
97+
### If the Azure portal blade errors
98+
99+
If the Azure portal **Defender for Cloud → Environment settings** page fails to load with an error like:
100+
`ECS feature flags for project 'Defenders' are not initialized (ErrorAcquiringViewModel)`
101+
102+
Use one of these workarounds:
103+
104+
- **Open the connector resource directly** (bypasses the Environment Settings blade):
105+
- Find the connector resource IDs from Terraform outputs (look for `defender_devops_security_connector_ids`).
106+
- Open in the portal using this pattern:
107+
- `https://portal.azure.com/#resource/<connector-resource-id>/overview`
108+
- Example: `.../providers/Microsoft.Security/securityConnectors/github-connector`
109+
110+
- **List the connector IDs via CLI** (then open them with the URL above):
111+
- `az resource list -g <rg-name> --resource-type Microsoft.Security/securityConnectors -o table`
112+
113+
- **Browser reset**: try InPrivate/Incognito, disable extensions (ad blockers), and sign out/in.
114+
52115
## About A2A Protocol
53116

54117
`A2A (Agent-to-Agent) Protocol is a standardized communication framework that enables multiple AI agents to collaborate and coordinate tasks seamlessly.` Like a communication pattern for coordinating multiple agents through structured messages, delegation, and (optionally) event-driven workflows.

src/a2a/status_automation.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if () {
1111

1212
# Check automation endpoint
1313
try {
14-
= Invoke-RestMethod -Uri "https://zava-6a7d57fb-app.azurewebsites.net/a2a/automation/status" -TimeoutSec 5
14+
= Invoke-RestMethod -Uri "https://zava-9e4d78b5-app.azurewebsites.net/a2a/automation/status" -TimeoutSec 5
1515
Write-Host "Automation Status: "
1616
} catch {
1717
Write-Host "Automation endpoint not accessible"

terraform-infrastructure/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ Templates structure:
5555
- terraform.tfvars `(Variable values)`: This file contains the actual values for the variables defined in `variables.tf`. By separating variable definitions and values, you can easily switch between different sets of values for different environments (e.g., development, staging, production) without changing the main configuration files.
5656
- outputs.tf `(Output values)`: This file defines the output values that Terraform should return after applying the configuration. Outputs are useful for displaying information about the resources created, such as IP addresses, resource IDs, and other important details. They can also be used as inputs for other Terraform configurations or scripts.
5757

58+
## Optional: Microsoft Defender for Cloud
59+
60+
This Terraform setup includes an opt-in configuration to enable **Microsoft Defender for Cloud** plans at the subscription scope.
61+
62+
> [!IMPORTANT]
63+
> Enabling Defender plans can incur additional costs in your Azure subscription.
64+
65+
- To enable, set `enable_defender_for_cloud = true` in `terraform.tfvars` and optionally adjust `defender_for_cloud_plans`.
66+
5867
## How to execute it
5968

6069
```mermaid

0 commit comments

Comments
 (0)