Skip to content

Commit

Permalink
Merge c1831b6 into ddd20a2
Browse files Browse the repository at this point in the history
  • Loading branch information
kwin committed Mar 9, 2021
2 parents ddd20a2 + c1831b6 commit ceb9ca8
Show file tree
Hide file tree
Showing 32 changed files with 127 additions and 207 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com)

### Fixed
- #2529 - Unable to find an implementation for interface acscommons.io.jsonwebtoken.io.Serializer using java.util.ServiceLoader
- #2341 - ACS Commons fails to deploy to AEM as a Cloud Service due to inclusion of /var nodes

## 4.11.2 - 2021-01-05

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ public final void execute(WorkItem workItem, WorkflowSession workflowSession, Me
}

}


// False positive, file path not controlled by the user
@SuppressWarnings("findsecbugs:PATH_TRAVERSAL_IN")
void saveImage(Asset asset, Rendition toReplace, Layer layer, String mimetype, double quality, WorkflowHelper workflowHelper)
throws IOException {
File tmpFile = File.createTempFile(getTempFileSpecifier(), "." + workflowHelper.getExtension(mimetype));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ private CacheUtils() {
* @param cacheKey
* @return
*/
// False positive, file path not controlled by the user
@SuppressWarnings("findsecbugs:PATH_TRAVERSAL_IN")
public static File createTemporaryCacheFile(CacheKey cacheKey) throws IOException {
// Create a file in Java temp directory with cacheKey.toSting() as file name.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.ResourceResolverFactory;
import org.apache.sling.commons.osgi.PropertiesUtil;
import org.apache.sling.serviceusermapping.ServiceUserMapped;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -51,7 +52,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -108,6 +108,9 @@ public class WorkflowPackageManagerImpl implements WorkflowPackageManager {
@Reference
ResourceResolverFactory resourceResolverFactory;

@Reference(target = "("+ServiceUserMapped.SUBSERVICENAME+"="+SERVICE_NAME+")")
ServiceUserMapped serviceUserMapped;

private String bucketPath;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
public class TestMarketoInterfaces {

@Test
// This test is known to fail when executed by Cloud Manager's code quality check, however works locally and in Travis
public void testInterfaces() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Object[] interfaces = new Object[] { new FormValue() {
}, new MarketoClientConfiguration() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
scripts=[
"# these users and ACLs are only necessary on author
create service user acs-commons-package-replication-status-event-service with path system/acs-commons
set ACL for acs-commons-package-replication-status-event-service
allow jcr:read,rep:write,jcr:readAccessControl,jcr:modifyAccessControl on /
end
"
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
scripts=[
"# extend rights for installing the ui.content package containing /var nodes with AEMaaCS (https://helpx.adobe.com/in/experience-manager/kb/cm/cloudmanager-deploy-fails-due-to-sling-distribution-aem.html)
create path /var/acs-commons(nt:folder)

# AEM classic does not know this system user, but creating it below system/acs-commons shouldn't do any harm
create service user sling-distribution-importer with path system/acs-commons
set ACL for sling-distribution-importer
allow jcr:read, rep:write, jcr:versionManagement, jcr:modifyAccessControl, jcr:readAccessControl, jcr:lockManagement on /var/acs-commons
end
"
]

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
scripts=[
"
# These paths must exist otherwise the following ACL applicaiton will fail, resulting in err'ing build
create path /content/cq:tags(sling:Folder)
create path /etc/packages(sling:Folder)

create service user acs-commons-automatic-package-replicator-service with path system/acs-commons
set ACL for acs-commons-automatic-package-replicator-service
allow jcr:read,jcr:versionManagement,rep:write,crx:replicate on /etc/packages
allow jcr:read on /
end

create service user acs-commons-file-fetch-service with path system/acs-aem-commons
set ACL for acs-commons-file-fetch-service
allow jcr:read,jcr:versionManagement,rep:write,crx:replicate on /content/dam
allow jcr:read on /
end

create service user acs-commons-remote-assets-service with path system/acs-aem-commons
set ACL for acs-commons-remote-assets-service
allow jcr:read, jcr:versionManagement, rep:write, crx:replicate on /content/cq:tags
allow jcr:read, jcr:versionManagement, rep:write, crx:replicate on /content/dam, /etc/tags
allow jcr:read on /

# If /etc/tags is used, these ACLs be set manually - if RepoInit defines this structure, it supersedes the use of /content/cq:tags
# allow jcr:read, jcr:versionManagement, rep:write, crx:replicate on /etc/tags
end
"
]

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
scripts=[
"
create service user acs-commons-ensure-oak-index-service with path system/acs-commons
set ACL for acs-commons-ensure-oak-index-service
allow jcr:read,rep:write,rep:indexDefinitionManagement on /oak:index
end
"
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
scripts=[
"
create service user acs-commons-dispatcher-flush-service with path system/acs-commons
set ACL for acs-commons-dispatcher-flush-service
allow jcr:read,crx:replicate,jcr:removeNode on /
end

create service user acs-commons-ensure-service-user-service with path system/acs-commons
set ACL for acs-commons-ensure-service-user-service
allow jcr:read,rep:write,jcr:readAccessControl,jcr:modifyAccessControl on /
end

create service user acs-commons-on-deploy-scripts-service with path system/acs-commons
set ACL for acs-commons-on-deploy-scripts-service
allow jcr:read on /
end
"
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
scripts=[
"# these users and ACLs are only necessary on author
create service user acs-commons-workflow-remover-service with path system/acs-commons
# the path may not yet exist in AEMaaCS as it is created lazily
create path /var/workflow/instances(sling:Folder)
set ACL for acs-commons-workflow-remover-service
allow jcr:read, rep:write on /var/workflow/instances
end

create service user acs-commons-workflowpackagemanager-service with path system/acs-commons
# the path may not yet exist in AEMaaCS as it is created lazily
create path /var/workflow/packages(sling:Folder)
set ACL for acs-commons-workflowpackagemanager-service
allow jcr:read on /var/workflow/packages
end
"
]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
user.mapping=[ \
"com.adobe.acs.acs-aem-commons-bundle:ensure-oak-index\=[acs-commons-ensure-oak-index-service]", \
"com.adobe.acs.acs-aem-commons-bundle:email-service\=[acs-commons-email-service]", \
"com.adobe.acs.acs-aem-commons-bundle:httpcache-jcr-storage-service\=[acs-commons-httpcache-jcr-storage-service]", \
"com.adobe.acs.acs-aem-commons-bundle:review-task-asset-mover\=[acs-commons-review-task-asset-mover-service]", \
"com.adobe.acs.acs-aem-commons-bundle:error-page-handler\=[acs-commons-error-page-handler-service]", \
"com.adobe.acs.acs-aem-commons-bundle:form-helper\=[acs-commons-form-helper-service]", \
"com.adobe.acs.acs-aem-commons-bundle:dispatcher-flush\=[acs-commons-dispatcher-flush-service]", \
"com.adobe.acs.acs-aem-commons-bundle:package-replication-status-event-listener\=[acs-commons-package-replication-status-event-service]", \
"com.adobe.acs.acs-aem-commons-bundle:component-error-handler\=[acs-commons-component-error-handler-service]", \
"com.adobe.acs.acs-aem-commons-bundle:system-notifications\=[acs-commons-system-notifications-service]", \
"com.adobe.acs.acs-aem-commons-bundle-twitter:twitter-updater\=[acs-commons-twitter-updater-service]", \
"com.adobe.acs.acs-aem-commons-bundle:workflow-remover\=[acs-commons-workflow-remover-service]", \
"com.adobe.acs.acs-aem-commons-bundle:bulk-workflow\=[acs-commons-bulk-workflow-service]", \
"com.adobe.acs.acs-aem-commons-bundle:bulk-workflow-runner\=[workflow-process-service]", \
"com.adobe.acs.acs-aem-commons-bundle:ensure-service-user\=[acs-commons-ensure-service-user-service]", \
"com.adobe.acs.acs-aem-commons-bundle:shared-component-props\=[acs-commons-shared-component-props-service]", \
"com.adobe.acs.acs-aem-commons-bundle:manage-controlled-processes\=[acs-commons-manage-controlled-processes-service]", \
"com.adobe.acs.acs-aem-commons-bundle:automatic-package-replicator\=[acs-commons-automatic-package-replicator-service]", \
"com.adobe.acs.acs-aem-commons-bundle:on-deploy-scripts\=[acs-commons-on-deploy-scripts-service]", \
"com.adobe.acs.acs-aem-commons-bundle:remote-assets\=[acs-commons-remote-assets-service]", \
"com.adobe.acs.acs-aem-commons-bundle:workflowpackagemanager-service\=[acs-commons-workflowpackagemanager-service]", \
"com.adobe.acs.acs-aem-commons-bundle:file-fetch\=[acs-commons-file-fetch-service]" \
]
60 changes: 0 additions & 60 deletions ui.content/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,66 +109,6 @@
<denyAllDeletes>true</denyAllDeletes>
</config>
</check>
<!-- check that rep:policy nodes are actually created by the package -->
<check>
<name>check-expected-policy-paths</name>
<template>basic/expectPaths</template>
<config>
<severity>minor</severity>
<expectedPaths>
<path>/oak:index/rep:policy</path>
<path>/conf/rep:policy</path>
<path>/content/rep:policy</path>
<path>/content/dam/rep:policy</path>
<path>/etc/rep:policy</path>
<path>/etc/acs-commons/bulk-workflow-manager/rep:policy</path>
<path>/etc/acs-commons/notifications/rep:policy</path>
<path>/etc/acs-commons/redirect-maps/rep:policy</path>
<path>/etc/cloudservices/dtm/rep:policy</path>
<path>/etc/cloudservices/sharethis/rep:policy</path>
<path>/etc/cloudservices/typekit/rep:policy</path>
<path>/etc/notification/email/rep:policy</path>
<path>/etc/workflow/instances/rep:policy</path>
<path>/home/groups/rep:policy</path>
<path>/home/users/rep:policy</path>
<path>/var/workflow/instances/rep:policy</path>
<path>/var/acs-commons/rep:policy</path>
<path>/var/acs-commons/httpcache/rep:policy</path>
<path>/var/acs-commons/mcp/rep:policy</path>
<path>/var/acs-commons/on-deploy-scripts-status/rep:policy</path>
</expectedPaths>
</config>
</check>
<check>
<name>verify-acls-on-root</name>
<template>basic/expectAces</template>
<!-- since the root rep:policy node will obviously exist regardless, we should be more
specific for these acl entries -->
<config>
<expectedAces>
<expectedAce>
principal=acs-commons-ensure-oak-index-service
;type=allow;path=/;privileges=jcr:read,rep:write,rep:indexDefinitionManagement
</expectedAce>
<expectedAce>
principal=acs-commons-dispatcher-flush-service
;type=allow;path=/;privileges=jcr:read,crx:replicate,jcr:removeNode
</expectedAce>
<expectedAce>
principal=acs-commons-package-replication-status-event-service
;type=allow;path=/;privileges=jcr:read,rep:write,jcr:readAccessControl,jcr:modifyAccessControl
</expectedAce>
<expectedAce>
principal=acs-commons-ensure-service-user-service
;type=allow;path=/;privileges=jcr:read,rep:write,jcr:readAccessControl,jcr:modifyAccessControl
</expectedAce>
<expectedAce>
principal=acs-commons-on-deploy-scripts-service
;type=allow;path=/;privileges=jcr:read
</expectedAce>
</expectedAces>
</config>
</check>
</checks>

<!-- assume that we are installing into an instance where utility pages and configs have already
Expand Down
4 changes: 0 additions & 4 deletions ui.content/src/main/content/META-INF/vault/filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@
<filter root="/home/groups/rep:policy"/>
<filter root="/home/users/rep:policy"/>
<filter root="/home/users/system/acs-commons"/>
<filter root="/oak:index/rep:policy"/>
<filter root="/rep:policy"/>
<filter root="/var/acs-commons">
<include pattern="/var/acs-commons/rep:policy"/>
<include pattern="/var/acs-commons/jcr:content"/>
Expand All @@ -103,6 +101,4 @@
<include pattern="/var/acs-commons/on-deploy-scripts-status"/>
<include pattern="/var/acs-commons/mcp"/>
</filter>
<filter root="/var/workflow/instances/rep:policy"/>
<filter root="/var/workflow/packages/rep:policy"/>
</workspaceFilter>

This file was deleted.

0 comments on commit ceb9ca8

Please sign in to comment.