# Can I Set dt.security\_context via OneAgent args in DynaKube Cloud-Native Full-Stack Mode?

**URL:** <https://community.dynatrace.com/t/can-i-set-dt-security-context-via-oneagent-args-in-dynakube-cloud-native-full-stack-mode/56339>\
**Category:** Cloud platforms\
**Tags:** azure, oneagent, kubernetes\
**Created:** [July 1, 2026, 7:15am UTC](https://community.dynatrace.com/t/can-i-set-dt-security-context-via-oneagent-args-in-dynakube-cloud-native-full-stack-mode/56339 "2026-07-01T07:15:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TahirJanwari](https://avatars.discourse-cdn.com/v4/letter/t/a87d85/32.png) [@TahirJanwari](https://community.dynatrace.com/u/TahirJanwari)\
**Post date:** [July 1, 2026, 7:15am UTC](https://community.dynatrace.com/t/can-i-set-dt-security-context-via-oneagent-args-in-dynakube-cloud-native-full-stack-mode/56339/1 "2026-07-01T07:15:09Z")

</div>

Hi everyone,

I’m using **DynaKube** in **cloud-native full-stack monitoring mode** on Kubernetes and need to confirm if I can set dt.security\_context using OneAgent args.

What I want to do:  
**spec:  
oneAgent:  
hostGroup: SAMPLE  
cloudNativeFullStack:  
args:  
- “--set-host-property=dt.security\_context=my\_security\_value”**

**Questions:**

1. Will this work in cloud-native full-stack mode on Kubernetes?
2. If not, what’s the recommended way to set dt.security\_context in DynaKube cloud-native full-stack mode?

I’ve seen oneagentctl --set-host-property mentioned for VMs (Linux/Windows), but I’m not sure if the same approach applies in the DynaKube args field.

Any help or experience with this would be appreciated!

Thanks

---

<div class="post-metadata">

**Author:** ![PacoPorro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pacoporro/32/36087_2.png) [@PacoPorro](https://community.dynatrace.com/u/PacoPorro)\
**Post date:** [July 1, 2026, 2:13pm UTC](https://community.dynatrace.com/t/can-i-set-dt-security-context-via-oneagent-args-in-dynakube-cloud-native-full-stack-mode/56339/2 "2026-07-01T14:13:28Z")

</div>

May I suggest you to check this link? You can use existing label, metadata, and also you can do set it up at pod level.

> **[Set up Grail permissions for telemetry from Kubernetes and Kubernetes workloads](https://docs.dynatrace.com/docs/ingest-from/setup-on-k8s/k8-security-context)**
>
> Set up Grail permissions in Kubernetes.

---

<div class="post-metadata">

**Author:** ![TahirJanwari](https://avatars.discourse-cdn.com/v4/letter/t/a87d85/32.png) [@TahirJanwari](https://community.dynatrace.com/u/TahirJanwari)\
**Post date:** [July 2, 2026, 7:44am UTC](https://community.dynatrace.com/t/can-i-set-dt-security-context-via-oneagent-args-in-dynakube-cloud-native-full-stack-mode/56339/3 "2026-07-02T07:44:21Z")

</div>

HI Paco,  
Thanks for the input. Based on the Dynatrace documentation [[Set up Grail permissions for telemetry from Kubernetes and Kubernetes workloads — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/kubernetes-security-context#security-context-based-on-existing-namespace-labels-or-annotations-recommended)], this is how I understand the setup:

First, label the namespaces you want to monitor, for example:  
kubectl label namespace NS1 security-context=DEMO  
kubectl label namespace NS1 dt-monitoring=true

Then in DynaKube, configure the namespace selector to pick up only those labeled namespaces

oneAgent:  
hostGroup: DEMO  
cloudNativeFullStack:  
namespaceSelector:  
matchExpressions dt-monitoring  
operator: In  
values: [“true”]

Finally, create an enrichment rule in Dynatrace with source security-context and target **dt.security\_context.**

Let me know if my understanding is correct

Thanks

---

<div class="post-metadata">

**Author:** ![Fin\_Ubels](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/fin_ubels/32/18008_2.png) [@Fin\_Ubels](https://community.dynatrace.com/u/Fin_Ubels)\
**Post date:** [July 3, 2026, 1:16am UTC](https://community.dynatrace.com/t/can-i-set-dt-security-context-via-oneagent-args-in-dynakube-cloud-native-full-stack-mode/56339/4 "2026-07-03T01:16:15Z")

</div>

Hey Tahir,

That all looks correct to me! However the steps you have identified for limiting monitoring is optional. You do not have to restrict monitoring to specific pods unless you want to or have a use case to. You can still let the operator roam free.
