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

Resource ID changed to Asset Id in asset list #1079

Closed
wants to merge 100 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
5efc9ef
fix: changed getPolicyId API endpoint
ranadheer-bolli Feb 3, 2023
d58a258
chore:Cognito_bug_fix
rnithinpaladin Feb 6, 2023
c6b70d5
bug:reduce policy name and uuid size
shefalibisht1992 Feb 3, 2023
1adfbe4
chore:Cognito_creation_after_ES_creation
rnithinpaladin Feb 8, 2023
cdac84c
chore:default.local.py_update
rnithinpaladin Feb 8, 2023
eb6e9b7
fix: Tagging filters on asset and violation
dheerajkholia-paladin Feb 9, 2023
86c4415
Merge pull request #796 from PaladinCloud/chore/default_local.py_update
rnithinpaladin Feb 10, 2023
54eb385
bug:V2-extra space character removal from db_Policy.sql file (#802)
shefalibisht1992 Feb 10, 2023
06f6e2b
fix: bug fixes
sidharthjain-zemoso Feb 10, 2023
914a3b3
fix: fix sorting issue for column containing numbers
sidharthjain-zemoso Feb 10, 2023
5178b3e
fixed sorting arrow in violations
sidharthjain-zemoso Feb 10, 2023
06d81ac
fix: fixed filters for tags in violations and asset list
sidharthjain-zemoso Feb 10, 2023
4560259
bug:V2 policy audit updated (#811)
shefalibisht1992 Feb 13, 2023
56dda82
fixed server side sorting for violations list
ranadheer-bolli Feb 13, 2023
f556c85
fix:Policy_Display_name in DB_Policy.sql
kushZemoso Feb 13, 2023
ff8af5b
chore/creating_cognito_user_after_es_creation
rnithinpaladin Feb 14, 2023
994304d
fix: truncating the policy table to reflect the new changes
santhosh-challa Feb 14, 2023
788db7d
Fix/recently viewed api (#822)
ranadheer-b Feb 14, 2023
3583ff4
fix: fixed tagging across target type widget, breadcrumbs in tagging
sidharthjain-zemoso Feb 15, 2023
bc1d40a
fix: Filters on asset and violation
dheerajkholia-paladin Feb 15, 2023
917477c
fix: fixed Account id sorting in asset list
sidharthjain-zemoso Feb 15, 2023
565a62e
bug:policy audit changes
shefalibisht1992 Feb 16, 2023
4b8cece
feat: adding new fields to user params in policies
akashpaladin Feb 8, 2023
a37b220
bug:policy audit changes for wiki links for asset group gcp and aws
shefalibisht1992 Feb 16, 2023
d33e6b6
chore/cognito_azure_ad_configuration
rnithinpaladin Feb 15, 2023
4c73bd3
feat: added client side filters for policy-knowledgebase, admin/polic…
sidharthjain-zemoso Feb 16, 2023
2cf248d
fix:Policy_Display Names and Wiki links for Azure
kushZemoso Feb 16, 2023
168ce2b
Resolved merge conflict by incorporating both suggestions.
kushZemoso Feb 16, 2023
cac2f7e
Merge pull request #842 from PaladinCloud/fix/DB_Policy_Entries
santhosh-challa Feb 16, 2023
b3da3ef
bug:build db error resolution
shefalibisht1992 Feb 16, 2023
bdbf72a
bug:remove costOptimization', 'governance' from db
shefalibisht1992 Feb 16, 2023
aa91935
bug:policy description changes uodate
shefalibisht1992 Feb 17, 2023
a79eb71
fix:Removed Duplicate Entries in DB_Policy.sql
kushZemoso Feb 17, 2023
d53c3fd
chore/client_id_n_client_secert_update
rnithinpaladin Feb 17, 2023
c559cf4
fix: removed compliance% and violation filters from dashboard list view
sidharthjain-zemoso Feb 17, 2023
10ad862
fixed create and update asset groups API
sidharthjain-zemoso Feb 17, 2023
e1fba3f
bug:policy description and wiki link changes uodate
shefalibisht1992 Feb 17, 2023
8ed176b
bug:policy description and wiki link changes uodate
shefalibisht1992 Feb 17, 2023
bec52a0
bug:policy description and wiki link changes uodate
shefalibisht1992 Feb 17, 2023
e93b5bf
fix: create edit asset group
sidharthjain-zemoso Feb 17, 2023
be8561e
bug:policy audit changes
shefalibisht1992 Feb 24, 2023
c561f90
chore/spell_fix
rnithinpaladin Feb 24, 2023
2d6ca07
fix: asset graph and policy knowledgebase bugs
sidharthjain-zemoso Feb 18, 2023
210c6a9
chore: Renamed policies to Policy in admin screen
sidharthjain-zemoso Feb 20, 2023
ec18147
feat: Added export button in policy screen, secondary sort in complia…
sidharthjain-zemoso Feb 24, 2023
d46b859
chore: updated release version
santhosh-challa Feb 24, 2023
e03e24b
bug:delete Enable_Azure_Account_Create_or_Update_Network_Security_Gro…
shefalibisht1992 Feb 27, 2023
e5b8106
fix: fixed secondary sort
sidharthjain-zemoso Feb 27, 2023
2aaa8d3
fix: Removed Policy parameter from event bridge constants
arunpaladin Mar 6, 2023
f57dd7b
fix: policy param fix
arunpaladin Mar 6, 2023
b423f02
fix: removed unused files.
arunpaladin Mar 6, 2023
e76d4c6
chore/sql_base64_bug_fix
rnithinpaladin Mar 1, 2023
8b68636
fix: modified zip folder location to v2
arunpaladin Mar 6, 2023
584c7a9
fix: Removed Policy parameter from event bridge constants
arunpaladin Mar 6, 2023
5141b72
fix: policy param fix
arunpaladin Mar 6, 2023
7d1e2d1
fix: removed unused files.
arunpaladin Mar 6, 2023
e471aad
fix: modified zip folder location to v2
arunpaladin Mar 6, 2023
cb3faf4
fix: rename columns from rule to policy
AishwaryaKulkarni97 Mar 6, 2023
ec5a809
fix: fixed alignment in tooltips of trend graphs, added default sort …
sidharthjain-zemoso Mar 6, 2023
2c231be
fix:Correctly mapped count value to its respective key
kushZemoso Mar 6, 2023
c6bc168
fix: policy Edit and Invoke fix.
arunpaladin Mar 6, 2023
8c20526
Merge branch 'v2.0.2' of https://github.com/PaladinCloud/Rev1 into fi…
arunpaladin Mar 6, 2023
ff15462
Fix/policy param (#912)
arunpaladin Mar 6, 2023
0b3b49e
fix: changes for policy param
akashpaladin Mar 6, 2023
6ee2e72
Merge branch 'v2.0.2' of https://github.com/PaladinCloud/Rev1 into fi…
arunpaladin Mar 7, 2023
379318b
fix: replaced policyID with policyUUID as Eventbridge rule id.
arunpaladin Mar 7, 2023
52302b7
Fix/policy param (#916)
arunpaladin Mar 7, 2023
e899b95
feat: correcting esServiceURL from the last changes
shefalibisht1992 Mar 7, 2023
c9bb8e1
reverted mandatory tags param changes
akashpaladin Mar 7, 2023
f1eb6db
Merge branch 'v2.0.2' of https://github.com/PaladinCloud/Rev1 into fi…
arunpaladin Mar 7, 2023
562b2c2
fix: Removed Policy category, severity and autofix from policyParam.
arunpaladin Mar 7, 2023
bbda4b7
Fix/policy param (#922)
arunpaladin Mar 7, 2023
2388edd
chore: updated release number
santhosh-challa Mar 7, 2023
d9beae3
Merge branch 'v2.0.2' of https://github.com/PaladinCloud/Rev1 into fi…
arunpaladin Mar 8, 2023
66aab20
fix: fixed application prefix typo
arunpaladin Mar 8, 2023
e2e6f64
Merge pull request #925 from PaladinCloud/fix/policyParam
santhosh-challa Mar 8, 2023
36f8b9e
fix: fixed non responsiveness of UI
ranadheer-bolli Mar 8, 2023
5a39a93
fix - aws external vpc changes
akashpaladin Mar 3, 2023
3d57b92
feat: removed roleIdentifyingString from policy params
akashpaladin Mar 8, 2023
7fac8b7
fix: fixed policy compliance screen and policy knowledgebase ui bugs
sidharthjain-zemoso Mar 8, 2023
71723d1
feat: quotes missing from policy param descroption attribute
shefalibisht1992 Mar 9, 2023
edaf680
fix: invalid json fixed
AishwaryaKulkarni97 Mar 9, 2023
002b4f2
Merge remote-tracking branch 'origin/v2.0.2' into policy_param_correc…
shefalibisht1992 Mar 9, 2023
2a1082d
feat: quotes missing from policy param descroption attribute
shefalibisht1992 Mar 9, 2023
e2224a6
Merge pull request #934 from PaladinCloud/policy_param_correction
santhosh-challa Mar 9, 2023
cfd5809
fix: fixed overall tagging count and individual tag count
ranadheer-bolli Mar 9, 2023
1faf6c6
refactored editpolicy screen
ranadheer-bolli Mar 9, 2023
5d6eb04
fix:display missing categories in trend compliance api
raviteja-mandala Mar 9, 2023
606070a
fix:include overall compliance percent in category compliance api
raviteja-mandala Mar 10, 2023
22c10e0
refactor: modified edit policy screen
ranadheer-bolli Mar 10, 2023
d20b658
fix: under utilize ec2,rdsdb, rediscluster policy fix
arunpaladin Mar 10, 2023
aa785c8
fix: fixed edit policy and getting updated list on successful Update
ranadheer-bolli Mar 13, 2023
7f65a05
fix:fix for NaN issue in trend compliance api
raviteja-mandala Mar 13, 2023
c2483ed
fix: Corrected qualys KB API URL
dheerajkholia-paladin Mar 13, 2023
113dc41
fixed multiple hits to update API
ranadheer-bolli Mar 14, 2023
1408d10
Fix: Removed duplicate params for category and severity
ranadheer-bolli Mar 14, 2023
55b501d
fix: Replace custom in line policy with securityAudit policy
arunpaladin Mar 14, 2023
4c46c2d
Resource ID changed to Asset Id in asset list
beingtechsavy Apr 9, 2023
cfebb3b
Merge branch 'PaladinCloud:master' into master
beingtechsavy Apr 11, 2023
14f36ea
updated
beingtechsavy Apr 11, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ private AdminConstants() {
public static final String CONFIG_ROLLBACK_MSG = "Rollback to an older timestamp through API invocation";
public static final String POLICY_UUID = "policyUUID";
public static final String INVOCATION_ID = "invocationId";
<<<<<<< HEAD
public static final String AUTOFIX_ENABLE_SUCCESS = "AutoFix has been successfully Enabled !!";
public static final String AUTOFIX_DISABLE_SUCCESS = "AutoFix has been successfully Disabled !!";
public static final String AUTO_FIX_KEY = "fixKey";
Expand All @@ -134,5 +135,7 @@ private AdminConstants() {
public static final String UPDATE_STICKY_EXCEPTION_SUBJECT = "Sticky Exception Updated";


=======
>>>>>>> 55b501d9d49feb8369404878431f66be1e658955
}

Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ public class TargetTypesDetails {
private List<AttributeDetails> attributes;
private List<String> allAttributesName;
private boolean added;
private String dataSourceName;

public void setDataSourceName(String dataSourceName){
this.dataSourceName = dataSourceName;
}

public String getDataSourceName(){
return dataSourceName;
}

public boolean isIncludeAll() {
return includeAll;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,23 @@
import static com.tmobile.pacman.api.admin.common.AdminConstants.DATE_FORMAT;
import static com.tmobile.pacman.api.admin.common.AdminConstants.UNEXPECTED_ERROR_OCCURRED;

<<<<<<< HEAD
import java.util.*;
import java.util.Map.Entry;
import java.util.stream.Collectors;
import org.apache.commons.lang.StringUtils;
=======
import java.sql.ResultSet;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.stream.Collectors;
import java.util.Set;
import java.util.UUID;
>>>>>>> 55b501d9d49feb8369404878431f66be1e658955

import com.google.gson.Gson;
import com.tmobile.pacman.api.admin.common.AdminConstants;
Expand Down Expand Up @@ -60,7 +73,11 @@
import com.tmobile.pacman.api.admin.repository.model.AssetGroupTargetDetails;
import com.tmobile.pacman.api.admin.service.CommonService;
import com.tmobile.pacman.api.admin.util.AdminUtils;
<<<<<<< HEAD
import org.springframework.util.CollectionUtils;
=======
import com.tmobile.pacman.api.commons.repo.PacmanRdsRepository;
>>>>>>> 55b501d9d49feb8369404878431f66be1e658955

/**
* AssetGroup Service Implementations
Expand All @@ -78,6 +95,12 @@ public class AssetGroupServiceImpl implements AssetGroupService {
@Autowired
private TargetTypesRepository targetTypesRepository;

<<<<<<< HEAD
=======
@Autowired
private PacmanRdsRepository rdsRepository;

>>>>>>> 55b501d9d49feb8369404878431f66be1e658955
@Autowired
private CommonService commonService;

Expand Down Expand Up @@ -447,6 +470,7 @@ private Set<AssetGroupTargetDetails> buildTargetTypes(List<TargetTypesDetails> t
return allTargetTypesDetails;
}

<<<<<<< HEAD
private UpdateAssetGroupDetails buildAssetGroupDetails(final AssetGroupDetails assetGroup) {
UpdateAssetGroupDetails assetGroupView = new UpdateAssetGroupDetails();
List<Map<String, Object>> countMap = getAssetCountByAssetGroup(assetGroup.getGroupName(), "all", null, null, null);
Expand All @@ -464,6 +488,95 @@ private UpdateAssetGroupDetails buildAssetGroupDetails(final AssetGroupDetails a
assetGroupView.setGroupName(assetGroup.getGroupName());
assetGroupView.setGroupType(assetGroup.getGroupType());
return assetGroupView;
=======
private UpdateAssetGroupDetails buildAssetGroupDetails(final AssetGroupDetails existingAssetGroupDetails) {
List<TargetTypesDetails> assetGroupTargetTypes = Lists.newArrayList();
UpdateAssetGroupDetails assetGroupDetails = new UpdateAssetGroupDetails();
assetGroupDetails.setGroupId(existingAssetGroupDetails.getGroupId());
assetGroupDetails.setCreatedBy(existingAssetGroupDetails.getCreatedBy());
assetGroupDetails.setDataSourceName(existingAssetGroupDetails.getDataSource());
assetGroupDetails.setDescription(existingAssetGroupDetails.getDescription());
assetGroupDetails.setDisplayName(existingAssetGroupDetails.getDisplayName());
assetGroupDetails.setGroupName(existingAssetGroupDetails.getGroupName());
assetGroupDetails.setType(existingAssetGroupDetails.getGroupType());
assetGroupDetails.setVisible(existingAssetGroupDetails.getIsVisible());

Set<AssetGroupTargetDetails> allTargetTypeDetails = existingAssetGroupDetails.getTargetTypes();
Map<String, Integer> targetTypesIndex = Maps.newHashMap();
Set<String> selectedTargetTypes = Sets.newHashSet();

String targetTypeNames = allTargetTypeDetails.stream()
.map(targetType->targetType.getTargetType())
.collect(Collectors.joining("','"));

targetTypeNames = "'"+targetTypeNames+"'";
String query = "SELECT targetName, dataSourceName FROM pacmandata.cf_Target where targetName in ("+targetTypeNames+")";
List<Map<String,Object>> targetNameList = rdsRepository.getDataFromPacman(query);
Map<String,String> targetNameMap = new HashMap<>();
targetNameList.stream().forEach(targetList->{
String targetName=(String) targetList.get("targetName");
String dataSourceName=(String) targetList.get("dataSourceName");
targetNameMap.put(targetName, dataSourceName);
});

final int[] idx = { -1 };
allTargetTypeDetails.forEach(targetTypeDetails -> {
TargetTypesDetails targetTypes = new TargetTypesDetails();
selectedTargetTypes.add(targetTypeDetails.getTargetType());
if(targetTypesIndex.get(targetTypeDetails.getTargetType()) != null) {
int index = targetTypesIndex.get(targetTypeDetails.getTargetType());
targetTypes = assetGroupTargetTypes.get(index);
List<AttributeDetails> attributes = targetTypes.getAttributes();
AttributeDetails attributeDetails = new AttributeDetails();
attributeDetails.setName(targetTypeDetails.getAttributeName());
attributeDetails.setValue(targetTypeDetails.getAttributeValue());
attributes.add(attributeDetails);
targetTypes.setAttributes(attributes);
} else {
idx[0]++;
targetTypes.setDataSourceName(targetNameMap.get(targetTypeDetails.getTargetType()));
targetTypesIndex.put(targetTypeDetails.getTargetType(), idx[0]);
targetTypes.setAdded(true);
targetTypes.setTargetName(targetTypeDetails.getTargetType());
targetTypes.setAllAttributesName(commonService.getFieldNames(targetTypesRepository.findDataSourceByTargetType(targetTypeDetails.getTargetType()) + "_" + targetTypeDetails.getTargetType(), targetTypeDetails.getTargetType()));
if(targetTypeDetails.getAttributeName().equalsIgnoreCase("all") && targetTypeDetails.getAttributeValue().equalsIgnoreCase("all")) {
targetTypes.setIncludeAll(true);
targetTypes.setAttributes(Lists.newArrayList());
} else {
targetTypes.setIncludeAll(false);
AttributeDetails attributeDetails = new AttributeDetails();
attributeDetails.setName(targetTypeDetails.getAttributeName());
attributeDetails.setValue(targetTypeDetails.getAttributeValue());
List<AttributeDetails> attributes = Lists.newArrayList();
attributes.add(attributeDetails);
targetTypes.setAttributes(attributes);
}
assetGroupTargetTypes.add(targetTypes);
}
});
List<TargetTypesDetails> attributes = Lists.newArrayList();
List<TargetTypesProjection> remainingTargetTypes = Lists.newArrayList();
assetGroupDetails.setTargetTypes(assetGroupTargetTypes);
if(!selectedTargetTypes.isEmpty()) {
remainingTargetTypes = targetTypesRepository.findByTargetTypeNotIn(Lists.newArrayList(selectedTargetTypes));
} else {
remainingTargetTypes = targetTypesRepository.getAllTargetTypes();
}


for(TargetTypesProjection remainingTargetType : remainingTargetTypes) {
String targetName = remainingTargetType.getText().trim();
TargetTypesDetails targetTypeAttribute = new TargetTypesDetails();
targetTypeAttribute.setAttributes(Lists.newArrayList());
targetTypeAttribute.setTargetName(targetName.trim());
targetTypeAttribute.setAllAttributesName(commonService.getFieldNames(targetTypesRepository.findDataSourceByTargetType(targetName) + "_" + targetName, targetName));
targetTypeAttribute.setIncludeAll(false);
attributes.add(targetTypeAttribute);
}
assetGroupDetails.setRemainingTargetTypes(remainingTargetTypes);
assetGroupDetails.setRemainingTargetTypesFullDetails(attributes);
return assetGroupDetails;
>>>>>>> 55b501d9d49feb8369404878431f66be1e658955
}

private boolean deleteAssetGroupAlias(final AssetGroupDetails assetGroupDetails) throws PacManException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,10 @@ public Map<String, Object> invokeAllPolicies(List<String> polocyIds) {

private boolean invokePolicy(AWSLambda awsLambdaClient, Policy policyDetails, String invocationId,
List<Map<String, Object>> additionalRuleParams) {
<<<<<<< HEAD
=======

>>>>>>> 55b501d9d49feb8369404878431f66be1e658955
JsonObject inputConstant = new JsonObject();
inputConstant.addProperty(AdminConstants.POLICY_UUID, policyDetails.getPolicyUUID());
if (invocationId != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,11 @@ private AssetConstants() {

public static final String ASSET = "asset";
public static final String TYPE_KEYWORD = "type.keyword";
<<<<<<< HEAD
public static final String EVENTCATEGORY = "eventCategoryName";
public static final String EVENTSOURCE = "eventSourceName";
=======
>>>>>>> 55b501d9d49feb8369404878431f66be1e658955

}

Original file line number Diff line number Diff line change
Expand Up @@ -1245,9 +1245,13 @@ public List<Map<String, Object>> getListAssetsTaggable(String assetGroup, Map<St
assetDetails = getAssetsByAssetGroup(assetGroup, targetType, new HashMap(), null, fieldNames);
}
} else {
<<<<<<< HEAD

ruleIdWithTargetTypeQuery = "SELECT DISTINCT p.targetType FROM cf_PolicyTable p WHERE p.status = 'ENABLED' AND p.category = 'tagging'";

=======
ruleIdWithTargetTypeQuery = "SELECT DISTINCT p.targetType FROM cf_PolicyTable p WHERE p.status = 'ENABLED' AND p.category = 'tagging'";
>>>>>>> 55b501d9d49feb8369404878431f66be1e658955
ruleIdwithTargetType = rdsRepository.getDataFromPacman(ruleIdWithTargetTypeQuery);
List<String> validTypes = ruleIdwithTargetType.stream()
.map(obj -> obj.get(Constants.TARGET_TYPE).toString()).collect(Collectors.toList());
Expand Down
Loading