diff --git a/c7n/resources/emr.py b/c7n/resources/emr.py
index 9656c7050..ebf5c502f 100644
--- a/c7n/resources/emr.py
+++ b/c7n/resources/emr.py
@@ -14,6 +14,7 @@
 import logging
 import time
 import json
+import jmespath
 
 from c7n.actions import ActionRegistry, BaseAction
 from c7n.exceptions import PolicyValidationError
@@ -24,6 +25,7 @@ from c7n.utils import (
     local_session, type_schema, get_retry)
 from c7n.tags import (
     TagDelayedAction, RemoveTag, TagActionFilter, Tag)
+import c7n.filters.vpc as net_filters
 
 filters = FilterRegistry('emr.filters')
 actions = ActionRegistry('emr.actions')
@@ -286,6 +288,37 @@ class QueryFilter:
         return {'Name': self.key, 'Values': value}
 
 
+@filters.register('subnet')
+class SubnetFilter(net_filters.SubnetFilter):
+
+    RelatedIdsExpression = "Ec2InstanceAttributes.RequestedEc2SubnetIds[]"
+
+
+@filters.register('security-group')
+class SecurityGroupFilter(net_filters.SecurityGroupFilter):
+
+    RelatedIdsExpression = ""
+    expressions = ('Ec2InstanceAttributes.EmrManagedMasterSecurityGroup',
+                'Ec2InstanceAttributes.EmrManagedSlaveSecurityGroup',
+                'Ec2InstanceAttributes.ServiceAccessSecurityGroup',
+                'Ec2InstanceAttributes.AdditionalMasterSecurityGroups[]',
+                'Ec2InstanceAttributes.AdditionalSlaveSecurityGroups[]')
+
+    def get_related_ids(self, resources):
+        sg_ids = set()
+        for r in resources:
+            for exp in self.expressions:
+                ids = jmespath.search(exp, r)
+                if isinstance(ids, list):
+                    sg_ids.update(tuple(ids))
+                elif isinstance(ids, str):
+                    sg_ids.add(ids)
+        return list(sg_ids)
+
+
+filters.register('network-location', net_filters.NetworkLocation)
+
+
 @resources.register('emr-security-configuration')
 class EMRSecurityConfiguration(QueryResourceManager):
     """Resource manager for EMR Security Configuration

emr extend network-location feature
**Is your feature request related to a problem? Please describe.**
Require subnet/sg tag comparison for resource: emr

**Describe the solution you'd like**
Extend filter `subnet`, `security-group` and `network-location` for emr

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

diff --git a/tests/data/placebo/test_emr_sg/ec2.DescribeSecurityGroups_1.json b/tests/data/placebo/test_emr_sg/ec2.DescribeSecurityGroups_1.json
new file mode 100644
index 000000000..3241d8fd8
--- /dev/null
+++ b/tests/data/placebo/test_emr_sg/ec2.DescribeSecurityGroups_1.json
@@ -0,0 +1,35 @@
+{
+    "status_code": 200,
+    "data": {
+        "SecurityGroups": [
+            {
+                "Description": "Member group for Elastic MapReduce",
+                "GroupName": "ElasticMapReduce-Member-Private",
+                "IpPermissions": [],
+                "OwnerId": "644160558196",
+                "GroupId": "sg-cfcf69c3",
+                "IpPermissionsEgress": [
+                    {
+                        "IpProtocol": "-1",
+                        "IpRanges": [
+                            {
+                                "CidrIp": "0.0.0.0/0"
+                            }
+                        ],
+                        "Ipv6Ranges": [],
+                        "PrefixListIds": [],
+                        "UserIdGroupPairs": []
+                    }
+                ],
+                "Tags": [
+                    {
+                        "Key": "NetworkLocation",
+                        "Value": "CustFacing,EntFacing"
+                    }
+                ],
+                "VpcId": "vpc-xxxxxxxx"
+            }
+        ],
+        "ResponseMetadata": {}
+    }
+}
\ No newline at end of file
diff --git a/tests/data/placebo/test_emr_sg/elasticmapreduce.DescribeCluster_1.json b/tests/data/placebo/test_emr_sg/elasticmapreduce.DescribeCluster_1.json
new file mode 100644
index 000000000..442bbcac4
--- /dev/null
+++ b/tests/data/placebo/test_emr_sg/elasticmapreduce.DescribeCluster_1.json
@@ -0,0 +1,83 @@
+{
+    "status_code": 200,
+    "data": {
+        "Cluster": {
+            "Id": "j-2OMWOHFEP8XA9",
+            "Name": "pratyush-emr-test",
+            "Status": {
+                "State": "WAITING",
+                "StateChangeReason": {
+                    "Message": "Cluster ready after last step completed."
+                },
+                "Timeline": {
+                    "CreationDateTime": {
+                        "__class__": "datetime",
+                        "year": 2019,
+                        "month": 9,
+                        "day": 27,
+                        "hour": 10,
+                        "minute": 36,
+                        "second": 12,
+                        "microsecond": 558000
+                    },
+                    "ReadyDateTime": {
+                        "__class__": "datetime",
+                        "year": 2019,
+                        "month": 9,
+                        "day": 27,
+                        "hour": 10,
+                        "minute": 42,
+                        "second": 52,
+                        "microsecond": 754000
+                    }
+                }
+            },
+            "Ec2InstanceAttributes": {
+                "Ec2KeyName": "pratyush-key",
+                "Ec2SubnetId": "subnet-028c2369",
+                "RequestedEc2SubnetIds": [
+                    "subnet-028c2369"
+                ],
+                "Ec2AvailabilityZone": "us-east-1c",
+                "RequestedEc2AvailabilityZones": [],
+                "IamInstanceProfile": "EMR_EC2_DefaultRole",
+                "EmrManagedMasterSecurityGroup": "sg-cecf69c2",
+                "EmrManagedSlaveSecurityGroup": "sg-cfcf69c3",
+                "ServiceAccessSecurityGroup": "sg-8cbc29c0",
+                "AdditionalMasterSecurityGroups": [],
+                "AdditionalSlaveSecurityGroups": []
+            },
+            "InstanceCollectionType": "INSTANCE_GROUP",
+            "LogUri": "s3n://aws-logs-644160558196-us-east-1/elasticmapreduce/",
+            "ReleaseLabel": "emr-5.23.0",
+            "AutoTerminate": false,
+            "TerminationProtected": false,
+            "VisibleToAllUsers": true,
+            "Applications": [
+                {
+                    "Name": "Hadoop",
+                    "Version": "2.8.5"
+                },
+                {
+                    "Name": "Ganglia",
+                    "Version": "3.7.2"
+                }
+            ],
+            "Tags": [],
+            "ServiceRole": "EMR_DefaultRole",
+            "NormalizedInstanceHours": 106352,
+            "MasterPublicDnsName": "ip-X-X-X-X.ec2.internal",
+            "Configurations": [],
+            "SecurityConfiguration": "Encrypted",
+            "AutoScalingRole": "EMR_AutoScaling_DefaultRole",
+            "ScaleDownBehavior": "TERMINATE_AT_TASK_COMPLETION",
+            "CustomAmiId": "ami-0xxxxxxx89dc50e2b",
+            "EbsRootVolumeSize": 20,
+            "RepoUpgradeOnBoot": "SECURITY",
+            "KerberosAttributes": {},
+            "ClusterArn": "arn:aws:elasticmapreduce:us-east-1:644160558196:cluster/j-2OMWOHFEP8XA9",
+            "StepConcurrencyLevel": 1
+        },
+        "ResponseMetadata": {}
+    }
+}
\ No newline at end of file
diff --git a/tests/data/placebo/test_emr_sg/elasticmapreduce.ListClusters_1.json b/tests/data/placebo/test_emr_sg/elasticmapreduce.ListClusters_1.json
new file mode 100644
index 000000000..92aaee225
--- /dev/null
+++ b/tests/data/placebo/test_emr_sg/elasticmapreduce.ListClusters_1.json
@@ -0,0 +1,42 @@
+{
+    "status_code": 200,
+    "data": {
+        "Clusters": [
+            {
+                "Id": "j-2OMWOHFEP8XA9",
+                "Name": "pratyush-emr-test",
+                "Status": {
+                    "State": "WAITING",
+                    "StateChangeReason": {
+                        "Message": "Cluster ready after last step completed"
+                    },
+                    "Timeline": {
+                        "CreationDateTime": {
+                            "__class__": "datetime",
+                            "year": 2019,
+                            "month": 9,
+                            "day": 27,
+                            "hour": 10,
+                            "minute": 36,
+                            "second": 12,
+                            "microsecond": 558000
+                        },
+                        "ReadyDateTime": {
+                            "__class__": "datetime",
+                            "year": 2019,
+                            "month": 9,
+                            "day": 27,
+                            "hour": 10,
+                            "minute": 42,
+                            "second": 52,
+                            "microsecond": 754000
+                        }
+                    }
+                },
+                "NormalizedInstanceHours": 106352,
+                "ClusterArn": "arn:aws:elasticmapreduce:us-east-1:644160558196:cluster/j-2OMWOHFEP8XA9"
+            }
+        ],
+        "ResponseMetadata": {}
+    }
+}
\ No newline at end of file
diff --git a/tests/test_emr.py b/tests/test_emr.py
index fe19dccb8..3810f066e 100644
--- a/tests/test_emr.py
+++ b/tests/test_emr.py
@@ -157,6 +157,26 @@ class TestEMR(BaseTest):
         self.assertEqual(len(resources), 1)
         self.assertFalse("test_tag" in old_tags)
 
+    def test_emr_sg(self):
+        session_factory = self.replay_flight_data("test_emr_sg")
+        p = self.load_policy(
+            {
+                "name": "emr-sg-tag",
+                "resource": "emr",
+                "filters": [
+                    {
+                        "type": "security-group",
+                        "key": "tag:NetworkLocation",
+                        "value": "CustFacing,EntFacing"
+                    }
+                ],
+            },
+            session_factory=session_factory
+        )
+        resources = p.run()
+        self.assertEqual(len(resources), 1)
+        self.assertEqual(resources[0]["Name"], "pratyush-emr-test")
+
 
 class TestEMRQueryFilter(unittest.TestCase):
 

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio
apt-get update apt-get install -y gcc
3.8
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
apipkg==1.5
appdirs==1.4.4
argcomplete==1.11.1
attrs==19.3.0
aws-xray-sdk==2.6.0
bleach==3.1.5
boto3==1.14.8
botocore==1.17.8
-e git+https://github.com/cloud-custodian/cloud-custodian.git@4283ae8c63e4c828f5de57f6d729f96f69aaa428#egg=c7n
certifi==2020.6.20
cffi==1.14.0
chardet==3.0.4
coverage==5.1
cryptography==2.9.2
distlib==0.3.0
docutils==0.15.2
exceptiongroup==1.2.2
execnet==1.7.1
filelock==3.0.12
flake8==3.8.3
future==0.18.2
idna==2.9
importlib-metadata==1.6.1
iniconfig==2.1.0
jeepney==0.4.3
jmespath==0.10.0
jsonpatch==1.26
jsonpickle==1.4.1
jsonpointer==2.0
jsonschema==3.2.0
keyring==21.2.1
mccabe==0.6.1
mock==4.0.2
more-itertools==8.4.0
multidict==4.7.6
packaging==20.4
pkginfo==1.5.0.1
placebo==0.9.0
pluggy==1.5.0
psutil==5.7.0
py==1.8.2
pycodestyle==2.6.0
pycparser==2.20
pyflakes==2.2.0
Pygments==2.6.1
pyparsing==2.4.7
pyrsistent==0.16.0
pytest==8.3.5
pytest-asyncio==0.24.0
pytest-cov==2.10.0
pytest-forked==1.1.3
pytest-mock==3.14.0
pytest-sugar==0.9.3
pytest-xdist==1.32.0
python-dateutil==2.8.1
PyYAML==5.3.1
readme-renderer==26.0
requests==2.24.0
requests-toolbelt==0.9.1
s3transfer==0.3.3
SecretStorage==3.1.2
six==1.15.0
tabulate==0.8.7
termcolor==1.1.0
toml==0.10.1
tomli==2.2.1
tox==3.15.2
tqdm==4.46.1
twine==3.1.1
urllib3==1.25.9
vcrpy==4.0.2
virtualenv==20.0.24
wcwidth==0.2.4
webencodings==0.5.1
wrapt==1.12.1
yarl==1.4.2
zipp==3.1.0

name: cloud-custodian
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=24.2=py38h06a4308_0
  - python=3.8.20=he870216_0
  - readline=8.2=h5eee18b_0
  - setuptools=75.1.0=py38h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.44.0=py38h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - apipkg==1.5
      - appdirs==1.4.4
      - argcomplete==1.11.1
      - attrs==19.3.0
      - aws-xray-sdk==2.6.0
      - bleach==3.1.5
      - boto3==1.14.8
      - botocore==1.17.8
      - c7n==0.9.4
      - certifi==2020.6.20
      - cffi==1.14.0
      - chardet==3.0.4
      - coverage==5.1
      - cryptography==2.9.2
      - distlib==0.3.0
      - docutils==0.15.2
      - exceptiongroup==1.2.2
      - execnet==1.7.1
      - filelock==3.0.12
      - flake8==3.8.3
      - future==0.18.2
      - idna==2.9
      - importlib-metadata==1.6.1
      - iniconfig==2.1.0
      - jeepney==0.4.3
      - jmespath==0.10.0
      - jsonpatch==1.26
      - jsonpickle==1.4.1
      - jsonpointer==2.0
      - jsonschema==3.2.0
      - keyring==21.2.1
      - mccabe==0.6.1
      - mock==4.0.2
      - more-itertools==8.4.0
      - multidict==4.7.6
      - packaging==20.4
      - pkginfo==1.5.0.1
      - placebo==0.9.0
      - pluggy==1.5.0
      - psutil==5.7.0
      - py==1.8.2
      - pycodestyle==2.6.0
      - pycparser==2.20
      - pyflakes==2.2.0
      - pygments==2.6.1
      - pyparsing==2.4.7
      - pyrsistent==0.16.0
      - pytest==8.3.5
      - pytest-asyncio==0.24.0
      - pytest-cov==2.10.0
      - pytest-forked==1.1.3
      - pytest-mock==3.14.0
      - pytest-sugar==0.9.3
      - pytest-xdist==1.32.0
      - python-dateutil==2.8.1
      - pyyaml==5.3.1
      - readme-renderer==26.0
      - requests==2.24.0
      - requests-toolbelt==0.9.1
      - s3transfer==0.3.3
      - secretstorage==3.1.2
      - six==1.15.0
      - tabulate==0.8.7
      - termcolor==1.1.0
      - toml==0.10.1
      - tomli==2.2.1
      - tox==3.15.2
      - tqdm==4.46.1
      - twine==3.1.1
      - urllib3==1.25.9
      - vcrpy==4.0.2
      - virtualenv==20.0.24
      - wcwidth==0.2.4
      - webencodings==0.5.1
      - wrapt==1.12.1
      - yarl==1.4.2
      - zipp==3.1.0
prefix: /opt/conda/envs/cloud-custodian

tests/test_emr.py::TestEMR::test_emr_sg
tests/test_emr.py::TestEMR::test_consolidate_query_filter tests/test_emr.py::TestEMR::test_emr_mark tests/test_emr.py::TestEMR::test_emr_tag tests/test_emr.py::TestEMR::test_emr_unmark tests/test_emr.py::TestEMR::test_get_emr_by_ids tests/test_emr.py::TestEMR::test_get_emr_tags tests/test_emr.py::TestEMRQueryFilter::test_parse tests/test_emr.py::TestTerminate::test_emr_terminate tests/test_emr.py::TestActions::test_action_construction tests/test_emr.py::TestEMRSecurityConfiguration::test_emr_security_configuration tests/test_emr.py::TestEMRSecurityConfiguration::test_emr_security_configuration_delete
c7n/resources/emr.py
c7n/resources/emr.py