Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File based Python logging config #1301

Closed
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
076ef78
feat: adding logging configuration file
chandanchowdhury May 1, 2024
7327354
feat: adding logging config parameter
chandanchowdhury May 1, 2024
c804e39
feat: use logging config from file
chandanchowdhury May 1, 2024
2f547b5
refactor: moved to logging config file
chandanchowdhury May 1, 2024
80e33e4
fix: typo
chandanchowdhury May 1, 2024
1206082
refactor: lint
chandanchowdhury May 1, 2024
603520c
GitHub intel updates to error handling (#1303)
serge-wq May 13, 2024
91289b7
0.91.0 (#1305)
May 15, 2024
0bba5a7
Add support for Okta group->AWS SSO role rel (#1307)
Jun 3, 2024
693e38d
0.92.0rc1 (#1308)
Jun 3, 2024
fb875a5
#1302: Refactor EC2 LaunchTemplate to use data model (#1312)
Jun 17, 2024
3bccad5
#1302: remove launchtemplate manual create index call (#1314)
Jun 17, 2024
975e667
0.92.0rc2 (#1313)
Jun 17, 2024
7b46cbb
Fix bug: Return empty access_keys object when access keys do not exis…
austincomstockzoom Jun 17, 2024
5f82ae8
Fix NoneType error in describe_images by filtering out None values in…
austincomstockzoom Jun 17, 2024
8a33b64
#1302: add missing cleanup job for launchtemplates (#1315)
Jun 17, 2024
1a6f2d8
Handle flaky CI failures in integration tests (#1319)
Jun 18, 2024
1c25cfa
#1316: EC2SubnetInstanceNodeProperties: s/subnet_id/subnetid/ (#1320)
Jun 18, 2024
66dd754
0.92.0 (#1317)
Jun 18, 2024
53b77d4
fixed typo in Azure load_vms cypher (#1047)
amirjalali65 Jun 26, 2024
6552a5e
Add Chandan to MAINTAINERS.md (#1322)
Jun 26, 2024
7e4b86a
crowdstrike: remove arbitrary filter and limit (#1008)
juju4 Jun 26, 2024
5e643b1
Fix #1326: update CVE request timeouts (#1327)
Jul 8, 2024
9a44321
Add ossf scorecard (#1037)
juju4 Jul 8, 2024
3ec1d1d
0.93.0rc1 (#1328)
Jul 9, 2024
3e3ab61
#1321: Refactor get_launch_template_versions to skip race condition. …
heryxpc Jul 17, 2024
d6b8b16
0.93.0 (#1333)
Jul 17, 2024
4dcf28c
Create pull_request_template.md (#1157)
ramonpetgrave64 Jul 20, 2024
b782197
Minor edits to pull request template (#1337)
Jul 22, 2024
484a966
Fix #1334: add retry + sleep to github team-repo sync (#1336)
Jul 22, 2024
f2ecdcf
0.94.0rc1 (#1338)
Jul 22, 2024
87e78d3
Fix #1340: run AWS Inspector only on supported regions (#1341)
Jul 23, 2024
7c5441f
Update Semgrep intel module to use the /findings API endpoint (#1342)
heryxpc Jul 25, 2024
335474d
Update Semgrep transform error log and tag release 0.94.0rc3 (#1343)
heryxpc Jul 26, 2024
e30ccaa
Fixes: #1298 - Add SnipeIT source (#1299)
chandanchowdhury Aug 21, 2024
054ea9a
Add more IAM sample queries to docs (#1346)
Aug 22, 2024
1c7933e
#1350: Update install.md (#1351)
chandanchowdhury Sep 11, 2024
0c22ea5
Update pre-commit hooks (#1352)
chandanchowdhury Sep 17, 2024
65b6a48
#1353: fix: stack trace while logging message (#1354)
chandanchowdhury Sep 17, 2024
1ba85d7
Fix #689: correctly pass job name to GraphStatement (#1355)
Sep 18, 2024
340c70f
Fix #689: pass parent job name from RPR sync (#1356)
Sep 23, 2024
59dc4ee
0.94.0 (#1357)
Sep 23, 2024
a8bede2
Add docs on cartography in production and its differentiators (#1358)
Sep 24, 2024
b4aba27
Fix broken links (#1359)
Sep 25, 2024
4e5ac1b
Deprecate crxcavator module (#1362)
Sep 26, 2024
1097783
Update the documentation reference (#1361)
emmanuel-ferdman Sep 26, 2024
ace90ae
#1363, #1347: Make docker-compose the preferred way to try cartograph…
Oct 11, 2024
cdecc8a
Adding token generation before each service API (#1324)
soumyadipDe Oct 11, 2024
f177ef4
Prevent .compose volumes from being doubly included in docker (#1367)
Oct 11, 2024
938f9e9
Add CNCF to docs (#1369)
Oct 24, 2024
4a1ac6d
0.95.0rc1 (#1370)
Oct 25, 2024
19776ce
Add initial governance guidelines (#1372)
Nov 3, 2024
47857a1
Ingest Go dependencies using Semgrep API (#1368)
hanzo Nov 5, 2024
bac2c54
Make docker and docker-compose work on WSL2 (#1375)
Nov 5, 2024
a3a2c28
0.95.0 (#1376)
Nov 5, 2024
9f3938b
Fix Semgrep schema doc (#1377)
hanzo Nov 6, 2024
33c7fd4
Update README with Slack instructions (#1381)
Nov 12, 2024
94c2a46
Fix race condition for Docker local tests (#1384)
Nov 14, 2024
e984d40
Add support for fuzzy case-insensitive match in PropertyRef (#1383)
Nov 18, 2024
1a7dbb2
Add support for AWS EC2 Network ACLs (#1386)
Nov 18, 2024
36b74ba
0.96.0rc1 (#1387)
Nov 18, 2024
bfd3260
Added in Identity Center Nodes + relationship mapping (#1380)
SecPrez Nov 19, 2024
d0f2fa4
first pass at identifying enterprise owner users (#1378)
danbrauer Nov 19, 2024
9a65f9e
Ingest NPM dependencies using Semgrep API (v0.96.0rc2) (#1385)
hanzo Nov 20, 2024
f6cb226
Rev precommit packages and fix the issues (#1388)
SecPrez Nov 20, 2024
a0ca3b0
0.96.0rc3: fix identitycenter import error (#1390)
Nov 20, 2024
fdcad12
Fix IAM policy naming for inline policies with empty string Sid field…
SecPrez Nov 23, 2024
639176f
Github "Direct" User Repo Access (#1391)
danbrauer Nov 25, 2024
657a2ee
docs: add logging config file doc link, samepl config file usage
chandanchowdhury Nov 27, 2024
f3945fd
Merge branch 'master' into topic/chandan/logging_config
chandanchowdhury Nov 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#1316: EC2SubnetInstanceNodeProperties: s/subnet_id/subnetid/ (#1320)
Fixes #1316.

Fixes a typo where EC2 subnets as known by EC2 instances would have
their id in `subnet_id` instead of `subnetid`. This would cause a
missing relationship between the subnet and VPC because VPCs attach to
subnets using `subnetid`; see
https://github.com/lyft/cartography/blob/098d8ca5f4bb172944338dad9df797a36e23485a/cartography/intel/aws/ec2/subnets.py#L50-L51.

This PR is the same as #1318 but with tests; getting this fixed asap.

See https://lyftoss.slack.com/archives/CTZUQL0KX/p1718644518442939 for
more context.

Signed-off-by: chandanchowdhury <chandan.chowdhury@hotmail.com>
Alex Chantavy authored and chandanchowdhury committed Nov 27, 2024

Verified

This commit was signed with the committer’s verified signature.
commit 1c25cfaacf19aa2db4eb37872e0ec8d79ac9fe5d
2 changes: 1 addition & 1 deletion cartography/models/aws/ec2/subnet_instance.py
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
class EC2SubnetInstanceNodeProperties(CartographyNodeProperties):
# arn: PropertyRef = PropertyRef('Arn', extra_index=True) TODO use arn; issue #1024
id: PropertyRef = PropertyRef('SubnetId')
subnet_id: PropertyRef = PropertyRef('SubnetId', extra_index=True)
subnetid: PropertyRef = PropertyRef('SubnetId', extra_index=True)
region: PropertyRef = PropertyRef('Region', set_in_kwargs=True)
lastupdated: PropertyRef = PropertyRef('lastupdated', set_in_kwargs=True)

Original file line number Diff line number Diff line change
@@ -91,6 +91,11 @@ def test_sync_ec2_instances(mock_get_instances, neo4j_session):
('eni-87', 'SOME_SUBNET_1'),
}

# #1316: Assert the fields of the subnet are as expected and that subnet_id does not exist
assert check_nodes(neo4j_session, 'EC2Subnet', ['id', 'subnetid', 'subnet_id']) == {
('SOME_SUBNET_1', 'SOME_SUBNET_1', None),
}

# Assert network interface to security group
assert check_rels(
neo4j_session,
30 changes: 15 additions & 15 deletions tests/integration/cartography/intel/aws/ec2/test_ec2_subnets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cartography.intel.aws.ec2
import tests.data.aws.ec2.subnets

from tests.integration.util import check_nodes

TEST_ACCOUNT_ID = '000000000000'
TEST_REGION = 'eu-north-1'
@@ -16,22 +16,22 @@ def test_load_subnets(neo4j_session):
TEST_ACCOUNT_ID,
TEST_UPDATE_TAG,
)

expected_nodes = {
"arn:aws:ec2:eu-north-1:000000000000:subnet/subnet-0773409557644dca4",
"arn:aws:ec2:eu-north-1:000000000000:subnet/subnet-020b2f3928f190ce8",
"arn:aws:ec2:eu-north-1:000000000000:subnet/subnet-0fa9c8fa7cb241479",
# Assert that we create EC2Subnet nodes and correctly include their subnetid field
assert check_nodes(neo4j_session, 'EC2Subnet', ['subnetid', 'subnet_arn']) == {
(
'subnet-020b2f3928f190ce8',
'arn:aws:ec2:eu-north-1:000000000000:subnet/subnet-020b2f3928f190ce8',
),
(
'subnet-0773409557644dca4',
'arn:aws:ec2:eu-north-1:000000000000:subnet/subnet-0773409557644dca4',
),
(
'subnet-0fa9c8fa7cb241479',
'arn:aws:ec2:eu-north-1:000000000000:subnet/subnet-0fa9c8fa7cb241479',
),
}

nodes = neo4j_session.run(
"""
MATCH (s:EC2Subnet) RETURN s.subnet_arn;
""",
)
actual_nodes = {n['s.subnet_arn'] for n in nodes}

assert actual_nodes == expected_nodes


def test_load_subnet_relationships(neo4j_session):
# Create Test AWSAccount