Skip to content

Instantly share code, notes, and snippets.

Avatar

SyCode7

View GitHub Profile
View GCSBucketPolicyChecker
String bucketName = "company-block-log-fce65e82-a0cd-4f71-8693-381100d93c18";
Policy p = Cache.GCSStorage.getIamPolicy(bucketName);
System.out.println(p);
List<Role> roleList = new ArrayList<>();
List<Set<Identity>> identities = new ArrayList<>();
// Print Roles and its identities
Set<Identity> wrongIdentities = new HashSet<Identity>();
Role roler = null;
Map<Role, Set<Identity>> policyBindings = p.getBindings();
View ReportCollector
public class ReportCollector {
public static void main(String[] args) throws JsonParseException, JsonMappingException, IOException {
// ArrayList
Layers layers = new Layers();
Layer layer = new Layer();
// List<Layers> de.security.reports.ScanReport.getLayers()
File reportFile = new File("reports/json/analysis-postgres-latest.json");
View gist:ec5c32da58a3648f2dc4f84411787c13
package de.security.reports;
import java.io.Serializable;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({